/* ————— Memorial site for Andy ————— */

:root {
  --bg: #FBF8F3;
  --ink: #3B342B;
  --ink-soft: #6E6457;
  --ink-faint: #A79C8C;
  --hairline: #E8E1D5;
  --card: #FFFFFF;
  --serif: "Iowan Old Style", "Palatino Nova", Palatino, "Book Antiqua", Georgia, serif;
  --row-h: clamp(120px, 17vh, 190px);
  --gap: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; }

/* ————— GoFundMe CTA ————— */

.gfm-cta {
  position: fixed;
  top: clamp(1rem, 2.4vw, 1.75rem);
  right: clamp(1rem, 2.4vw, 1.75rem);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.72em 1.15em;
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1;
  box-shadow: 0 10px 28px -10px rgba(59, 52, 43, 0.4),
              0 2px 6px -2px rgba(59, 52, 43, 0.22);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.gfm-cta:hover {
  transform: translateY(-2px);
  border-color: var(--ink-faint);
  box-shadow: 0 16px 36px -12px rgba(59, 52, 43, 0.5),
              0 3px 8px -2px rgba(59, 52, 43, 0.26);
}

.gfm-mark {
  width: 1.15em;
  height: 1.15em;
  fill: var(--ink);
  flex: none;
}

.gfm-word {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.gfm-rest { color: var(--ink-soft); }

.gfm-arrow {
  width: 0.95em;
  height: 0.95em;
  color: var(--ink-faint);
  flex: none;
  transition: color 0.28s ease, transform 0.28s ease;
}

.gfm-cta:hover .gfm-arrow {
  color: var(--ink-soft);
  transform: translate(1px, -1px);
}

@media (max-width: 600px) {
  .gfm-cta { font-size: 0.8rem; padding: 0.65em 1em; gap: 0.45em; }
  .gfm-rest { display: none; }
}

/* ————— Masthead ————— */

.masthead {
  text-align: center;
  padding: clamp(4.5rem, 10vh, 7.5rem) 1.5rem 0;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.6rem;
}

.masthead h1 {
  font-weight: 400;
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.dates {
  margin-top: 1.1rem;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  color: var(--ink-soft);
  font-variant-numeric: oldstyle-nums;
}

/* ————— Service callouts ————— */

.services {
  max-width: 1200px;
  margin: clamp(2.75rem, 6vh, 4.25rem) auto 0;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.service-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.6vw, 1.1rem);
}

.service-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  padding: clamp(1.2rem, 2.4vw, 1.6rem) clamp(1.25rem, 2.6vw, 1.75rem);
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  font-family: var(--serif);
  color: var(--ink);
  text-align: left;
  transition: border-color 0.28s ease, background-color 0.28s ease;
}

button.service-card { cursor: pointer; }

button.service-card:hover { border-color: var(--ink-faint); }

button.service-card:focus-visible {
  outline: 2px solid var(--ink-soft);
  outline-offset: 3px;
}

.service-card.is-static { background: transparent; }

.service-title {
  font-size: clamp(1rem, 1.35vw, 1.13rem);
  line-height: 1.35;
}

.service-meta {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  font-variant-numeric: oldstyle-nums;
}

.service-dot { color: var(--ink-faint); }

.service-card.is-static .service-meta { color: var(--ink-faint); }

.service-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

.service-chevron {
  width: 0.95em;
  height: 0.95em;
  color: var(--ink-faint);
  transition: transform 0.32s ease, color 0.28s ease;
}

button.service-card:hover .service-chevron { color: var(--ink-soft); }

button.service-card[aria-expanded="true"] .service-chevron {
  transform: rotate(180deg);
}

/* Expanding details panel */

.service-details {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.42s ease, opacity 0.42s ease;
}

.service-details[hidden] { display: none; }

.service-details.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.service-details-inner { overflow: hidden; }

.service-details-inner > :first-child {
  margin-top: clamp(1rem, 2.2vw, 1.4rem);
}

.service-details-inner {
  font-size: clamp(0.97rem, 1.3vw, 1.06rem);
}

.sd-lede {
  padding-bottom: clamp(1.1rem, 2.4vw, 1.5rem);
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-soft);
}

.sd-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.1rem, 2.4vw, 1.5rem) 0;
  border-bottom: 1px solid var(--hairline);
}

.sd-block p { line-height: 1.6; }

.sd-strong { color: var(--ink); }

