/* ============================================================
   PARTNER PORTAL — Accessible Theme
   Designed for older adults: high contrast, large type,
   generous spacing, clear focus indicators, reduced motion.
   ============================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
    /* Palette — warm off-white base, deep navy text, rich teal accent */
    --bg: #c8c8c8;
    --bg-alt: #c8c8c8;
    --surface: #9caf88;
    --tile-color: #ffffff;
    --border: #c8c8c8;
    --border-strong: #8a7f72;

    --text: #1a1612; /* near-black, warm undertone   */
    --text-secondary: #4a4238; /* dark brown-grey              */
    --muted: #6b6157;

    --accent: #1d5c8a; /* deep accessible teal-blue    */
    --accent-hover: #154368;
    --accent-light: #e8f2fa;
    --accent-text: #ffffff;

    --focus: #d97706; /* amber — highly visible       */
    --error: #b91c1c;

    /* Typography — Lora (serif display) + Source Sans 3 (body) */
    --font-head: "Arial", Georgia, serif;
    --font-body: "Arial", Tahoma, sans-serif;

    /* Scale — everything larger than a typical site */
    --text-xs: 0.9rem; /* 14.4px */
    --text-sm: 1rem; /* 16px   */
    --text-base: 1.2rem; /* 19.2px */
    --text-md: 1.4rem; /* 22.4px */
    --text-lg: 1.75rem; /* 28px   */
    --text-xl: 2.25rem; /* 36px   */
    --text-2xl: 3rem; /* 48px   */
    --text-3xl: clamp(2.5rem, 6vw, 4.5rem);

    --radius: 6px;
    --radius-lg: 10px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.16);

    --transition: 0.25s ease;
}

/* ── Reset & base ──────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 100%; /* respect user browser font-size settings */
}

/* Honour reduced-motion preferences throughout */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Global focus style — thick, amber, always visible ─────── */
:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: var(--radius);
}

/* ── Skip-to-content link (screen readers / keyboard) ──────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--accent);
    color: var(--accent-text);
    font-size: var(--text-sm);
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 10000;
    text-decoration: none;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* ── Banner ────────────────────────────────────────────────── */
.banner {
    background: var(--surface);
    border-bottom: 3px solid var(--accent);
    box-shadow: var(--shadow-sm);
}

.banner__ticker {
    padding: 0.55rem clamp(1.5rem, 5vw, 5rem);
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    overflow: hidden;
    font-size: 20px;
}

.banner__ticker-label {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-text);
    white-space: nowrap;
    flex-shrink: 0;
    opacity: 0.85;
}

.banner__ticker-track {
    display: flex;
    gap: 2.5rem;
    white-space: nowrap;
    animation: ticker 30s linear infinite;
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

@keyframes ticker {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

.banner__hero {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 2rem;
    padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1.5rem, 5vw, 5rem)
        clamp(2rem, 4vw, 3.5rem);
}

.banner__eyebrow {
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.banner__title {
    font-family: var(--font-head);
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
    text-align: center;
}

.banner__title span {
    color: var(--accent);
}

.banner__meta {
    text-align: right;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    padding-bottom: 0.4rem;
    line-height: 1.4;
}

.banner__meta strong {
    display: block;
    font-family: var(--font-head);
    font-size: var(--text-xl);
    color: var(--text);
}

/* ── Mission statement ─────────────────────────────────────── */
.mission {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding-top: 1rem;
    padding: clamp(2.5rem, 50px, 50px) clamp(1.5rem, 5vw, 5rem);
    grid-template-columns: 180px 1fr;
    gap: 3rem;
    align-items: start;
}

.mission__label {
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    padding-top: 0.4rem;
    text-align: center;
}

.mission__label::before {
    content: "";
    display: block;
    width: 2.5rem;
    height: 3px;
    background: var(--accent);
    margin-bottom: 0.75rem;
    border-radius: 2px;
}

.mission__text {
    font-family: "Comic Sans MS", "Comic Sans", cursive, sans-serif;
    font-size: var(--text-lg);
    font-weight: 400;
    line-height: 1.55;
    color: var(--text-secondary);
    min-height: 2.5em;
    position: relative;
    text-align: center;
}

.mission__text.filled::after {
    display: none;
}

/* ── Partners section ──────────────────────────────────────── */
.partners {
    padding: clamp(2.5rem, 5vw, 5rem) clamp(1.5rem, 5vw, 5rem);
}

.partners__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.partners__title {
    font-family: var(--font-head);
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text);
}

.partners__count {
    font-size: var(--text-sm);
    color: var(--muted);
    font-weight: 500;
}

.partners__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

/* ── Partner card ──────────────────────────────────────────── */
.card {
    background: var(--tile-color);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.25rem 1.75rem 2rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        transform var(--transition);
    animation: fadeUp 0.45s both;

    /* Remove default button styles */
    font-family: inherit;
    color: inherit;
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Visible "click me" cue */
.card__logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
    transition: opacity var(--transition);
}

.card:hover .card__logo {
    opacity: 0.85;
}

.card__logo-placeholder {
    width: 88px;
    height: 88px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--accent);
    transition:
        border-color var(--transition),
        background var(--transition);
}

