/* ============================================================================
   HLPS theme — public site skin modelled on hlpsbhs.org (Hirendra Leela
   Patranavis School). Standalone: it styles every `st-*` class the themed
   PageBuilder blocks emit, so it loads INSTEAD of ststephens.css, not on top
   of it. Load it by adding `/front/css/hlpsbhs.css` to Admin -> Settings ->
   Custom CSS.

   Palette sampled from the source site (WP theme "Education Reform"):
     brand green   #00a651     submenu green  #00a953
     accent blue   #1a4d8c     ticker orange  #ff8400
     body ink      #333333     body face      Roboto / system sans
   ========================================================================= */

.st-theme,
.st-header,
.st-footer {
    --hlps-green: #00a651;
    --hlps-green-dark: #007a3c;
    --hlps-submenu: #00a953;
    --hlps-blue: #1a4d8c;
    --hlps-orange: #ff8400;
    --hlps-ink: #333;
    --hlps-muted: #666;
    --hlps-line: #e2e2e2;
    --hlps-band: #f8f9fa;
    /* Source `.wrapper`: a centred 1400px column with 15px side padding.
       Every band (topbar content, interior pages, footer) reads this pair. */
    --hlps-wrap: 1400px;
    --hlps-gutter: 15px;
    /* Distance from the viewport edge to the centred column, floored at the
       gutter — used to inset the header's logo + nav row. */
    --hlps-edge: max(15px, calc((100% - 1400px) / 2));
    --hlps-font: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */

.st-wrap {
    width: 100%;
    max-width: var(--hlps-wrap);
    margin: 0 auto;
    padding: 0 var(--hlps-gutter);
    box-sizing: border-box;
}

.st-section {
    padding-top: 28px;
    padding-bottom: 28px;
}

/* PageRenderer wraps blocks in .page-content; neutralise its spacing so the
   themed bands can run edge to edge. */
.st-theme .page-content,
.st-header .page-content,
.st-footer .page-content {
    margin: 0;
    padding: 0;
}

.st-theme {
    font-family: var(--hlps-font);
    font-size: 16px;
    line-height: 1.7;
    color: var(--hlps-ink);
}

.st-theme p {
    margin: 0 0 14px;
    text-align: justify;
}

.st-theme a {
    color: var(--hlps-blue);
    text-decoration: none;
}

.st-theme a:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Contact topbar — the green strip above the header
   -------------------------------------------------------------------------- */

/* Source `#top-header`: green with the header-shape graphic over it, 15px/24px
   type, 10px vertical padding, 10px after each icon, 15px between items. */
.st-topbar {
    background: var(--hlps-green) url('/uploads/wp/theme/header-shape.png');
    color: #fff;
    font-family: var(--hlps-font);
    font-size: 15px;
    line-height: 24px;
}

.st-topbar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 18px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.st-topbar__contact {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 15px;
}

.st-topbar__item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.st-topbar__item i {
    font-size: 14px;
    line-height: 1;
}

.st-topbar__links {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Doubled class beats `.st-header a`, which otherwise wins the tie by order */
.st-topbar .st-topbar__links a {
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.st-topbar .st-topbar__links a:hover {
    text-decoration: underline;
    color: #eafff3;
}

.st-topbar__sep {
    opacity: .65;
}

/* --------------------------------------------------------------------------
   Header band — white, logo lockup left, nav right (one row on desktop).
   `site.header.class` is "st-header hlps-header"; the flex is on the
   PageRenderer wrapper so the SchoolHeader and SchoolNav blocks sit side
   by side, with the topbar spanning the full width above them.
   -------------------------------------------------------------------------- */

.st-header {
    background: #fff;
    color: var(--hlps-ink);
    border-bottom: 3px solid var(--hlps-green);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
}

.hlps-header .page-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.hlps-header .st-topbar {
    flex: 0 0 100%;
}

/* The header block's own wrap only needs to fit the lockup. The logo/nav row
   is inset to the centred column while the topbar's green stays full-bleed. */
.hlps-header .page-content > .st-wrap {
    width: auto;
    flex: 0 1 auto;
    margin: 0 0 0 var(--hlps-edge);
}

.hlps-header .st-nav {
    flex: 1 1 auto;
    min-width: 0;
    margin-right: var(--hlps-edge);
}

.st-header a {
    color: var(--hlps-ink);
    text-decoration: none;
}

/* Sitewide slider (Slider block in the header layout, as on the source):
   full-bleed row under the logo/nav, at the source slides' 1900x800 ratio,
   with none of the block's default card styling. */
.hlps-header .page-block-slider {
    flex: 0 0 100%;
    width: 100%;
}

/* No rule between the header band and the slider — the white band meets the
   slides directly. */
.st-header.hlps-header {
    border-bottom: 0;
}

.hlps-header .page-block-slider .carousel-inner {
    border-radius: 0 !important;
}

.hlps-header .page-block-slider .carousel-item img {
    height: auto !important;   /* beats the block's inline 520px height */
    aspect-ratio: 1900 / 800;
    object-fit: cover;
}

.st-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 0;
}

.st-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* Pre-set crest + name lines as a single graphic (what the source ships:
   a 435x93 lockup). The JPEG's background is rgb(250,248,249), not white —
   a 3% brightness lift clips it to pure white so it melts into the band,
   while the dark crest and lettering shift imperceptibly. */
.st-brand__lockup {
    display: block;
    width: auto;
    max-width: min(435px, 72vw);
    height: auto;
    max-height: 93px;
    filter: brightness(1.03);
}

.st-brand__crest {
    flex: 0 0 auto;
    width: 62px;
    height: auto;
    display: block;
}

.st-brand__crest--placeholder {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--hlps-green);
    border-radius: 50%;
    font-size: 24px;
    color: var(--hlps-green);
}

.st-brand__text {
    min-width: 0;
}

.st-brand__title {
    font-family: var(--hlps-font);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 2px;
    color: var(--hlps-green);
}

.st-brand__title--gothic,
.st-brand__title--serif {
    font-family: Georgia, 'Times New Roman', serif;
}

.st-brand__lines {
    font-size: 12px;
    line-height: 1.5;
    color: var(--hlps-muted);
}

.st-brand__lines span {
    display: block;
}

.st-header__aside {
    flex: 0 0 auto;
    max-width: 300px;
    text-align: right;
    font-size: 14px;
    line-height: 1.4;
    font-family: var(--hlps-font);
    color: var(--hlps-blue);
    font-weight: 500;
}

.st-header__aside a {
    color: var(--hlps-blue);
}

.st-header__aside a:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Primary navigation — uppercase links, green hover dropdowns
   -------------------------------------------------------------------------- */

.st-nav,
.st-nav__item,
.st-nav__link {
    list-style: none;
    display: block;
    position: relative;
    box-sizing: border-box;
}

.st-nav__inner {
    position: relative;
    padding: 0 var(--hlps-gutter) 0 0;
}

.st-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    box-sizing: border-box;
}

