/* Static memorial site for Grímur Jónsson. No external dependencies. */
:root {
  --ink: #282622;
  --muted: #666158;
  --paper: #fbfaf7;
  --white: #fff;
  --rule: #ddd8ce;
  --accent: #745c28;
  --focus: #1f5d86;
  --measure: 45rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.125rem;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
}
a { color: #654e1e; text-decoration-thickness: .08em; text-underline-offset: .15em; }
a:hover { color: #2f250f; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
img { max-width: 100%; height: auto; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: .75rem;
  left: .75rem;
  padding: .65rem 1rem;
  color: var(--white);
  background: #171614;
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }

.hero {
  position: relative;
  min-height: clamp(32rem, 72vh, 58rem);
  overflow: hidden;
  background: #8c9dad;
}
.home .hero { min-height: max(32rem, calc(100svh - 4rem)); }
.inner .hero { min-height: clamp(20rem, 43vh, 33rem); }
.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 50%;
}
.hero-shade {
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .62));
}
.brand {
  position: absolute;
  z-index: 1;
  left: max(5vw, calc((100% - 57rem) / 2));
  right: 2rem;
  bottom: clamp(2.25rem, 6vh, 4.75rem);
  color: var(--white);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .65);
}
.site-title {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(2rem, 4vw, 3.55rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.inner .site-title { font-size: clamp(1.75rem, 3vw, 2.65rem); }
.site-title a { color: inherit; text-decoration: none; }
.site-description { margin: .35rem 0 0; font-family: Arial, Helvetica, sans-serif; font-size: 1rem; }

.primary-nav {
  border-bottom: 1px solid var(--rule);
  background: var(--white);
  font-family: Arial, Helvetica, sans-serif;
}
.primary-nav ul {
  display: flex;
  justify-content: center;
  gap: clamp(.3rem, 2.5vw, 2.25rem);
  margin: 0 auto;
  padding: 0 1rem;
  max-width: 76rem;
  list-style: none;
}
.primary-nav a {
  display: block;
  padding: 1rem .2rem .9rem;
  color: #393734;
  border-bottom: 3px solid transparent;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: #171614; border-bottom-color: var(--accent); }

.content-shell { padding: clamp(3rem, 7vw, 6.5rem) max(1.25rem, 5vw); }
.page-content { max-width: var(--measure); margin: 0 auto; }
.gallery-page .page-content { max-width: 80rem; }
.page-content > h1 {
  margin: 0 0 2.5rem;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1.12;
  font-weight: 400;
}
.page-content h2, .page-content h3 { margin-top: 2.5em; line-height: 1.25; }
.page-content p { margin: 0 0 1.55em; }
.page-content strong { font-weight: 700; }
.page-content blockquote { margin: 2rem 0; padding-left: 1.5rem; border-left: 3px solid var(--accent); color: var(--muted); }
.content-image { display: block; margin: 2.25rem auto; }
.content-figure { margin: 2.5rem 0; }
.caption, .content-figure figcaption, .gallery-card figcaption {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .82rem;
  line-height: 1.4;
}

.video-embed {
  display: flex;
  min-height: 18rem;
  margin: 1.5rem 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
  color: var(--white);
  background: #25231f;
  aspect-ratio: 16 / 9;
}
.video-embed iframe { width: 100%; height: 100%; border: 0; }
.video-load {
  display: none;
  padding: .8rem 1.2rem;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 2px;
  color: var(--white);
  background: transparent;
  font: 700 1rem Arial, Helvetica, sans-serif;
  cursor: pointer;
}
.has-js .video-load { display: inline-block; }
.video-fallback { color: var(--white); font-family: Arial, Helvetica, sans-serif; font-size: .9rem; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.75rem);
}
.gallery-card { margin: 0; min-width: 0; }
.gallery-card a { display: block; overflow: hidden; background: #e7e3dc; }
.gallery-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .18s ease; }
.gallery-card a:hover img { transform: scale(1.015); }
.gallery-card figcaption { padding-top: .45rem; overflow-wrap: anywhere; }

.site-footer {
  padding: 2rem 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  background: #f2f0eb;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .78rem;
  text-align: center;
}
.site-footer p { margin: 0; }

.lightbox {
  width: min(94vw, 88rem);
  max-width: none;
  height: min(94vh, 62rem);
  max-height: none;
  padding: 3rem 4.5rem 2rem;
  border: 0;
  color: var(--white);
  background: #171614;
}
.lightbox::backdrop { background: rgba(0,0,0,.88); }
.lightbox figure { display: flex; height: 100%; margin: 0; align-items: center; justify-content: center; flex-direction: column; }
.lightbox img { max-width: 100%; max-height: calc(100% - 3rem); object-fit: contain; }
.lightbox figcaption { margin-top: .65rem; color: #eee; font-family: Arial, Helvetica, sans-serif; }
.lightbox button { position: absolute; border: 0; color: var(--white); background: transparent; font-size: 2.6rem; cursor: pointer; }
.lightbox-close { top: .2rem; right: .8rem; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: .7rem; }
.lightbox-next { right: .7rem; }

@media (max-width: 760px) {
  body { font-size: 1.04rem; }
  .hero { min-height: 32rem; }
  .inner .hero { min-height: 20rem; }
  .hero-image { object-position: 56% center; }
  .brand { left: 1.25rem; right: 1.25rem; bottom: 2rem; }
  .site-title, .inner .site-title { font-size: clamp(1.6rem, 8vw, 2.25rem); }
  .primary-nav { overflow-x: auto; }
  .primary-nav ul { width: max-content; min-width: 100%; justify-content: flex-start; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lightbox { padding: 3rem 2.75rem 1.5rem; }
}

@media (max-width: 430px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .gallery-card img { transition: none; }
}
