/* Magnolia Cemetery — Friends of Magnolia Cemetery, Inc. */

:root {
  --stone-50:  #faf8f4;
  --stone-100: #f2eee6;
  --stone-200: #e4ddd0;
  --stone-400: #a89e8c;
  --stone-600: #6b6455;
  --ink:       #23261f;
  --ink-soft:  #4a4f42;
  --moss:      #2f4a34;
  --moss-deep: #1e3123;
  --moss-soft: #47694e;
  --brick:     #8c3a2b;
  --line:      rgba(35, 38, 31, 0.14);
  --shadow:    0 1px 2px rgba(30, 49, 35, .06), 0 8px 24px rgba(30, 49, 35, .08);

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1120px;
  --prose: 68ch;
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --stone-50:  #16180f;
    --stone-100: #1d2018;
    --stone-200: #2b2f24;
    --stone-400: #8b8574;
    --stone-600: #b6b0a0;
    --ink:       #f0ece2;
    --ink-soft:  #cdc7b8;
    --moss:      #9ec5a5;
    --moss-deep: #cfe3d2;
    --moss-soft: #7ea886;
    --brick:     #e0917f;
    --line:      rgba(240, 236, 226, 0.16);
    --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--stone-50);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.02rem, 0.98rem + 0.2vw, 1.12rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--moss-deep);
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.2rem, 1.6rem + 3vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 1.35rem + 1.7vw, 2.5rem); }
h3 { font-size: clamp(1.22rem, 1.1rem + 0.6vw, 1.5rem); }
p  { margin: 0 0 1.1em; }

a { color: var(--moss); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brick); }

:focus-visible {
  outline: 3px solid var(--brick);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Layout helpers --- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.prose { max-width: var(--prose); }
.section { padding: clamp(3rem, 2rem + 5vw, 5.5rem) 0; }
.section--tint { background: var(--stone-100); }
.eyebrow {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--moss-soft);
  margin: 0 0 .9rem;
}
.lede { font-size: 1.15em; color: var(--ink-soft); }

/* --- Skip link --- */
.skip {
  position: absolute; left: 0; top: 0;
  transform: translateY(-120%);
  background: var(--moss-deep); color: #fff;
  padding: .85rem 1.25rem; z-index: 100;
  text-decoration: none; font-weight: 600;
}
.skip:focus { transform: translateY(0); color: #fff; }

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--stone-50);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 72px;
}
.brand {
  display: flex; align-items: center; gap: .7rem;
  text-decoration: none; color: var(--moss-deep);
  padding: .4rem 0;
}
.brand svg { flex: none; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.42rem; font-weight: 600; line-height: 1.05;
  display: block;
}
.brand__sub {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--stone-600); display: block; margin-top: .12rem;
}

.nav-toggle {
  display: none;
  align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; min-width: 44px;
  padding: .5rem .8rem;
  font: inherit; font-size: .95rem; font-weight: 600;
  color: var(--moss-deep);
  background: transparent;
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer;
}
.nav { display: flex; align-items: center; gap: .35rem; }
.nav a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 .8rem;
  font-size: .96rem; font-weight: 600;
  color: var(--ink-soft); text-decoration: none;
  border-radius: var(--radius);
}
.nav a:hover { color: var(--moss-deep); background: var(--stone-200); }
.nav a[aria-current="page"] { color: var(--moss-deep); box-shadow: inset 0 -2px 0 var(--moss); }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute; left: -1.25rem; right: -1.25rem; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: .5rem 1.25rem 1.1rem;
    background: var(--stone-50);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: .35rem .6rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav a:last-child { border-bottom: 0; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: .75rem 1.5rem;
  font: inherit; font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--moss); color: #fff; }
