/* ==========================================================================
   Church News: the list (templates/church_news/list.html), a story's page
   (details.html), their shared right-hand column (_aside.html) and story
   card (_card.html). Built on pages.css; only what these pages add to it.
   Load after templates/partials/_pages_head.html; bump ?v= on every change.
   ========================================================================== */

/* Font Awesome's script swaps every <i> for an <svg class="svg-inline--fa">
   (keeping the <i>'s own classes), so pages.css's "… i" icon rules never
   match. The ones these pages rely on, restated for the svg. */
.cn-page .vp-row__sub .svg-inline--fa { width: 0.95em; margin-right: 0.3rem; color: var(--vh-orange); }
.cn-page .vp-panel__title > .svg-inline--fa { color: var(--vh-orange); }
.cn-page .vp-panel--brand .vp-panel__title > .svg-inline--fa { color: #fff; }
.cn-page .vp-more .svg-inline--fa { transition: transform 0.15s ease; }
.cn-page .vp-more:hover .svg-inline--fa { transform: translateX(3px); }

/* A whole card is one link (pages.css .vp-stretch): its focus ring goes
   round the card, not just the title's words. */
.cn-page .vp-stretch:focus-visible { outline: none; }
.cn-page .vp-stretch:focus-visible::after { border-radius: var(--vp-radius); outline: 3px solid var(--vh-focus); outline-offset: -3px; }

/* ------------------------------------------------------------------ hero */
/* The light hero sits in the main column, beside the right-hand panels. */

.cn-intro.vp-hero--light { min-height: 15rem; }
/* Narrower than a full-width hero: the words keep the left half, the photo
   the right half, so the lead never runs over the picture. */
@media (min-width: 768px) {
  .cn-intro.vp-hero--light .vp-hero__media { width: 50%; }
  .cn-intro.vp-hero--light .vp-hero__body { max-width: min(34rem, 50%); }
}
@media (min-width: 992px) {
  .cn-intro.vp-hero--light { align-items: flex-end; }
  .cn-intro.vp-hero--light .vp-hero__body { align-self: center; }
  .cn-intro .vp-hero__aside { flex-basis: 16rem; }
  .cn-intro .vp-quote-card { padding: 0.95rem 1.1rem 0.9rem; }
  .cn-intro .vp-quote-card p { font-size: 0.9rem; }
}

/* ------------------------------------------------------------- top stories */
/* The lead story (a picture card with the words over it) and three beside it. */

.cn-top { display: grid; gap: 1rem; min-width: 0; }
@media (min-width: 768px) {
  .cn-top { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
}

.cn-lead { min-height: 23rem; isolation: isolate; }
/* The picture paints under the words, so the title's link can cover the whole card. */
.cn-lead > .vp-card__media { z-index: -1; }
.cn-lead > .vp-card__body { position: static; gap: 0.55rem; padding: 1.5rem 1.6rem 1.6rem; }
/* Parish photos are often bright walls and posters: a deeper veil keeps the white words readable. */
.cn-lead > .vp-card__media::after { background: linear-gradient(180deg, rgba(20, 10, 6, 0.05) 0%, rgba(20, 10, 6, 0.3) 35%, rgba(20, 10, 6, 0.9) 100%); }
.cn-lead .vp-card__media > video { width: 100%; height: 100%; object-fit: cover; }
.cn-lead .vp-card__title { font-size: clamp(1.45rem, 2.2vw, 2.05rem); line-height: 1.15; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); }
.cn-lead .vp-card__excerpt { max-width: 36rem; -webkit-line-clamp: 2; }
.cn-lead .vp-pill { align-self: flex-start; }
.cn-lead__cta { align-self: flex-start; margin-top: 0.3rem; }
.cn-lead__plain { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #4a2418 0%, #7a3a22 55%, #b0562a 100%); }
.cn-lead__icon { margin-bottom: 4rem; color: rgba(255, 255, 255, 0.16); font-size: 5.5rem; }

.cn-beside { display: grid; gap: 0.85rem; min-width: 0; margin: 0; padding: 0; list-style: none; }
@media (min-width: 768px) { .cn-beside { grid-auto-rows: 1fr; } }
.cn-beside > li { display: flex; min-width: 0; container-type: inline-size; }
.cn-side { flex: 1; min-height: 7.25rem; }
.cn-side > .vp-card__media { flex: 0 0 36%; max-width: 9.5rem; min-height: 0; }
.cn-side > .vp-card__body { justify-content: center; gap: 0.3rem; padding: 0.75rem 0.9rem; }
.cn-side .vp-card__title { font-size: 0.98rem; line-height: 1.25; -webkit-line-clamp: 3; }
.cn-side__go { display: none; position: static; align-self: center; margin-right: 0.9rem; }
@container (min-width: 21rem) {
  .cn-side__go { display: inline-flex; }
}

.cn-kicker { color: var(--vh-orange); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; line-height: 1.2; text-transform: uppercase; }
.cn-kicker--announcements { color: #b3261e; }
.cn-kicker--events { color: #24609e; }

/* --------------------------------------------------------- chips and list */

.cn-browse { display: flex; flex-direction: column; gap: var(--vp-gap); min-width: 0; scroll-margin-top: calc(var(--phoenix-navbar-top-height) + 1rem); }
.cn-chips { min-width: 0; padding: 0.45rem; border: 1px solid var(--vh-line); border-radius: 18px; background: var(--vh-surface); box-shadow: var(--vp-shadow); }
/* At most four chips: they wrap rather than hide off the edge of a phone. */
.cn-chips .vp-tabs { flex-wrap: wrap; padding-bottom: 0; overflow: visible; }
.cn-chips .vp-tab .svg-inline--fa { font-size: 0.9em; }

/* Never more than four cards to a row: twelve to a page fill 2, 3 or 4 columns. */
.cn-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, max(13.25rem, calc((100% - 3.3rem) / 4))), 1fr)); }

