/* =============================================================
   Settle Memorial UMC — public theme
   -----------------------------------------------------------
   This stylesheet contains every visual decision for the
   public-facing site. Admin pages still use admin.css.
   
   Conventions (see PROJECT_HANDOFF.md §9):
     - Every brand value lives in the :root custom-property block
       below. The rest of the file references variables.
     - When the multi-church refactor ships, the :root block is
       what each per-site repo overrides. Nothing else.
     - Mobile-first. Media queries upgrade, never downgrade.
     - Cinzel for headings (uppercase, letterspaced). Lato for body.
   ============================================================= */


/* ---------- 1. Custom property declarations ---------- */

:root {
  /* Brand colors (sourced from the logo) */
  --brand-primary:        #9E2A2B;
  /* Derived shades. The static hex is the legacy fallback; the
     color-mix() line below it wins in modern browsers and tracks the
     (DB-overridable) --brand-primary so an admin's color change stays
     coherent across hovers/dark accents. Roadmap #4c (Option A). */
  --brand-primary-dark:   #7E2122;
  --brand-primary-dark:   color-mix(in srgb, var(--brand-primary) 80%, black);
  --brand-primary-darker: #5E1819;
  --brand-primary-darker: color-mix(in srgb, var(--brand-primary) 60%, black);
  --brand-ink:            #2C2C2E;   /* the dark-grey from the cross/shield */
  --brand-ink-soft:       #4A4A4D;
  --brand-ink-soft:       color-mix(in srgb, var(--brand-ink) 85%, white);

  /* Neutrals */
  --bg:                   #FFFFFF;
  --bg-soft:              #F7F4F2;
  --bg-band:              #1F1B1B;   /* footer */
  --border-soft:          #E8E2DE;
  --text:                 #2C2C2E;
  --text-muted:           #6B6661;
  --text-on-dark:         #F4EFEC;
  --text-on-dark-muted:   #BDB6B1;

  /* Typography */
  --font-display: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
  --font-body:    'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                  Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Layout */
  --container-max:        1200px;
  --container-gutter:     1.25rem;
  --section-pad-y:        3rem;
  --section-pad-y-lg:     5rem;

  /* Scale */
  --radius:               4px;
  --radius-lg:            8px;
  --shadow-card:          0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.05);
  --transition-fast:      120ms ease;
  --transition-med:       250ms ease;

  /* Header */
  --header-height:        88px;
  --header-height-mobile: 68px;
}


/* ---------- 2. Reset and base ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--brand-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}
a:hover { color: var(--brand-primary-dark); }
a:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-soft);
  margin: 2rem 0;
}


/* ---------- 3. Typography ---------- */

h1, h2, h3, h4, .eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-ink);
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

