/*
 * Mufa design system
 * One source for colours, radii, spacing, type and the shared components used by the inner pages.
 * Rules of thumb:
 *   - sharp corners: the --ds-radius-* tokens are 0 (kept as tokens so the shape can change in one place);
 *     only round icon buttons stay circles
 *   - Montserrat only, weights 300-600, normal case (no all-caps)
 *   - colour comes from the logo, used sparingly:
 *       ~85% neutral grounds, ~10% logo grey text, ~4% navy accent (buttons, links, active states),
 *       ~1% red / green only as tiny details (the brand mark next to eyebrows)
 */

:root {
    /* logo colours (measured from the logo file) */
    --brand-navy: #2F3D91;
    --brand-red: #E30613;
    --brand-green: #A1C639;
    --brand-grey: #575656;

    /* accent: navy, plus a darker step for hover */
    --ds-accent: var(--brand-navy);
    --ds-accent-dark: #232E6F;
    --ds-accent-tint: #EEF0F7;

    /* text: logo grey family */
    --ds-ink: #262626;
    --ds-ink-soft: rgba(38, 38, 38, 0.75);
    /* 0.68: secondary text still reads 4.5:1 on white and on the cream ground (WCAG AA) */
    --ds-muted: rgba(38, 38, 38, 0.68);

    /* grounds: neutral (no cream / beige) */
    --ds-cream: #F5F5F3;
    --ds-sand: #ECECE9;
    --ds-line: rgba(38, 38, 38, 0.08);

    /* legacy names kept so older rules keep working */
    --ds-walnut: var(--ds-accent);
    --ds-walnut-dark: var(--ds-accent-dark);

    /* shape: sharp corners everywhere (circles still use 50%) */
    --ds-radius-lg: 0;
    --ds-radius-md: 0;
    --ds-radius-pill: 0;

    /* type & motion */
    --ds-font: 'Montserrat', sans-serif;
    --ds-ease: cubic-bezier(0.16, 1, 0.3, 1);

    /* layout: the page gutter shared by navbar, sections and footer */
    --page-px: 10vw;
    --section-py: clamp(56px, 6vw, 96px);
}

@media (max-width: 1550px) {
    :root {
        --page-px: 5vw;
    }
}

@media (max-width: 1300px) {
    :root {
        --page-px: 3.5vw;
    }
}

@media (max-width: 991px) {
    :root {
        --page-px: 20px;
    }
}

@media (max-width: 576px) {
    :root {
        --page-px: 16px;
    }
}

/* ---------- Layout ---------- */

.ds-container {
    width: 100%;
    padding-left: var(--page-px);
    padding-right: var(--page-px);
    box-sizing: border-box;
}

.ds-section {
    padding-top: var(--section-py);
    padding-bottom: var(--section-py);
    /* explicit: the legacy style.css paints the page grey */
    background-color: #ffffff;
    font-family: var(--ds-font);
    color: var(--ds-ink);
}

.ds-section--tight {
    padding-top: calc(var(--section-py) * 0.6);
    padding-bottom: calc(var(--section-py) * 0.6);
}

.ds-section--flush-top {
    padding-top: 0;
}

.ds-section--cream {
    background-color: var(--ds-cream);
}

.ds-section--warm {
    background: linear-gradient(180deg, #ffffff 0%, #F8F8F6 60%, var(--ds-cream) 100%);
}

/* ---------- Type ---------- */

.ds-eyebrow {
    display: inline-block;
    margin-bottom: 16px;
    font-family: var(--ds-font);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--ds-accent);
}

