/* =====================================================================
   News & events (WordPress blog) — follows the Carpe Diem tokens
   ===================================================================== */
.news-hero .page-hero-copy { justify-items: center; text-align: center; }
.news-hero .container { grid-template-columns: 1fr !important; }

/* Featured story */
.news-featured { display: grid; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-1); text-decoration: none; color: inherit; transition: box-shadow .2s ease, transform .2s ease; }
.news-featured:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); text-decoration: none; }
@media (min-width: 900px) { .news-featured { grid-template-columns: 1.25fr 1fr; } }
.news-featured .nf-media { position: relative; min-height: 15rem; }
.news-featured .nf-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.news-featured .nf-body { padding: clamp(1.5rem, 4vw, 2.5rem); display: grid; gap: 0.9rem; align-content: center; }
.news-featured h2 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2; letter-spacing: -0.015em; }
.news-featured p { color: var(--ink-soft); }
.nf-flag { position: absolute; left: 1rem; top: 1rem; background: var(--amber-bright); color: var(--purple-deep); font-family: var(--font-display); font-weight: 700; font-size: 0.8125rem; padding: 0.4rem 0.85rem; border-radius: var(--r-pill); transform: rotate(-3deg); box-shadow: var(--shadow-2); }

/* Category tags */
.ntag { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--font-display); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.02em; padding: 0.3rem 0.7rem; border-radius: var(--r-pill); justify-self: start; width: max-content; }
.ntag .icon { font-size: 0.95rem; }
.ntag-news { background: var(--purple-subtle); color: var(--purple); }
.ntag-events { background: var(--coral-subtle); color: var(--coral); }
.ntag-notices { background: var(--amber-soft); color: #5c4300; }
.ntag-achievements { background: var(--green-subtle); color: var(--green); }

.nmeta { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; color: var(--muted); font-size: 0.875rem; align-items: center; }
.nmeta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.nmeta .icon { font-size: 1rem; }

/* Upcoming events strip */
.upcoming { display: grid; gap: 0.75rem; }
@media (min-width: 600px) and (max-width: 959px) { .upcoming { grid-template-columns: repeat(2, minmax(0, 1fr)); } .upcoming > :only-child, .upcoming > :nth-child(3):last-child { grid-column: 1 / -1; } }
@media (min-width: 960px) { .upcoming { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.event-pill { display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0.85rem 1rem; text-decoration: none; color: inherit; transition: border-color .15s ease; }
.event-pill:hover { border-color: var(--purple-soft); text-decoration: none; }
.cal { display: block; width: 3.4rem; border-radius: 0.75rem; overflow: hidden; text-align: center; background: var(--canvas); border: 1px solid var(--line); font-family: var(--font-display); }
.cal b { display: block; background: var(--coral-bright); color: #fff; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.15rem 0; }
.cal span { display: block; font-size: 1.35rem; font-weight: 700; color: var(--ink); padding: 0.15rem 0 0.25rem; line-height: 1.2; }
.event-pill h3 { font-size: 1rem; line-height: 1.3; }
.event-pill p { font-size: 0.8125rem; color: var(--muted); margin-top: 0.15rem; }

/* Story cards */
.news-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.ncard { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow .2s ease, transform .2s ease; }
.ncard:hover { box-shadow: var(--shadow-2); transform: translateY(-3px); text-decoration: none; }
.ncard .nc-media { position: relative; aspect-ratio: 16 / 10; background: var(--purple-subtle); overflow: hidden; }
.ncard .nc-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ncard .nc-media .ntag { position: absolute; left: 0.85rem; top: 0.85rem; box-shadow: 0 4px 12px -4px rgba(45,52,75,.25); }
.ncard .nc-body { padding: 1.15rem 1.25rem 1.35rem; display: grid; gap: 0.55rem; flex: 1; align-content: start; }
.ncard h3 { font-size: 1.15rem; line-height: 1.3; }
.ncard p { color: var(--ink-soft); font-size: 0.9375rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ncard .more { margin-top: auto; padding-top: 0.35rem; font-family: var(--font-display); font-weight: 700; font-size: 0.875rem; color: var(--purple); display: inline-flex; align-items: center; gap: 0.3rem; }
.ncard .when-chip { position: absolute; right: 0.85rem; bottom: 0.85rem; }
.ncard .when-chip .cal { box-shadow: var(--shadow-2); background: #fff; }
.ncard.is-notice .nc-body { border-top: 4px solid var(--amber-bright); }

/* Pagination */
.pager { display: flex; justify-content: center; gap: 0.4rem; margin-top: 2.5rem; flex-wrap: wrap; }
.pager a, .pager span { min-width: 2.6rem; height: 2.6rem; padding: 0 0.85rem; display: inline-grid; place-items: center; border-radius: var(--r-pill); border: 1.5px solid var(--line-strong); background: var(--card); font-family: var(--font-display); font-weight: 700; color: var(--ink); text-decoration: none; }
.pager .current { background: var(--purple); border-color: var(--purple); color: #fff; }
.pager a:hover { border-color: var(--purple-soft); color: var(--purple); }

/* ---------- Single article ---------- */
.article-head { padding-block: clamp(2rem, 5vw, 3rem) 0; }
.article-head .container { max-width: 52rem; display: grid; gap: 1rem; justify-items: start; }
.article-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); letter-spacing: -0.02em; line-height: 1.14; }
.article-head .standfirst { font-size: 1.15rem; color: var(--ink-soft); }
.article-cover { max-width: 64rem; margin: clamp(1.5rem, 4vw, 2.25rem) auto 0; padding-inline: var(--gutter); }
.article-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 28px 28px 28px 10px; border: 6px solid var(--card); box-shadow: var(--shadow-3); }
.article-cover figcaption { font-size: 0.875rem; color: var(--muted); margin-top: 0.6rem; text-align: center; }
.article-layout { max-width: 64rem; margin-inline: auto; padding: clamp(2rem, 5vw, 3rem) var(--gutter) 0; display: grid; gap: 2rem; }
@media (min-width: 960px) { .article-layout { grid-template-columns: minmax(0, 1fr) 18rem; gap: 3rem; align-items: start; } }
.article-body { font-size: 1.0625rem; line-height: 1.75; color: var(--ink-soft); }
.article-body > * + * { margin-top: 1.1rem; }
.article-body h2 { font-size: 1.45rem; color: var(--ink); margin-top: 2rem; }
.article-body h3 { font-size: 1.2rem; color: var(--ink); margin-top: 1.6rem; }
.article-body a { color: var(--purple); font-weight: 700; }
.article-body ul, .article-body ol { padding-left: 1.3rem; display: grid; gap: 0.4rem; }
.article-body blockquote { margin-inline: 0; padding: 1rem 1.25rem; border-left: 4px solid var(--amber-bright); background: var(--amber-subtle); border-radius: 0 var(--r-lg) var(--r-lg) 0; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--ink); }
.article-body figure { margin: 1.75rem 0; }
.article-body figure img { width: 100%; border-radius: var(--r-lg); }
.article-body figcaption { font-size: 0.875rem; color: var(--muted); margin-top: 0.5rem; text-align: center; }
.article-gallery { display: grid; gap: 0.6rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.article-gallery button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 1; }
.article-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.article-gallery button:hover img { transform: scale(1.04); }

.article-aside { display: grid; gap: 1rem; }
/* Phones and tablets: event details first (date, time, place), then the story, then sharing. */
@media (max-width: 959px) {
  .article-layout { display: flex; flex-direction: column; }
  .article-aside { display: contents; }
  .article-aside .event-card { order: -1; }
  .article-aside .share-card { order: 1; }
}
@media (min-width: 960px) { .article-aside { position: sticky; top: calc(var(--header-h) + 1.5rem); } }
.event-card { background: var(--purple-deep); color: #fff; border-radius: var(--r-xl); padding: 1.35rem 1.4rem; display: grid; gap: 0.85rem; }
.event-card h3 { color: #fff; font-size: 1.1rem; }
.event-card dl { display: grid; gap: 0.7rem; margin: 0; }
.event-card dl div { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.5rem; align-items: start; }
.event-card dt { color: var(--amber-bright); }
.event-card dd { margin: 0; color: #e4dffb; font-size: 0.9375rem; line-height: 1.45; }
.event-card dd b { color: #fff; display: block; }
.event-card .btn { justify-content: center; }
.share-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 1.15rem 1.25rem; display: grid; gap: 0.7rem; }
.share-card h3 { font-size: 1rem; }
.share-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.share-row a, .share-row button { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.85rem; border-radius: var(--r-pill); border: 1.5px solid var(--line-strong); background: var(--card); font-family: var(--font-display); font-weight: 700; font-size: 0.8125rem; color: var(--ink); text-decoration: none; cursor: pointer; }
.share-row a:hover, .share-row button:hover { border-color: var(--purple-soft); color: var(--purple); }
.share-row .glyph { width: 1rem; height: 1rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--font-display); font-weight: 700; color: var(--purple); text-decoration: none; font-size: 0.9375rem; }
.back-link .icon { transform: rotate(180deg); }

/* Home page strip */
.home-news .news-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
@media (min-width: 900px) { .home-news .news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- School calendar (4 Nov 2026) ---------- */
.cal-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-1); padding: clamp(1rem, 3vw, 1.75rem); display: grid; gap: 1.1rem; font-size: 1rem; line-height: 1.5; }
.cal-top { display: flex; flex-wrap: wrap; gap: 0.85rem 1rem; align-items: center; justify-content: space-between; }
.cal-top .tabs [role="tab"] { padding: 0.6rem 1.25rem; }
.cal-range { font-size: 0.9375rem; color: var(--ink-soft); margin: 0 0 0.5rem; }
.cal-range b { color: var(--ink); font-family: var(--font-display); }
.cal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.cal-row { display: grid; grid-template-columns: 2.4rem 9.5rem minmax(0, 1fr); gap: 0.15rem 1rem; align-items: center; padding: 0.65rem 0.75rem; border-radius: var(--r-md); scroll-margin: calc(var(--header-h, 5rem) + 2rem); transition: opacity .2s ease; }
.cal-row + .cal-row { background-image: linear-gradient(var(--line), var(--line)); background-size: calc(100% - 1.5rem) 1px; background-position: center top; background-repeat: no-repeat; }
.cal-ic { width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.cal-ic .icon { font-size: 1.25rem; }
.k-event .cal-ic { background: var(--coral-subtle); color: var(--coral); }
.k-term .cal-ic { background: var(--purple-subtle); color: var(--purple); }
.k-holiday .cal-ic { background: var(--amber-soft); color: #5c4300; }
.k-meeting .cal-ic { background: var(--teal-subtle); color: var(--teal); }
.cal-row.k-holiday { background: var(--amber-subtle); }
.cal-row.k-holiday + .cal-row, .cal-row.is-next + .cal-row { background-image: none; }
.cal-when { display: grid; font-family: var(--font-display); line-height: 1.3; }
.cal-when b { font-weight: 700; color: var(--ink); }
.cal-when small { font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.cal-when i { font-style: normal; font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.cal-what { color: var(--ink-soft); }
.cal-what > b { color: var(--ink); font-weight: 700; }
.cal-row.k-term .cal-what > b { color: var(--purple-deep); }
.cal-note { display: block; font-size: 0.875rem; color: var(--muted); }
.cal-what .cal-more { display: inline-flex; align-items: center; gap: 0.2rem; margin-left: 0.4rem; font-family: var(--font-display); font-weight: 700; font-size: 0.875rem; color: var(--purple); white-space: nowrap; text-decoration: none; }
.cal-what .cal-more:hover { text-decoration: underline; }
.cal-more .icon { font-size: 1rem; }
.cal-badge { display: inline-block; vertical-align: 0.12em; background: var(--coral-bright); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.1rem 0.5rem; border-radius: var(--r-pill); }
.cal-row.is-next { background: var(--coral-subtle); box-shadow: inset 0 0 0 1.5px var(--coral-bright); }
.cal-row.is-past { opacity: 0.5; }
.cal-row.is-target { animation: calFlash 2s ease; }
@keyframes calFlash { 0%, 35% { background: var(--purple-subtle); box-shadow: inset 0 0 0 2px var(--purple-soft); } }
.cal-key { list-style: none; margin: 0; padding: 0.9rem 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.8125rem; color: var(--muted); }
.cal-key li { display: inline-flex; align-items: center; gap: 0.45rem; }
.cal-key .cal-ic { width: 1.6rem; height: 1.6rem; }
.cal-key .cal-ic .icon { font-size: 1rem; }
.tab-panel.is-in .cal-row { animation: tabCardIn .45s cubic-bezier(.2, .7, .2, 1) both; }
@media (prefers-reduced-motion: reduce) { .tab-panel.is-in .cal-row, .cal-row.is-target { animation: none; } }
@media (max-width: 639px) {
  .cal-top .tabs { display: flex; width: 100%; }
  .cal-top .tabs [role="tab"] { flex: 1; justify-content: center; padding-inline: 0.5rem; }
  .cal-top .cal-ics { width: 100%; justify-content: center; }
  .cal-row { grid-template-columns: 2.25rem minmax(0, 1fr); gap: 0.1rem 0.8rem; align-items: start; padding: 0.7rem 0.6rem; }
  .cal-row .cal-ic { grid-row: span 2; width: 2.25rem; height: 2.25rem; }
  .cal-when { display: flex; flex-wrap: wrap; gap: 0 0.3rem; font-size: 0.875rem; }
  .cal-when b, .cal-when small, .cal-when i { font-size: inherit; }
  .cal-row.k-term .cal-when b, .cal-row .cal-when b { color: var(--coral); }
}
/* Inside a story */
.article-body .cal-block { margin-top: 1.75rem; }
.article-body .cal-list { padding: 0; gap: 0.25rem; }
.article-body .cal-key { display: flex; padding-left: 0; gap: 0.5rem 1.25rem; }
.article-body .cal-what .cal-more { text-decoration: none; }
.article-body .cal-block a.btn { color: var(--purple); }
/* School calendar page */
.cal-page { max-width: 64rem; }
.cal-back { margin-top: 1.5rem; text-align: center; }
/* YouTube video in a story: a picture with a play button; YouTube loads only after a tap */
.story-video { margin: 1.75rem 0; }
.sv-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: var(--purple-deep); box-shadow: var(--shadow-2, 0 10px 30px -12px rgba(42, 31, 99, .35)); }
.story-video.is-short .sv-frame { aspect-ratio: 9 / 16; max-width: 22rem; margin-inline: auto; }
.sv-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sv-play { position: absolute; inset: 0; display: block; color: #fff; text-decoration: none; cursor: pointer; }
.sv-play .sv-poster, .sv-play img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2, .7, .2, 1), filter .3s ease; }
.sv-blank { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, var(--purple-bright), var(--purple-deep) 70%); }
.sv-blank .icon { font-size: 4rem; opacity: .25; }
.sv-play::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(42, 31, 99, 0) 45%, rgba(42, 31, 99, .78)); }
.sv-btn { position: absolute; z-index: 1; left: 50%; top: 50%; width: 4.75rem; height: 4.75rem; margin: -2.375rem 0 0 -2.375rem; border-radius: 50%; display: grid; place-items: center; background: var(--purple); color: #fff; box-shadow: 0 10px 30px rgba(42, 31, 99, .45), 0 0 0 8px rgba(255, 255, 255, .28); transition: transform .25s cubic-bezier(.2, .7, .2, 1), background .2s ease; }
.sv-btn svg { width: 2.1rem; height: 2.1rem; margin-left: .25rem; }
.sv-title { position: absolute; z-index: 1; left: 1.1rem; right: 1.1rem; bottom: .95rem; font-family: var(--font-display); font-weight: 700; font-size: clamp(1rem, 2.2vw, 1.2rem); line-height: 1.25; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.sv-play:hover .sv-btn, .sv-play:focus-visible .sv-btn { transform: scale(1.08); background: var(--coral-bright); }
.sv-play:hover img { transform: scale(1.03); }
.sv-play:focus-visible { outline: 3px solid var(--ring, var(--amber-bright)); outline-offset: -3px; }
.story-video figcaption { display: grid; gap: .2rem; justify-items: center; }
.story-video figcaption small { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--muted); }
.story-video figcaption small .icon { font-size: .95rem; }
.story-video.is-playing .sv-frame { box-shadow: 0 0 0 4px var(--purple-soft); }
@media (prefers-reduced-motion: reduce) { .sv-btn, .sv-play img { transition: none; } }

/* Filters on News & events: the stories fade out and the new ones come in */
.news-stage { transition: height .45s cubic-bezier(.4, 0, .2, 1); }
.news-stage[style*="height"] { overflow: hidden; }
.news-stage.is-out { opacity: 0; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease, height .45s cubic-bezier(.4, 0, .2, 1); }
.news-stage.is-in .ncard { animation: tabCardIn .5s cubic-bezier(.2, .7, .2, 1) both; }
.news-stage.is-in .ncard:nth-child(2) { animation-delay: .04s; } .news-stage.is-in .ncard:nth-child(3) { animation-delay: .08s; }
.news-stage.is-in .ncard:nth-child(4) { animation-delay: .12s; } .news-stage.is-in .ncard:nth-child(5) { animation-delay: .16s; } .news-stage.is-in .ncard:nth-child(n+6) { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) { .news-stage, .news-stage.is-out { transition: none; } .news-stage.is-in .ncard { animation: none; } }
.story-video .sv-play, .story-video .sv-title { color: #fff; }

/* Story cards: the event date stands out, so it is not mixed up with the posted date (11 Nov 2026) */
.nmeta .nc-when { color: var(--ink); font-weight: 700; }
.nmeta .nc-when .icon { color: var(--coral); }