h1 { font-size: 1.85rem; }           /* 29.6px mobile */
h2 { font-size: 1.4rem; }            /* 22.4px */
h3 { font-size: 1.15rem; letter-spacing: 0.1em; }
h4 { font-size: 0.95rem; letter-spacing: 0.12em; }

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--brand-primary);
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  h1 { font-size: 2.4rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

/* Heading immediately after another heading: tighten the gap */
h1 + h2, h1 + h3, h2 + h3 { margin-top: -0.25rem; }


/* ---------- 4. Layout primitives ---------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-gutter);
}

.section {
  padding-block: var(--section-pad-y);
}

.section--lg {
  padding-block: var(--section-pad-y-lg);
}

.section--soft  { background: var(--bg-soft); }
.section--brand { background: var(--brand-primary); color: var(--text-on-dark); }
.section--brand h1, .section--brand h2, .section--brand h3, .section--brand h4,
.section--brand .eyebrow { color: var(--text-on-dark); }
.section--brand a { color: var(--text-on-dark); }

/* Tighter vertical rhythm — used on the home page (roadmap #4c) so the
   home bands scroll less without changing the global section padding
   that interior pages rely on. */
.section--tight { padding-block: 2.25rem; }

/* ---------- Home-page components (styles lifted from inline home.php) ---------- */

/* Centered intro for a section/sub-section: eyebrow + heading. */
.section-head {
  text-align: center;
  margin-bottom: 2rem;
}
/* The "This Sunday" sub-head sits inside the welcome band: add space
   above to separate it from the welcome copy, less below. */
.section-head--sub {
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
}

/* Button row: replaces repeated inline margins between adjacent buttons. */
.btn-row {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

/* Welcome block. */
.home-welcome {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}
.home-welcome__lead {
  font-size: 1.1rem;
  line-height: 1.7;
}

/* Worship-times row. Single column on phones; three across on wider
   screens (was a hardcoded 1fr that stacked even on desktop). */
.worship-times {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  max-width: 760px;
  margin-inline: auto;
}
@media (min-width: 700px) {
  .worship-times { grid-template-columns: repeat(3, 1fr); }
}
.worship-card {
  background: var(--bg);
  padding: 1.25rem 1rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  text-align: center;
}
.worship-card__service {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin: 0 0 0.35rem;
}
.worship-card__time { font-size: 1.05rem; }

/* Get-in-touch CTA. */
.home-cta {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}
.home-cta h2 { font-size: 1.6rem; }
.home-cta p  { margin: 1rem 0 0; opacity: 0.95; }


/* ---------- Home #10b: hero overlay, service strip, feature bands ---------- */

/* Text + CTA overlay sitting on the slideshow hero. Above the slides
   (z-index 2) but below the dot controls (z-index 4) so the dots stay
   clickable; the overlay ignores pointer events except on its buttons. */
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem var(--container-gutter) 3rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.45), rgba(0,0,0,0.30) 45%, rgba(0,0,0,0.55));
  pointer-events: none;
}
.hero__overlay-inner { max-width: 720px; }
.hero__overlay .btn { pointer-events: auto; }
.hero__overlay .eyebrow,
.hero--empty .eyebrow { color: rgba(255,255,255,0.85); }
.hero__overlay h1,
.hero--empty h1 {
  color: #fff;
  margin: 0.25rem 0 0;
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  line-height: 1.12;
}
.hero__sub {
  color: rgba(255,255,255,0.92);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0.9rem auto 0;
  max-width: 36rem;
}
@media (max-width: 600px) {
  .hero__overlay { padding-bottom: 2rem; }
  .hero__sub { font-size: 0.95rem; }
}

/* Compact worship-times strip directly under the hero. */
.service-strip {
  background: var(--brand-primary);
  color: var(--text-on-dark);
}
.service-strip__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}
.service-strip__item {
  flex: 1 1 8rem;
  min-width: 8rem;
  padding: 0.9rem 1.25rem;
}
.service-strip__name {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  opacity: 0.85;
}
.service-strip__time {
  display: block;
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 0.15rem;
}
@media (min-width: 600px) {
  .service-strip__item + .service-strip__item {
    border-left: 1px solid rgba(255,255,255,0.25);
  }
}

/* Three photo "doorway" bands. The staged Section-*.jpg backgrounds (Media
   Library) supply the photo; until they're imported, .feature-band--plain
   falls back to a solid ink band so the page still renders correctly. */
.feature-bands {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 800px) {
  .feature-bands { grid-template-columns: repeat(3, 1fr); }
}
.feature-band {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 200px;
  padding: 1.5rem;
  background-color: var(--brand-ink);
  background-size: cover;
  background-position: center;
  color: #fff;
  text-decoration: none;
  overflow: hidden;
}
.feature-band:hover { color: #fff; }
@media (min-width: 800px) {
  .feature-band { min-height: 260px; }
}
.feature-band__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.72), rgba(0,0,0,0.15));
  transition: background var(--transition-med);
}
.feature-band:hover .feature-band__scrim,
.feature-band:focus-visible .feature-band__scrim {
  background: linear-gradient(to top, rgba(0,0,0,0.80), rgba(0,0,0,0.32));
}
.feature-band__content { position: relative; z-index: 1; }
.feature-band__title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.15;
}
.feature-band__cta {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.95rem;
  opacity: 0.92;
}
.feature-band:hover .feature-band__cta { opacity: 1; }


/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid var(--brand-primary);
  background: var(--brand-primary);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.btn:hover {
  background: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--brand-primary);
}
.btn--ghost:hover {
  background: var(--brand-primary);
  color: #fff;
}

.btn--on-dark {
  background: transparent;
  border-color: #fff;
  color: #fff;
}
.btn--on-dark:hover {
  background: #fff;
  color: var(--brand-primary);
  border-color: #fff;
}


/* ---------- 5. Header + Nav + Footer ---------- */

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height-mobile);
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.site-header__brand img {
  height: 44px;
  width: auto;
}

/* Hide visible church-name text on mobile (logo is enough) */
.site-header__brand-text { display: none; }

