/*
Theme Name: NSCT Twenty Twenty-Five
Theme URI: 
Author: NSCT
Author URI: 
Description: Customized version of Twenty Twenty-Five for NSCT.
Requires at least: 6.9
Tested up to: 6.9
Requires PHP: 5.7
Version: 1.0.29
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Template: twentytwentyfive
Text Domain: nsct-test
Tags: 
*/

/* Custom CSS can go here later if you need it */

/* figure/image captions */
.wpb_wrapper .vc_figure {
    position: relative;
}

.wpb_wrapper .vc_figure-caption {
    position: absolute;
    bottom: 0px;
    left: 0px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 10px 15px;
    margin: 0;
}

/* Open Sans for web (self-hosted); Calibri/Carlito as fallback */
body, .wp-block-post-content, p, h1, h2, h3, h4, h5, h6 {
    font-family: "Open Sans", "Calibri", "Carlito", sans-serif !important;
}

/* Home header logo sizing (patterns/header-home.php) */
.nsct-home-logo img {
    height: auto;
    width: 160px;
}

/* Sticky footer: make site wrapper full-height flex column so footer
   is always pushed to the bottom on short pages */
.wp-site-blocks {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.wp-site-blocks > main {
    flex: 1;
}

/* Cloudflare Stream background video for WPBakery rows */
.vc_row.nsct-has-cf-stream {
    position: relative;
    overflow: hidden;
}

.nsct-cf-stream-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 177.78vh;   /* 100/9*16 — fills height at 16:9 */
    min-width: 100%;
    height: 56.25vw;   /* 100/16*9 — fills width at 16:9 */
    min-height: 100%;
    pointer-events: none;
    z-index: 0;
}

.nsct-cf-stream-bg iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.vc_row.nsct-has-cf-stream > .wpb_column,
.vc_row.nsct-has-cf-stream > .vc_column_container {
    position: relative;
    z-index: 1;
}

