/* Nave and Light: the home page, the WordPress layer and motion. See DESIGN.md.
   Components carried over from the static site are in site.css and read the same tokens. */

:root {
  --cassock: #14233A;
  --cassock-2: #1B2D48;
  --brass: #B8964F;
  --stone: #EEF2F7;
  --on-dark: #F4F7FB;
  --on-dark-soft: #B9C5D6;
  --linen: #EEF2F7;
  --plaster: #DCE4EE;
  --timber: #1D4E8F;
  --card: #FFFFFF;
  --lantern: #F4F7FB;
  --lantern-soft: #C9D4E3;
  --candle: #BFD3F2;
  --hero-cross: #D0584E; /* the Church's red, in the shade church-year.js uses on dark grounds */
  --wide: 76rem;
}
:root[data-page="cream"] { --linen: #EBDFBE; --plaster: #E3D5AE; --stone: #EBDFBE; }
:root[data-page="night"] { --linen: #152033; --plaster: #1B2A40; --timber: #9DB9E8; --card: #0F1622; }
@media (prefers-color-scheme: dark) {
  :root[data-page="device"] { --linen: #152033; --plaster: #1B2A40; --timber: #9DB9E8; --card: #0F1622; }
}

/* Newsreader, set light: headings are drawn rather than shouted. */
h1, h2, h3 { font-weight: 300; letter-spacing: -.01em; }
h4 { font-family: var(--display); font-weight: 400; }
/* Plainer letters means plain: no light weights or italics carried over to Atkinson. */
:root[data-letters="plain"] :is(h1, h2, h3, .statement-text, .saying blockquote p) { font-weight: 400; }
:root[data-letters="plain"] :is(.hero .revd, .quote-card-h, .reel-when) { font-style: normal; }

/* ---------- WordPress layer ---------- */
.wp-site-blocks { padding: 0; }
.wp-site-blocks > * + * { margin-block-start: 0; }
:where(.is-layout-flow) > * { margin-block: 0; }
.wp-block-group { box-sizing: border-box; }
main.page-main.is-full { padding-bottom: 0; }
.preview-note { background: var(--brass); color: var(--cassock); font-family: var(--sans); font-size: var(--t-ui); text-align: center; padding: .4rem 1rem; }

/* Inner pages: title and the words underneath */
.page-title { font-size: var(--t-title); line-height: 1.04; padding-top: clamp(2.5rem, 6vw, 5rem); margin: 0 0 1.25rem; }
.prose > p, .prose > ul, .prose > ol, .prose > dl, .prose > figure, .prose > blockquote, .prose > .wp-block-group { margin-bottom: var(--para); }
.prose > .standfirst, .standfirst { font-size: var(--t-lead); line-height: 1.5; color: var(--text); max-width: 52ch; margin-bottom: 2rem; }
.prose h2 { font-size: var(--t-h2); margin: 3.5rem 0 1rem; }
.prose h3 { margin: 2.25rem 0 .6rem; }
.prose a { text-decoration-color: var(--timber); }
.prose a:hover { text-decoration-color: currentColor; }
.prose .wp-block-image { margin: 2.5rem 0; }
.prose .wp-block-image img { width: 100%; }
.prose blockquote.wp-block-quote { border-left: 3px solid var(--season); padding-left: 1.25rem; margin: 2rem 0; }
.prose blockquote.wp-block-quote p { font-family: var(--italic); font-style: italic; font-size: var(--t-lead); line-height: 1.4; }
.prose blockquote.wp-block-quote cite { display: block; font-family: var(--sans); font-size: var(--t-ui); color: var(--soft); margin-top: .5rem; }
.wp-block-separator { border: 0; height: 1px; background: var(--hairline); margin: 3rem 0; }

/* The portrait on About sits beside the opening words on wide screens */
.about-open { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; margin-bottom: 1rem; }
.about-open .wp-block-image { margin: 0; }
@media (min-width: 900px) {
  .page-about .column { max-width: 72rem; }
  .page-about .prose > :not(.about-open) { max-width: var(--measure); }
  .about-open { grid-template-columns: minmax(0, 1fr) 22rem; align-items: start; gap: 4rem; }
  .about-open .wp-block-image { grid-column: 2; grid-row: 1 / span 3; }
}

/* ---------- Type details ---------- */
.wordmark { font-family: var(--display); font-size: 1.5rem; }
.wordmark i, .colophon .name i, .ribbon-slip i { font-family: var(--italic); font-style: italic; }
.wordmark b { font-weight: 400; }
.wordmark i { font-weight: 300; }
.nav a { font-family: var(--sans); font-weight: 500; font-size: 1.0625rem; letter-spacing: .005em; }
.masthead { box-shadow: 0 1px 0 rgb(184 150 79 / .25); }

/* ---------- Home: the opening ---------- */
/* The timber star ceiling of St Barnabas under a navy shade, with his name set light and wide across it. */
.hero {
  position: relative; isolation: isolate; overflow: hidden; display: grid; place-items: center; text-align: center;
  min-height: min(88svh, 52rem); background: var(--cassock); color: var(--lantern);
}
.page-home .hero { margin-top: calc(-1 * var(--head-h)); padding-top: var(--head-h); }
.hero-photo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 52%, rgb(14 28 52 / .62), rgb(14 28 52 / .84)),
    linear-gradient(180deg, rgb(14 28 52 / .5), transparent 28%, transparent 72%, rgb(14 28 52 / .55));
}
.hero-inner { padding: clamp(4rem, 10vw, 8rem) var(--gutter); max-width: 64rem; min-width: 0; }
.hero .revd { font-family: var(--italic); font-style: italic; font-weight: 300; font-size: clamp(1.375rem, 1.1rem + 1vw, 2rem); color: var(--candle); margin: 0 0 .75rem; }
.hero h1 { font-weight: 200; text-transform: uppercase; letter-spacing: .09em; font-size: clamp(min(2.75rem, 14vw), 1rem + 7.2vw, 7rem); line-height: 1; margin: 0 -.09em 0 0; }
.hero h1 .line { display: inline-block; }
/* A red cross under his name, drawn like the cross in the masthead. */
.hero .hero-cross { display: block; width: clamp(2.25rem, 3.6vw, 3rem); height: auto; aspect-ratio: 14 / 22; margin: clamp(1.75rem, 3vw, 2.5rem) auto; fill: none; stroke: var(--hero-cross); stroke-width: 3px; stroke-linecap: square; vector-effect: non-scaling-stroke; transform-origin: top; overflow: visible; }
.hero .hero-cross path { vector-effect: non-scaling-stroke; }
.hero .role { font-size: var(--t-lead); margin: 0; }
.hero .role.soft { font-size: var(--t-body); color: var(--lantern-soft); margin: .4rem auto 0; max-width: 44ch; text-wrap: balance; }
.hero :focus-visible { outline-color: var(--focus-on-navy); }

/* The masthead lies over the photograph until the page moves. */
.js .page-home .masthead:not(.is-scrolled):not(:has(.comfort:not([hidden]))) { background: transparent; box-shadow: none; }
/* The This Sunday ribbon hangs over the dark photograph on the home page. */
.page-home .ribbon:focus-visible { outline-color: var(--focus-on-navy); box-shadow: 0 0 0 8px var(--cassock); }
.page-home .ribbon-silk { --season-edge: rgb(244 247 251 / .6); }

/* ---------- Home: sections ---------- */
.home-main { padding-bottom: 0; }
.band { padding-block: var(--section); }
.band.is-tight { padding-block: clamp(1.75rem, 3vw, 2.5rem); }
.band.is-linen { background: var(--linen); }
.band.is-plaster { background: var(--plaster); }
.band-inner { max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }
.band-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 2rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.band-head h2 { margin: 0; }
.band-head p { margin: 0; font-family: var(--sans); font-size: var(--t-ui); }
.band h2, .quote-band h2 { font-size: var(--t-h2); }

/* A sentence about the site, set large and centred, with the church below it and to the right. */
.statement { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 var(--gutter); }
.statement-text {
  grid-column: 1 / -1; justify-self: center; text-align: center; max-width: 30ch; margin: 0;
  font-family: var(--display); font-weight: 300; font-size: clamp(1.75rem, 1.15rem + 2.1vw, 3rem); line-height: 1.28; text-wrap: balance;
}
.statement-sunday { grid-column: 1 / span 5; grid-row: 2; align-self: end; margin-top: clamp(3rem, 6vw, 5rem); }
.statement-sunday .sunday-line { max-width: none; margin: 0; border: 0; padding: 0; }
.statement-sunday .sunday-line p { font-size: var(--t-body); }
.statement-sunday .sunday-line p.link { font-size: var(--t-ui); font-family: var(--sans); }
.statement-photo { grid-column: 6 / -1; grid-row: 2; margin: clamp(3rem, 6vw, 5rem) 0 0; }
.statement-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* Sermons as white cards on plaster */
.reel { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.75rem); }
.reel-item { background: var(--card); display: flex; flex-direction: column; }
.reel-still { position: relative; display: block; overflow: hidden; background: var(--cassock); text-decoration: none; }
.reel-still img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 900ms var(--ease); }
.reel-item:hover .reel-still img { transform: scale(1.03); }
.reel-still::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--season); z-index: 1; }
.reel-play {
  position: absolute; left: 1.25rem; bottom: 1rem; z-index: 1; font-family: var(--sans); font-size: var(--t-ui);
  color: var(--on-dark); background: rgb(20 35 58 / .72); padding: .3rem .75rem;
}
.reel-text { padding: clamp(1.25rem, 2vw, 1.75rem); }
.reel-when { font-family: var(--italic); font-style: italic; font-size: var(--t-small); color: var(--timber); margin: 0 0 .5rem; }
.reel h3 { font-size: var(--t-h3); font-weight: 300; line-height: 1.15; margin: 0 0 .75rem; }
.reel h3 a { text-decoration: none; }
.reel h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.reel h3 a::after { content: ""; position: absolute; inset: 0; }
.reel-item { position: relative; }
.reel-item:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.reel-item:focus-within h3 a:focus-visible { outline: none; }
.reel .meta { font-family: var(--sans); font-size: var(--t-ui); line-height: 1.5; color: var(--soft); margin: 0; }