@media (min-width: 768px) {
  .site-header__inner { height: var(--header-height); }
  .site-header__brand img { height: 56px; }
  .site-header__brand-text {
    display: block;
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brand-ink-soft);
  }
}

/* --- Top nav --- */
.site-nav {
  display: none;
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav__item {
  position: relative;
}

.site-nav__link {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--brand-ink);
  text-decoration: none;
  padding: 0.5rem 0;
  display: inline-block;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

/* Submenu (one level of nesting) */
.site-nav__submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 0.5rem 0;
  list-style: none;
  margin: 0;
}
.site-nav__item:hover > .site-nav__submenu,
.site-nav__item:focus-within > .site-nav__submenu {
  display: block;
}
.site-nav__submenu .site-nav__link {
  display: block;
  padding: 0.5rem 1rem;
  border-bottom: none;
  white-space: nowrap;
}
.site-nav__submenu .site-nav__link:hover {
  background: var(--bg-soft);
}

/* Third-tier submenu: fly out to the side of its (second-tier) parent
   item rather than stacking below it. The existing hover/focus-within
   rule above already toggles its display at any depth. */
.site-nav__submenu .site-nav__submenu {
  top: 0;
  left: 100%;
  transform: none;
  margin-left: 0.25rem;
}
/* Invisible bridge across the margin gap so the pointer never leaves the
   hover region when traveling from the 2nd-tier item to the 3rd-tier flyout.
   Lives inside the flyout's subtree, so it keeps the parent :hover alive
   while the 0.25rem visual separation is preserved. */
.site-nav__submenu .site-nav__submenu::before {
  content: "";
  position: absolute;
  top: 0;
  left: -0.25rem;
  width: 0.25rem;
  height: 100%;
}

@media (min-width: 1024px) {
  .site-nav { display: block; }
}

/* --- Mobile nav (CSS-only, no JS) --- */
.site-nav-toggle { display: none; }   /* hidden checkbox */
.site-nav-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-ink);
  cursor: pointer;
  padding: 0.5rem;
  user-select: none;
}
.site-nav-toggle-label::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -7px 0 currentColor, 0 7px 0 currentColor;
}

/* When the checkbox is checked, slide the mobile drawer down */
.site-nav-toggle:checked ~ .site-nav-mobile {
  display: block;
}
.site-nav-mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
  /* The drawer is absolutely positioned (out of flow), so a long 3-tier
     menu can run past the viewport with no way to scroll to it. The header
     is sticky at the top, so the drawer's top sits --header-height-mobile
     below the viewport top; cap it to the remaining height and let it
     scroll internally. dvh tracks mobile browser chrome; the preceding vh
     line is the fallback for engines without dvh (later valid rule wins). */
  max-height: calc(100vh - var(--header-height-mobile));
  max-height: calc(100dvh - var(--header-height-mobile));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.site-nav-mobile__list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}
.site-nav-mobile__link {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--brand-ink);
  text-decoration: none;
  display: block;
  padding: 0.85rem var(--container-gutter);
  border-bottom: 1px solid var(--border-soft);
}
.site-nav-mobile__link:hover,
.site-nav-mobile__link[aria-current="page"] {
  color: var(--brand-primary);
  background: var(--bg-soft);
}
.site-nav-mobile__sublist {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--bg-soft);
}
.site-nav-mobile__sublist .site-nav-mobile__link {
  padding-left: calc(var(--container-gutter) + 1.25rem);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  background: var(--bg-soft);
}
.site-nav-mobile__sublist .site-nav-mobile__sublist .site-nav-mobile__link {
  padding-left: calc(var(--container-gutter) + 2.5rem);
}

@media (min-width: 1024px) {
  /* Desktop: the inline nav is visible, so hide the mobile toggle (hamburger
     + "Menu") and the drawer. These sit AFTER the base .site-nav-toggle-label
     rule, so source order makes the hide win — the earlier copy was overridden
     and the toggle showed at every width. */
  .site-nav-toggle, .site-nav-toggle-label { display: none; }
  .site-nav-mobile { display: none !important; }
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-band);
  color: var(--text-on-dark);
  padding-block: 3rem 1.5rem;
}
.site-footer a { color: var(--text-on-dark); }
.site-footer a:hover { color: #fff; }

.site-footer__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .site-footer__grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}

.site-footer h4 {
  color: var(--text-on-dark);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  margin-bottom: 1rem;
}

.site-footer__brand-line {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 0.5rem;
}

