/* =========================================================================
   St Werburgh & St Laurence Catholic Church, Birkenhead
   Modern responsive rebuild — shared stylesheet
   Keeps the ecclesiastical "spirit": heritage blue + gold, church imagery.
   ========================================================================= */

:root {
  --blue-900: #14263f;
  --blue-800: #1d3a5f;
  --blue-700: #285285;  /* heritage #336699 family, deepened */
  --blue-600: #336699;
  --gold-600: #b8902a;
  --gold-500: #c9a227;  /* heritage #cc9900 family */
  --gold-300: #e3c766;
  --ink: #20303f;
  --slate: #4a5a68;
  --paper: #f7f5f0;
  --paper-2: #ffffff;
  --line: #e3ddd0;
  --shadow: 0 10px 30px rgba(20, 38, 63, 0.12);
  --shadow-lg: 0 18px 50px rgba(20, 38, 63, 0.20);
  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1140px;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--blue-900);
  line-height: 1.12;
  font-weight: 600;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.4rem; }

p { margin: 0 0 1rem; }

a { color: var(--blue-700); text-decoration: none; }
a:hover { color: var(--gold-600); }

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

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.section--blue { background: var(--blue-800); color: #eaf0f7; }
.section--blue h2, .section--blue h3 { color: #fff; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .18em; font-size: .78rem;
  font-weight: 700; color: var(--gold-600); margin: 0 0 .4rem;
}
.section--blue .eyebrow { color: var(--gold-300); }
.center { text-align: center; }
.lead { font-size: 1.15rem; color: var(--slate); }
.section--blue .lead { color: #cdd8e6; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  font-weight: 600; font-size: 1rem; line-height: 1;
  padding: 14px 26px; border-radius: 999px; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--gold { background: var(--gold-500); color: #2a2208; }
.btn--gold:hover { background: var(--gold-300); color: #2a2208; }
.btn--ghost { border-color: currentColor; color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.12); color:#fff; }
.btn--blue { background: var(--blue-700); color: #fff; }
.btn--blue:hover { background: var(--blue-800); color:#fff; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(20, 38, 63, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--gold-500);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px 0;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; flex-shrink: 0; }
.brand img { height: 38px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-display); font-size: .98rem; font-weight: 600; }
.brand-text span { font-size: .62rem; letter-spacing: .04em; text-transform: uppercase; color: var(--gold-300); }
.brand-text strong, .brand-text > span { white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 1px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: #dce5f0; font-weight: 500; font-size: .81rem;
  padding: 8px 7px; border-radius: 8px; white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(255,255,255,.10); }
/* Default (offline / unknown): muted, NOT red */
.nav-links .nav-live {
  color: #cdd8e6; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.20);
  padding: 8px 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.nav-links .nav-live:hover { background: rgba(255,255,255,.16); color: #fff; }
.nav-links .nav-live .live-dot { background: #8d9bab; animation: none; }
/* Live: red, pulsing */
.nav-links .nav-live.is-live {
  color: #fff; background: #b3261e; border-color: #b3261e;
}
.nav-links .nav-live.is-live:hover { background: #cf2e25; color: #fff; }
.nav-links .nav-live.is-live .live-dot { background: #fff; animation: pulse 1.6s infinite; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.35;} }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 8px;
}
.nav-toggle span { display: block; width: 26px; height: 2px; background: #fff; margin: 5px 0; transition: .25s; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; text-align: center;
  background: linear-gradient(rgba(13,26,45,.62), rgba(13,26,45,.72)),
              url("../images/church.jpg") center 30% / cover no-repeat;
}
.hero-inner { padding: 96px 0 88px; }
.hero h1 { color: #fff; margin-bottom: .3em; }
.hero p { font-size: 1.25rem; color: #e7eef6; max-width: 640px; margin: 0 auto 1.6rem; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Live stream ---------- */
.stream-wrap { max-width: 980px; margin: 0 auto; }
.stream-frame {
  position: relative; background: #000; border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 16 / 9;
}
.stream-frame video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }
.stream-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.stream-status {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.6); color: #fff; font-size: .8rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; padding: 7px 13px; border-radius: 999px;
}
.stream-status .dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa7b4; }
.stream-status.is-live { background: #b3261e; }
.stream-status.is-live .dot { background: #fff; animation: pulse 1.6s infinite; }
.stream-offline {
  position: absolute; inset: 0; display: none; z-index: 2;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: #cdd8e6; text-align: center; padding: 24px; overflow-y: auto;
  background: radial-gradient(circle at center, #1d3a5f, #0c1929);
}
.stream-offline.show { display: flex; }
.stream-offline h3 { color: #fff; }
/* Scale the offline message down on phones so it fits the 16:9 box */
@media (max-width: 600px) {
  .stream-offline { padding: 12px; gap: 6px; }
  .stream-offline h3 { font-size: 1rem; line-height: 1.2; }
  .stream-offline p { font-size: .8rem; line-height: 1.35; margin: 0; }
  .stream-offline .btn { padding: 8px 14px; font-size: .82rem; }
}

/* ---------- Schedule ---------- */
.schedule {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin-top: 26px;
}
.sched-card {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius); padding: 18px 20px;
}
.sched-card .day { font-weight: 700; color: var(--gold-300); letter-spacing: .04em; }
.sched-card .time { font-family: var(--font-display); font-size: 1.6rem; color: #fff; }
.sched-card .what { font-size: .92rem; color: #cdd8e6; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card .icon { font-size: 1.6rem; color: var(--gold-600); }

.info-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.info-row .k { min-width: 92px; font-weight: 700; color: var(--blue-800); }

/* Day sub-heading inside the Mass-times cards (e.g. Saturday / Sunday under "Weekends") */
.mt-daylabel { margin: 14px 0 8px; font-weight: 700; color: var(--gold-600); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.mt-daylabel:first-child { margin-top: 0; }

/* A temporarily-suspended service (wedding/funeral over a Mass time) */
.info-row.mt-off { opacity: .72; }
.info-row.mt-off .k { color: var(--slate); }
.mt-badge { display: inline-block; background: #fbeecf; color: #8a5a00; border: 1px solid #edd6a0; border-radius: 999px; padding: 1px 9px; font-size: .82rem; font-weight: 600; margin-left: 4px; white-space: nowrap; }

/* Saints / figure */
.figure { text-align: center; }
.figure img { border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 auto 12px; }
.saints { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; }
.saints .figure img { width: 150px; }

/* image card (newsletter / parish team / diary) */
.image-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 14px; max-width: 1000px; margin: 0 auto;
}
.image-card img { border-radius: 8px; margin: 0 auto; }

/* Links grid */
.link-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 24px; }
.link-tile {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; text-align: center; transition: transform .15s;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.link-tile:hover { transform: translateY(-4px); }
.link-tile img { height: 130px; width: auto; object-fit: contain; }
.link-tile span { font-weight: 600; color: var(--blue-800); }

/* News archive */
.news-year { margin-bottom: 30px; }
.news-year h3 { color: var(--gold-600); border-bottom: 2px solid var(--line); padding-bottom: 6px; }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* Newsletter archive dropdown */
.newsletter-archive {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-size: 1rem; color: var(--blue-800);
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23345' stroke-width='2.5'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 14px center;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 42px 12px 16px; min-width: 260px; max-width: 100%; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.newsletter-archive:hover { border-color: var(--gold-600); }
.newsletter-archive:focus-visible { outline: none; border-color: var(--gold-600); box-shadow: 0 0 0 3px rgba(180,140,60,.25); }

/* Map */
.map-embed iframe { width: 100%; height: 420px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Footer ---------- */
.site-footer { background: var(--blue-900); color: #c6d2e0; padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.site-footer h4 { color: #fff; font-family: var(--font-body); font-size: .85rem; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 14px; }
.site-footer a { color: #c6d2e0; }
.site-footer a:hover { color: var(--gold-300); }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-bottom {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: .85rem; color: #8ea0b5;
}

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 2px;
  border-radius: 4px;
}
.site-header a:focus-visible, .hero a:focus-visible, .btn:focus-visible {
  outline-color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1140px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 8px;
    background: var(--blue-900); padding: 14px 14px 20px;
    border-bottom: 3px solid var(--gold-500);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .2s;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a, .nav-links .nav-live { display: block; padding: 15px 12px; border-radius: 10px; text-align: center; line-height: 1.2; }
  .nav-links a { background: rgba(255, 255, 255, 0.06); }
  .nav-links a:hover, .nav-links a.active { background: rgba(255, 255, 255, 0.16); }
  .nav-links .nav-live { display: flex; justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
}

/* ---------- Video embed (guided tour) ---------- */
.video-frame {
  position: relative; max-width: 980px; margin: 0 auto;
  aspect-ratio: 16 / 9; background: #000;
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Parish Diary ---------- */
.diary-list { list-style: none; margin: 0 auto; padding: 0; max-width: 760px; }
.diary-item { display: flex; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.diary-item:first-child { padding-top: 0; }
.diary-date {
  flex: 0 0 auto; width: 74px; text-align: center; line-height: 1.1;
  background: var(--blue-800); color: #fff; border-radius: var(--radius); padding: 10px 6px;
}
.diary-date .dd { display: block; font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; }
.diary-date .mm { display: block; text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; color: var(--gold-300); }
.diary-date .yy { display: block; font-size: .72rem; color: #b9c6d6; }
.diary-body { flex: 1 1 auto; }
.diary-body h3 { margin: 0 0 4px; }
.diary-time { color: var(--gold-600); font-weight: 600; margin: 0 0 6px; }
.diary-body p { margin: 0 0 .5rem; color: var(--slate); }

/* ---------- Parish Pastoral Team ---------- */
.pastoral-intro { max-width: 680px; margin: 0 auto 30px; }
.pastoral-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px; max-width: 900px; margin: 0 auto; }
.pastoral-card { text-align: center; }
.pastoral-card img, .pastoral-noimg { width: 130px; height: 130px; border-radius: 50%; object-fit: cover; margin: 0 auto 10px; box-shadow: var(--shadow); }
.pastoral-noimg { display: flex; align-items: center; justify-content: center; background: var(--blue-700); color: #fff; font-family: var(--font-display); font-size: 2.4rem; }
.pastoral-card strong { display: block; color: var(--blue-900); }
.pastoral-card span { display: block; font-size: .9rem; color: var(--gold-600); }

/* ---------- Parish Groups ---------- */
.groups-intro { max-width: 760px; margin: 0 auto 34px; }
.groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; }
.group-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.group-card h3 { margin: 0 0 8px; }
.group-card p { margin: 0 0 8px; color: var(--slate); }
.group-when { font-weight: 600; color: var(--gold-600); font-size: .9rem; margin-bottom: 0; }

/* ---------- Photo gallery ---------- */
.gal-album { margin-bottom: 40px; }
.gal-album-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; border-bottom: 2px solid var(--line); padding-bottom: 6px; margin-bottom: 16px; }
.gal-album-head h3 { color: var(--gold-600); margin: 0; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gal-thumb { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 10px; overflow: hidden; aspect-ratio: 1 / 1; }
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.gal-thumb:hover img { transform: scale(1.05); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; background: rgba(8, 15, 26, .93); padding: 30px; }
.lightbox.open { display: flex; }
.lb-img { max-width: 92vw; max-height: 82vh; border-radius: 8px; box-shadow: var(--shadow-lg); background: #000; }
.lb-close, .lb-prev, .lb-next {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; cursor: pointer;
  border-radius: 50%; width: 48px; height: 48px; font-size: 1.9rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.28); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-caption { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #dfe7f0; font-size: .9rem; }
@media (max-width: 600px) {
  .lb-prev { left: 6px; } .lb-next { right: 6px; }
  .diary-date { width: 60px; }
}
