/* ============================================================
   UDM v2 Design System  ·  udm-design.css
   Foundational tokens, typography, buttons, forms & utilities.
   Section-specific styles (hero, mega menu, panels, …) are layered
   on top of this vocabulary by the layout and home-page partials.

   Brand red (#D3000F) is the standout action colour site-wide.
   Seasonal themes override the --udm-* custom properties below
   (see udm-theme.* / the server-side theme engine); every rule here
   reads those variables, so a theme switch re-colours everything.
   ============================================================ */

:root {
    /* ---- Brand palette (default / permanent UDM theme) ---- */
    --udm-primary: #D3000F;        /* UDM red — the standout colour */
    --udm-primary-dark: #7E0009;   /* hover / pressed red */
    --udm-primary-ink: #FFFFFF;    /* text on red */

    --udm-accent: #F2B705;         /* party gold */
    --udm-accent-soft: #F2D27A;
    --udm-accent-ink: #1E1414;     /* text on gold */

    --udm-night: #2A0D10;          /* dark brand backdrop */
    --udm-ink: #1E1414;            /* primary text */
    --udm-muted: #6E6262;          /* secondary text */
    --udm-muted-2: #5E5252;

    --udm-white: #FFFFFF;
    --udm-surface: #F6F2F0;        /* light section background */
    --udm-surface-2: #F4EFED;      /* chips / inset panels */
    --udm-border: #E9E3E1;         /* hairlines on light */
    --udm-border-strong: #DDD5D3;

    --udm-whatsapp: #1FA855;       /* WhatsApp / M-Pesa success green */

    /* ---- Theme hooks (overridden by the seasonal theme engine) ---- */
    --udm-ribbon-bg: var(--udm-night);
    --udm-ribbon-ink: #FFFFFF;
    --udm-media-filter: none;      /* e.g. grayscale(1) for mourning */

    /* ---- Shape & motion ---- */
    --udm-radius: 18px;
    --udm-radius-sm: 12px;
    --udm-radius-pill: 999px;
    --udm-shadow-sm: 0 1px 0 rgba(30, 20, 20, .08);
    --udm-shadow: 0 10px 24px rgba(0, 0, 0, .18);
    --udm-shadow-lg: 0 30px 60px rgba(30, 20, 20, .14);
    --udm-ease: cubic-bezier(.2, .8, .2, 1);

    /* ---- Layout ---- */
    --udm-wrap: 1320px;
    --udm-wrap-pad: 40px;
    --udm-header-h: 84px;

    /* ---- Legacy aliases ----
       Older pages/components reference these names. Pointing them at the
       new tokens shifts the whole site to the v2 red/gold in one move.
       (Task #19 removes the legacy names once pages are migrated.) */
    --udm-red: var(--udm-primary);
    --udm-dark: var(--udm-night);
    --udm-text: var(--udm-ink);
    --udm-accent-2: #B8860B;
    --udm-green: var(--udm-whatsapp);
    --udm-dark-2: #1E1414;
    --udm-bg: var(--udm-surface);
}

/* ============================================================
   Fonts
   Archivo (variable) is the brand face. Loaded via <link> in the
   layout <head>; this @import is a fallback for standalone use.
   ============================================================ */
@font-face {
    /* intentionally empty — see layout <head> preconnect + <link> */
}

/* ============================================================
   Base
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body.udm-v2 {
    margin: 0;
    font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--udm-ink);
    background: var(--udm-white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Smooth in-page anchor scrolling, offset for the sticky header */
@media (prefers-reduced-motion: no-preference) {
    html:has(body.udm-v2) {
        scroll-behavior: smooth;
    }
}

html:has(body.udm-v2) {
    scroll-padding-top: 110px;
}

/* Default link colour for prose. Chrome containers (utility bar,
   header, drawer, footer) each re-declare their own `a` colour in
   udm-layout.css, which loads after this file and so wins the tie. */
.udm-v2 a {
    color: var(--udm-primary);
}

.udm-v2 a:hover {
    color: var(--udm-primary-dark);
}

.udm-v2 button {
    font-family: inherit;
    cursor: pointer;
    color: inherit;
}

.udm-v2 img {
    max-width: 100%;
}