/* scroll to top button */
.scroll-top-button {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s, background-color 0.2s;
  width: 50px;
  height: 50px;
  overflow: hidden;
  background-color: var(--nsct-primary-100, #2d76b2);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.scroll-top-button:hover {
  background-color: var(--nsct-primary-80, #1f5a8c);
}

.scroll-top-button a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.scroll-top-button svg {
  width: 24px;
  height: 24px;
  display: block;
  fill: #ffffff;
}

html {
  scroll-behavior: smooth;
}

/* Address block — output by [nsct_address] shortcode */
.nsct-address {
    font-style: normal;
    display: flex;
    flex-direction: column;
    gap: 0.2em;
}

.nsct-address-line {
    display: block;
}

/* ── Primary tints ─────────────────────────────────────────── */

.nsct-bg-primary-100 {
        background-color: var(--nsct-primary-100);
        color: #ffffff;
}

.nsct-bg-primary-80 {
        background-color: var(--nsct-primary-80);
        color: #ffffff;
}

.nsct-bg-primary-60 {
        background-color: var(--nsct-primary-60);
        color: #ffffff;
}

.nsct-bg-primary-40 {
        background-color: var(--nsct-primary-40);
        color: #ffffff;
}

.nsct-bg-primary-20 {
        background-color: var(--nsct-primary-20);
        color: #000000;
}

/* ── Secondary tints ───────────────────────────────────────── */

.nsct-bg-secondary-100 {
        background-color: var(--nsct-secondary-100);
        color: #ffffff;
}

.nsct-bg-secondary-80 {
        background-color: var(--nsct-secondary-80);
        color: #ffffff;
}

.nsct-bg-secondary-60 {
        background-color: var(--nsct-secondary-60);
        color: #ffffff;
}

.nsct-bg-secondary-40 {
        background-color: var(--nsct-secondary-40);
        color: #ffffff;
}

.nsct-bg-secondary-20 {
        background-color: var(--nsct-secondary-20);
        color: #000000;
}

/* ── Inherit text colour for all descendants ───────────────── */

.nsct-bg-primary-100 *,
.nsct-bg-primary-80 *,
.nsct-bg-primary-60 *,
.nsct-bg-primary-40 *,
.nsct-bg-primary-20 *,
.nsct-bg-secondary-100 *,
.nsct-bg-secondary-80 *,
.nsct-bg-secondary-60 *,
.nsct-bg-secondary-40 *,
.nsct-bg-secondary-20 * {
        color: inherit;
}


/* =======================
 * NSCT
 * ======================= */

/* Allow float-image-left / float-image-right for template 2 to allow modular and text flow */
.float-image-left,
.float-image-right {
  max-width: 40%;
}

.float-image-left {
  float: left;
  margin: 0 25px 5px 0 !important;
}

.float-image-right {
  float: right;
  margin: 0 0 5px 25px !important;
}

.float-image-left img,
.float-image-right img {
  width: 100%;
  height: auto;
}

/* iPad portrait and narrower: stack and centre */
@media (max-width: 768px) {
  .float-image-left,
  .float-image-right {
    float: none;
    display: table;
    margin: 0 auto 20px !important;
    max-width: 100%;
  }
}

/* Home page overlay header — fixed on the outer template-part wrapper */
.home .wp-site-blocks > .wp-block-template-part:first-child {
    position: fixed;
    top: var(--wp-admin--admin-bar--height, 0px);
    left: 0;
    right: 0;
    z-index: 1000;
}

/* Transparent background on the inner header group */
.nsct-overlay-header {
    background-color: rgba(255, 255, 255, 0.85);
}

/* Main content starts at top:0 — behind the fixed header */
.home .wp-site-blocks > .wp-block-template-part:first-child + * {
    margin-top: 0 !important;
}

.vc_message_box {
  padding-top: 0 !important;
  padding-right: 1em !important;
  padding-left: 2em !important;
}


/* home - align left */
.alignleft {
    float: left;
    margin: 0 20px 20px 0;
}

.alignright {
    float: right;
    margin: 0 0 20px 20px;
}

.aligncenter {
    display: block;
    margin: 10px auto;
}
.alignwide {
    margin-left: auto;
    margin-right: auto;
    clear: both;
}

/* Vertically center the title/breadcrumb row within the banner's min-height.
   This used to be done with position:absolute + translateY(-50%), but that
   centers on the row's own midpoint regardless of its height, so when the
   breadcrumb wraps onto two lines the extra height overflows equally above
   and below the fixed 150px banner and spills outside the coloured box.
   Centering via the row's own min-height/align-items instead lets the
   banner grow to fit a wrapped breadcrumb rather than clipping or
   overflowing it (templates/page.html). */
.wp-block-group.nsct-banner > .wp-block-group {
    min-height: 150px;
    align-items: center;
}

/* Give the banner breadcrumb a fixed size/weight instead of the fluid body
   scale, so it doesn't shrink away on smaller screens (matches the old
   theme's fixed 20px bold breadcrumb) */
.wp-block-boldblocks-breadcrumb-block {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Breadcrumb links: no underline, colour change on hover (matches Kingfisher's
   .edgt-breadcrumbs a: inherit colour, hover #212121, 0.2s ease-out) */
.wp-block-boldblocks-breadcrumb-block a {
    text-decoration: none;
    transition: color 0.2s ease-out;
}
.wp-block-boldblocks-breadcrumb-block a:hover {
    color: #212121;
}

/* Utility: hold an element's width at a few fixed tiers instead of
   reflowing continuously with the viewport, so text inside it wraps in the
   old Kingfisher/Bootstrap-grid "jumps in blocks" style rather than one
   word at a time. Opt in per-block by adding "nsct-stepped-width" as the
   Extra Class Name on a WPBakery row or column (Design Options tab) - it
   isn't applied to anything by default. */
.nsct-stepped-width {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 576px) {
    .nsct-stepped-width {
        max-width: 500px;
    }
}
@media (min-width: 768px) {
    .nsct-stepped-width {
        max-width: 680px;
    }
}
@media (min-width: 992px) {
    .nsct-stepped-width {
        max-width: 860px;
    }
}
@media (min-width: 1200px) {
    .nsct-stepped-width {
        max-width: 100%;
    }
}

/* Stack the breadcrumb under the title on narrow viewports instead of
   crowding them into one row (matches kingfisherhallacademy.org.uk/fsm) */
@media (max-width: 1024px) {
    .wp-block-group.nsct-banner > .wp-block-group {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 0;
    }

    /* Drop the title's desktop clamp(30px,5vw,50px) padding - with
       justify-content:center above, the row's own centering already gives
       the stacked title/breadcrumb block even space above and below,
       so the title doesn't need its own padding on top of that (and the
       clamp value, plus a wrapped 2-line breadcrumb, would make the
       stacked banner too tall). Covers both post-title (templates/
       page.html) and site-title (templates/single.html,
       single-mec-events.html), which otherwise keeps its padding here and
       makes the gap above the breadcrumb inconsistent between page vs.
       single/event banners. */
    .wp-block-group.nsct-banner .wp-block-post-title,
    .wp-block-group.nsct-banner .wp-block-site-title {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .wp-block-group.nsct-banner .wp-block-boldblocks-breadcrumb-block {
        margin-top: 20px;
    }
}

/* Drop the copyright/privacy text below the floated (alignright) North Star
   logo in the footer instead of beside it (patterns/footer.php) */
.nsct-footer-logo-clear {
    clear: both;
}

/* Match legacy Kingfisher: lists in post content have no left indent
   (Kingfisher's Edge theme reset zeroes ul padding). */
.entry-content ul {
    padding-left: 0;
    list-style-position: inside; /* Kingfisher: ul,ol{list-style-position:inside} */
}

/* Events widget (Modern Events Calendar, grid-minimal skin): keep titles bold.
   MEC sets .mec-event-grid-minimal .mec-event-title { font-weight: 700 }
   (specificity 0,2,0) but also .entry-content .mec-wrap h4 { font-weight: 400 }
   (0,2,1), which wins here because block themes wrap page content in
   .entry-content (Kingfisher's Educator theme does not). The extra selectors
   below raise specificity to 0,4,0 so the 700 wins. The link inherits it. */
.entry-content .mec-wrap .mec-event-grid-minimal .mec-event-title {
    font-weight: 700;
}

/* Events widget links: underlined, underline removed on hover (matches Kingfisher).
   Kingfisher's Educator theme has `.wpb_wrapper div a:not(.vc_btn3):not(.edgt-btn)
   { text-decoration: underline }` plus a :hover { none }; MEC itself sets
   `body[class*="mec-theme"] .mec-wrap a { text-decoration: none }` (0,2,2), so
   the selector below (0,3,1) is needed to beat it. */
.wpb_wrapper .mec-wrap .mec-event-title a {
    text-decoration: underline;
}
.wpb_wrapper .mec-wrap .mec-event-title a:hover {
    text-decoration: none;
}

/* MEC single event: full-width content, title first, card-style details */
.single-mec-events .mec-single-modern .mec-no-image {
    display: none;
}
.single-mec-events .mec-single-modern .col-md-8 {
    float: none;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
/* title (inside .mec-event-content) first, then date/time, then the rest */
.single-mec-events .mec-event-content { order: 0; }
.single-mec-events .mec-single-event-bar { order: 1; }
.single-mec-events .mec-single-modern .col-md-8 > * { order: 2; }
.single-mec-events .mec-single-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}
/* soft cards */
.single-mec-events .mec-single-event-bar,
.single-mec-events .mec-event-export-module,
.single-mec-events .mec-events-meta-group-countdown {
    margin: 0;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: none;
}
/* export buttons in the school accent colour */
body.single-mec-events .mec-wrap .mec-events-button.mec-color {
    color: var(--nsct-primary-60);
    border-color: var(--nsct-primary-60);
    border-radius: 4px;
}
body.single-mec-events .mec-wrap .mec-events-button.mec-color:hover {
    color: #fff;
    background: var(--nsct-primary-60);
    border-color: var(--nsct-primary-60);
}
body.single-mec-events .mec-wrap .mec-countdown-details .countdown-w .block-w,
body.single-mec-events .mec-wrap .mec-countdown-details .countdown-w .block-w span {
    color: var(--nsct-primary-60);
}

/* Banner text (title, breadcrumb, links) uses the default text colour; the
   preset has-base-color / has-link-color classes are !important, so match */
.wp-block-group.nsct-banner,
.wp-block-group.nsct-banner a,
.wp-block-group.nsct-banner .wp-block-site-title,
.wp-block-group.nsct-banner .wp-block-post-title {
    color: var(--nsct-banner-text, #333333) !important;
}

/* Home page only: headings inside page content use the middle primary colour */
.home .wp-block-post-content :is(h1, h2, h3, h4, h5, h6) {
    color: var(--nsct-primary-60);
}

/* Home page only: the "School Uniform / Academy Plus / Who We Are / Work
   With Us" quick-link headings are plain <a> tags wrapped in <h2> with no
   class, so they pick up the default underlined link styling. Strip that
   so they read as plain headings while staying clickable
   (https://dev.woodpeckerhallacademy.org.uk/). */
.home .entry-content h2 > a {
    text-decoration: none;
    color: inherit;
}

/* Home page only: the hero heading ("One of the very best schools...") has
   an inline font-size:40px/line-height:60px with no responsive class
   (Kingfisher's equivalent uses .homepage-hero-heading, which shrinks to
   24px/36px at <=768px), so on Woodpecker it stays oversized on narrow
   viewports. Match Kingfisher's own breakpoint/values; !important is
   needed to beat the inline style's specificity
   (https://dev.woodpeckerhallacademy.org.uk/). */
@media (max-width: 768px) {
    .home .vc_video-bg-container h2.vc_custom_heading,
    .home .vc_video-bg-container h2.vc_custom_heading a {
        font-size: 24px !important;
        line-height: 36px !important;
    }
}

/* Paragraphs after a paragraph holding a left-floated image stay in their own
   column beside it instead of wrapping underneath it.
   Note: overflow:hidden can clip long unbroken words/URLs, box-shadows and
   focus outlines at the paragraph edge. "display: flow-root" gives the same
   column behaviour without clipping, so we may be able to switch to it. */
p:has(img.alignleft) ~ p {
    overflow: hidden;
}