.ds-heading {
    margin: 0;
    font-family: var(--ds-font);
    font-size: clamp(1.9rem, 3vw, 2.8rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: var(--ds-ink);
}

.ds-heading--sm {
    font-size: clamp(1.5rem, 2.2vw, 2rem);
}

.ds-lead {
    margin: 0;
    font-family: var(--ds-font);
    font-size: clamp(1.05rem, 1.3vw, 1.2rem);
    font-weight: 400;
    line-height: 1.7;
    color: var(--ds-ink-soft);
}

/* rich text coming from the admin editor */
.ds-prose {
    font-family: var(--ds-font);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.85;
    color: var(--ds-ink-soft);
}

.ds-prose > *:first-child {
    margin-top: 0;
}

.ds-prose p {
    margin: 0 0 1.2em;
}

/* the opening paragraph reads as a lead */
.ds-prose > p:first-child {
    font-size: clamp(1.15rem, 1.35vw, 1.3rem);
    line-height: 1.7;
    color: var(--ds-ink);
}

.ds-prose h2,
.ds-prose h3,
.ds-prose h4 {
    margin: 1.6em 0 0.6em;
    font-weight: 500;
    line-height: 1.3;
    color: var(--ds-ink);
}

.ds-prose strong,
.ds-prose b {
    font-weight: 600;
    color: var(--ds-ink);
}

.ds-prose a {
    color: var(--ds-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ds-prose a:hover {
    color: var(--ds-accent-dark);
}

.ds-prose ul,
.ds-prose ol {
    margin: 0 0 1.2em;
    padding-left: 1.2em;
}

.ds-prose li {
    margin-bottom: 0.5em;
}

/* ---------- Buttons ---------- */

.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 50px;
    padding: 0 26px;
    border: 1px solid transparent;
    border-radius: var(--ds-radius-pill);
    font-family: var(--ds-font);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.ds-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    transition: transform 0.35s var(--ds-ease);
}

.ds-btn:hover svg {
    transform: translate(2px, -2px);
}

.ds-btn--primary {
    background-color: var(--ds-accent);
    color: #ffffff;
}

.ds-btn--primary:hover {
    background-color: var(--ds-accent-dark);
    color: #ffffff;
}

.ds-btn--outline {
    border-color: rgba(38, 38, 38, 0.25);
    color: var(--ds-ink);
}

.ds-btn--outline:hover {
    background-color: var(--ds-ink);
    border-color: var(--ds-ink);
    color: #ffffff;
}

/* on dark / navy backgrounds */
.ds-btn--light {
    background-color: #ffffff;
    color: var(--ds-ink);
}

.ds-btn--light:hover {
    background-color: var(--ds-cream);
    color: var(--ds-accent);
}

.ds-btn--ghost-light {
    border-color: rgba(255, 255, 255, 0.45);
    color: #ffffff;
}

.ds-btn--ghost-light:hover {
    background-color: #ffffff;
    border-color: #ffffff;
    color: var(--ds-ink);
}

/* ---------- Page header (inner pages) ----------
   A medium banner: page title, and right under it a plain breadcrumb (home icon › section › page). */

.ds-page-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: clamp(340px, 46vh, 460px);
    overflow: hidden;
    background-color: #0c151e;
    font-family: var(--ds-font);
    color: #ffffff;
}

.ds-page-hero__media {
    position: absolute;
    inset: 0;
}

.ds-page-hero__media img,
.ds-page-hero__media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* even darkening so the title and the breadcrumb read on any photo */
.ds-page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, rgba(12, 21, 30, 0.45) 0%, rgba(12, 21, 30, 0) 30%),
        linear-gradient(to top, rgba(12, 21, 30, 0.62) 0%, rgba(12, 21, 30, 0.38) 100%);
    pointer-events: none;
}

.ds-page-hero__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 130px var(--page-px) clamp(40px, 6vh, 64px);
}

.ds-page-hero__title {
    max-width: 900px;
    margin: 0 0 20px;
    font-size: clamp(2.2rem, 3.8vw, 3.5rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.5px;
    color: #ffffff;
}

/* long titles (news, products) step down so they stay within two or three lines */
.ds-page-hero__title--long {
    max-width: 1000px;
    font-size: clamp(1.8rem, 2.8vw, 2.6rem);
    line-height: 1.25;
}

.ds-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.78);
}

.ds-crumbs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    transition: color 0.3s ease;
}

.ds-crumbs a:hover {
    color: #ffffff;
}

.ds-crumbs-home svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    margin-top: -2px;
}

.ds-crumbs-sep {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    stroke: rgba(255, 255, 255, 0.5);
}

.ds-crumbs [aria-current] {
    color: #ffffff;
}

@media (max-width: 767px) {
    .ds-page-hero {
        min-height: 300px;
    }

    .ds-page-hero__inner {
        padding-top: 110px;
        padding-bottom: 36px;
    }

    .ds-page-hero__title {
        margin-bottom: 14px;
    }

    .ds-crumbs {
        font-size: 13.5px;
    }

    /* phones: the home icon alone is enough */
    .ds-crumbs-home span {
        display: none;
    }
}