/* Lines from the sermons: a strip of the church's lattice, with a card laid over its lower edge. */
.quote-band { padding-bottom: var(--section); }
.quote-band-photo { display: block; width: 100%; height: clamp(13rem, 24vw, 22rem); object-fit: cover; }
.quote-card {
  position: relative; box-sizing: border-box; width: calc(100% - 2 * var(--gutter)); max-width: 46rem; margin: calc(-1 * clamp(4rem, 8vw, 7rem)) auto 0;
  background: var(--card); border: 1px solid var(--hairline); padding: clamp(2rem, 4.5vw, 3.75rem) clamp(1.5rem, 4.5vw, 4rem); text-align: center;
}
.quote-card-h { font-family: var(--italic); font-style: italic; font-weight: 300; font-size: var(--t-lead) !important; color: var(--timber); margin: 0 0 1.5rem; }
.sayings { list-style: none; margin: 0; padding: 0; }
.saying + .saying { margin-top: 2.5rem; padding-top: 2.5rem; border-top: 1px solid var(--hairline); }
.is-turning .saying + .saying { margin: 0; padding: 0; border: 0; }
/* The lines share one place, so the card keeps the height of the longest and Previous and Next stay put. */
.is-turning .sayings { display: grid; }
.is-turning .saying { grid-area: 1 / 1; }
.is-turning .saying[hidden] { display: block; visibility: hidden; }
.saying[hidden] { display: none; }
.saying blockquote { margin: 0; }
.saying blockquote p { font-family: var(--display); font-weight: 300; font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.5rem); line-height: 1.25; margin: 0; text-wrap: balance; }
.saying-from { font-family: var(--sans); font-size: var(--t-ui); color: var(--soft); margin: 1.5rem 0 .3rem; }
.saying-link { font-family: var(--sans); font-size: var(--t-ui); margin: 0; }
.sayings-nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .75rem 1.75rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--hairline); }
.sayings-nav[hidden] { display: none; }
.sayings-count { margin: 0; font-family: var(--sans); font-size: var(--t-ui); color: var(--soft); min-width: 4.5em; }