.st-nav__sub,
.st-nav__sub li {
    display: block;
    list-style: none;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.st-nav__item {
    font-family: var(--hlps-font);
    margin: 0 10px;
}

/* Source `.primary-menu > li > a`: bold black uppercase with an animated
   black underline bar 5px below the text on hover. */
.st-nav__link {
    padding: 26px 4px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #000;
    text-align: center;
    white-space: nowrap;
    transition: color .2s ease;
}

.st-nav__link::before {
    content: "";
    position: absolute;
    height: 2px;
    width: 0;
    right: 4px;
    bottom: 20px;
    background-color: #000;
    transition: width .4s cubic-bezier(.22, .61, .36, 1);
}

.st-nav__item:hover > .st-nav__link::before,
.st-nav__item:focus-within > .st-nav__link::before {
    width: calc(100% - 8px);
    left: 4px;
}

/* Chevron on items that open a dropdown, as on the source nav */
.st-nav__item:has(> .st-nav__sub) > .st-nav__link::after {
    content: "\F282";
    font-family: 'bootstrap-icons';
    font-size: 11px;
    font-weight: 400;
    margin-left: 5px;
    vertical-align: 1px;
}

.st-nav__link:hover,
.st-nav__item:hover > .st-nav__link,
.st-nav__link.is-active {
    color: #db6a23;
    text-decoration: none;
}

/* Dropdowns: parked off-screen rather than display:none so they stay
   reachable by keyboard (focus-within). Green panel, white links, with the
   source's fade + slide-up entrance. */
.st-nav__sub {
    position: absolute;
    top: 100%;
    left: -9999px;
    z-index: 60;
    min-width: 300px;
    background: var(--hlps-submenu);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .15s linear, transform .15s linear, left 0s .15s;
}

.st-nav__item:hover > .st-nav__sub,
.st-nav__item:focus-within > .st-nav__sub {
    left: 0;
    opacity: 1;
    transform: translateY(0);
    transition: opacity .15s linear, transform .15s linear;
}

/* Keep the right-most dropdown on-screen */
.st-nav__item:last-child:hover > .st-nav__sub,
.st-nav__item:last-child:focus-within > .st-nav__sub {
    left: auto;
    right: 0;
}

/* Source `.primary-menu ul`: 1.9rem at a 10px root = 19px, normal weight,
   1.5rem (15px) link padding. */
.st-nav__sub .st-nav__link {
    padding: 15px;
    font-size: 19px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #fff;
    text-align: left;
    white-space: normal;
    border-bottom: 1px solid rgba(255, 255, 255, .18);
}

.st-nav__sub li:last-child .st-nav__link {
    border-bottom: 0;
}

.st-nav__sub .st-nav__link:hover {
    background: var(--hlps-green-dark);
    color: #fff;
}

/* Mobile toggle — CSS-only, so navigation works before any script runs. */
.st-nav__toggle {
    display: none;
}

.st-nav__burger {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--hlps-ink);
    cursor: pointer;
    user-select: none;
}

