:root {
    color-scheme: light;
    --background: #ffffff;
    --border: #e5e7eb;
    --muted: #6b7280;
    --text: #1f2937;
    --link: #175cd3;
    --row-hover: #f8fafc;
    --campaign-blue: #124a98;
    --campaign-blue-dark: #08336f;
    --campaign-yellow: #f9ce22;
}

/* Base visual y reglas comunes de accesibilidad. */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f5f7fb;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 10px 14px;
    border-radius: 4px;
    background: #ffffff;
    color: #004884;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.institutional-header {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e6e6e6;
}

/* Identidad institucional ubicada antes del contenido documental. */
.govco-bar,
.footer-govco {
    display: flex;
    align-items: center;
    background: #4869c9;
}

.govco-bar {
    height: 70px;
    padding: 0 22px;
}

.govco-bar img,
.footer-govco img {
    display: block;
    width: 116px;
    height: auto;
}

.govco-bar a,
.footer-govco a {
    display: inline-flex;
    border-radius: 4px;
}

.govco-bar a:focus-visible,
.footer-govco a:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 4px;
}

.institutional-brand {
    min-height: 242px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
    padding: 34px 24px;
}

.brand-art img {
    display: block;
    width: 250px;
    height: auto;
}

.brand-divider {
    width: 1px;
    height: 116px;
    background: #7d7d7d;
}

.brand-dsci {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 245px;
    color: #555555;
    text-align: center;
    font-size: 1.38rem;
    line-height: 1.02;
}

.brand-emblem {
    position: relative;
    display: block;
    width: 62px;
    height: 43px;
    overflow: hidden;
    margin-bottom: 4px;
}

.brand-emblem img {
    position: absolute;
    top: 0;
    left: 50%;
    width: 190px;
    max-width: none;
    transform: translateX(-50%);
}

.brand-colors {
    width: 44px;
    height: 4px;
    margin-top: 10px;
    background: linear-gradient(90deg, #f7ce22 0 45%, #2455a4 45% 76%, #c91f2d 76%);
}

/* Bloque promocional que ambienta el acceso al repositorio documental. */
.campaign-hero {
    position: relative;
    overflow: hidden;
    border-top: 8px solid var(--campaign-yellow);
    background:
        radial-gradient(circle at 18% 18%, rgb(105 174 255 / 38%), transparent 30%),
        linear-gradient(135deg, var(--campaign-blue-dark), var(--campaign-blue) 58%, #2b72bc);
    color: #ffffff;
}

.campaign-hero::after {
    position: absolute;
    right: -8%;
    bottom: -110px;
    width: 42%;
    height: 220px;
    border-radius: 50%;
    background: rgb(249 206 34 / 14%);
    content: "";
    transform: rotate(-8deg);
}

.campaign-hero-inner {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 410px);
    gap: clamp(36px, 7vw, 88px);
    align-items: center;
    padding: 54px 0;
}

.campaign-copy {
    max-width: 610px;
}

.campaign-copy h1 {
    max-width: 720px;
    margin: 0 0 20px;
    color: #ffffff;
    font-size: clamp(2.1rem, 5vw, 4rem);
    font-weight: 780;
    line-height: 1.03;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.campaign-copy p {
    max-width: 590px;
    margin: 0 0 30px;
    color: rgb(255 255 255 / 90%);
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.6;
}

.campaign-button {
    display: inline-flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 7px;
    background: var(--campaign-yellow);
    color: #17345f;
    font-weight: 750;
    text-decoration: none;
    box-shadow: 0 8px 20px rgb(0 0 0 / 20%);
}

.campaign-button:hover {
    background: #ffda36;
    text-decoration: none;
    transform: translateY(-1px);
}

.campaign-button:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 4px;
}

.campaign-art {
    width: 100%;
    margin: 0;
}

.campaign-art img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 610px;
    border: 5px solid rgb(255 255 255 / 88%);
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 22px 48px rgb(0 0 0 / 30%);
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 58px 0 84px;
    scroll-margin-top: 18px;
}

.container:focus {
    outline: none;
}

/* Explorador público de carpetas y archivos. */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

h1 {
    margin: 0 0 8px;
    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 650;
    letter-spacing: -0.02em;
}

.page-header h2 {
    margin: 0 0 8px;
    color: #17345f;
    font-size: clamp(1.45rem, 3vw, 2rem);
    letter-spacing: -0.02em;
}