/* above-the-fold intro: CSS only (no wait for scripts), opacity only, after the font is in */
@media (prefers-reduced-motion: no-preference) {
    .ds-page-hero__media {
        transform: scale(1.06);
        transition: transform 2.4s var(--ds-ease);
    }

    .fonts-ready .ds-page-hero__media {
        transform: scale(1);
    }

    .ds-crumbs,
    .ds-page-hero__title {
        opacity: 0;
    }

    .fonts-ready .ds-page-hero__title,
    .fonts-ready .ds-crumbs {
        animation: dsFadeIn 1s cubic-bezier(0.33, 1, 0.68, 1) both;
    }

    .fonts-ready .ds-crumbs {
        animation-delay: 0.15s;
    }
}

@keyframes dsFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ---------- Sub navigation (sibling pages) ---------- */

.ds-subnav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-top: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--ds-line);
    background-color: #ffffff;
    scrollbar-width: none;
    font-family: var(--ds-font);
}

.ds-subnav::-webkit-scrollbar {
    display: none;
}

.ds-subnav a {
    flex-shrink: 0;
    padding: 11px 20px;
    border-radius: var(--ds-radius-pill);
    font-size: 14px;
    font-weight: 500;
    color: var(--ds-ink-soft);
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.ds-subnav a:hover {
    background-color: var(--ds-cream);
    color: var(--ds-accent);
}

.ds-subnav a[aria-current="page"] {
    background-color: var(--ds-ink);
    color: #ffffff;
}

/* ---------- Cards ---------- */

.ds-media {
    position: relative;
    overflow: hidden;
    border-radius: var(--ds-radius-lg);
    background-color: var(--ds-sand);
}

.ds-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s var(--ds-ease);
}

.ds-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    color: var(--ds-ink);
    text-decoration: none;
    font-family: var(--ds-font);
}

.ds-card:hover {
    color: var(--ds-ink);
}

.ds-card:hover .ds-media img {
    transform: scale(1.05);
}

.ds-card__title {
    margin: 0;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.ds-card:hover .ds-card__title {
    color: var(--ds-accent);
}

.ds-card__text {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: var(--ds-muted);
}

.ds-card__more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ds-accent);
}

.ds-card__more i {
    font-size: 11px;
    transition: transform 0.3s var(--ds-ease);
}

.ds-card:hover .ds-card__more i {
    transform: translateX(4px);
}

/* ---------- Call to action band ---------- */

.ds-cta {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
    overflow: hidden;
    padding: clamp(40px, 5vw, 64px);
    border-radius: 0;
    background-color: var(--ds-accent);
    color: #ffffff;
    font-family: var(--ds-font);
}

.ds-cta__title {
    margin: 0 0 10px;
    font-size: clamp(1.7rem, 2.6vw, 2.4rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.ds-cta__text {
    margin: 0;
    max-width: 520px;
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
}

.ds-cta__actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ds-cta__grain {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.5;
}

.ds-cta > div {
    position: relative;
    z-index: 1;
}

/* ---------- Brand mark ----------
   Three short bars in the logo colours; the only place red and green appear.
   Use as <span class="ds-mark"></span> before an eyebrow, or via .ds-eyebrow--mark. */
.ds-mark,
.ds-eyebrow--mark::before {
    display: inline-block;
    flex-shrink: 0;
    width: 30px;
    height: 3px;
    border-radius: 0;
    background: linear-gradient(90deg,
            var(--brand-navy) 0 33.33%,
            var(--brand-red) 33.33% 66.66%,
            var(--brand-green) 66.66% 100%);
    vertical-align: middle;
}

.ds-eyebrow--mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.ds-eyebrow--mark::before {
    content: '';
}

/* ---------- Legacy page containers ----------
   Older pages still use Bootstrap's fixed-width .container; tie it to the shared page gutter
   so their content lines up with the navbar, the banner and the footer at every width. */
main .container {
    width: 100%;
    max-width: none;
    padding-left: var(--page-px);
    padding-right: var(--page-px);
}

/* long legal / policy texts: keep lines readable on wide screens (still starts on the page gutter) */
main .ca-about-content-3 {
    max-width: 880px;
}