/* --------------------------------------------------------------------------
   Interior page — full-width article (the source uses no sidebar)
   -------------------------------------------------------------------------- */

.st-page-row {
    display: grid;
    grid-template-columns: clamp(230px, 22%, 320px) minmax(0, 1fr);
    gap: clamp(18px, 2vw, 34px);
    align-items: start;
}

.st-page-row--full {
    grid-template-columns: minmax(0, 1fr);
}

.st-page-main {
    min-width: 0;
}

.st-page-row:not(.st-page-row--full) .st-page-main {
    border-left: 1px solid var(--hlps-line);
    padding-left: clamp(14px, 1.6vw, 26px);
}

/* Source `.entry-title`: bold green, oversized (4.2rem desktop / 2.7rem
   mobile — scaled down a notch here so long titles survive). */
.st-page-title {
    font-family: var(--hlps-font);
    font-weight: 800;
    font-size: clamp(1.9rem, 4vw, 2.9rem);
    line-height: 1.15;
    color: var(--hlps-green);
    margin: 0 0 20px;
}

/* --------------------------------------------------------------------------
   Interior page body — the migrated WordPress content: plain paragraphs,
   lists, tables and images with no classes of its own.
   -------------------------------------------------------------------------- */

.st-page-body {
    font-size: 16px;
    line-height: 1.75;
}

.st-page-body p {
    margin: 0 0 14px;
    text-align: justify;
}

.st-page-body h2,
.st-page-body h3,
.st-page-body h4 {
    font-family: var(--hlps-font);
    font-weight: 700;
    color: var(--hlps-green);
    margin: 22px 0 10px;
}

.st-page-body h2 { font-size: 24px; }
.st-page-body h3 { font-size: 20px; }
.st-page-body h4 { font-size: 17px; }

.st-page-body ul,
.st-page-body ol {
    margin: 0 0 14px;
    padding-left: 24px;
}

.st-page-body li {
    margin: 6px 0;
    text-align: justify;
}

.st-page-body ul li::marker {
    color: var(--hlps-green);
}

.st-page-body img {
    max-width: 100%;
    height: auto;
    background: #fff;
    border: 1px solid var(--hlps-line);
    padding: 3px;
}

/* Source tables carry width/border attributes; normalise them so they stay
   inside the column and pick up the theme's rules. */
.st-page-body table {
    width: 100% !important;
    max-width: 100%;
    border-collapse: collapse;
    margin: 0 0 16px;
    font-size: 14px;
}

.st-page-body th,
.st-page-body td {
    border: 1px solid var(--hlps-line);
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}

.st-page-body th {
    background: #eefaf3;
    color: var(--hlps-green-dark);
    font-weight: 700;
}

.st-page-body .st-table-scroll {
    overflow-x: auto;
}

.st-page-body a {
    color: var(--hlps-blue);
}

.st-page-body iframe {
    max-width: 100%;
    border: 0;
}

/* --------------------------------------------------------------------------
   Sidebar panels (used only when a page opts back into ShowSidebar)
   -------------------------------------------------------------------------- */

.st-page-aside {
    min-width: 0;
}

.st-page-aside__gallery {
    margin-top: 26px;
}

.st-noticeboard__title {
    font-family: var(--hlps-font);
    font-weight: 700;
    font-size: 18px;
    color: var(--hlps-orange);
    margin: 0 0 10px;
}

.st-noticeboard__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 26px;
    gap: 8px;
}

.st-noticeboard__arrows {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.st-noticeboard__viewport {
    max-height: 200px;
    overflow: hidden;
    scroll-behavior: smooth;
}

.st-noticeboard__viewport--tall {
    max-height: 300px;
}

.st-noticeboard__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.st-noticeboard__item {
    margin: 10px 0 0;
}

.st-noticeboard__link {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--hlps-ink);
    border-bottom: 1px dashed var(--hlps-line);
    padding: 0 0 10px;
}

.st-noticeboard__link:hover {
    color: var(--hlps-green);
}