.sd-block p:not(.sd-strong) { color: var(--ink-soft); }

.sd-notes {
  padding: clamp(1.1rem, 2.4vw, 1.5rem) 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-soft);
}

.sd-notes p { line-height: 1.6; }

.sd-notes p + p { margin-top: 0.5em; }

.sd-label {
  display: inline-block;
  margin-right: 0.6em;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.sd-closing {
  padding-top: clamp(1.1rem, 2.4vw, 1.5rem);
  font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
  .service-details { transition: none; }
  .service-chevron { transition: color 0.28s ease; }
}

@media (max-width: 720px) {
  .service-cards { grid-template-columns: 1fr; }
  .sd-grid { grid-template-columns: 1fr; }
}

/* ————— Hero + obituary ————— */

.hero {
  max-width: 1200px;
  margin: clamp(3.5rem, 8vh, 6rem) auto 0;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 6.5fr) minmax(0, 5.5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.hero-photo {
  position: sticky;
  top: 2.5rem;
}

.hero-photo img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 24px 60px -24px rgba(59, 52, 43, 0.35);
}

.obituary p {
  margin-bottom: 1.5em;
  font-size: clamp(1rem, 1.35vw, 1.13rem);
}

.obituary p:first-child::first-letter {
  font-size: 3.1em;
  float: left;
  line-height: 0.82;
  padding-right: 0.09em;
  padding-top: 0.05em;
}

/* ————— Carousel ————— */

.carousel {
  margin-top: clamp(4.5rem, 11vh, 8rem);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  overflow: hidden;
}

.row { overflow: hidden; }

.track {
  display: flex;
  gap: var(--gap);
  width: max-content;
  will-change: transform;
  animation: marquee var(--dur, 80s) linear infinite;
}

.carousel:hover .track { animation-play-state: paused; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.track img {
  height: var(--row-h);
  width: auto;
  border-radius: 3px;
  cursor: pointer;
  transition: opacity 0.35s ease;
}

.track img:hover { opacity: 0.88; }

@media (prefers-reduced-motion: reduce) {
  .track { animation: none; }
  .row { overflow-x: auto; }
}

/* ————— See all ————— */

.see-all-wrap {
  text-align: center;
  margin: clamp(3rem, 7vh, 5rem) 1.5rem;
}

.see-all {
  font-family: var(--serif);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 1.05em 2.6em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.see-all:hover {
  color: var(--ink);
  border-color: var(--ink-faint);
  background: var(--card);
}

/* ————— Collage ————— */

.collage {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2.5rem) 2rem;
}

.collage-columns {
  column-count: 4;
  column-gap: var(--gap);
}

@media (max-width: 1100px) { .collage-columns { column-count: 3; } }
@media (max-width: 720px)  { .collage-columns { column-count: 2; } }

.collage-columns img {
  width: 100%;
  height: auto;
  margin-bottom: var(--gap);
  border-radius: 3px;
  cursor: pointer;
  break-inside: avoid;
  transition: opacity 0.35s ease;
}

.collage-columns img:hover { opacity: 0.88; }

/* ————— Footer ————— */

footer {
  text-align: center;
  padding: clamp(4rem, 10vh, 7rem) 1.5rem clamp(3rem, 7vh, 5rem);
}

.footer-name {
  font-size: 1.9rem;
  font-style: italic;
}

.footer-note {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ————— Lightbox ————— */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(30, 26, 20, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] { display: none; }

.lb-img {
  max-width: min(92vw, 1400px);
  max-height: 90vh;
  border-radius: 3px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

.lb-close, .lb-nav {
  position: fixed;
  background: none;
  border: none;
  color: rgba(251, 248, 243, 0.75);
  font-family: var(--serif);
  cursor: pointer;
  transition: color 0.25s ease;
  line-height: 1;
}

.lb-close:hover, .lb-nav:hover { color: #FBF8F3; }

.lb-close { top: 1.2rem; right: 1.6rem; font-size: 2.4rem; }

.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3.2rem;
  padding: 1.5rem 1rem;
}

.lb-prev { left: 0.5rem; }
.lb-next { right: 0.5rem; }

/* ————— Mobile ————— */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { position: static; }
  :root { --row-h: clamp(96px, 13vh, 140px); --gap: 7px; }
  .lb-nav { font-size: 2.4rem; padding: 1rem 0.6rem; }
}