.btn--primary:hover { background: var(--moss-deep); color: #fff; }
.btn--ghost { border-color: currentColor; color: var(--moss-deep); background: transparent; }
.btn--ghost:hover { background: var(--moss-deep); color: var(--stone-50); border-color: var(--moss-deep); }
.btn--onhero { background: rgba(255,255,255,.94); color: #1e3123; }
.btn--onhero:hover { background: #fff; color: #1e3123; }
.btn--onmoss { background: #fff; color: #1e3123; }
.btn--onmoss:hover { background: var(--stone-200); color: #1e3123; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* --- Hero --- */
.hero { position: relative; isolation: isolate; color: #fff; background: #1e3123; }
.hero__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(20,34,24,.62) 0%, rgba(20,34,24,.46) 45%, rgba(20,34,24,.80) 100%);
}
.hero__inner { padding: clamp(4.5rem, 3rem + 10vw, 9rem) 0 clamp(3rem, 2rem + 5vw, 6rem); max-width: 44rem; }
.hero h1 { color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.35); margin-bottom: .35em; }
.hero .eyebrow { color: rgba(255,255,255,.85); }
.hero p { color: rgba(255,255,255,.94); font-size: 1.2em; text-shadow: 0 1px 12px rgba(0,0,0,.4); }

.hero--page .hero__inner { padding: clamp(3rem, 2rem + 5vw, 5rem) 0 clamp(2.5rem, 2rem + 3vw, 4rem); }

/* --- Stat strip --- */
.stats {
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.stat { background: var(--stone-50); padding: 1.6rem 1.25rem; text-align: center; }
.stat__num {
  font-family: var(--font-display); font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.7rem);
  font-weight: 600; color: var(--moss); line-height: 1; display: block;
}
.stat__label {
  display: block; margin-top: .45rem;
  font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--stone-600);
}

/* --- Split feature --- */
.split { display: grid; gap: clamp(2rem, 1rem + 4vw, 4rem); align-items: center; }
@media (min-width: 860px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--flip .split__media { order: 2; }
}
.split__media img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }

/* --- Cards --- */
.cards { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.card {
  display: flex; flex-direction: column;
  background: var(--stone-50);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.card__body { padding: 1.4rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--ink-soft); font-size: .98rem; }
.card__link { margin-top: auto; font-weight: 700; text-decoration: none; }
.card__link:hover { text-decoration: underline; }
.card__link::after { content: " \2192"; }

/* --- Notable burials --- */
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 700px) { .people { grid-template-columns: 1fr 1fr; } }
.people li { background: var(--stone-50); padding: 1.1rem 1.3rem; }
.people b { display: block; font-family: var(--font-display); font-size: 1.2rem; color: var(--moss-deep); font-weight: 600; }
.people span { color: var(--ink-soft); font-size: .95rem; }

/* --- Gallery --- */
.gallery { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.gallery figure { margin: 0; }
.gallery img { border-radius: var(--radius); aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }
.gallery figcaption { margin-top: .55rem; font-size: .88rem; color: var(--stone-600); }

/* --- Timeline --- */
.timeline { list-style: none; margin: 2rem 0 0; padding: 0 0 0 1.9rem; border-left: 2px solid var(--stone-200); max-width: var(--prose); }
.timeline li { position: relative; padding-bottom: 2rem; }
.timeline li::before {
  content: ""; position: absolute; left: calc(-1.9rem - 7px); top: .45rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--moss); border: 2px solid var(--stone-50);
}
.timeline h3 { margin-bottom: .25rem; }
.timeline .year { font-family: var(--font-body); font-size: .8rem; font-weight: 700; letter-spacing: .12em; color: var(--brick); text-transform: uppercase; display: block; margin-bottom: .3rem; }
.timeline p { margin: 0; color: var(--ink-soft); }

/* --- Contact --- */
.contact-grid { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 800px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-card {
  background: var(--stone-50); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow);
}
.contact-card dl { margin: 0; }
.contact-card dt { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--stone-600); margin-top: 1.35rem; }
.contact-card dt:first-of-type { margin-top: 0; }
.contact-card dd { margin: .3rem 0 0; font-size: 1.06rem; }
.contact-card dd a { font-weight: 600; }
.map-embed { border: 0; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius); box-shadow: var(--shadow); }

/* --- Callout --- */
.callout {
  background: #1e3123; color: #fff;
  border-radius: var(--radius); padding: clamp(2rem, 1.5rem + 3vw, 3.25rem);
}
.callout h2 { color: #fff; }
.callout .eyebrow { color: rgba(255,255,255,.8); }
.callout p { color: rgba(255,255,255,.92); }
.callout a:not(.btn) { color: #fff; }

/* --- Footer --- */
.site-footer {
  background: #1e3123; color: rgba(255,255,255,.82);
  padding: 3.5rem 0 2rem;
  font-size: .95rem;
}
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer h2 {
  font-family: var(--font-body); font-size: .78rem; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(255,255,255,.6); margin-bottom: .9rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a { display: inline-block; padding: .45rem 0; text-decoration: none; }
.site-footer li a:hover { text-decoration: underline; }
.footer-brand .brand { color: #fff; }
.footer-brand .brand__name { color: #fff; }
.footer-brand .brand__sub { color: rgba(255,255,255,.6); }
.footer-brand p { margin-top: .9rem; max-width: 32ch; color: rgba(255,255,255,.72); }
.footer-bottom {
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.16);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
  font-size: .87rem; color: rgba(255,255,255,.62);
}
.footer-bottom a { color: rgba(255,255,255,.82); }

/* --- Misc --- */
.credit { font-size: .85rem; color: var(--stone-600); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