.card:hover .card__logo-placeholder {
    border-color: var(--accent);
    background: var(--accent-light);
}

.card__name {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.02em;
}

/* "View details" label — always visible, not just on hover */
.card__cta {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: gap var(--transition);
}

.card:hover .card__cta {
    gap: 0.55rem;
}

.card__cta::after {
    content: "→";
    font-style: normal;
}

/* ── Empty / loading states ────────────────────────────────── */
.loading,
.empty {
    grid-column: 1 / -1;
    background: var(--tile-color);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 4rem 3rem;
    text-align: center;
    color: var(--muted);
    font-size: var(--text-base);
    line-height: 1.8;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: var(--text-sm);
    letter-spacing: 0.08em;
}

.loading__dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 1.2s ease-in-out infinite;
}

.loading__dot:nth-child(2) {
    animation-delay: 0.2s;
}
.loading__dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.25;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.empty code {
    display: inline-block;
    margin-top: 1rem;
    font-size: var(--text-sm);
    color: var(--accent);
    background: var(--bg-alt);
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* ── Modal backdrop ────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 16, 10, 0.72);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Modal panel ───────────────────────────────────────────── */
.modal {
    background: var(--tile-color);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    transform: translateY(24px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open .modal {
    transform: translateY(0) scale(1);
}

.modal__video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
}

.modal__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal__video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: #888;
    font-size: var(--text-base);
}

.modal__video-placeholder svg {
    opacity: 0.4;
}

.modal__body {
    padding: clamp(1.75rem, 4vw, 2.75rem);
}

.modal__entity {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 2px solid var(--bg-alt);
}

.modal__logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: var(--radius);
}

.modal__logo-placeholder {
    width: 64px;
    height: 64px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
}

.modal__name {
    font-family: var(--font-head);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.modal__description {
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* ── Modal close button ────────────────────────────────────── */
.modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px; /* large tap target */
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border);
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    box-shadow: var(--shadow-sm);
    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition);
    z-index: 10;
}

.modal__close:hover {
    background: var(--error);
    border-color: var(--error);
    color: #fff;
}

.modal__phone,
.modal__address,
.modal__website {
    font-size: var(--text-sm);
    width: 33%;
}

.modal__footer {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 2px solid var(--bg-alt);
    text-align: center;
}

.modal__footer-value {
    width: 100px;
}
/* ── Footer ────────────────────────────────────────────────── */
.foot {
    background: var(--surface);
    border-top: 2px solid var(--border);
    padding: 1.75rem clamp(1.5rem, 5vw, 5rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: var(--text-sm);
    color: var(--muted);
    font-weight: 500;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 700px) {
    .mission {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .banner__hero {
        grid-template-columns: 1fr;
    }

    .banner__meta {
        text-align: left;
    }

    .modal__entity {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* ── High-contrast mode support ────────────────────────────── */
@media (forced-colors: active) {
    .card {
        border: 2px solid ButtonText;
    }
    .card:hover {
        border-color: Highlight;
    }
    .modal__close {
        border: 2px solid ButtonText;
    }
}