.site-footer__address {
  font-style: normal;
  color: var(--text-on-dark-muted);
  line-height: 1.7;
}
.site-footer__address strong { color: var(--text-on-dark); font-weight: 600; }

.site-footer__social {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.site-footer__social a {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--text-on-dark-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.site-footer__social a:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}

.site-footer__bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  color: var(--text-on-dark-muted);
  text-align: center;
}


/* ---------- 6. Hero / Slideshow ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--brand-primary);
  color: #fff;
}

/* Empty-state hero: no slides yet, just a brand band */
.hero--empty {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1rem;
}
.hero--empty h1 {
  color: #fff;
  margin: 0;
}
.hero--empty__tagline {
  opacity: 0.9;
  margin-top: 1rem;
}

/* Slideshow container */
.slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 560px;
  background: var(--brand-ink);
}
@media (max-width: 767px) {
  .slideshow { aspect-ratio: 4 / 3; max-height: 420px; }
}

.slideshow__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 800ms ease;
  background-size: cover;
  background-position: center;
}
.slideshow__slide.is-active {
  opacity: 1;
  z-index: 2;
}

/* Optional caption overlay */
.slideshow__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  color: #fff;
  padding: 2rem var(--container-gutter) 1.5rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

/* Dot indicators */
.slideshow__dots {
  position: absolute;
  bottom: 0.85rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 0.5rem;
}
.slideshow__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.slideshow__dot.is-active { background: #fff; }
.slideshow__dot:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }


/* ---------- 7. Page content, cards, forms, utilities ---------- */

/* Generic prose styling for body_html content from the pages table */
.prose {
  max-width: 70ch;
}
.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.5rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.35rem; }
.prose img { border-radius: var(--radius); margin: 1.5rem 0; }
.prose blockquote {
  border-left: 3px solid var(--brand-primary);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

/* Page intro band */
.page-intro {
  background: var(--bg-soft);
  padding-block: 3rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: center;
}
.page-intro h1 { margin-bottom: 0.5rem; }
.page-intro .eyebrow { margin-bottom: 0.25rem; }


/* --- Staff cards (de-inlined from the existing pattern) --- */
.staff-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 600px)  { .staff-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { .staff-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .staff-grid { grid-template-columns: repeat(4, 1fr); } }

.staff-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-med), box-shadow var(--transition-med);
}
.staff-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.staff-card__photo {
  aspect-ratio: 4 / 5;
  background: var(--bg-soft);
  background-size: cover;
  background-position: center;
}
.staff-card__body {
  padding: 1.25rem 1.25rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.staff-card__name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-ink);
  margin: 0 0 0.25rem;
}
.staff-card__title {
  font-size: 0.85rem;
  color: var(--brand-primary);
  margin: 0 0 0.75rem;
  /* Keep a varied set of titles from wrapping cards to different heights. */
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.staff-card__bio {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  /* Clamp the preview to four lines so a long bio can't inflate its grid
     row and leave its neighbours with empty gaps. The full text lives in
     .staff-card__bio-full and opens in the modal via "Read more".
     -webkit-line-clamp gives the ellipsis where it's honoured (Blink); the
     max-height below is the cross-browser ENFORCER — Safari/iOS refuses to
     line-clamp text wrapped in a block <p>, so it would otherwise show the
     whole bio. */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Hard four-line cap that holds everywhere (incl. WebKit with a <p> child).
     min == max so short/no-bio cards still reserve four lines and stay
     aligned with their bio'd neighbours instead of collapsing. */
  max-height: calc(0.9rem * 1.5 * 4);
  min-height: calc(0.9rem * 1.5 * 4);
}
/* Neutralise the bio paragraphs' own margins so "four lines" is four lines of
   text — the global `p { margin: 0 0 1rem }` would otherwise count toward the
   cap and clip a line early. The modal keeps its own paragraph spacing. */
.staff-card__bio p { margin: 0; }
/* Full bio text: hidden in the card, cloned into the modal by JS. The
   [hidden] attribute already hides it; this is a belt-and-suspenders guard
   in case a future reset overrides attribute hiding. */
.staff-card__bio-full { display: none; }

/* Transient state set by staff-modal.js while measuring the bio's true
   height: WebKit reports scrollHeight === clientHeight on a -webkit-line-clamp
   box, so to detect truncation we briefly drop the clamp, read scrollHeight,
   and remove the class — all synchronously, so it never paints/flickers. */
.staff-card__bio.is-measuring {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
  max-height: none;
  min-height: 0;
}

.staff-card__more {
  align-self: flex-start;
  background: none;
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--brand-primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.staff-card__more:hover { color: var(--brand-primary-dark); }
.staff-card__contact {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.staff-card__contact a {
  display: block;
  word-break: break-word;
}

/* --- Screen-reader-only helper (used by the staff "Read more" buttons) --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- Staff bio modal --- */
.staff-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.staff-modal[hidden] { display: none; }
.staff-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity var(--transition-med);
}
.staff-modal.is-open .staff-modal__backdrop { opacity: 1; }
.staff-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity var(--transition-med), transform var(--transition-med);
}
.staff-modal.is-open .staff-modal__dialog {
  opacity: 1;
  transform: none;
}
.staff-modal__dialog:focus { outline: none; }
.staff-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--brand-ink);
  cursor: pointer;
  transition: background var(--transition-med);
}
.staff-modal__close:hover { background: var(--bg-soft); }
.staff-modal__photo {
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  background-size: cover;
  background-position: center top;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.staff-modal__body {
  padding: 1.5rem 1.75rem 1.75rem;
}
.staff-modal__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-ink);
  margin: 0 0 0.25rem;
}
.staff-modal__title {
  font-size: 0.95rem;
  color: var(--brand-primary);
  margin: 0 0 1rem;
}
.staff-modal__title[hidden] { display: none; }
.staff-modal__bio {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--brand-ink-soft);
}
.staff-modal__bio p { margin: 0 0 0.85rem; }
.staff-modal__bio p:last-child { margin-bottom: 0; }
.staff-modal__contact {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.staff-modal__contact[hidden] { display: none; }
.staff-modal__contact a {
  display: inline-block;
  margin-right: 1rem;
  word-break: break-word;
}
/* Lock background scroll while the modal is open (class set on <body>). */
body.staff-modal-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .staff-modal__backdrop,
  .staff-modal__dialog {
    transition: none;
  }
  .staff-modal__dialog { transform: none; }
}

