/* Margate Christian Church. Brand teal comes from the logo. */
@font-face { font-family: "Lora"; src: url(/assets/fonts/lora-wght-normal.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url(/assets/fonts/source-sans-3-wght-normal.woff2) format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }

:root {
  --brand: #248d98;        /* logo teal: large text, fills, accents */
  --brand-dark: #1a6b74;   /* teal for body-size text and links (WCAG AA on white) */
  --brand-tint: #e6f3f4;
  --ink: #1e1e1e;
  --muted: #555;
  --paper: #fff;
  --line: #dde7e8;
  --radius: 10px;
  --wrap: 72rem;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 1.125rem/1.65 var(--sans); color: var(--ink); background: var(--paper); }
img, iframe { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--brand-dark); text-underline-offset: .15em; }
/* Long unbroken text (an email address, a video title that is one long hashtag) wraps instead of
   pushing the page wider than the screen. */
main, .site-footer { overflow-wrap: anywhere; }
a:hover { color: var(--ink); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
/* Text for screen readers and voice control only. */
.vh { 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; }

/* Header and navigation */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 5.5rem; }
.brand img { width: 220px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; gap: .25rem; }
.site-nav a { display: block; white-space: nowrap; padding: .55rem .8rem; text-decoration: none; color: var(--ink); font-weight: 500; border-radius: 6px; }
.site-nav a:hover { background: var(--brand-tint); color: var(--ink); }
.site-nav .active > a, .site-nav a[aria-current="page"] { color: var(--brand-dark); }
.site-nav li { position: relative; }
.site-nav .sub { display: none; position: absolute; left: 0; top: 100%; min-width: 11rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .35rem; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.site-nav li:hover > .sub, .site-nav li:focus-within > .sub, .site-nav li.open > .sub { display: block; }
@media (min-width: 981px) { .site-nav li.closed > .sub { display: none; } }   /* closed with Escape; see site.js */
.site-nav .has-sub > a::after { content: ""; display: inline-block; margin-left: .4em; vertical-align: .15em; border: .3em solid transparent; border-top-color: currentColor; border-bottom: 0; }
.nav-toggle { display: none; }

@media (max-width: 980px) {
  .brand img { width: 180px; }
  .js .nav-toggle { display: inline-block; font: inherit; font-weight: 600; background: var(--brand-dark); color: #fff; border: 0; border-radius: 6px; padding: .5rem 1rem; cursor: pointer; }
  .header-inner { flex-wrap: wrap; }
  .site-nav { width: 100%; }
  .js .site-nav { display: none; padding-bottom: 1rem; }
  /* The header stays on screen, so on a short screen (a phone held sideways) the open menu scrolls. */
  .js .site-nav.open { display: block; max-height: calc(100vh - 6rem); max-height: calc(100dvh - 6rem); overflow-y: auto; overscroll-behavior: contain; }
  .site-nav > ul { flex-direction: column; }
  .site-nav .sub { display: block; position: static; border: 0; box-shadow: none; padding: 0 0 0 1rem; }
}

/* Sections */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section.tint { background: var(--brand-tint); }
.eyebrow { font: 600 .8rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--brand-dark); margin: 0 0 .9rem; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 42rem; }
.page-head { background: var(--brand-tint); padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2rem, 5vw, 3rem); }
.page-head h1 { margin: 0; }
.page-head p { margin: .6rem 0 0; color: var(--muted); max-width: 42rem; }
.prose { max-width: 44rem; }
.prose h2 { margin-top: 1.8em; }
.prose h2:first-child { margin-top: 0; }

