/* ===========================================================================
 * Scout Edu Hub theme — youthful, playful, mobile-first.
 *
 * Brand: the four logo colours — teal-green (#008556, the SEH wordmark),
 * orange (#FF6B00), yellow (#F7BE00) and lime (#93D500). Rounded everything,
 * bouncy hovers, friendly type (Fredoka headings over Nunito body) and a
 * four-colour stripe that bookends the page in place of a folk ribbon.
 *
 * Brand colours come per-site from theme_config as CSS custom properties
 * (--seh-primary / --seh-secondary / --seh-accent2 / --seh-accent3, injected
 * in base_site.html). Everything keys off those so one Site config change
 * re-skins the whole site.
 * ========================================================================= */

:root {
    --seh-primary: #008556;   /* teal-green */
    --seh-secondary: #FF6B00; /* orange */
    --seh-accent2: #F7BE00;   /* yellow */
    --seh-accent3: #93D500;   /* lime */

    /* Derived tokens (fall back gracefully where color-mix is unsupported) */
    --seh-primary-dark: color-mix(in srgb, var(--seh-primary) 82%, black);
    --seh-primary-soft: color-mix(in srgb, var(--seh-primary) 8%, white);
    --seh-secondary-dark: color-mix(in srgb, var(--seh-secondary) 85%, black);
    --seh-ink: #243027;
    --seh-muted: #5f6f66;
    --seh-paper: #ffffff;
    --seh-line: #e4ece7;
}

/* --- Base ---------------------------------------------------------------- */
body.seh {
    font-family: "Nunito", system-ui, -apple-system, sans-serif;
    color: var(--seh-ink);
    background: var(--seh-paper);
}

body.seh h1,
body.seh h2,
body.seh h3,
body.seh .seh-brand-text {
    font-family: "Baloo 2", "Nunito", system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: -0.005em;
}

body.seh a {
    color: var(--seh-primary);
    text-underline-offset: 2px;
}

body.seh a:hover {
    color: var(--seh-primary-dark);
}

body.seh .text-secondary-accent {
    color: var(--seh-secondary) !important;
}

/* --- Buttons ------------------------------------------------------------- *
 * `body.seh a` (0,1,2) outweighs Bootstrap's `.btn { color: var(--bs-btn-color) }`
 * (0,1,0), so anchor-buttons lose their variant text colour. Restore it. */
body.seh a.btn {
    color: var(--bs-btn-color);
}

body.seh a.btn:hover,
body.seh a.btn:focus {
    color: var(--bs-btn-hover-color);
}

/* Bouncy, rounded buttons across the board */
body.seh .btn {
    border-radius: 999px;
    padding-inline: 1.5rem;
    font-weight: 700;
    transition: transform 0.12s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

body.seh .btn:hover {
    transform: translateY(-2px);
}

body.seh .btn-primary {
    --bs-btn-bg: var(--seh-primary);
    --bs-btn-border-color: var(--seh-primary);
    --bs-btn-hover-bg: var(--seh-primary-dark);
    --bs-btn-hover-border-color: var(--seh-primary-dark);
    --bs-btn-active-bg: var(--seh-primary-dark);
    --bs-btn-disabled-bg: var(--seh-primary);
    --bs-btn-disabled-border-color: var(--seh-primary);
}

/* Accent CTA = orange (the "do it now" button) */
body.seh .btn-accent {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--seh-secondary);
    --bs-btn-border-color: var(--seh-secondary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--seh-secondary-dark);
    --bs-btn-hover-border-color: var(--seh-secondary-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--seh-secondary-dark);
    box-shadow: 0 6px 0 0 color-mix(in srgb, var(--seh-secondary) 60%, black);
}

body.seh .btn-accent:hover,
body.seh .btn-accent:focus {
    box-shadow: 0 4px 0 0 color-mix(in srgb, var(--seh-secondary) 60%, black);
}

/* Secondary CTA on the hero: white outline on the photo, fills white on hover. */
body.seh .btn-outline-light {
    --bs-btn-color: #fff;
    --bs-btn-border-color: rgba(255, 255, 255, 0.9);
    --bs-btn-hover-color: var(--seh-primary);
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-border-color: #fff;
    --bs-btn-active-color: var(--seh-primary);
    --bs-btn-active-bg: #fff;
}

/* --- Header / nav -------------------------------------------------------- */
.seh-header {
    background: var(--seh-primary);
    color: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.seh-header .navbar {
    padding-block: 0.6rem;
    --bs-navbar-color: rgba(255, 255, 255, 0.9);
    --bs-navbar-hover-color: #fff;
    --bs-navbar-active-color: #fff;
}

.seh-header .navbar-brand,
.seh-header .navbar-text {
    color: #fff;
}

.seh-header .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
}