/* --- Forms (prayer, contact, future) --- */
.form {
  max-width: 640px;
}
.form__field {
  margin-bottom: 1.25rem;
}
.form__label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-ink);
  margin-bottom: 0.5rem;
}
.form__label .req { color: var(--brand-primary); }

.form__input,
.form__textarea,
.form__select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form__textarea { min-height: 140px; resize: vertical; }
.form__input:focus,
.form__textarea:focus,
.form__select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(158, 42, 43, 0.15);
}

.form__radio-group {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.form__radio-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  cursor: pointer;
}
.form__hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}
.form__error {
  background: #FDECEC;
  border: 1px solid var(--brand-primary);
  color: var(--brand-primary-darker);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}
.form__success {
  background: #F0F7EE;
  border: 1px solid #3D7A3A;
  color: #2C5C2A;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

/* Honeypot — visually and screen-reader hidden but present in DOM */
.form__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}


/* --- Utilities --- */
.u-text-center { text-align: center; }
.u-mt-0 { margin-top: 0 !important; }
.u-mb-0 { margin-bottom: 0 !important; }
.u-mt-2 { margin-top: 1.5rem; }
.u-mb-2 { margin-bottom: 1.5rem; }
.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;
}


/* ---------- 8. Calendar (events, roadmap #2) ---------- */

/* Homepage upcoming-events widget */
.event-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  max-width: 900px;
  margin-inline: auto;
}
@media (min-width: 700px) {
  .event-grid { grid-template-columns: repeat(3, 1fr); }
}
.event-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--text);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.08), 0 10px 24px rgba(0,0,0,0.08);
}
.event-card--featured {
  border-color: var(--brand-primary);
  border-left-width: 4px;
}
.event-card__date {
  flex: 0 0 auto;
  width: 3.25rem;
  text-align: center;
  line-height: 1;
}
.event-card__mon {
  display: block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-primary);
}
.event-card__day {
  display: block;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--brand-ink);
}
.event-card__body { min-width: 0; }
.event-card__badge {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: 0.25rem;
}
.event-card__title {
  font-size: 1rem;
  margin: 0 0 0.35rem;
  line-height: 1.3;
}
.event-card__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.event-card__loc { font-style: italic; }

/* Event card with a background image (an override image set on an event in
   /admin/calendar). The per-event image URL is set inline on the card (the
   one unavoidable inline style, like the slideshow's per-slide background);
   the readable dark overlay and light text live here. A featured card keeps
   its brand left-border cue. background-color is a fallback if the image
   fails to load, so text stays readable. */