.cn-card .vp-card__body { gap: 0.5rem; }
.cn-card .vp-card__media > video { width: 100%; height: 100%; object-fit: cover; background: #2b170f; }
.cn-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin: auto;
  border-radius: 50%;
  background: rgba(20, 10, 6, 0.55);
  color: #fff;
  pointer-events: none;
}

/* A story's kind, as a small pill: News, Announcement, Event. */
.cn-kind {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: rgba(168, 77, 28, 0.1);
  color: var(--vh-orange);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}
.cn-kind--announcements { background: #fde4e2; color: #b3261e; }
.cn-kind--events { background: #e2effd; color: #24609e; }

.cn-meta { display: flex; flex-wrap: wrap; gap: 0.2rem 0.85rem; margin: 0; padding: 0; list-style: none; color: var(--vh-muted); font-size: 0.78rem; font-weight: 600; }
.cn-meta li { display: inline-flex; align-items: center; gap: 0.35rem; }
.cn-meta .svg-inline--fa { color: var(--vh-orange); font-size: 0.92em; }
.vp-card--overlay .cn-meta { color: rgba(255, 255, 255, 0.86); }
.vp-card--overlay .cn-meta .svg-inline--fa { color: #f4c25a; }

.cn-readmore { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: auto; padding-top: 0.3rem; color: var(--vh-orange); font-size: 0.84rem; font-weight: 800; }
.cn-readmore .svg-inline--fa { font-size: 0.85em; transition: transform 0.15s ease; }
.cn-card:hover .cn-readmore .svg-inline--fa { transform: translateX(3px); }

/* ------------------------------------------------------ right-hand column */

.cn-aside__empty { margin: 0; padding: 0.5rem 0.55rem 0.65rem; color: var(--vh-muted); font-size: 0.86rem; line-height: 1.5; }
.cn-aside__empty a { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--vh-orange); font-weight: 800; text-decoration: none; }
.cn-aside__empty a:hover { color: var(--vh-brown); text-decoration: underline; }
.cn-events .vp-date { flex: none; }
.cn-quick .vp-panel__title > .svg-inline--fa { color: #2f9a5b; }
.cn-quick .vp-row__thumb--icon { width: 2.9rem; height: 2.9rem; background: var(--vp-tone-bg); color: var(--vp-tone); }
.cn-stay { min-height: 12.5rem; }
.cn-stay .vp-cta__img { object-position: 70% 40%; }
.cn-stay .vh-btn { margin-top: 0.35rem; }

/* Between phone and desktop the column sits under the stories: two panels
   side by side, the app card across both. */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .cn-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .cn-stay { grid-column: 1 / -1; }
}

/* -------------------------------------------------------- a story's page */

.cn-progress { position: fixed; top: 0; right: 0; left: 0; z-index: 1100; height: 3px; pointer-events: none; }
.cn-progress__fill { height: 100%; background: var(--vh-grad); transform: scaleX(0); transform-origin: 0 50%; }

.cn-detail .vp-detail-hero__lead { max-width: 46rem; }
.cn-detail .vp-detail-hero__body .vp-pill { align-self: flex-start; }
/* The date and Share sit over the hero's top edge (pages.css positions them
   absolutely): a long title must start below them, not under them. */
.cn-detail .vp-detail-hero__body { padding-top: 6.75rem; }
/* A deeper veil than pages.css's: parish photos are often bright walls. */
.cn-hero.vp-detail-hero:not(.cn-hero--plain)::before {
  background: linear-gradient(180deg, rgba(20, 10, 6, 0.3) 0%, rgba(20, 10, 6, 0.12) 22%, rgba(20, 10, 6, 0.55) 52%, rgba(20, 10, 6, 0.9) 100%);
}
.cn-detail .vp-detail-hero__title { text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35); }

/* A long current crumb squeezed its chevron (a flex item) to a slash, and the
   ellipsis never showed on bare text: the chevron keeps its size and the
   title gets its own box to cut. */
.cn-page .vp-crumbs li + li::before { flex: none; }
.cn-crumb-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* No picture: a warm brown banner with the kind's icon, shorter. */
.cn-hero--plain { min-height: clamp(13rem, 22vw, 17rem); background: radial-gradient(130% 150% at 85% 15%, #8a4630 0%, #4a2418 48%, #2b170f 100%); }
.cn-hero__art { position: absolute; top: 50%; right: 2.5rem; z-index: -1; color: rgba(255, 255, 255, 0.08); font-size: 9rem; transform: translateY(-50%); }

/* A portrait picture (a poster, most often) is shown whole beside the words,
   on a blurred copy of itself, instead of being cut to a wide banner. */
.cn-poster-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.75rem;
  min-height: clamp(18rem, 30vw, 26rem);
  padding: 1.6rem 1.75rem;
  overflow: hidden;
  border-radius: 22px;
  background: #2b170f;
  color: #fff;
  isolation: isolate;
}
.cn-poster-hero__backdrop { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; filter: blur(28px) saturate(1.1); transform: scale(1.2); }
.cn-poster-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(36, 17, 9, 0.95) 0%, rgba(36, 17, 9, 0.84) 50%, rgba(36, 17, 9, 0.55) 100%);
}
.cn-poster-hero__body { display: flex; flex-direction: column; align-items: flex-start; gap: 0.65rem; min-width: 0; max-width: 42rem; }
.cn-poster-hero__body .vp-detail-hero__title { margin: 0.15rem 0 0; }
.cn-poster-hero__picture { display: block; justify-self: end; overflow: hidden; border-radius: 14px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.85); }
.cn-poster-hero__picture img { display: block; width: auto; max-width: min(21rem, 38vw); height: auto; max-height: 23rem; object-fit: contain; }
.cn-poster-hero__picture:focus-visible { outline: 3px solid #f4c25a; outline-offset: 3px; }
.cn-hero-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.35rem; }

