/* ==========================================================================
   Christ Church Blakenall – stylesheet (v2)
   Sections: 1 Tokens · 2 Base · 3 Header · 4 Season strip · 5 Hero
             6 Page heads · 7 Layout & cards · 8 Timetable · 9 People
             10 Prose & misc · 11 Footer · 12 Motion
   To change the look, start with the colours in section 1.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,650&family=Source+Sans+3:wght@400;600&display=swap");

/* ---------- 1. Design tokens (colours, fonts, sizes) ---------- */
:root {
  --ink: #1a1214;
  --paper: #fbf8f2;
  --stone: #f0e9dc;
  --crimson: #7a1f2b;
  --deep: #3d0f16;          /* darkest crimson, used for bands */
  --gold: #b08d4a;
  --muted: #6a5f5a;
  --line: #e2d8c8;
  --season: #b08d4a;        /* overwritten by site.js with the liturgical colour */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 0.75rem;
  --max: 72rem;
  --shadow: 0 2px 4px rgba(26,18,20,.06), 0 14px 36px rgba(26,18,20,.10);
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--crimson);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font: 1.05rem/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; }
a { color: var(--crimson); text-underline-offset: .15em; }
img { max-width: 100%; height: auto; display: block; }
a:focus-visible, button:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

/* "Skip to content" link for keyboard and screen-reader users */
.skip-link { position: absolute; left: 1rem; top: -100%; z-index: 100; background: var(--crimson);
  color: #fff; padding: .75rem 1rem; border-radius: var(--radius); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 1rem; }

/* ---------- 3. Header & navigation ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(251,248,242,.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { max-width: var(--max); margin: 0 auto; padding: .4rem 1rem; min-height: 4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { font-family: var(--display); font-size: 1.2rem; color: var(--crimson); text-decoration: none; white-space: nowrap; }
.logo::before { content: "✠"; color: var(--gold); margin-right: .45rem; }
.nav { display: none; gap: .1rem; }
.nav a { padding: .5rem .7rem; border-radius: 999px; color: var(--ink); text-decoration: none; font-size: .95rem; }
.nav a:hover { background: rgba(122,31,43,.08); color: var(--crimson); }
.nav a[aria-current="page"] { background: var(--crimson); color: #fff; }
.menu-btn { width: 2.75rem; height: 2.75rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 1.15rem; height: 2px; background: var(--ink); position: relative; border-radius: 1px; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -.38rem; } .menu-icon::after { top: .38rem; }
.mobile-nav { display: none; padding: .25rem 1rem 1rem; border-top: 1px solid var(--line); background: var(--paper); }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: .85rem .25rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.mobile-nav a[aria-current="page"] { color: var(--crimson); font-weight: 600; }
@media (min-width: 1024px) { .nav { display: flex; } .menu-btn, .mobile-nav { display: none !important; } }

/* ---------- 4. Season strip (thin bar under the header, filled by site.js) ---------- */
.season-strip { background: var(--season); color: #fff; text-align: center; font-size: .9rem; padding: .35rem 1rem; }
.season-strip:empty { display: none; }

/* ---------- 5. Home page hero ---------- */
.hero { position: relative; color: #fff; overflow: hidden; background: var(--deep); }
.hero::before { /* the church photo, tinted crimson so the text stays readable */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(61,15,22,.96) 25%, rgba(61,15,22,.55)),
              url("images/services/communion.jpg") center / cover; }
.hero-inner { position: relative; max-width: var(--max); margin: 0 auto; padding: 4rem 1rem 4.5rem;
  display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .hero-inner { grid-template-columns: 1.3fr 1fr; padding: 5.5rem 1rem; } }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); margin: .3rem 0 .8rem; }
.hero p.big { font-size: 1.2rem; max-width: 34rem; opacity: .95; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* Liturgical "which week are we in" card (filled by site.js) */
.liturgy-card { background: rgba(251,248,242,.97); color: var(--ink); border-radius: var(--radius);
  padding: 1.5rem; border-top: 6px solid var(--season); box-shadow: var(--shadow); }
.liturgy-card .date { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0; }
.liturgy-card .now { font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2rem); color: var(--crimson); margin: .4rem 0; line-height: 1.2; }
.liturgy-card .note { margin: 0 0 1rem; color: var(--muted); }
.liturgy-card .colour { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; }
.liturgy-card .colour i { width: 1rem; height: 1rem; border-radius: 50%; background: var(--season); border: 1px solid rgba(0,0,0,.2); }
.pips { display: flex; gap: .4rem; margin: 0 0 1rem; }
.pips span { flex: 1; height: .45rem; border-radius: 99px; background: var(--line); }
.pips span.on { background: var(--season); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .75rem 1.3rem; border-radius: 999px;
  background: var(--crimson); color: #fff; font-weight: 600; font-size: .98rem; text-decoration: none;
  border: 2px solid var(--crimson); transition: transform .15s, background .15s; }