.event-card--image {
  position: relative;
  overflow: hidden;
  background-color: var(--brand-ink);
  background-size: cover;
  background-position: center;
}
.event-card--image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.62) 100%);
}
.event-card--image > * { position: relative; z-index: 1; }
.event-card--image .event-card__mon,
.event-card--image .event-card__day,
.event-card--image .event-card__title,
.event-card--image .event-card__badge { color: #fff; }
.event-card--image .event-card__meta { color: rgba(255,255,255,0.85); }

/* Calendar page — month navigation */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto 0.5rem;
}
.calendar-nav__title {
  margin: 0;
  text-align: center;
  font-size: 1.4rem;
  flex: 1 1 auto;
}
.calendar-nav__btn { white-space: nowrap; }
.calendar-empty {
  text-align: center;
  color: var(--text-muted);
  margin: 1.5rem 0;
}

/* Calendar page — month grid */
.calendar-grid {
  max-width: 1000px;
  margin: 1.5rem auto 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg);
}
.calendar-grid__head,
.calendar-grid__body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.calendar-grid__weekday {
  padding: 0.6rem 0.25rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-on-dark);
  background: var(--brand-primary);
}
.calendar-grid__weekday-full { display: none; }
@media (min-width: 700px) {
  .calendar-grid__weekday-short { display: none; }
  .calendar-grid__weekday-full { display: inline; }
}
.calendar-cell {
  min-height: 84px;
  padding: 0.3rem;
  border-top: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
  position: relative;
}
.calendar-grid__body .calendar-cell:nth-child(7n) { border-right: 0; }
.calendar-cell--empty { background: var(--bg-soft); }
.calendar-cell--today { background: rgba(158, 42, 43, 0.06); }
.calendar-cell--today .calendar-cell__date {
  background: var(--brand-primary);
  color: var(--text-on-dark);
  border-radius: 50%;
}
.calendar-cell__date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}
.calendar-cell__events {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.calendar-chip {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 1px 4px;
  font-size: 0.68rem;
  line-height: 1.25;
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
  border-left: 3px solid var(--brand-ink-soft);
}
.calendar-chip:hover { background: var(--border-soft); }
.calendar-chip--featured { border-left-color: var(--brand-primary); }
.calendar-chip__star { color: var(--brand-primary); font-size: 0.6rem; }
.calendar-chip__title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* On small screens the chips get cramped; hide chip text, show a dot count */
@media (max-width: 520px) {
  .calendar-cell { min-height: 56px; }
  .calendar-chip__title { display: none; }
  .calendar-chip {
    width: 8px; height: 8px; padding: 0;
    border-left: 0; border-radius: 50%;
    background: var(--brand-ink-soft);
  }
  .calendar-chip--featured { background: var(--brand-primary); }
  .calendar-chip__star { display: none; }
  .calendar-cell__events { flex-direction: row; flex-wrap: wrap; }
}

/* Calendar page — chronological details list */
.calendar-list__heading {
  max-width: 760px;
  margin: 2.5rem auto 1rem;
  font-size: 1.2rem;
  text-align: center;
}
.calendar-list {
  list-style: none;
  max-width: 760px;
  margin: 0 auto;
  padding: 0;
}
.calendar-list__item {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border-soft);
  scroll-margin-top: calc(var(--header-height) + 1rem);
}
.calendar-list__item:target {
  background: rgba(158, 42, 43, 0.06);
  border-radius: var(--radius-lg);
  padding-inline: 1rem;
}
.calendar-list__item--featured { border-left: 4px solid var(--brand-primary); padding-left: 1rem; }
.calendar-list__date {
  flex: 0 0 auto;
  width: 3.25rem;
  text-align: center;
  line-height: 1.1;
}
.calendar-list__dow {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.calendar-list__day {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--brand-ink);
}
.calendar-list__mon {
  display: block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-primary);
}
.calendar-list__body { min-width: 0; }
.calendar-list__title { font-size: 1.1rem; margin: 0 0 0.35rem; }
.calendar-list__star { color: var(--brand-primary); }
.calendar-list__meta {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-bottom: 0.5rem;
}
.calendar-list__loc { font-style: italic; }
.calendar-list__image {
  max-width: 25vw;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 0.5rem 0;
}
.calendar-list__notes { margin: 0.25rem 0; font-weight: 700; }
.calendar-list__desc { margin: 0.25rem 0; color: var(--text); }