/* The story itself. */
.cn-article { display: flex; flex-direction: column; gap: 1.15rem; padding: 1.4rem 1.5rem 1.6rem; }
@media (min-width: 992px) { .cn-article { padding: 1.75rem 2rem 2rem; } }

.cn-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--vh-line); }
.cn-byline__when { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; color: var(--vh-muted); font-size: 0.84rem; font-weight: 600; }
.cn-byline__when .svg-inline--fa { color: var(--vh-orange); }
.cn-share { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-left: auto; }
.cn-share__wa:hover { border-color: #25a85a; background: #25a85a; }

/* Two or three facts in one row on a computer (phones: see the end of the file). */
.cn-facts { grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr)); }
.cn-facts .vp-fact { align-items: flex-start; padding: 0.8rem 0.85rem; }
.cn-prose { font-size: 1.04rem; }
.cn-attachment { margin: 0; }

.cn-h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.5rem 0 0;
  color: var(--vh-ink);
  font-family: var(--vp-serif);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
}

/* "More Details": the theme's (Phoenix) accordion in the site's colours, light and dark. */
.cn-accordion {
  --phoenix-accordion-color: var(--vh-body);
  --phoenix-accordion-bg: var(--vh-surface);
  --phoenix-accordion-border-color: var(--vh-line);
  --phoenix-accordion-border-width: 0;
  --phoenix-accordion-border-radius: 14px;
  --phoenix-accordion-inner-border-radius: 13px;
  --phoenix-accordion-btn-color: var(--vh-ink);
  --phoenix-accordion-btn-bg: transparent;
  --phoenix-accordion-btn-focus-box-shadow: none;
  --phoenix-accordion-active-color: var(--vh-brown);
  --phoenix-accordion-active-bg: rgba(200, 97, 45, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.cn-accordion .accordion-item { padding: 0; overflow: hidden; border: 1px solid var(--vh-line); border-radius: 14px; background: var(--vh-surface); }
.cn-accordion .accordion-button { gap: 0.75rem; min-height: 2.75rem; padding: 0.9rem 1rem; font-size: 0.98rem; font-weight: 800; line-height: 1.3; }
.cn-accordion .accordion-button::after { display: none; }
.cn-accordion .accordion-button:focus-visible { outline: 3px solid var(--vh-focus); outline-offset: -3px; }
.cn-accordion__num {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: rgba(200, 97, 45, 0.12);
  color: var(--vh-orange);
  font-size: 0.78rem;
  font-weight: 800;
}
.cn-accordion .accordion-button:not(.collapsed) .cn-accordion__num { background: var(--vh-grad); color: #fff; }
.cn-accordion__title { flex: 1; min-width: 0; text-align: left; overflow-wrap: anywhere; }
.cn-accordion__chev { flex: none; color: var(--vh-muted); transition: transform 0.2s ease; }
.cn-accordion .accordion-button:not(.collapsed) .cn-accordion__chev { transform: rotate(180deg); }
.cn-accordion .accordion-body { padding: 0.4rem 1.1rem 1.2rem; }

.cn-figure { margin: 1rem 0 0; overflow: hidden; border-radius: 14px; background: var(--vh-field); }
.cn-figure a { display: block; }
.cn-figure img, .cn-figure video { display: block; width: 100%; height: auto; max-height: 34rem; margin: 0 auto; object-fit: contain; }

.cn-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: #2b1d16;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 1rem);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.cn-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.cn-toast .svg-inline--fa { color: #f4c25a; }

/* ------------------------------------------------------------ dark theme */

[data-bs-theme="dark"] .cn-kind { background: rgba(228, 138, 82, 0.14); }
[data-bs-theme="dark"] .cn-kind--announcements { background: rgba(240, 128, 116, 0.15); color: #f4a097; }
[data-bs-theme="dark"] .cn-kind--events { background: rgba(143, 192, 242, 0.14); color: #9cc8f5; }
[data-bs-theme="dark"] .cn-kicker--announcements { color: #f4a097; }
[data-bs-theme="dark"] .cn-kicker--events { color: #9cc8f5; }
[data-bs-theme="dark"] .cn-quick .vp-panel__title > .svg-inline--fa { color: #6fd39a; }
[data-bs-theme="dark"] .cn-toast { background: #f4eae0; color: #2b1d16; }
[data-bs-theme="dark"] .cn-toast .svg-inline--fa { color: #a84d1c; }

/* ---------------------------------------------------------------- phones */

@media (max-width: 991.98px) {
  /* Fingers, not mouse pointers. */
  .cn-page .vp-pager > a, .cn-page .vp-pager > span { min-width: 2.75rem; height: 2.75rem; }
  .cn-aside__empty a { min-height: 2.75rem; }
}

@media (max-width: 767.98px) {
  .cn-lead { min-height: 19rem; }
  .cn-lead > .vp-card__body { padding: 1.1rem 1.1rem 1.2rem; }
  .cn-lead .vp-card__title { font-size: 1.45rem; }
  .cn-lead__icon { margin-bottom: 6rem; font-size: 4rem; }

  .cn-hero__art { right: 1rem; font-size: 6rem; }

  .cn-poster-hero { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 1rem 1rem 1.2rem; border-radius: 18px; }
  .cn-poster-hero__picture { order: -1; justify-self: center; }
  .cn-poster-hero__picture img { max-width: 100%; max-height: 22rem; }
  .cn-poster-hero::before { background: linear-gradient(180deg, rgba(36, 17, 9, 0.5) 0%, rgba(36, 17, 9, 0.92) 60%); }

  .cn-article { padding: 1.1rem 1.05rem 1.25rem; }
  .cn-share { margin-left: 0; }
  /* Date and reading time side by side, the place across under them. */
  .cn-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; gap: 0.6rem; }
  .cn-facts .vp-fact { gap: 0.5rem; padding: 0.65rem 0.6rem; }
  .cn-facts .vp-fact__icon { width: 1.75rem; height: 1.75rem; border-radius: 9px; font-size: 0.85rem; }
  .cn-facts .vp-fact__value { font-size: 0.86rem; }
  .cn-fact--place { grid-column: 1 / -1; }
  .cn-prose { font-size: 1rem; }
  .cn-accordion .accordion-body { padding: 0.3rem 0.9rem 1rem; }
}

/* A phone lists stories as rows: picture, kind, title and date. */
@media (max-width: 575.98px) {
  .cn-grid { gap: 0.75rem; }
  .cn-card { flex-direction: row; }
  .cn-card > .vp-card__media { flex: 0 0 7.5rem; min-height: 7.5rem; aspect-ratio: auto; }
  .cn-card > .vp-card__body { gap: 0.35rem; padding: 0.75rem 0.85rem; }
  .cn-card .vp-card__title { font-size: 1rem; -webkit-line-clamp: 3; }
  .cn-card .vp-card__excerpt, .cn-card .cn-readmore { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cn-accordion__chev, .cn-toast, .cn-readmore .svg-inline--fa, .cn-page .vp-more .svg-inline--fa { transition: none; }
}
