/*
 * KKN UPI Unified Public UI v1.0.2
 * Visual presentation only.
 * Does not replace existing header/navigation.
 */

body.kpu-unified {
    --kpu-red: #E10000;
    --kpu-red-dark: #9B111E;
    --kpu-yellow: #FFCC00;
    --kpu-ink: #23262D;
    --kpu-muted: #667085;
    --kpu-border: #E5E7EB;
    --kpu-white: #FFFFFF;
    --kpu-radius: 14px;

    font-family:
        "Roboto",
        system-ui,
        -apple-system,
        "Segoe UI",
        Arial,
        sans-serif;

    font-size: 15px;
    line-height: 1.6;
    color: var(--kpu-ink);
    -webkit-text-size-adjust: 100%;
}

/* Typography */

body.kpu-unified :where(h1, h2, h3) {
    letter-spacing: -0.018em;
    overflow-wrap: break-word;
}

body.kpu-unified h1 {
    font-size: clamp(27px, 3vw, 38px);
    line-height: 1.18;
}

body.kpu-unified h2 {
    font-size: clamp(21px, 2vw, 27px);
    line-height: 1.28;
}

body.kpu-unified h3 {
    font-size: clamp(17px, 1.5vw, 21px);
    line-height: 1.35;
}

/* Shared card rhythm */

body.kpu-unified :where(
    .card,
    .info-card,
    .kes-panel
) {
    border-radius: var(--kpu-radius);
}

/* Existing header remains intact */

body.kpu-unified :where(
    .kes-topbar,
    .site-header
) {
    border-bottom: 1px solid var(--kpu-border);
}

/* Executive Summary */

body.kpu-executive .kes-panel {
    min-width: 0;
}

body.kpu-executive .kes-section-heading {
    margin-bottom: 15px;
}

body.kpu-executive .kes-section-heading h2 {
    font-size: clamp(21px, 2vw, 26px);
    line-height: 1.25;
}

/* Prevent narrow or clipped summary text */

body.kpu-executive .kes-panel :is(
    .kes-narrative,
    .kes-summary,
    .kes-prose,
    .kes-content,
    .kes-text,
    .kes-narrative-body
) {
    width: 100%;
    max-width: none !important;
    min-width: 0;
    height: auto;
    max-height: none;
    overflow: visible;
}

body.kpu-executive .kes-panel p {
    max-width: none;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    text-overflow: clip;

    font-size: 15px;
    line-height: 1.7;
    margin-top: 0;
    margin-bottom: 13px;
}

body.kpu-executive .kes-section-heading p {
    margin-bottom: 0;
}

/* SDG images must remain visible */

body.kpu-executive .kes-sdg-official-v121 {
    width: 58px;
    height: 58px;
    max-width: 100%;
    object-fit: contain;
    flex-shrink: 0;
}

/* Inputs: visual styling only */

body.kpu-unified :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
    select,
    textarea
) {
    font-family: inherit;
    border-radius: 9px;
}

/* Accessibility */

body.kpu-unified :focus-visible {
    outline: 3px solid var(--kpu-yellow);
    outline-offset: 2px;
}

/* Tablet */

@media (max-width: 1023px) {
    body.kpu-unified {
        font-size: 15px;
    }

    body.kpu-executive .kes-section-heading h2 {
        font-size: 23px;
    }
}

/* Mobile */

@media (max-width: 767px) {
    body.kpu-unified h1 {
        font-size: clamp(25px, 7vw, 31px);
    }

    body.kpu-unified h2 {
        font-size: clamp(20px, 5vw, 24px);
    }

    body.kpu-executive .kes-panel p {
        font-size: 15px;
        line-height: 1.65;
        margin-bottom: 12px;
    }

    body.kpu-executive .kes-section-heading {
        margin-bottom: 13px;
    }

    body.kpu-executive .kes-sdg-official-v121 {
        width: 48px;
        height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.kpu-unified *,
    body.kpu-unified *::before,
    body.kpu-unified *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}