/* ---------- 9. Blog (roadmap #3) ---------- */
/* Card grid mirrors the staff grid's responsive columns; cards reuse the
   same surface/shadow/hover language as staff and event cards. All colors
   reference existing brand variables — no new :root values. */

.blog-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 600px)  { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px)  { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

.post-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-med), box-shadow var(--transition-med);
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.post-card__media {
  display: block;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-soft);
}
.post-card__body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}
.post-card__title {
  font-size: 1.15rem;
  margin: 0;
  line-height: 1.3;
}
.post-card__title a { color: var(--brand-ink); }
.post-card__title a:hover { color: var(--brand-primary); }
.post-card__excerpt {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}
.post-card__meta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Category chips (on cards and on the single-post byline) */
.post-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.post-cats--intro { justify-content: center; margin-bottom: 0.75rem; }
.post-cat {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.6rem;
  border-radius: 1em;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  color: var(--brand-primary);
}
.post-cat:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--text-on-dark);
}

/* Category filter row on the listing */
.blog-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.blog-filter__chip {
  font-size: 0.85rem;
  padding: 0.3rem 0.9rem;
  border-radius: 1.5em;
  border: 1px solid var(--border-soft);
  background: #fff;
  color: var(--brand-ink-soft);
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.blog-filter__chip:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.blog-filter__chip.is-active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--text-on-dark);
}

/* Pagination */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.5rem;
}
.blog-pagination__status { color: var(--text-muted); font-size: 0.9rem; }
.btn.is-disabled { opacity: 0.4; pointer-events: none; }

/* Single post */
.post-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.post-single { max-width: 760px; }
.post-single__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}
.post-single__footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
}


/* ---------- 8a. Calendar display enhancements ---------- */
/* Adds: a Month/List view switcher + subscribe links (.cal-toolbar), a
   month grid whose multi-day / all-day events render as horizontal bars
   spanning the days they cover (.cal-month / .cal-week / .cal-bar), and
   day-view chrome. The chronological list/day views reuse the existing
   .calendar-list and .blog-pagination styles. All colors reference
   existing brand variables — no new :root values. The older .calendar-grid
   / .calendar-chip rules above are retained but unused by the new month
   template (harmless). */

.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 1000px;
  margin: 0 auto 1.25rem;
}
.cal-views {
  display: inline-flex;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-views__btn {
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  color: var(--brand-primary);
  background: var(--bg);
  text-decoration: none;
}
.cal-views__btn + .cal-views__btn { border-left: 1px solid var(--border-soft); }
.cal-views__btn:hover { background: var(--bg-soft); }
.cal-views__btn.is-active { background: var(--brand-primary); color: var(--text-on-dark); }
.cal-subscribe { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cal-subscribe .btn { font-size: 0.82rem; padding: 0.4rem 0.85rem; }

/* Month grid */
.cal-month {
  max-width: 1000px;
  margin: 1.25rem auto 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg);
}
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-weekday {
  padding: 0.55rem 0.25rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-on-dark);
  background: var(--brand-primary);
}
.cal-weekday__short { display: none; }

/* A week row is the positioning context for that week's spanning bars.
   --lanes (set inline) is how many bar lanes this week needs; it inherits
   into the cells so every cell in the row reserves the same top space and
   stays aligned. --cal-num-h / --cal-bar-h are the day-number and per-lane
   heights the bar math is built on. */
.cal-week {
  position: relative;
  --cal-num-h: 1.55rem;
  --cal-bar-h: 1.35rem;
}
.cal-week__cells { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell {
  position: relative;
  min-height: 96px;
  border-top: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
  padding: 0.25rem 0.3rem 0.45rem;
  padding-top: calc(var(--cal-num-h) + var(--lanes, 0) * var(--cal-bar-h));
}
.cal-week__cells .cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell--out { background: var(--bg-soft); }
.cal-cell--out .cal-cell__num { color: var(--text-muted); opacity: 0.55; }
.cal-cell--today { background: rgba(158, 42, 43, 0.06); }
.cal-cell__num {
  position: absolute;
  top: 0.25rem;
  left: 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.3rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-ink);
  text-decoration: none;
}
.cal-cell--today .cal-cell__num {
  background: var(--brand-primary);
  color: var(--text-on-dark);
  border-radius: 1rem;
}
.cal-cell__num:hover { color: var(--brand-primary); }
.cal-cell--today .cal-cell__num:hover { color: var(--text-on-dark); }