/* Buttons */
.btn { display: inline-block; padding: .8rem 1.4rem; border-radius: 999px; font-weight: 600; text-decoration: none; background: var(--brand-dark); color: #fff; border: 2px solid var(--brand-dark); }
.btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost { background: transparent; color: #fff; border-color: #fff; }
.btn.ghost:hover { background: #fff; color: var(--ink); }
.btn.outline { background: transparent; color: var(--brand-dark); }
.btn.outline:hover { background: var(--brand-dark); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* Home hero */
.hero { position: relative; color: #fff; min-height: min(78vh, 40rem); display: grid; align-items: end; background: #234 url(/assets/img/church.webp?v=5a823fe3) center 35% / cover no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,30,35,.05) 20%, rgba(10,30,35,.78) 100%); }
.hero .wrap { position: relative; padding-top: 6rem; padding-bottom: clamp(2.5rem, 7vw, 4.5rem); width: 100%; }
.hero h1 { color: #fff; font-size: clamp(2.3rem, 6vw, 4rem); max-width: 18ch; margin-bottom: .3em; }
.hero p { font-size: 1.25rem; max-width: 36rem; margin: 0; }
.hero .eyebrow { color: #fff; opacity: .9; }
@media (max-width: 640px) { .hero { background-image: url(/assets/img/church-640.webp?v=a7665ed3); } }

/* Grids and cards */
.split { display: grid; gap: clamp(1.5rem, 5vw, 4rem); grid-template-columns: 1fr 1fr; align-items: center; }
.split.wide-text { grid-template-columns: 3fr 2fr; }
@media (max-width: 800px) { .split, .split.wide-text { grid-template-columns: 1fr; } }
.card-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); }
/* Grid columns may shrink below their content's natural width (long words wrap instead). */
.split > *, .card-grid > *, .video-grid > *, .sermon-grid > *, .footer-grid > *, .activity > *, .person > * { min-width: 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.card h3 { margin-bottom: .35em; }
.card p:last-child { margin-bottom: 0; }
/* Card rows (About page): equal-height cards, with the closing link pinned to the bottom so links line up. */
.card-grid .card { display: flex; flex-direction: column; }
.card-grid .card > :last-child { margin-top: auto; }
.rounded { border-radius: var(--radius); }

/* Video embeds */
.video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-grid { display: grid; gap: 2.5rem 2rem; grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); }
.video-grid h2 { font-size: 1.4rem; }

.video-caption { margin: .75rem 0 0; font-weight: 600; }
.video-caption .when, .sermon .when { display: block; font-weight: 400; color: var(--muted); font-size: .95rem; }

/* Recent sermons grid (built by site.js from /data/sermons.json) */
.sermon-grid { display: grid; gap: 2rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); margin-top: 1.25rem; }
.sermon h3 { font-size: 1.1rem; margin: .75rem 0 .2rem; line-height: 1.35; }
.sermon h3 a { color: var(--ink); text-decoration: none; }
.sermon h3 a:hover { color: var(--brand-dark); text-decoration: underline; }
.sermon .when { margin: 0; }
.sermon-thumb { position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: #000; }
.sermon-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.sermon-thumb:hover img { transform: scale(1.03); }
.sermon-thumb .play { position: absolute; left: 50%; top: 50%; width: 4rem; height: 4rem; margin: -2rem 0 0 -2rem; border-radius: 50%; background: rgba(26,107,116,.92); box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.sermon-thumb .play::after { content: ""; position: absolute; left: 1.55rem; top: 1.2rem; border-style: solid; border-width: .8rem 0 .8rem 1.3rem; border-color: transparent transparent transparent #fff; }
.sermon-thumb:hover .play, .sermon-thumb:focus-visible .play { background: var(--ink); }
.sermon-thumb .duration { position: absolute; right: .5rem; bottom: .5rem; background: rgba(0,0,0,.8); color: #fff; font-size: .8rem; font-weight: 600; padding: .1rem .4rem; border-radius: 4px; }

/* Facebook widget */
.fb-page { display: flex; justify-content: center; min-height: 12rem; }
.fb-page iframe { max-width: 100%; border-radius: var(--radius); background: #fff; }

/* What we do */
.activity { display: grid; gap: clamp(1.5rem, 4vw, 3rem); grid-template-columns: 2fr 3fr; align-items: center; padding: clamp(2rem, 5vw, 3rem) 0; border-top: 1px solid var(--line); }
.activity:first-child { border-top: 0; }

.activity .meta { color: var(--brand-dark); font-weight: 600; margin-bottom: .6rem; }
@media (max-width: 800px) { .activity { grid-template-columns: 1fr; } }
.banner { border-radius: var(--radius); margin-bottom: 2rem; }

/* Team */
.team { display: grid; gap: 2.5rem; }
/* The name sits above; the photo's top edge lines up with the top of the first paragraph. */
.person { display: grid; grid-template-columns: 12rem 1fr; gap: .9rem 1.75rem; align-items: start; }
.person h2 { grid-column: 1 / -1; margin: 0; }
.person img { border-radius: var(--radius); width: 12rem; }
.person p:first-child { margin-top: 0; }
@media (max-width: 640px) { .person { grid-template-columns: 1fr; } .person img { width: 10rem; } }

/* History timeline */
.timeline { border-left: 3px solid var(--brand); padding-left: 1.75rem; max-width: 44rem; }
.timeline section { position: relative; padding-bottom: 2rem; }
.timeline section::before { content: ""; position: absolute; left: calc(-1.75rem - 9px); top: .45rem; width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }
.timeline .when { font-weight: 600; color: var(--brand-dark); margin-bottom: .3rem; }
.timeline .source { font-size: .9rem; color: var(--muted); }
.history-figures { display: grid; gap: 1.25rem 1.5rem; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; align-items: start; margin: 1.25rem 0 .5rem; }
.history-figures .tall { grid-column: 2; grid-row: 1 / span 2; }
.history-figures.one { grid-template-columns: minmax(0, 22rem); grid-template-rows: auto; }
.history-figures a:hover img { border-color: var(--brand); }
@media (max-width: 640px) { .history-figures { grid-template-columns: 1fr; } .history-figures .tall { grid-column: auto; grid-row: auto; } }
.history-figures figure { margin: 0; }
.history-figures img { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.history-figures figcaption { font-size: .88rem; line-height: 1.45; color: var(--muted); margin-top: .45rem; }
.history-figures .credit { display: block; font-size: .8rem; margin-top: .15rem; }

/* Contact */
.contact-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.contact-list li { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.contact-list strong { display: block; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.map { aspect-ratio: 4 / 3; border: 0; width: 100%; border-radius: var(--radius); background: var(--brand-tint); }

/* Footer */
.site-footer { background: #17393d; color: #d9e8ea; margin-top: 0; }
.site-footer a { color: #fff; }
.site-footer h2 { font: 600 .8rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #9fd0d5; margin-bottom: .8rem; }
/* 16rem: wide enough for the email address on one line at every width where columns sit side by side. */
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); padding-top: 3rem; padding-bottom: 2rem; }
.social { list-style: none; padding: 0; margin: 0; }
.footer-base { border-top: 1px solid rgba(255,255,255,.15); padding-top: 1.2rem; padding-bottom: 1.5rem; font-size: .9rem; }
.footer-base p { margin: 0; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Printing: the words and pictures, without the menu or the empty video and Facebook frames. */
@media print {
  .site-header, .site-nav, .nav-toggle, .skip, iframe, .video, .fb-page, .sermon-thumb, .actions { display: none !important; }
  .hero { min-height: 0; background: none; color: #000; }
  .hero::before { display: none; }
  .hero h1, .hero .eyebrow { color: #000; }
  .hero .wrap { padding-top: 1rem; }
  .site-footer { background: none; color: #000; }
  .site-footer a, .site-footer h2 { color: #000; }
  .section, .page-head { padding: 1rem 0; }
}