.btn:hover { background: var(--deep); border-color: var(--deep); transform: translateY(-2px); }
.btn-light { background: #fff; color: var(--crimson); border-color: #fff; }
.btn-light:hover { background: var(--stone); color: var(--deep); border-color: var(--stone); }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.6); }
.btn[aria-disabled="true"] { background: var(--muted); border-color: var(--muted); pointer-events: none; }

/* ---------- 6. Inner page heads ---------- */
.page-head { color: #fff; border-bottom: 4px solid var(--gold);
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 14px, transparent 14px 28px), linear-gradient(120deg, var(--deep), var(--crimson)); }
.page-head-inner { max-width: var(--max); margin: 0 auto; padding: 3rem 1rem; }
.page-head h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin: 0; }
.page-head .lede { max-width: 38rem; margin: .9rem 0 0; font-size: 1.15rem; opacity: .92; }
.page-head a { color: #fff; }
.kicker { font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin: 0 0 .5rem; }
.page-head .kicker, .hero .kicker { color: #e6cf9c; }

/* ---------- 7. Layout & cards ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 3rem 1rem; }
.band { background: var(--stone); border-block: 1px solid var(--line); }
.section-title { color: var(--crimson); font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-title::after { content: ""; display: block; width: 3.5rem; height: 3px; background: var(--gold); margin-top: .6rem; border-radius: 2px; }
.grid-2, .grid-3 { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; color: inherit; text-decoration: none; transition: transform .2s, box-shadow .2s; }
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card h2, .card h3 { color: var(--crimson); margin-bottom: .25rem; }
.card .meta { color: var(--muted); margin: 0 0 .6rem; }
.card p { margin: .5rem 0 0; }
.card .more { display: inline-block; margin-top: 1rem; font-weight: 600; color: var(--crimson); }
.card-media { padding: 0; overflow: hidden; }
.card-media img, .card-media .fallback { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.card-media .fallback { display: flex; align-items: center; justify-content: center; text-align: center; padding: 1rem;
  font-family: var(--display); font-size: 1.3rem; color: #fff; background: linear-gradient(135deg, var(--crimson), var(--deep)); }
.card-media .body { padding: 1.4rem 1.6rem 1.6rem; }

/* Maps and service photos */
.map-frame, .service-image { width: 100%; aspect-ratio: 16/9; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--stone); }
.map-frame iframe { width: 100%; height: 100%; border: 0; }
.service-image { object-fit: cover; }
.service-detail { margin-top: 2rem; align-items: start; }
.service-intro { font-size: 1.2rem; margin-top: 0; }
.points { list-style: none; padding: 0; margin: 1.5rem 0; }
.points li { padding: .45rem 0 .45rem 1.9rem; position: relative; }
.points li::before { content: "✠"; position: absolute; left: 0; color: var(--gold); }

/* ---------- 8. Weekly timetable (home page) ---------- */
.timetable { list-style: none; margin: 0; padding: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; }
.timetable li + li { border-top: 1px solid var(--line); }
.timetable a { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 1rem; align-items: center;
  padding: 1.1rem 1.25rem; text-decoration: none; color: inherit; }
.timetable a:hover { background: var(--stone); }
.timetable .tt-day { font-family: var(--display); font-size: 1.15rem; color: var(--crimson); }
.timetable .what small { display: block; color: var(--muted); }
.timetable .time { font-weight: 600; white-space: nowrap; }
@media (max-width: 560px) { .timetable a { grid-template-columns: 1fr auto; } .timetable .tt-day { grid-column: 1 / -1; } }

/* ---------- 9. Who's who (arched photos) ---------- */
.person { text-align: center; }
.person-photo { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: center top;
  border-radius: 999px 999px var(--radius) var(--radius); border: 4px solid #fff; box-shadow: var(--shadow); background: var(--stone); }
.person-photo.placeholder { display: flex; align-items: center; justify-content: center; font-family: var(--display);
  font-size: 3.5rem; color: var(--crimson); background: linear-gradient(160deg, var(--stone), #e0d4bd); }
.person h2 { color: var(--crimson); font-size: 1.5rem; margin: 1rem 0 .15rem; }
.person p { margin: 0; color: var(--muted); }

/* ---------- 10. Prose, roll of honour, magazine ---------- */
.prose { max-width: 42rem; font-size: 1.12rem; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.roll { columns: 3 13rem; column-gap: 2rem; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.roll li { break-inside: avoid; padding: .25rem 0; border-bottom: 1px dotted var(--line); }
.contact-panel { display: grid; gap: 1.5rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; margin-bottom: 2.5rem; }
@media (min-width: 640px) { .contact-panel { grid-template-columns: 1fr 1fr; } }
.contact-value { font-family: var(--display); font-size: clamp(1.25rem, 3vw, 1.8rem); margin: .3rem 0 0; word-break: break-word; }
.contact-value a { text-decoration: none; }
.muted { color: var(--muted); }

/* ---------- 11. Footer ---------- */
.footer { background: var(--deep); color: #f3ebe0; border-top: 4px solid var(--gold); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 2.5rem 1rem 1.5rem; }
.footer-title { font-family: var(--display); font-size: 1.4rem; margin: 0; }
.footer-tagline { margin: .25rem 0 1.5rem; opacity: .8; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; font-size: .95rem; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-label { font-family: var(--display); color: #e6cf9c; margin: 0 0 .3rem; }
.footer-grid p { margin: 0; }
.footer a { color: #fff; }
.footer-note { margin: 1.75rem 0 0; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.18); font-size: .85rem; opacity: .75; }

/* ---------- 12. Motion (gentle fade-ins; switched off if the visitor prefers) ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: .01ms !important; }
}

/* ---------- 13. News articles (news.html) ----------
   Each article is an <article class="article"> block. The picture is optional:
   delete the <img> line and the article simply shows text. */
.news-layout { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 900px) { .news-layout { grid-template-columns: 2fr 1fr; } }
.news-list { display: grid; gap: 1.75rem; }
.article { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.article img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--stone); }
.article-body { padding: 1.5rem 1.6rem 1.7rem; }
.article time { display: block; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-bottom: .35rem; }
.article h2 { color: var(--crimson); font-size: 1.6rem; margin-bottom: .6rem; }
.article p { margin: 0 0 .8rem; }
.article p:last-child { margin-bottom: 0; }
.news-aside { background: var(--stone); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
@media (min-width: 900px) { .news-aside { position: sticky; top: 5.5rem; } }
.news-aside h2 { color: var(--crimson); font-size: 1.3rem; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: .6rem 0; border-top: 1px solid var(--line); }
.mini-list a { font-weight: 600; text-decoration: none; display: block; }
.mini-list small { color: var(--muted); }

/* ---------- 14. News page: highlights, calendar, filters ----------
   Layout of news.html. The coloured CC / SC tags, date badges and day cards
   are all defined here. Past days fade and today glows (set by site.js). */
.subnav { background: var(--stone); border-bottom: 1px solid var(--line); }
.subnav-inner { max-width: var(--max); margin: 0 auto; padding: .7rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.subnav a { padding: .4rem 1rem; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--crimson); font-weight: 600; font-size: .92rem; text-decoration: none; }
.subnav a:hover { border-color: var(--crimson); }
#highlights, #calendar, #stories { scroll-margin-top: 4.5rem; }

/* Little "calendar leaf" showing weekday, day and month */
.date-badge { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 4.1rem; min-width: 4.1rem;
  padding: .35rem 0 .4rem; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--crimson); border-radius: .6rem; text-align: center; line-height: 1.1; }
.date-badge span, .date-badge em { font-size: .66rem; font-style: normal; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.date-badge b { font-family: var(--display); font-size: 1.65rem; font-weight: 650; color: var(--ink); }

/* Coloured church tags: CC crimson, SC teal */
.tag { display: inline-block; min-width: 2.2rem; text-align: center; padding: .05rem .45rem; border-radius: 99px; font-size: .72rem; font-weight: 600; letter-spacing: .04em; color: #fff; vertical-align: .08em; }
.tag-cc { background: var(--crimson); }
.tag-sc { background: #2f6f73; }
.tag-none { visibility: hidden; }

/* Highlight cards */
.highlights { display: grid; gap: 1rem; }
@media (min-width: 700px) { .highlights { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .highlights { grid-template-columns: repeat(4, 1fr); } }
.hl { display: flex; flex-direction: column; gap: 1rem; padding: 1.3rem; border-radius: var(--radius); color: #fff; text-decoration: none;
  background: linear-gradient(150deg, var(--crimson), var(--deep)); transition: transform .2s, box-shadow .2s; }
.hl--sc { background: linear-gradient(150deg, #2f6f73, #173c3f); }
.hl:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.hl .date-badge { border-top-color: var(--gold); }
.hl .tag { background: rgba(255,255,255,.2); }
.hl h3 { color: #fff; font-size: 1.3rem; margin: .5rem 0 .3rem; }
.hl p { margin: 0; font-size: .95rem; opacity: .92; }

/* Calendar */
.cal-layout { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 1000px) { .cal-layout { grid-template-columns: 2fr 1fr; } }
.month { margin-bottom: 2rem; }
.month-title { display: flex; align-items: center; gap: .75rem; margin: 0 0 .8rem; font-family: var(--sans); font-size: .85rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.month-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.days { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.day { display: flex; gap: 1rem; align-items: flex-start; padding: .9rem 1.1rem; scroll-margin-top: 6rem; }
.day + .day { border-top: 1px solid var(--line); }
.day.sun { box-shadow: inset 4px 0 0 var(--gold); }
.day .date-badge { width: 3.6rem; min-width: 3.6rem; }
.day.is-past { opacity: .5; }
.day.is-today { background: #fbf1f2; box-shadow: inset 4px 0 0 var(--crimson); }
.day.is-today .date-badge { background: var(--crimson); border-color: var(--crimson); border-top-color: var(--gold); }
.day.is-today .date-badge b, .day.is-today .date-badge span, .day.is-today .date-badge em { color: #fff; }
.day.is-today .events::before { content: "Today"; display: block; font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--crimson); }
.events { list-style: none; margin: 0; padding: 0; flex: 1; }
.events li { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: baseline; padding: .4rem 0; }
.events li + li { border-top: 1px dotted var(--line); }
.events .when { color: var(--muted); font-weight: 600; font-size: .95rem; white-space: nowrap; }
@media (max-width: 520px) { .events li { grid-template-columns: auto 1fr; } .events .when { grid-column: 2; } }
.day.break { justify-content: center; background: var(--stone); font-family: var(--display); font-size: 1.15rem; color: var(--crimson); }
.cal-aside { display: grid; gap: 1.25rem; }
@media (min-width: 1000px) { .cal-aside { position: sticky; top: 5.5rem; } .news-aside { position: static; } }
.mini-list strong { display: block; }
.stories { align-items: start; }
.thanks { margin: 0; padding: 1rem 1.25rem; border-left: 4px solid var(--gold); background: #fff; border-radius: 0 var(--radius) var(--radius) 0; }

/* ---------- 15. News page: Helen's note, calendar filters ---------- */
#diary { scroll-margin-top: 4.5rem; }
.wrap.diary-wrap { padding-top: 0; }
.note { max-width: 46rem; padding: 1.4rem 1.5rem; background: var(--stone); border: 1px solid var(--line); border-radius: var(--radius); }
.note-title { color: var(--crimson); font-size: 1.3rem; margin: 0 0 .4rem; }
.note-list { list-style: none; margin: 0; padding: 0; }
.note-list li { display: grid; grid-template-columns: 10.5rem 1fr; gap: .25rem 1rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.note-date { font-weight: 600; }
.note-foot { margin: .9rem 0 0; font-size: .95rem; color: var(--muted); }
@media (max-width: 560px) { .note-list li { grid-template-columns: 1fr; } }

.cal-key { margin-bottom: .9rem; }
.cal-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.4rem; }
.chip { font: inherit; font-size: .92rem; font-weight: 600; padding: .4rem 1rem; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--crimson); cursor: pointer; }
.chip:hover { border-color: var(--crimson); }
.chip.is-on { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.chip:focus-visible, .chip-check:focus-within { outline: none; box-shadow: var(--focus); }
.chip-check { display: inline-flex; align-items: center; gap: .45rem; margin-left: auto; }
.chip-check input { accent-color: var(--crimson); }
.cal-empty { padding: 1rem 1.25rem; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
[hidden] { display: none !important; }