.seh-header .navbar-nav .nav-link.active,
.seh-header .navbar-nav .nav-link:hover,
.seh-header .navbar-nav .nav-link:focus {
    color: #fff;
}

.seh-header .nav-link {
    font-weight: 700;
    position: relative;
    font-size: 0.95rem;
    padding-inline: 0.6rem;
}

/* Playful multi-colour underline on hover/active nav items (not on
   dropdown toggles, so Bootstrap's caret survives). */
.seh-header .navbar-nav:not(.seh-lang-switch) .nav-link:not(.dropdown-toggle)::after {
    content: "";
    position: absolute;
    left: 0.55rem;
    right: 0.55rem;
    bottom: 0.1rem;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--seh-accent3), var(--seh-accent2), var(--seh-secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.18s ease;
}

.seh-header .navbar-nav:not(.seh-lang-switch) .nav-link:not(.dropdown-toggle):hover::after,
.seh-header .navbar-nav:not(.seh-lang-switch) .nav-link.active:not(.dropdown-toggle)::after {
    transform: scaleX(1);
}

/* --- Dropdown submenus --------------------------------------------------- */
.seh-dropdown {
    --bs-dropdown-link-active-bg: var(--seh-primary);
    --bs-dropdown-link-hover-bg: var(--seh-primary-soft);
    --bs-dropdown-link-hover-color: var(--seh-primary-dark);
    border: 1px solid var(--seh-line);
    border-radius: 0.9rem;
    box-shadow: 0 10px 28px rgba(0, 80, 50, 0.14);
    padding-block: 0.35rem;
}

.seh-dropdown .dropdown-item {
    font-size: 0.95rem;
    padding-block: 0.4rem;
    font-weight: 600;
}

/* Collapsed (mobile) navbar: inline submenu on the coloured header. */
@media (max-width: 991.98px) {
    .seh-header .seh-dropdown {
        background: transparent;
        border: 0;
        box-shadow: none;
        padding-left: 1rem;
    }
    .seh-header .seh-dropdown .dropdown-item {
        color: rgba(255, 255, 255, 0.9);
    }
    .seh-header .seh-dropdown .dropdown-item:hover,
    .seh-header .seh-dropdown .dropdown-item:focus {
        background: transparent;
        color: #fff;
    }
}

.seh-logo {
    height: 48px;
    width: auto;
    display: block;
}

.seh-brand-text {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.05;
}

.seh-header .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.45);
}

.seh-header .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.95)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.4' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Language switcher — uppercase pills, divider on desktop */
.seh-lang-switch {
    flex-direction: row;
    gap: 0.1rem;
    align-items: center;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    padding-left: 0.75rem;
    margin-left: 0.5rem;
}

.seh-lang-switch .nav-link {
    padding: 0.2rem 0.45rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    opacity: 0.78;
}

.seh-lang-switch .nav-link.active {
    opacity: 1;
}

@media (max-width: 991.98px) {
    .seh-lang-switch {
        border-left: 0;
        padding-left: 0;
        margin-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.28);
        padding-top: 0.5rem;
        margin-top: 0.5rem;
    }
}

/* --- Hero ---------------------------------------------------------------- */
.seh-hero {
    position: relative;
    color: #fff;
    background: var(--seh-primary);
    overflow: hidden;
}

.seh-hero--image {
    background-size: cover;
    background-position: center;
}

/* Readability scrim over photos + brand tint */
.seh-hero--image::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(15, 50, 35, 0.2), rgba(15, 50, 35, 0.66)),
        linear-gradient(90deg, color-mix(in srgb, var(--seh-primary) 55%, transparent), transparent);
}

/* Floating brand "bubble" — a playful blob behind the hero copy. */
.seh-hero::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 220px;
    height: 220px;
    border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
    background: var(--seh-accent2);
    opacity: 0.28;
    z-index: 0;
    pointer-events: none;
}

.seh-hero__inner {
    position: relative;
    z-index: 1;
    padding-block: clamp(3.5rem, 9vw, 7rem);
    max-width: 740px;
}

.seh-hero h1 {
    font-size: clamp(2.2rem, 5.2vw, 3.7rem);
    font-weight: 600;
    line-height: 1.04;
    margin-bottom: 1rem;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
}

.seh-hero p {
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    opacity: 0.97;
    max-width: 54ch;
}