.page-header p {
    margin: 0;
    color: var(--muted);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 0.94rem;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

td {
    font-size: 0.94rem;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: var(--row-hover);
}

.item-link {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    font-weight: 500;
}

.icon {
    display: inline-flex;
    width: 22px;
    justify-content: center;
}

.action-cell {
    width: 130px;
    text-align: right;
}

.copy-link {
    border: 0;
    background: transparent;
    color: var(--link);
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    padding: 6px;
}

.copy-link:hover {
    text-decoration: underline;
}

.notice {
    padding: 14px 16px;
    border: 1px solid;
    border-radius: 8px;
    line-height: 1.5;
}

.notice-warning {
    border-color: #f5d78e;
    background: #fffbeb;
    color: #7c4a03;
}

.notice-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.empty {
    padding: 40px;
    color: var(--muted);
    text-align: center;
}

.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;
}

.institutional-footer {
    width: 100%;
    background: #4869c9;
}

/* Información oficial, redes sociales y enlaces normativos. */
.footer-yellow {
    padding: 0 24px 44px;
    background: #f8d43f;
}

.footer-card {
    width: min(1080px, 100%);
    margin: 0 auto;
    padding: 36px 42px;
    transform: translateY(-28px);
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 3px 10px rgb(0 0 0 / 10%);
}

.footer-card h2 {
    margin: 0 0 18px;
    color: #111111;
    font-size: 1.02rem;
    line-height: 1.3;
    text-transform: uppercase;
}

.footer-card p {
    margin: 0 0 7px;
    color: #111111;
    line-height: 1.45;
}

.footer-card a {
    color: #2455d6;
}

.social-links {
    display: flex;
    gap: 10px;
    margin: 20px 0 36px;
}

.social-links a {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.social-links a:hover {
    filter: brightness(1.12);
}

.social-x,
.social-tiktok {
    background: #111111;
}

.social-instagram {
    background: linear-gradient(135deg, #7f38b8, #e84870 55%, #f6ae35);
}

.social-youtube {
    background: #e52d27;
}

.social-facebook {
    background: #4267a9;
}

.footer-links > a {
    display: inline-block;
    margin-bottom: 28px;
}

.policy-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.footer-govco {
    min-height: 68px;
    padding: 0 22px;
}

@media (max-width: 640px) {
    /* Ajustes para teléfonos y pantallas angostas. */
    .govco-bar {
        height: 52px;
        padding: 0 16px;
    }

    .govco-bar img,
    .footer-govco img {
        width: 96px;
    }

    .institutional-brand {
        min-height: 0;
        gap: 14px;
        padding: 24px 14px;
    }

    .brand-art img {
        width: min(42vw, 180px);
    }

    .brand-divider {
        height: 90px;
    }

    .brand-dsci {
        max-width: 46vw;
        font-size: 0.88rem;
    }

    .brand-emblem {
        width: 48px;
        height: 33px;
    }

    .brand-emblem img {
        width: 145px;
    }

    .campaign-hero {
        border-top-width: 5px;
    }

    .campaign-hero-inner {
        width: min(100% - 28px, 520px);
        grid-template-columns: 1fr;
        gap: 34px;
        padding: 38px 0 46px;
    }

    .campaign-copy {
        text-align: center;
    }

    .campaign-copy h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .campaign-copy p {
        font-size: 1rem;
    }

    .campaign-art {
        width: min(100%, 390px);
        margin: 0 auto;
    }

    .campaign-art img {
        max-height: none;
        border-width: 4px;
        border-radius: 14px;
    }

    .container {
        width: min(100% - 20px, 1120px);
        padding: 34px 0 72px;
    }

    table {
        min-width: 0;
    }

    th:nth-child(2),
    th:nth-child(3),
    th:nth-child(4),
    td:nth-child(2),
    td:nth-child(3),
    td:nth-child(4) {
        display: none;
    }

    .item-link {
        align-items: flex-start;
        line-height: 1.4;
    }

    .footer-yellow {
        padding: 0 10px 26px;
    }

    .footer-card {
        padding: 28px 20px;
        transform: translateY(-20px);
    }

    .policy-links {
        flex-direction: column;
    }

    .footer-govco {
        min-height: 58px;
        padding: 0 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