.st-noticeboard__date {
    display: block;
    font-weight: normal;
    font-size: 12px;
    color: var(--hlps-orange);
    margin: 10px 0;
}

.st-noticeboard__empty {
    font-size: 13px;
    color: var(--hlps-muted);
}

.st-noticeboard__scroll {
    width: 26px;
    height: 26px;
    border: 0;
    background: none;
    padding: 0;
    cursor: pointer;
    color: var(--hlps-muted);
    line-height: 1;
    font-size: 20px;
}

.st-noticeboard__scroll:hover {
    color: var(--hlps-green);
}

.st-more {
    display: block;
    margin: 10px 0;
    text-align: right;
    font-size: 13px;
    color: var(--hlps-blue);
}

.st-panel {
    border: 1px solid var(--hlps-line);
    background: #fff;
}

.st-panel__head {
    font-family: var(--hlps-font);
    font-weight: 700;
    font-size: 17px;
    color: var(--hlps-green);
    padding: 10px 14px 6px;
    margin: 0;
}

.st-panel__body {
    padding: 0 14px 12px;
    font-size: 13px;
    line-height: 1.65;
}

.st-gallery__head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    background: var(--hlps-green);
    color: #fff;
    padding: 8px 14px;
    font-family: var(--hlps-font);
    font-weight: 600;
    font-size: 16px;
}

.st-gallery__head-sep {
    opacity: .6;
}

.st-theme .st-gallery__head a.st-gallery__viewall {
    font-size: 12px;
    color: #fff;
    text-decoration: underline;
}

.st-gallery__body {
    position: relative;
    padding: 12px;
}

.st-gallery__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc(50% - 5px);
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.st-gallery__track::-webkit-scrollbar {
    display: none;
}

.st-gallery__track img {
    display: block;
    width: 100%;
    height: auto;
}

.st-gallery__track > a {
    align-self: start;
    display: block;
}

.st-gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 0;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.st-gallery__nav:hover {
    background: rgba(0, 0, 0, .78);
}

.st-gallery__nav--prev { left: 16px; }
.st-gallery__nav--next { right: 16px; }

.st-gallery__empty {
    font-size: 13px;
    color: var(--hlps-muted);
    padding: 4px 2px 8px;
}

/* --------------------------------------------------------------------------
   Footer — plain light band with a centred copyright line
   -------------------------------------------------------------------------- */

.st-footer {
    background: var(--hlps-band);
    border-top: 3px solid var(--hlps-green);
    font-family: var(--hlps-font);
    font-size: 14px;
    color: var(--hlps-ink);
    padding: 18px 0;
}

.st-footer a {
    color: var(--hlps-blue);
    text-decoration: none;
}

.st-footer a:hover {
    text-decoration: underline;
}

.st-footer .small.text-secondary {
    color: var(--hlps-ink) !important;
    font-size: 13px;
}

/* MainLayout wraps the footer content in .container-fluid — pull it into the
   same centred column as the rest of the page. */
.st-footer .container-fluid {
    max-width: var(--hlps-wrap);
    padding: 0 var(--hlps-gutter);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    /* Nav drops under the lockup before it gets cramped */
    .hlps-header .page-content > .st-wrap {
        flex: 1 1 100%;
    }

    .st-nav__list {
        justify-content: flex-start;
    }

    .st-nav__link {
        padding: 14px 12px;
    }

    .st-nav__inner {
        padding: 0 var(--hlps-gutter);
    }
}

@media (max-width: 900px) {
    .st-page-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .st-page-row:not(.st-page-row--full) .st-page-main {
        order: -1;
        border-left: 0;
        padding-left: 0;
    }

    .st-header__inner {
        justify-content: center;
    }

    /* Nav collapses behind the burger */
    .st-nav__burger {
        display: flex;
    }

    .st-nav__list {
        display: none;
        flex-direction: column;
        padding-bottom: 8px;
    }

    .st-nav__toggle:checked ~ .st-nav__list {
        display: flex;
    }

    .st-nav__item {
        border-top: 1px solid var(--hlps-line);
    }

    .st-nav__item:first-child {
        border-top: 0;
    }

    .st-nav__link {
        line-height: 1.2;
        padding: 12px;
        text-align: left;
    }

    /* Submenus stack inline on small screens instead of parking off-screen */
    .st-nav__sub {
        position: static;
        left: auto;
        min-width: 0;
        box-shadow: none;
        opacity: 1;
        transform: none;
        transition: none;
    }

    .st-nav__sub .st-nav__link {
        padding-left: 26px;
    }

    /* The desktop underline animation has no anchor point in the stacked menu */
    .st-nav__link::before {
        display: none;
    }

    .st-topbar__inner {
        justify-content: center;
        text-align: center;
    }
}