/* --- Section rhythm ------------------------------------------------------ */
.seh-section {
    padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.seh-section--soft {
    background: var(--seh-primary-soft);
}

.seh-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--seh-secondary);
}

.seh-section-title {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    margin-bottom: 0.25rem;
}

/* Multi-colour accent rule under interior page titles */
body.seh .seh-prose > h1:first-child::after,
body.seh main .seh-page-title::after {
    content: "";
    display: block;
    width: 3.4rem;
    height: 5px;
    margin-top: 0.6rem;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--seh-accent3), var(--seh-accent2), var(--seh-secondary));
}

/* --- Cards --------------------------------------------------------------- */
body.seh .card {
    border: 1px solid var(--seh-line);
    border-radius: 1.25rem;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.16s ease, transform 0.16s ease;
}

body.seh .card:hover {
    box-shadow: 0 0.8rem 1.8rem rgba(0, 110, 70, 0.16);
    transform: translateY(-4px);
}

body.seh .card-img-top {
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

/* Pin/recommended badge picks up the sunny accent */
body.seh .badge.bg-warning-subtle {
    background: color-mix(in srgb, var(--seh-accent2) 35%, white) !important;
    color: var(--seh-primary-dark) !important;
}

/* --- Prose --------------------------------------------------------------- */
.seh-prose {
    font-size: 1.07rem;
    line-height: 1.7;
}

.seh-prose img {
    border-radius: 0.9rem;
}

/* --- Page body (StreamField) -------------------------------------------- */
.static-body,
.article-body {
    text-align: justify;
    hyphens: auto;
}

.static-body img,
.article-body img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0.9rem;
}

.static-body > * + *,
.article-body > * + * {
    margin-top: 1.5rem;
}

.static-body h2,
.static-body h3,
.static-body .rich-text h2,
.static-body .rich-text h3,
.article-body h2,
.article-body h3,
.article-body .rich-text h2,
.article-body .rich-text h3 {
    text-align: left;
    margin-top: 2.25rem;
    margin-bottom: 0.5rem;
}

.static-body .rich-text > :first-child,
.article-body .rich-text > :first-child {
    margin-top: 0;
}

/* --- Four-colour stripe (brand trim) ------------------------------------- *
 * The SEH "clover" palette as a candy stripe, used to bookend the page in
 * place of nocrich's folk ribbon: under the header, above the footer, and as
 * the bottom edge of the hero. Pure CSS — no asset needed. */
.seh-ribbon {
    height: 0.6rem;
    background: linear-gradient(
        90deg,
        var(--seh-accent3) 0 25%,
        var(--seh-accent2) 25% 50%,
        var(--seh-secondary) 50% 75%,
        var(--seh-primary) 75% 100%
    );
}

.seh-ribbon--header {
    height: 0.5rem;
}

.seh-ribbon--footer {
    height: 0.6rem;
}

/* Bottom of the hero: sits above the scrim so the colours read true. */
.seh-ribbon--hero {
    position: relative;
    z-index: 1;
    height: 0.7rem;
}

@media (max-width: 575.98px) {
    .seh-ribbon { height: 0.5rem; }
}

/* --- Footer -------------------------------------------------------------- */
.seh-footer {
    background: var(--seh-primary);
    color: rgba(255, 255, 255, 0.88);
    border-top: 0;
}

body.seh .seh-footer a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

body.seh .seh-footer a:hover {
    color: #fff;
    opacity: 0.82;
}

/* ONCR attribution: monochrome (white) logo + name, links to scout.ro.
   Override the footer link underline — it reads as a brand lockup, not a text link. */
body.seh .seh-footer-oncr,
body.seh .seh-footer-oncr:hover {
    text-decoration: none;
    color: #fff;
}

body.seh .seh-footer-oncr {
    opacity: 0.92;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.16s ease;
}

body.seh .seh-footer-oncr:hover {
    opacity: 1;
}

body.seh .seh-footer-oncr img {
    height: 36px;
    width: auto;
}

/* --- Inline edit button (signed-in editors only) ------------------------- *
 * Scoped under body.seh so these win over the generic `body.seh a` link
 * colour — otherwise the icon + label render in the link colour on the pill. */
body.seh .seh-edit-fab {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1030;
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: var(--seh-secondary);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    transition: transform 0.12s ease, background-color 0.16s ease;
}

body.seh .seh-edit-fab:hover,
body.seh .seh-edit-fab:focus {
    background: var(--seh-secondary-dark);
    color: #fff;
    transform: translateY(-2px);
}