/* A word for today, centred */
.band.is-centred .word-wrap { max-width: 48rem; margin-inline: auto; }
.band.is-centred .word-wrap > :is(h2, .rubric) { text-align: center; }
.band.is-centred .feelings { text-align: center; }

/* Text beside a photograph */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2.5rem, 7vw, 7rem); align-items: center; }
.split > * { min-width: 0; }
.split-photo { margin: 0; }
.split-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.split.is-flip .split-photo { max-width: 30rem; justify-self: end; width: 100%; }
/* His photograph is cropped above the lectern frontal. */
.split.is-flip .split-photo img { aspect-ratio: 5 / 4; object-position: center top; }
.split-text { max-width: 34rem; }
.split-text h2 { margin: 0 0 1.25rem; }
.split-text .more { margin-top: 1.75rem; }

/* ---------- Sermon page ---------- */
.sermon-head { position: relative; }
.stole-head { width: 12px; min-height: 0; height: 4.5rem; margin: 0 auto 1.25rem; }
.film-frame { background: var(--still, none) center / cover var(--cassock); }
.film-card { background: linear-gradient(180deg, rgb(14 26 44 / .70), rgb(14 26 44 / .90)); }
.film-frame { box-shadow: inset 0 0 0 1px var(--brass); }
.film.is-audio .film-card { background: var(--navy-deep); }