.udm-v2 :focus-visible {
    outline: 3px solid var(--udm-accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ============================================================
   Layout helpers
   ============================================================ */
.udm-wrap {
    max-width: var(--udm-wrap);
    margin: 0 auto;
    padding: 0 var(--udm-wrap-pad);
}

.udm-section {
    padding: 120px 0;
}

.udm-section--tight {
    padding: 80px 0;
}

/* Pull the section up close to the hero above it */
.udm-section--snug-top {
    padding-top: 40px;
}
@media (max-width: 575.98px) {
    .udm-section--snug-top {
        padding-top: 28px;
    }
}

.udm-section--night {
    background: var(--udm-night);
    color: var(--udm-white);
}

.udm-section--surface {
    background: var(--udm-surface);
}

/* A section header row: big title left, action(s) right. */
.udm-sechead {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 44px;
}

/* ============================================================
   Typography
   .udm-x  — heavy condensed display (hero / section titles)
   .udm-x2 — semi-condensed strong (sub-headings, card titles)
   ============================================================ */
.udm-x {
    font-family: 'Archivo', sans-serif;
    font-stretch: 118%;
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: .95;
    margin: 0;
    color: inherit; /* beat app.min.css heading colour; follow the container */
}

.udm-x2 {
    font-family: 'Archivo', sans-serif;
    font-stretch: 112%;
    font-weight: 700;
    letter-spacing: -.015em;
    line-height: 1.05;
    margin: 0;
    color: inherit; /* beat app.min.css heading colour; follow the container */
}

/* Fluid display sizes used across sections. */
.udm-display {
    font-size: clamp(56px, 8vw, 116px);
}

.udm-h2 {
    font-size: clamp(40px, 5.5vw, 72px);
}

.udm-h3 {
    font-size: clamp(26px, 3vw, 38px);
}

.udm-lead {
    font-size: clamp(22px, 2.4vw, 40px);
    line-height: 1.22;
    font-weight: 500;
    font-stretch: 105%;
    letter-spacing: -.015em;
}

.udm-muted {
    color: var(--udm-muted);
}

/* ============================================================
   Buttons
   ============================================================ */
.udm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 26px;
    border: 0;
    border-radius: var(--udm-radius-pill);
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    text-decoration: none;
    transition: transform .2s var(--udm-ease), box-shadow .2s var(--udm-ease), background .2s ease;
}

.udm-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--udm-shadow);
}

.udm-btn.udm-btn--sm {
    padding: 11px 20px;
    font-size: 15px;
}

.udm-btn.udm-btn--block {
    width: 100%;
}

/* Variants */
.udm-btn.udm-btn--primary {
    background: var(--udm-primary);
    color: var(--udm-primary-ink);
}

.udm-btn.udm-btn--primary:hover {
    color: var(--udm-primary-ink);
    background: var(--udm-primary-dark);
}

.udm-btn.udm-btn--accent {
    background: var(--udm-accent);
    color: var(--udm-accent-ink);
}

.udm-btn.udm-btn--accent:hover {
    color: var(--udm-accent-ink);
}

.udm-btn.udm-btn--dark {
    background: var(--udm-ink);
    color: var(--udm-white);
}

.udm-btn.udm-btn--dark:hover {
    color: var(--udm-white);
}

.udm-btn.udm-btn--soft {
    background: var(--udm-surface-2);
    color: var(--udm-ink);
}

.udm-btn.udm-btn--soft:hover {
    color: var(--udm-ink);
}

.udm-btn.udm-btn--whatsapp {
    background: var(--udm-whatsapp);
    color: var(--udm-white);
}

.udm-btn.udm-btn--whatsapp:hover {
    color: var(--udm-white);
}

/* Ghost / outline button for dark backgrounds */
.udm-btn.udm-btn--ghost {
    background: rgba(255, 255, 255, .12);
    color: var(--udm-white);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
}

.udm-btn.udm-btn--ghost:hover {
    color: var(--udm-white);
    background: rgba(255, 255, 255, .2);
}

/* Circular icon button (carousel arrows, lightbox controls) */
.udm-circ {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .45);
    background: rgba(255, 255, 255, .06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--udm-white);
    transition: background .2s ease;
}

.udm-circ:hover {
    background: rgba(255, 255, 255, .18);
}

/* [hidden] must win over the display above (used by lightbox arrows) */
.udm-circ[hidden] {
    display: none;
}

/* ============================================================
   Forms
   ============================================================ */
.udm-input {
    width: 100%;
    padding: 16px 18px;
    font-size: 17px;
    font-family: inherit;
    border: 1px solid var(--udm-border-strong);
    border-radius: var(--udm-radius-sm);
    background: var(--udm-white);
    color: var(--udm-ink);
}

