/* ==========================================================================
   Home / landing page  (loaded by the St. Demetrios — Home Page mu-plugin on
   the front page and the News archive, which shares the card styles)
   Reuses the design tokens defined in the theme's style.css :root
   Sections render full-bleed; an inner .home-wrap re-centers content.
   ========================================================================== */

.home { color: var(--ink); }

.home-wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.1rem;
}

/* Neutralize the empty trailing <main> that balances the header markup. */
.home-tail { padding: 0 !important; min-height: 0; }

.home-sec { padding-block: clamp(2.75rem, 6vw, 4.5rem); }

.sec-head { text-align: center; max-width: 720px; margin: 0 auto 2.25rem; }
.sec-head .eyebrow {
  display: inline-block;
  font: 600 .78rem/1 var(--font-body);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-700);
  margin-bottom: .6rem;
}
.sec-head h2 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  line-height: 1.15; color: var(--blue-900); margin: 0;
}
.sec-head p { margin: .75rem 0 0; color: var(--ink-soft, #52606d); font-size: 1.05rem; }

.sec-head--light .eyebrow { color: var(--gold-500); }
.sec-head--light h2 { color: #fff; }
.sec-head--light p { color: rgba(255,255,255,.85); }

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: 600 .98rem/1 var(--font-body);
  padding: .8rem 1.4rem; border-radius: 999px;
  text-decoration: none; border: 2px solid transparent;
  transition: transform .12s ease, background .18s ease, color .18s ease, border-color .18s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn--gold { background: var(--gold-500); color: #3a2d05; border-color: var(--gold-500); }
.btn--gold:hover { background: var(--gold-700); border-color: var(--gold-700); color: #fff; }
.btn--blue { background: var(--blue-900); color: #fff; border-color: var(--blue-900); }
.btn--blue:hover { background: var(--blue-800, #0e4a80); border-color: var(--blue-800, #0e4a80); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn--ghost:hover { background: #fff; color: var(--blue-900); border-color: #fff; }
.btn--outline { background: #fff; color: var(--blue-900); border-color: var(--line); }
.btn--outline:hover { border-color: var(--blue-900); }

/* 1 — HERO ---------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  color: #fff;
  background: var(--blue-900);
  padding-block: clamp(3.5rem, 9vw, 7rem);
  overflow: hidden;
}
/* Stacked slide layers (one = static hero; many = crossfading slideshow).
   --focal-d / --focal-m are per-slide crop focal points set inline by the
   renderer (Home Page → Hero Slideshow); they default to centered. */
.hero-slides { position: absolute; inset: 0; z-index: 0; }
.hero-slide {
  position: absolute; inset: 0;
  background-position: var(--focal-d, 50% 50%); background-size: cover; background-repeat: no-repeat;
  opacity: 0; transition: opacity .9s ease;
}
.hero-slide.is-active { opacity: 1; }
.hero-video {
  width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: var(--focal-d, 50% 50%);
}
/* Branded blue scrim — applied to EVERY slide automatically so any photo stays
   readable and the headline/buttons stay legible. Slightly evened out on the
   right vs. the old icon-tuned gradient so arbitrary photos still work. */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(103deg,
      rgba(9,44,79,.95) 0%,
      rgba(9,44,79,.82) 42%,
      rgba(9,44,79,.6) 72%,
      rgba(9,44,79,.46) 100%),
    linear-gradient(180deg, rgba(9,44,79,0) 55%, rgba(9,44,79,.32) 100%);
}
.hero::after { /* subtle gold hairline at the base */
  content: ""; position: absolute; inset: auto 0 0 0; height: 4px; z-index: 2;
  background: linear-gradient(90deg, var(--gold-700), var(--gold-500), var(--gold-100));
}
.hero .home-wrap { position: relative; z-index: 3; }
.hero-inner { max-width: 620px; text-align: left; }
.hero .eyebrow {
  font: 600 .82rem/1 var(--font-body); letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold-100);
  display: inline-flex; align-items: center; gap: .55rem; margin-bottom: 1rem;
}
.hero .eyebrow::before { content: ""; width: 34px; height: 2px; background: var(--gold-500); }
.hero h1 {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(2.1rem, 5.2vw, 3.5rem); line-height: 1.08;
  margin: 0 0 1rem; text-wrap: balance;
}
.hero p.lede {
  font-size: clamp(1.05rem, 2vw, 1.28rem); line-height: 1.55;
  color: rgba(255,255,255,.9); margin: 0 0 1.9rem; max-width: 34em;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; }

/* Slideshow controls (only rendered when 2+ photos are set). */
.hero--carousel { padding-bottom: clamp(4rem, 9vw, 7rem); }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; line-height: 1; color: #fff;
  background: rgba(9,44,79,.4); border: 1px solid rgba(255,255,255,.5);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.hero-arrow:hover { background: var(--gold-500); color: var(--blue-900); border-color: var(--gold-500); }
.hero-prev { left: clamp(.5rem, 2vw, 1.5rem); }
.hero-next { right: clamp(.5rem, 2vw, 1.5rem); }
.hero-dots {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 1.4rem;
  display: flex; justify-content: center; gap: .55rem;
}
.hero-dot {
  width: 11px; height: 11px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.5); transition: background .15s ease, width .2s ease;
}
.hero-dot:hover { background: rgba(255,255,255,.85); }
.hero-dot.is-active { background: var(--gold-500); width: 28px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: none; }
}

/* 2 — NEWS ---------------------------------------------------------------- */
.news { background: var(--bg-soft); }
.news-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.news-card {
  position: relative;
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .18s ease;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
/* Whole card is clickable (stretched link) — the "Read more" link stays as a
   visible affordance, but its ::before overlay covers the entire card. */
.news-card .more::before {
  content: ""; position: absolute; inset: 0; z-index: 2;
}
.news-card:focus-within { outline: 2px solid var(--gold-500); outline-offset: 2px; }
.news-card:hover h3 { color: var(--gold-700); }
/* --focal is the per-item crop focus set inline by the News plugin/templates
   (see the "Featured image crop" meta box); it falls back to dead center. */
.news-card .thumb {
  position: relative;
  aspect-ratio: 16/9;
  background-color: var(--blue-50);
  background-position: var(--focal, 50% 50%);
  background-size: cover;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--line);
}
.news-card .body { padding: 1.15rem 1.2rem 1.35rem; display: flex; flex-direction: column; flex: 1; }
.news-card .date {
  font: 600 .74rem/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold-700); margin-bottom: .5rem;
}
.news-card h3 {
  font-family: var(--font-head); font-weight: 600; font-size: 1.28rem;
  line-height: 1.2; margin: 0 0 .55rem; color: var(--blue-900);
}
.news-card p { margin: 0 0 1rem; color: var(--ink-soft, #52606d); font-size: .98rem; line-height: 1.5; }
.news-card .more {
  margin-top: auto; align-self: flex-start;
  font: 600 .92rem/1 var(--font-body); color: var(--blue-900);
  text-decoration: none; display: inline-flex; align-items: center; gap: .35rem;
}
.news-card .more::after { content: "\2192"; transition: transform .15s ease; }
.news-card .more:hover::after { transform: translateX(3px); }
.news-empty {
  text-align: center; color: var(--ink-soft, #52606d);
  background: #fff; border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 2.5rem 1rem;
}
.news-all { text-align: center; margin-top: 1.75rem; }

/* Featured / primary news — pinned first and shown full width as a wide banner */
.news-card.is-primary {
  grid-column: 1 / -1;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 1px var(--gold-500), var(--shadow-md);
}
.news-card.is-primary .thumb { border-bottom-color: var(--gold-500); }
.news-card.is-primary h3 { color: var(--blue-900); }

/* On tablet/desktop the featured banner lays image + text side by side. */
@media (min-width: 561px) {
  .news-card.is-primary { flex-direction: row; align-items: stretch; }
  .news-card.is-primary .thumb {
    flex: 0 0 44%; aspect-ratio: auto; min-height: 300px;
    border-bottom: 0; border-right: 1px solid var(--gold-500);
  }
  .news-card.is-primary.feat-noimg .thumb { display: none; }
  .news-card.is-primary .body { justify-content: center; padding: 1.85rem 2.1rem; }
  .news-card.is-primary .date { font-size: .8rem; }
  .news-card.is-primary h3 { font-size: 1.72rem; line-height: 1.15; }
  .news-card.is-primary p { font-size: 1.06rem; line-height: 1.55; margin-bottom: 1.15rem; }
  .news-card.is-primary .more { margin-top: .4rem; }
}
.news-ribbon {
  position: absolute; top: .7rem; left: .7rem; z-index: 1;
  display: inline-flex; align-items: center; gap: .3rem;
  font: 700 .7rem/1 var(--font-body); letter-spacing: .05em; text-transform: uppercase;
  color: #3a2d05; background: var(--gold-500); padding: .38rem .6rem; border-radius: 4px;
  box-shadow: var(--shadow-sm);
}

/* Auto "This Week" card — branded thumb when it has no featured image */
.news-card.is-week .thumb {
  background: linear-gradient(135deg, var(--blue-800, #1b4d80), var(--blue-900) 72%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff;
}
.news-card.is-week .thumb::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 78% 22%, rgba(212,175,55,.28), transparent 60%);
}
.thumb-cal { position: relative; z-index: 1; text-align: center; }
.thumb-cal__ico { display: block; font-size: 2.5rem; line-height: 1; }
.thumb-cal__txt {
  display: block; margin-top: .4rem;
  font: 600 .82rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-500);
}

/* News archive page (archive-stdem_news.php) */
.news-archive { max-width: var(--maxw); margin: 0 auto; padding: 2.5rem 1.25rem 3rem; }
.news-archive .sec-head { text-align: center; margin-bottom: 2rem; }
.news-archive .sec-head h1 {
  font-family: var(--font-head); font-weight: 600; color: var(--blue-900);
  font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.12; margin: .35rem 0 .5rem;
}
.news-archive .sec-head .eyebrow {
  font: 600 .8rem/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-700);
}
.news-archive .sec-head p { color: var(--ink-soft, #52606d); margin: 0; }
.news-card.is-archived { opacity: .92; }
.news-badge {
  position: absolute; top: .7rem; left: .7rem; z-index: 1;
  font: 600 .68rem/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: var(--gold-700); padding: .35rem .55rem; border-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.news-archive .pagination,
.news-archive .nav-links {
  display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap;
  margin-top: 2.25rem;
}
.news-archive .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.4rem; padding: .5rem .75rem;
  border: 1px solid var(--line); border-radius: 6px;
  color: var(--blue-900); text-decoration: none; font-weight: 600;
  background: #fff; transition: background .14s ease, border-color .14s ease;
}
.news-archive .page-numbers:hover { background: var(--blue-50); border-color: var(--blue-800); }
.news-archive .page-numbers.current {
  background: var(--blue-900); border-color: var(--blue-900); color: #fff;
}

/* 3 — COMMUNITY / MINISTRIES --------------------------------------------- */
.community { background: #fff; }
.min-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.35rem;
}
.min-card {
  position: relative; display: block; text-decoration: none; color: inherit;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .18s ease;
}
.min-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.min-card .pic {
  aspect-ratio: 3/2; background: var(--blue-50) center / cover no-repeat;
}
.min-card .cap { padding: .9rem 1rem 1.05rem; }
.min-card .cap h3 {
  font-family: var(--font-head); font-weight: 600; font-size: 1.18rem;
  margin: 0 0 .3rem; color: var(--blue-900);
}
.min-card .cap p { margin: 0; font-size: .9rem; line-height: 1.45; color: var(--ink-soft, #52606d); }
.community .all-link { text-align: center; margin-top: 2.25rem; }

/* 4 — WORSHIP & VISIT ----------------------------------------------------- */
.worship { background: var(--blue-50); }
.worship-grid {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.75rem;
}
.info-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.6rem 1.7rem;
  box-shadow: var(--shadow-sm);
}
.info-card h3 {
  font-family: var(--font-head); font-weight: 600; font-size: 1.4rem;
  margin: 0 0 1rem; color: var(--blue-900);
  display: flex; align-items: center; gap: .6rem;
}
.info-card h3 svg { width: 26px; height: 26px; flex: none; color: var(--gold-700); }
.svc-list { list-style: none; margin: 0; padding: 0; }
.svc-list li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .65rem 0; border-bottom: 1px solid var(--line);
}
.svc-list li:last-child { border-bottom: 0; }
.svc-list .svc { font-weight: 600; color: var(--ink); }
.svc-list .time { color: var(--blue-900); font-variant-numeric: tabular-nums; white-space: nowrap; }
.svc-note { margin: .9rem 0 0; font-size: .9rem; color: var(--ink-soft, #52606d); }
.visit-list { list-style: none; margin: 0 0 1.2rem; padding: 0; }
.visit-list li { display: flex; gap: .7rem; padding: .45rem 0; align-items: flex-start; }
.visit-list li svg { width: 20px; height: 20px; color: var(--gold-700); flex: none; margin-top: .15rem; }
.visit-list a { color: var(--blue-900); text-decoration: none; }
.visit-list a:hover { text-decoration: underline; }
.info-card .btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: .3rem; }

/* 5 — WELCOME ------------------------------------------------------------- */
.welcome { background: #fff; }
.welcome-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center;
}
.welcome .txt .eyebrow {
  display: inline-block; font: 600 .78rem/1 var(--font-body);
  letter-spacing: .12em; text-transform: uppercase; color: var(--gold-700); margin-bottom: .6rem;
}
.welcome .txt h2 {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.35rem); line-height: 1.15;
  color: var(--blue-900); margin: 0 0 1rem;
}
.welcome .txt p { font-size: 1.06rem; line-height: 1.65; margin: 0 0 1rem; color: var(--ink); }
.welcome .txt .scripture {
  border-left: 4px solid var(--gold-500); padding: .35rem 0 .35rem 1rem;
  font-family: var(--font-head); font-style: italic; font-size: 1.12rem;
  color: var(--blue-900); margin: 1.25rem 0 1.5rem;
}
.welcome .txt .btn-row { display: flex; flex-wrap: wrap; gap: .8rem; }
.welcome .art {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md);
  aspect-ratio: 4/3; background: var(--blue-50) center / cover no-repeat;
  position: relative;
}
.welcome .art::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); border-radius: var(--radius);
}

/* 6 — LOCATION & CONTACT -------------------------------------------------- */
.location { background: var(--blue-900); color: #fff; }
.loc-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: stretch; }
.loc-map {
  position: relative;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md);
  min-height: 340px; border: 3px solid rgba(255,255,255,.12);
  background: var(--blue-800);
}
.loc-map iframe { width: 100%; height: 100%; min-height: 340px; border: 0; display: block; }
.loc-map-link {
  position: absolute; right: .6rem; bottom: .6rem;
  background: rgba(255,255,255,.94); color: var(--blue-900);
  font: 600 .8rem/1 var(--font-body); text-decoration: none;
  padding: .45rem .7rem; border-radius: 6px; box-shadow: var(--shadow-sm);
}
.loc-map-link:hover { background: #fff; }
.loc-card {
  align-self: center;
}
.loc-card h2 {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 1.1rem;
}
.loc-list { list-style: none; margin: 0 0 1.6rem; padding: 0; }
.loc-list li { display: flex; gap: .8rem; padding: .55rem 0; align-items: flex-start; }
.loc-list li svg { width: 22px; height: 22px; color: var(--gold-500); flex: none; margin-top: .1rem; }
.loc-list a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.35); }
.loc-list a:hover { border-color: var(--gold-500); }
.loc-list .lbl { display: block; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-100); margin-bottom: .1rem; }
.loc-card .btn-row { display: flex; flex-wrap: wrap; gap: .7rem; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 960px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .min-grid { grid-template-columns: repeat(2, 1fr); }
  .worship-grid, .welcome-grid, .loc-grid { grid-template-columns: 1fr; }
  .welcome .art { order: -1; }
  .loc-map { min-height: 300px; }
}
@media (max-width: 767px) {
  /* Use the mobile focal point (falls back to desktop, then centered). */
  .hero-slide { background-position: var(--focal-m, var(--focal-d, 50% 50%)); }
  .hero-video { object-position: var(--focal-m, var(--focal-d, 50% 50%)); }
}
@media (max-width: 560px) {
  .news-grid { grid-template-columns: 1fr; }
  .min-grid { grid-template-columns: 1fr; }
  .hero-cta .btn, .btn-row .btn { flex: 1 1 auto; justify-content: center; }
  /* Arrows would sit over the headline on narrow screens — dots + autoplay
     remain, which is enough to browse photos on mobile. */
  .hero-arrow { display: none; }
}

/* Offset in-page anchor jumps for the sticky site header. */
.home section[id] { scroll-margin-top: 150px; }
@media (max-width: 720px) { .home section[id] { scroll-margin-top: 96px; } }