/* ---------- Footer ---------- */
.colophon { padding: clamp(3.5rem, 7vw, 6rem) var(--gutter) 2.5rem; border-top: 3px solid var(--season); }
.colophon-inner { max-width: var(--wide); }
.colophon-sign { max-width: 40rem; }
.colophon .name { font-family: var(--display); font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem); }
.colophon-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 3rem; margin-top: 3rem; padding-top: 2.25rem; border-top: 1px solid rgb(184 150 79 / .3); }
.colophon-h { font-family: var(--sans); font-size: var(--t-ui); font-weight: 600; color: var(--brass); margin: 0 0 .6rem; }
.colophon-cols p { font-size: var(--t-ui); line-height: 1.55; }
.colophon-foot { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: .25rem 2rem; align-items: center; justify-content: space-between; }
.colophon-foot p { margin: 0; }
.colophon .foot-links { margin: 0; }
.colophon .foot-links a { font-family: var(--sans); font-size: var(--t-ui); }

/* ---------- Responsive ---------- */
@media (max-width: 959.98px) {
  .reel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .reel-item:first-child { grid-column: 1 / -1; }
  .statement-sunday { grid-column: 1 / span 4; }
  .statement-photo { grid-column: 5 / -1; }
  :root:is([data-size="largest"], [data-size="very-large"]) .statement-sunday { grid-column: 1 / -1; grid-row: 3; margin-top: 2rem; }
  :root:is([data-size="largest"], [data-size="very-large"]) .statement-photo { grid-column: 1 / -1; }
}
@media (max-width: 759.98px) {
  .wordmark { font-size: min(1.25rem, 22px); }
  .reel { grid-template-columns: minmax(0, 1fr); }
  .statement-sunday { grid-column: 1 / -1; grid-row: 3; margin-top: 2rem; }
  .statement-photo { grid-column: 1 / -1; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split.is-flip .split-photo { justify-self: start; max-width: 20rem; }
  .split:not(.is-flip) .split-photo { order: -1; }
  .split-photo img { aspect-ratio: 4 / 3; }
  .split.is-flip .split-photo img { aspect-ratio: 5 / 4; }
  .hero h1 .line { display: block; }
  .colophon-cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 479.98px) {
  .wordmark { font-size: 19px; }
}

/* ---------- Motion ---------- */
/* The one orchestrated moment: on the first page of a visit the ceiling settles into place,
   his name rises and the red cross is drawn down beneath it. Pictures elsewhere open like a
   shutter as they arrive. */
@keyframes settle { from { opacity: 0; transform: scale(1.06); } }
@keyframes thread { from { transform: scaleY(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(.35em); } }
@keyframes shutter { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.opening .hero-photo { animation: settle 2200ms var(--ease) both; }
.opening .hero .revd { animation: rise 900ms var(--ease) 300ms both; }
.opening .hero h1 .line { animation: rise 1000ms var(--ease) both; }
.opening .hero h1 .line:nth-child(1) { animation-delay: 450ms; }
.opening .hero h1 .line:nth-child(2) { animation-delay: 600ms; }
.opening .hero .hero-cross { animation: thread 900ms var(--ease) 1000ms both; }
.opening .hero .role { animation: rise 900ms var(--ease) 1200ms both; }
.js .reveal { clip-path: inset(0 0 100% 0); }
.js .reveal.is-in { animation: shutter 900ms var(--ease) both; }

@media print {
  .hero, .band, .quote-band, .preview-note { display: none !important; }
  .js .reveal { clip-path: none !important; animation: none !important; }
}

/* The record on the About page: what he did, then when, one row each. */
.record { margin: 1rem 0 var(--para); }
.record-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: .15rem; padding-block: .9rem; }
.record-item + .record-item { border-top: 1px solid var(--hairline); }
.record-item p { margin: 0; }
.record-what { font-weight: 500; }
.record-when { color: var(--soft); font-size: var(--t-ui); max-width: 60ch; }

/* The sermon archive: titles in the display face, flush with the season headings. */
.abbey, .prose .abbey { padding: 0; margin: 1.75rem 0 0; }
.abbey h3, .abbey h4 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1.15; }