.udm-input::placeholder {
    color: var(--udm-muted);
}

.udm-input--pill {
    border-radius: var(--udm-radius-pill);
    padding: 16px 20px;
}

.udm-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Pill toggle group (language, frequency, registration method) */
.udm-toggle {
    display: inline-flex;
    padding: 5px;
    border-radius: var(--udm-radius-pill);
    background: var(--udm-surface-2);
}

.udm-toggle__btn {
    border: 0;
    padding: 11px 20px;
    border-radius: var(--udm-radius-pill);
    font-weight: 700;
    font-size: 15px;
    background: transparent;
    color: var(--udm-ink);
    transition: background .2s ease, color .2s ease;
}

.udm-toggle__btn[aria-selected="true"],
.udm-toggle__btn[aria-pressed="true"] {
    background: var(--udm-ink);
    color: var(--udm-white);
}

/* ============================================================
   Cards & chips
   ============================================================ */
.udm-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--udm-radius-pill);
    font-size: 14px;
    font-weight: 600;
    background: var(--udm-surface-2);
    color: var(--udm-ink);
}

/* Media frame: image cover + hover zoom, used by photo/video tiles. */
.udm-frame {
    position: relative;
    overflow: hidden;
    border-radius: var(--udm-radius);
    background: var(--udm-night);
    display: block;
    color: var(--udm-white);
}

.udm-frame > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .9s ease;
    filter: var(--udm-media-filter);
}

.udm-frame:hover > img {
    transform: scale(1.05);
}

/* ============================================================
   Utilities
   ============================================================ */
.udm-stack > * + * {
    margin-top: var(--udm-stack-gap, 16px);
}

.udm-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.udm-flag-stripe {
    height: 6px;
    display: flex;
    flex-direction: column;
}
.udm-flag-stripe > i { display: block; }
.udm-flag-stripe > i:nth-child(1) { flex: 3; background: #000000; }
.udm-flag-stripe > i:nth-child(2) { flex: 1; background: #FFFFFF; }
.udm-flag-stripe > i:nth-child(3) { flex: 3; background: #BB0000; }
.udm-flag-stripe > i:nth-child(4) { flex: 1; background: #FFFFFF; }
.udm-flag-stripe > i:nth-child(5) { flex: 3; background: #006600; }

/* ============================================================
   Responsive container padding
   ============================================================ */
@media (max-width: 1080px) {
    :root {
        --udm-wrap-pad: 28px;
    }

    .udm-section {
        padding: 80px 0;
    }
}

@media (max-width: 640px) {
    :root {
        --udm-wrap-pad: 18px;
    }

    .udm-section {
        padding: 64px 0;
    }

    .udm-btn {
        padding: 14px 22px;
    }
}

/* ============================================================
   Scroll reveal (progressive enhancement; JS adds .is-in)
   ============================================================ */
/* Hiding is gated behind .udm-js (set early in <head>) so content stays
   visible if JavaScript is disabled or fails. */
.udm-js [data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .7s var(--udm-ease), transform .7s var(--udm-ease);
    will-change: opacity, transform;
}

.udm-js [data-reveal].is-in {
    opacity: 1;
    transform: none;
}

/* Staggered children (e.g. grids of cards) */
.udm-js [data-reveal-stagger] > * {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .6s var(--udm-ease), transform .6s var(--udm-ease);
}

.udm-js [data-reveal-stagger].is-in > * {
    opacity: 1;
    transform: none;
}

[data-reveal-stagger].is-in > *:nth-child(1) { transition-delay: .00s; }
[data-reveal-stagger].is-in > *:nth-child(2) { transition-delay: .07s; }
[data-reveal-stagger].is-in > *:nth-child(3) { transition-delay: .14s; }
[data-reveal-stagger].is-in > *:nth-child(4) { transition-delay: .21s; }
[data-reveal-stagger].is-in > *:nth-child(5) { transition-delay: .28s; }
[data-reveal-stagger].is-in > *:nth-child(6) { transition-delay: .35s; }

@media (prefers-reduced-motion: reduce) {
    .udm-v2 *,
    .udm-v2 *::before,
    .udm-v2 *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }

    [data-reveal],
    [data-reveal-stagger] > * {
        opacity: 1 !important;
        transform: none !important;
    }
}