/* Spanning bars. left/width come from the start column and span (1/7ths
   of the row); top from the lane. The small +3px / -6px insets leave a
   gap between horizontally adjacent bars. */
.cal-bar {
  position: absolute;
  left:  calc(var(--col) / 7 * 100% + 3px);
  width: calc(var(--span) / 7 * 100% - 6px);
  top:   calc(var(--cal-num-h) + var(--lane) * var(--cal-bar-h) + 0.1rem);
  height: calc(var(--cal-bar-h) - 0.25rem);
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0 0.4rem;
  border-radius: var(--radius);
  background: var(--brand-ink-soft);
  color: var(--text-on-dark);
  font-size: 0.72rem;
  line-height: 1;
  text-decoration: none;
  overflow: hidden;
  z-index: 1;
}
.cal-bar:hover { filter: brightness(1.08); color: var(--text-on-dark); }
.cal-bar--featured { background: var(--brand-primary); }
.cal-bar--cont-left  { border-top-left-radius: 0;  border-bottom-left-radius: 0;  margin-left: -3px; }
.cal-bar--cont-right { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-bar__star { font-size: 0.62rem; }
.cal-bar__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* In-cell single-day timed entries */
.cal-cell__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-ev {
  display: block;
  padding: 1px 4px;
  border-radius: var(--radius);
  border-left: 3px solid var(--brand-ink-soft);
  font-size: 0.72rem;
  line-height: 1.25;
  color: var(--text);
  text-decoration: none;
}
.cal-ev:hover { background: var(--bg-soft); }
.cal-ev--featured { border-left-color: var(--brand-primary); }
.cal-ev__time { display: block; font-weight: 700; color: var(--brand-primary); white-space: nowrap; }
.cal-ev__title {
  display: block;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}
.cal-more {
  display: inline-block;
  margin-top: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
}
.cal-more:hover { color: var(--brand-primary); }

/* Day view — "back to month" link under the day nav */
.calendar-day__back { text-align: center; margin: 0.4rem 0 0; font-size: 0.9rem; }

/* Tighter month grid on small screens */
@media (max-width: 640px) {
  .cal-week { --cal-num-h: 1.35rem; --cal-bar-h: 1.2rem; }
  .cal-cell { min-height: 74px; padding-inline: 0.2rem; }
  .cal-bar, .cal-ev { font-size: 0.66rem; }
  .cal-weekday__full { display: none; }
  .cal-weekday__short { display: inline; }
}

/* ---------- 10. Photo Albums (Flickr-replacement gallery) ---------- */
/* Reuses the blog-grid/post-card responsive language and existing brand
   variables — no new :root values. Album cards mirror .post-card exactly;
   photo tiles are a denser square-thumbnail grid for browsing hundreds of
   images at once. */

.album-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .album-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .album-grid { grid-template-columns: repeat(4, 1fr); } }

.album-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition-med), box-shadow var(--transition-med);
}
.album-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.album-card__media {
  display: block;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.album-card__placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.album-card__body {
  display: block;
  padding: 0.9rem 1rem;
}
.album-card__title {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--brand-ink);
}
.album-card__meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Album detail header */
.album-detail__meta {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}
.album-detail__desc {
  max-width: 60ch;
  margin: 0.6rem auto 0;
  color: var(--text);
}

/* Photo grid within an album — dense square tiles */
.photo-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 480px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .photo-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 992px) { .photo-grid { grid-template-columns: repeat(5, 1fr); } }

.photo-tile {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-med);
}
.photo-tile:hover img { transform: scale(1.04); }

/* Lightbox overlay — progressive enhancement over the plain grid links */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.lightbox[hidden] { display: none; }
.lightbox__img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.lightbox__caption {
  color: var(--text-on-dark);
  margin-top: 0.8rem;
  font-size: 0.9rem;
  text-align: center;
  max-width: 60ch;
}
.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  color: var(--text-on-dark);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: var(--text-on-dark);
  font-size: 2.4rem;
  line-height: 1;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}
.lightbox__nav:hover:not(:disabled) { background: rgba(255, 255, 255, 0.25); }
.lightbox__nav:disabled { opacity: 0.25; cursor: default; }
.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }
@media (max-width: 640px) {
  .lightbox__nav { width: 2.2rem; height: 2.2rem; font-size: 2rem; }
  .lightbox__nav--prev { left: 0.4rem; }
  .lightbox__nav--next { right: 0.4rem; }
}
