/* IN MEMORIAM — Siim Kallas */

:root {
  --bg: #fcfcfb;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e2e2df;
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.72;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Hero */

.hero {
  text-align: center;
  padding-top: 88px; /* nothing above it now, so the title needs its own breathing room */
}

.memoriam-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 50px;
  line-height: 1.18;
  margin: 0;
  letter-spacing: 0.01em;
}

.dates {
  color: var(--muted);
  font-size: 15px;
  margin: 18px 0 0;
}

.portrait {
  margin: 36px 0 0;
}

.portrait img {
  width: 100%;
  height: auto;
  max-width: 1735px; /* photo's native width — avoids upscaling */
  display: block;
  margin: 0 auto;
  border-radius: 14px;
  filter: grayscale(1);
}

/* Obituary */

.obituary {
  padding-top: 52px;
}

/* Text is held narrower than the photo so lines stay readable. */
.obituary p,
.obituary ul {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.obituary p {
  margin: 0 0 22px;
}

.lead-et strong {
  font-weight: 700;
}

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 30px 0;
}

.signature {
  margin-top: 34px;
  font-style: italic;
  color: var(--muted);
}

.funeral {
  margin-top: 26px;
  font-weight: 500;
}

/* Remembrance photographs — smaller than the opening image, side by side */

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding-top: 58px;
}

.gallery figure {
  margin: 0;
}

/* Each photograph is a button so it opens enlarged on click or Enter. */
.gallery .zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  cursor: zoom-in;
}

.gallery .zoom:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.gallery img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  filter: grayscale(1);
  transition: opacity 0.18s ease;
}

.gallery .zoom:hover img,
.gallery .zoom:focus-visible img {
  opacity: 0.86;
}

@media (max-width: 620px) {
  .gallery {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-top: 46px;
  }
}

/* Enlarged view */

.lightbox[hidden] { display: none; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: rgba(16, 16, 16, 0.94);
}

.lightbox-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.lightbox-figure img {
  display: block;
  max-width: 100%;
  /* Leaves room for the caption below the photograph. */
  max-height: calc(100vh - 140px);
  max-height: calc(100dvh - 140px); /* mobile toolbars make 100vh overshoot */
  width: auto;
  height: auto;
  border-radius: 6px;
  filter: grayscale(1);
}

.lightbox-figure figcaption {
  color: #d8d8d4;
  font-size: 14.5px;
  line-height: 1.5;
  text-align: center;
  max-width: 640px;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 18px;
  font: inherit;
  font-size: 34px;
  line-height: 1;
  color: #d8d8d4;
  background: none;
  border: 0;
  padding: 6px 12px;
  cursor: pointer;
}

.lightbox-close:hover { color: #fff; }

.lightbox-close:focus-visible {
  outline: 2px solid #d8d8d4;
  outline-offset: 2px;
}

/* Stops the page behind the enlarged view from scrolling. */
body.lightbox-open { overflow: hidden; }

/* On a phone the gallery photo is already near full width, so the enlarged
   view has to give up its gutters to actually read as bigger. */
@media (max-width: 620px) {
  .lightbox { padding: 50px 6px 18px; }
  .lightbox-figure { gap: 10px; }
  .lightbox-figure img {
    border-radius: 4px;
    max-height: calc(100vh - 130px);
    max-height: calc(100dvh - 130px);
  }
  .lightbox-figure figcaption { font-size: 13.5px; padding: 0 8px; }
  .lightbox-close { top: 6px; right: 8px; }
}

/* Condolences */

.condolences-section {
  padding: 70px 0 40px;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 37px;
  line-height: 1.25;
  margin: 0 0 30px;
}

.responses-title {
  margin-top: 64px;
}

/* Form */

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
}

.req { color: #8a2020; }

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c9c9c5;
  border-radius: 6px;
  padding: 10px 12px;
}

.field textarea { resize: vertical; }

.field input:focus,
.field textarea:focus {
  outline: 2px solid #1a1a1a;
  outline-offset: 1px;
  border-color: #1a1a1a;
}

/* Honeypot — visually removed, still in DOM for bots */
.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.privacy-note {
  font-size: 13.5px;
  color: var(--muted);
  margin: 4px 0 18px;
}

#submit-btn {
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  color: #fff;
  background: #161616;
  border: 0;
  border-radius: 6px;
  padding: 11px 24px;
  cursor: pointer;
}

#submit-btn:hover { background: #333; }
#submit-btn:disabled { background: #888; cursor: default; }

#form-status { min-height: 1.4em; font-size: 15px; margin-top: 14px; }
#form-status.success { color: #1e5c2e; }
#form-status.error { color: #8a2020; }

/* Condolence list */

.condolence {
  margin-bottom: 34px;
}

.c-name {
  font-weight: 700;
  font-size: 15.5px;
  margin: 0;
}

.c-date {
  color: var(--muted);
  font-size: 13.5px;
  margin: 2px 0 10px;
}

.c-text {
  margin: 0;
  white-space: pre-line;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 26px 0 34px;
}

.footer-logo {
  display: block;
  width: 230px;
  max-width: 70%;
  height: auto;
  margin: 0 auto;
}

/* Small screens */

@media (max-width: 520px) {
  .container { padding: 0 18px; } /* the wider desktop gutter costs too much line here */
  .hero { padding-top: 56px; }
  .memoriam-title { font-size: 33px; }
  .section-title { font-size: 26px; }
  .condolences-section { padding-top: 54px; }
}
