/* Extra pages (basic, event, ministry, announcement) in the Cinematic Night look.
 * Only layout for page parts the home page does not have. Colours, type, buttons
 * and spacing all come from the tokens in site.css so new pages look native. */

.subpage .site-header { background: rgba(10,15,31,0.96); box-shadow: 0 1px 0 var(--line); }
.subpage .site-header::before { opacity: 0; }

.page-head { position: relative; overflow: clip; background: var(--ink); padding: calc(4.6rem + clamp(3.5rem, 9vw, 7rem)) 0 clamp(3rem, 7vw, 5.5rem); border-bottom: 1px solid var(--line); }
.page-glow { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(42rem 22rem at 78% 18%, rgba(245,196,81,0.16), rgba(245,196,81,0) 70%),
              radial-gradient(48rem 26rem at 8% 100%, rgba(96,165,250,0.14), rgba(96,165,250,0) 70%); }
.page-head .wrap { position: relative; }
.page-title { font-size: clamp(2.8rem, 7vw, 5.6rem); line-height: 1.02; max-width: 18ch; text-wrap: balance; }
.page-meta { margin: clamp(2rem, 4vw, 2.8rem) 0 0; display: grid; max-width: 44rem; background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.4rem clamp(1.2rem, 2.4vw, 2rem); }
.page-meta > div { display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr); gap: 1.2rem; align-items: baseline; padding: 1rem 0; }
.page-meta > div + div { border-top: 1px solid var(--line); }
.page-meta dt { font-weight: 700; font-size: 1rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.page-meta dd { margin: 0; font-size: 1.2rem; font-weight: 700; color: #fff; }
.page-meta a { color: var(--sky-soft); }

.page-body { background: var(--ink-2); }
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); }
.page-text { max-width: 44rem; }
.page-text p { font-size: 1.1rem; color: var(--muted); }
.page-text p:first-child { font-size: clamp(1.2rem, 1.7vw, 1.4rem); line-height: 1.55; color: #fff; }
.page-back { margin-top: 1.4rem; }
.page-photo { margin: 0; }
/* never stretch a photo past its own size */
.page-photo img { width: auto; max-width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--line-strong); box-shadow: 0 0 70px -24px rgba(245,196,81,0.45); }
@media (min-width: 900px) {
  .page-grid--photo { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
  .page-photo { position: sticky; top: calc(4.6rem + 2rem); }
}
.page-text a[href^="tel:"], .page-meta a[href^="tel:"] { white-space: nowrap; }
.page-meta dd, .page-text p { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 560px) {
  .page-meta > div { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
}

/* ---- Article pages (pages brought over from the church's original site) ---- */
.page-intro { margin-top: clamp(1.4rem, 3vw, 2rem); max-width: 44rem; }
.page-intro p { font-size: clamp(1.15rem, 1.6vw, 1.3rem); color: var(--muted); white-space: pre-line; margin: 0 0 0.8rem; }
.page-article .wrap { display: grid; gap: clamp(3rem, 6vw, 4.5rem); }
.art-sec { display: grid; gap: clamp(1.4rem, 3vw, 2.2rem); min-width: 0; }
.art-sec + .art-sec { border-top: 1px solid var(--line); padding-top: clamp(3rem, 6vw, 4.5rem); margin-top: calc(-1 * clamp(1rem, 2vw, 1.5rem)); }
.art-h { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.08; max-width: 26ch; }
.art-body { max-width: 44rem; min-width: 0; }
.art-body p { font-size: 1.1rem; line-height: 1.7; color: var(--muted); white-space: pre-line; margin: 0 0 1.1rem; overflow-wrap: anywhere; }
.art-body p:last-child { margin-bottom: 0; }
.art-body a { overflow-wrap: anywhere; }
.art-body a[href^="tel:"] { white-space: nowrap; }
.art-list { margin: 0 0 1.1rem; padding-left: 1.4rem; display: grid; gap: 0.55rem; }
.art-list li { font-size: 1.1rem; line-height: 1.6; color: var(--muted); padding-left: 0.3rem; overflow-wrap: anywhere; }
.art-list li::marker { color: var(--gold); }
.art-action { margin: 1.2rem 0 0 !important; white-space: normal !important; }
.art-action .btn { white-space: normal; text-align: center; }
.art-back { margin: 0; }

/* side layout: photos at (never above) their own size, next to the text on wide screens */
.art-photos { display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: flex-start; }
.art-photo { margin: 0; max-width: 100%; }
.art-photo img { display: block; width: auto; max-width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line-strong); }
.art-photo figcaption { margin-top: 0.6rem; color: var(--muted); font-size: 1rem; max-width: 30ch; }
@media (min-width: 900px) {
  .art-sec--side { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(2rem, 5vw, 4rem); align-items: start; }
  .art-sec--side > .art-h { grid-column: 1 / -1; }
  .art-sec--side > .art-photos:first-child { grid-column: 1 / -1; }
}

/* gallery: tiles never enlarge a photo; a tap opens the photo in the viewer */
.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(0.6rem, 1.4vw, 1rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.g-item { min-width: 0; }
.g-link { display: grid; place-items: center; aspect-ratio: 1 / 1; background: var(--ink-3); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.g-link img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.g-link:hover, .g-link:focus-visible { border-color: var(--gold); }
.g-cap { margin: 0.5rem 0 0; font-size: 1rem; color: var(--muted); }
@media (max-width: 560px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* hub cards: links to the pages in this part of the site */
.page-hub { background: var(--ink); padding-block: clamp(3rem, 6vw, 4.5rem); border-bottom: 1px solid var(--line); }
.hub-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.hub-card { display: grid; gap: 0.5rem; align-content: start; height: 100%; min-height: 3.4rem; padding: 1.3rem 1.4rem; background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--radius); color: #fff; text-decoration: none; }
.hub-card:hover, .hub-card:focus-visible { border-color: var(--gold); background: var(--ink-4); color: #fff; }
.hub-title { font-family: var(--font-display); font-size: 1.9rem; line-height: 1.1; }
.hub-text { color: var(--muted); font-size: 1rem; }
.hub-go { color: var(--gold); font-weight: 700; font-size: 1rem; margin-top: 0.2rem; }
.hub-go::after { content: " \2192"; }

/* footer: page links, grouped */
.foot-pages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 3rem; margin-top: 2.6rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.foot-group h4 { font-family: var(--font-body); font-weight: 700; font-size: 1rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.9rem; }
.foot-group h4 a { color: var(--gold); text-decoration: none; }
.foot-group h4 a:hover { text-decoration: underline; }
.foot-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.foot-group ul a { color: #fff; text-decoration: none; display: inline-block; padding: 0.3rem 0; }
.foot-group ul a:hover { color: var(--gold-soft); text-decoration: underline; }
@media (max-width: 760px) { .foot-pages { grid-template-columns: minmax(0, 1fr); } }
.nav-links a[aria-current="page"] { border-bottom-color: var(--gold); }

/* photo viewer (native <dialog>) */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(5,8,18,0.96); color: #fff; }
.lightbox::backdrop { background: rgba(5,8,18,0.9); }
.lb-inner { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 0.8rem; padding: clamp(0.8rem, 2vw, 1.6rem); }
.lb-fig { margin: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; place-items: center; gap: 0.6rem; }
.lb-img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 10px; }
.lb-cap { color: var(--muted); font-size: 1rem; text-align: center; max-width: 60ch; }
.lb-bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.8rem; }
.lb-count { min-width: 6rem; text-align: center; color: var(--muted); font-size: 1rem; }
@media (max-width: 560px) { .lb-bar .btn { padding-inline: 1rem; } }

/* home: the church sign photo in the Contact visit card (never above its own size) */
.c-photo { display: block; width: auto; max-width: 100%; height: auto; margin: 0 0 1.2rem; border-radius: 12px; border: 1px solid var(--line-strong); }

/* ---- Calendar (content/events.json): home "next events", /calendar, /events/<name> ---- */
[hidden] { display: none !important; }

/* home: the next 4 events, in the Night event-card look (first card is the featured one) */
.ev-next { list-style: none; margin: 0; padding: 0; }
.ev-next > .ev { grid-column: span 3; position: relative; }
.ev-next > .ev:first-child { grid-column: span 4; background: linear-gradient(150deg, var(--ink-4), var(--ink-3) 65%); border-color: rgba(245,196,81,0.5); box-shadow: 0 0 70px -24px rgba(245,196,81,0.55); }
.ev-next > .ev:nth-child(2) { grid-column: span 2; }
.ev-link { color: #fff; text-decoration: none; }
.ev-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.ev-next > .ev:hover { border-color: var(--gold); }
.ev-next > .ev:focus-within { outline: 3px solid var(--gold); outline-offset: 3px; }
.ev-link:focus-visible { outline: none; }
.ev-day { color: #fff !important; font-weight: 700; }
.ev-empty { margin: 0; color: var(--muted); font-size: 1.1rem; }
.ev-more { margin: clamp(1.6rem, 3vw, 2.4rem) 0 0; }
@media (max-width: 1100px) {
  .ev-next > .ev, .ev-next > .ev:nth-child(2) { grid-column: span 3; }
  .ev-next > .ev:first-child { grid-column: span 6; }
}
@media (max-width: 760px) { .ev-next > .ev, .ev-next > .ev:first-child, .ev-next > .ev:nth-child(2) { grid-column: span 6; } }

/* calendar page */
.cal { background: var(--ink-2); padding-block: clamp(3rem, 7vw, 5rem); border-bottom: 1px solid var(--line); }
.cal-bar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: clamp(1.6rem, 4vw, 2.6rem); }
.cal-h { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.cal-views { display: flex; gap: 0.6rem; }
.cal-view { background: transparent; color: #fff; border-color: var(--line-strong); }
.cal-view:hover { border-color: #fff; }
.cal-view[aria-pressed="true"] { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.cal-list { display: grid; gap: clamp(2rem, 4vw, 3rem); }
.cal-mh { font-size: clamp(1.9rem, 3.4vw, 2.5rem); margin-bottom: 1rem; display: flex; align-items: center; gap: 1rem; }
.cal-mh::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.cal-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.cal-link { display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); gap: 1.2rem; align-items: center; padding: 1rem 1.3rem; background: var(--ink-3); border: 1px solid var(--line); border-radius: 18px; color: #fff; text-decoration: none; }
.cal-link:hover, .cal-link:focus-visible { border-color: var(--gold); background: var(--ink-4); color: #fff; }
.cal-date { display: grid; justify-items: center; gap: 0.2rem; line-height: 1; padding: 0.4rem 1rem 0.4rem 0; border-right: 1px solid var(--line); }
.cal-dow { font-weight: 700; font-size: 1rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sky-soft); }
.cal-day { font-family: var(--font-display); font-size: 3.2rem; line-height: 1; color: var(--gold); }
.cal-what { display: grid; gap: 0.2rem; min-width: 0; }
.cal-title { font-family: var(--font-display); font-size: clamp(1.6rem, 2.6vw, 2rem); line-height: 1.1; overflow-wrap: anywhere; }
.cal-when { font-weight: 700; font-size: 1.05rem; }
.cal-place { color: var(--muted); font-size: 1rem; overflow-wrap: anywhere; }
.cal-empty { margin: 0; color: var(--muted); font-size: 1.1rem; }
.cal-more-wrap { margin: 1.6rem 0 0; }
@media (max-width: 560px) {
  .cal-link { grid-template-columns: 4.4rem minmax(0, 1fr); gap: 0.9rem; padding: 0.9rem 1rem; }
  .cal-date { padding-right: 0.8rem; }
  .cal-day { font-size: 2.7rem; }
}

/* month grid: wide screens only (the list is easier to read on a phone) */
.cal-gnav { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.cal-gnav .btn[disabled] { opacity: 0.45; cursor: default; transform: none; }
.cal-gm .cal-mh { justify-content: center; }
.cal-gm .cal-mh::after { display: none; }
.cal-table { width: 100%; border-collapse: separate; border-spacing: 5px; table-layout: fixed; }
.cal-table th { font-weight: 700; font-size: 1rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sky-soft); padding: 0.3rem 0.5rem; text-align: left; }
.cal-table abbr { text-decoration: none; }
.cal-table td { vertical-align: top; height: 7.4rem; background: var(--ink-3); border: 1px solid var(--line); border-radius: 12px; padding: 0.5rem 0.55rem; }
.cal-table td.is-out { background: transparent; border-color: transparent; }
.cal-table td.is-past { background: var(--ink); }
.cal-table td.is-past .cal-n, .cal-table td.is-past a { color: var(--muted); }
.cal-table td.is-today { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.cal-n { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; color: #fff; }
.cal-table ul { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.3rem; }
.cal-table li a { display: block; font-size: 1rem; line-height: 1.25; color: #fff; text-decoration: none; padding: 0.25rem 0.4rem; border-radius: 8px; background: rgba(245,196,81,0.12); border-left: 3px solid var(--gold); overflow-wrap: anywhere; }
.cal-table li a:hover, .cal-table li a:focus-visible { background: rgba(245,196,81,0.26); color: #fff; }
.cal-gt { display: block; font-weight: 700; color: var(--gold-soft); }
.cal-table td.is-past .cal-gt { color: var(--muted); }
@media (max-width: 959px) { .cal-views, .cal-grid { display: none !important; } }

/* subscribe box + share box */
.cal-sub, .share { margin-top: clamp(2.5rem, 5vw, 4rem); padding: clamp(1.4rem, 3vw, 2.4rem); background: var(--ink-3); border: 1px solid rgba(245,196,81,0.5); border-radius: var(--radius); box-shadow: 0 0 70px -24px rgba(245,196,81,0.45); }
.cal-sub-h, .share-h, .evp-h { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 0.7rem; }
.cal-sub p { color: var(--muted); max-width: 44rem; font-size: 1.1rem; }
.cal-actions, .page-text .share-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1rem 0 0; }
.cal-actions .btn, .share-row .btn { white-space: normal; text-align: center; }
.share-msg { margin: 0.9rem 0 0; color: var(--gold-soft) !important; font-weight: 700; overflow-wrap: anywhere; }
.share-msg:empty { display: none; }

/* event page */
.evp-cal { color: var(--gold); text-decoration: none; }
.evp-cal:hover { color: var(--gold-soft); text-decoration: underline; }
.evp-past { display: inline-block; margin: 1.2rem 0 0; padding: 0.5rem 1rem; border: 1px solid var(--gold); border-radius: 12px; background: rgba(245,196,81,0.14); color: #fff; font-weight: 700; }
.evp-map { font-weight: 700; }
.evp-dates { margin: 2rem 0 0; }
.evp-list { list-style: none; margin: 0; padding: 0; display: grid; max-width: 30rem; }
.evp-list li { font-size: 1.1rem; color: #fff; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.subpage--event .page-text { max-width: 48rem; }
