:root {
    --green-950: #0c2615;
    --green-900: #12351c;
    --green-800: #1b4a27;
    --green-700: #285d34;
    --green-100: #e6eee4;
    --cream: #f4f2e9;
    --paper: #faf9f4;
    --gold: #c5a15a;
    --gold-soft: #dfc889;
    --ink: #20261f;
    --muted: #687067;
    --line: rgba(15, 48, 25, .14);
    --white: #fff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: "Inter", sans-serif;
    overflow-x: hidden;
}

.container {
    width: min(1180px, calc(100% - 48px));
    margin-inline: auto;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--gold-soft);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .2em;
}

.eyebrow-dark {
    color: var(--green-700);
}

/* =========================================================
   HERO REPOSITORIO
   ========================================================= */

.repo-hero {
    position: relative;
    overflow: hidden;
    color: var(--white);
    background:
        radial-gradient(circle at 80% 30%, rgba(197,161,90,.18), transparent 30%),
        var(--green-950);
}

.repo-hero::after {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    right: -180px;
    bottom: -300px;
    border: 1px solid rgba(223,200,137,.25);
    border-radius: 50%;
}

.repo-hero-inner {
    min-height: 460px;
    display: grid;
    grid-template-columns: 1fr .45fr;
    align-items: center;
    gap: 70px;
    padding-block: 70px;
}

.repo-hero-copy {
    max-width: 760px;
}

.repo-hero h1 {
    margin: 0;
    font-family: "DM Serif Display", serif;
    font-size: clamp(4rem, 7vw, 7rem);
    font-weight: 400;
    line-height: .98;
}

.repo-hero h1 em {
    color: var(--gold-soft);
    font-style: normal;
}

.repo-hero p {
    max-width: 650px;
    margin: 30px 0 0;
    color: rgba(255,255,255,.68);
    line-height: 1.8;
    font-size: 1rem;
}

.repo-hero-symbol {
    justify-self: end;
    text-align: center;
}

.symbol-circle {
    width: 190px;
    height: 190px;
    margin: 0 auto 20px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(223,200,137,.5);
    border-radius: 50%;
    color: var(--gold-soft);
}

.symbol-circle i {
    font-size: 4rem;
}

.repo-hero-symbol > span {
    color: rgba(255,255,255,.6);
    font-size: .65rem;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: .18em;
}

/* =========================================================
   CONTENIDO
   ========================================================= */

.repo-section {
    padding: 105px 0 120px;
    background: var(--cream);
}

.repo-toolbar {
    display: grid;
    grid-template-columns: 1fr 380px;
    align-items: end;
    gap: 50px;
    margin-bottom: 35px;
}

.repo-toolbar h2 {
    margin: 0;
    color: var(--green-950);
    font-family: "DM Serif Display", serif;
    font-size: clamp(2.8rem, 5vw, 5rem);
    font-weight: 400;
    line-height: 1;
}

.repo-search {
    position: relative;
}

.repo-search i {
    position: absolute;
    top: 50%;
    left: 17px;
    color: var(--green-700);
    transform: translateY(-50%);
}

.repo-search input {
    width: 100%;
    height: 54px;
    padding: 0 18px 0 48px;
    border: 1px solid var(--line);
    border-radius: 0;
    outline: 0;
    color: var(--ink);
    background: var(--white);
}

.repo-search input:focus {
    border-color: var(--green-700);
}

.repo-count {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .04em;
}

.repo-count #repoCount {
    color: var(--green-800);
    font-weight: 800;
}

.repo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.repo-card {
    display: grid;
    grid-template-columns: 230px 1fr;
    min-height: 285px;
    background: var(--white);
    border: 1px solid var(--line);
    transition: transform .3s ease, box-shadow .3s ease;
}

.repo-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 20px 45px rgba(12,38,21,.12);
}

.repo-cover {
    position: relative;
    min-height: 285px;
    overflow: hidden;
    background: var(--green-900);
}

.repo-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.repo-card:hover .repo-cover img {
    transform: scale(1.06);
}

.repo-cover-placeholder {
    height: 100%;
    min-height: 285px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: var(--gold-soft);
    background:
        radial-gradient(circle at center, rgba(197,161,90,.14), transparent 50%),
        var(--green-900);
}

.repo-cover-placeholder i {
    font-size: 3rem;
}

.repo-cover-placeholder span {
    font-size: .55rem;
    font-weight: 700;
    letter-spacing: .18em;
}

.repo-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(12,38,21,.75), transparent 55%);
    pointer-events: none;
}

.repo-number {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    color: var(--gold-soft);
    font-size: .7rem;
    font-weight: 800;
}

.repo-file-type {
    position: absolute;
    right: 13px;
    bottom: 13px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    color: var(--green-950);
    background: var(--gold-soft);
    font-size: .58rem;
    font-weight: 800;
}

.repo-content {
    display: flex;
    flex-direction: column;
    padding: 28px;
}

.repo-category {
    display: inline-block;
    align-self: flex-start;
    margin-bottom: 14px;
    color: var(--green-700);
    font-size: .61rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.repo-content h3 {
    margin: 0;
    color: var(--green-950);
    font-family: "DM Serif Display", serif;
    font-size: 1.8rem;
    font-weight: 400;
    line-height: 1.08;
}

.repo-content p {
    margin: 15px 0 20px;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.7;
}

.repo-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.repo-file {
    max-width: 55%;
    overflow: hidden;
    color: var(--muted);
    font-size: .62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.repo-file i {
    margin-right: 5px;
    color: var(--gold);
}

.repo-open {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--green-800);
    text-decoration: none;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.repo-open:hover {
    color: var(--gold);
}

.repo-empty {
    display: none;
    padding: 70px 20px;
    text-align: center;
}

.repo-empty.visible {
    display: block;
}

.repo-empty i {
    color: var(--gold);
    font-size: 2rem;
}

.repo-empty h3 {
    margin: 18px 0 8px;
    font-family: "DM Serif Display", serif;
    font-size: 2rem;
    font-weight: 400;
}

.repo-empty p {
    margin: 0;
    color: var(--muted);
}

/* =========================================================
   CTA
   ========================================================= */

.repo-cta {
    padding: 85px 0;
    color: var(--white);
    background: var(--green-800);
}

.repo-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

.repo-cta h2 {
    max-width: 720px;
    margin: 0;
    font-family: "DM Serif Display", serif;
    font-size: clamp(2.7rem, 4.5vw, 4.6rem);
    font-weight: 400;
    line-height: 1;
}

.repo-cta-button {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 50px;
    padding: 0 22px;
    color: var(--green-950);
    background: var(--gold-soft);
    text-decoration: none;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    transition: .25s ease;
}

.repo-cta-button:hover {
    color: var(--green-950);
    background: var(--white);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 991px) {
    .repo-hero-inner {
        grid-template-columns: 1fr;
    }

    .repo-hero-symbol {
        justify-self: start;
        text-align: left;
        display: flex;
        align-items: center;
        gap: 20px;
    }

    .symbol-circle {
        width: 120px;
        height: 120px;
        margin: 0;
    }

    .repo-toolbar {
        grid-template-columns: 1fr;
    }

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

    .repo-cta-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(100% - 30px, 1180px);
    }

    .repo-hero-inner {
        min-height: auto;
        padding-block: 65px;
    }

    .repo-hero h1 {
        font-size: 3.5rem;
    }

    .repo-section {
        padding: 75px 0;
    }

    .repo-toolbar h2 {
        font-size: 3rem;
    }

    .repo-card {
        grid-template-columns: 1fr;
    }

    .repo-cover,
    .repo-cover-placeholder {
        min-height: 260px;
    }

    .repo-content {
        padding: 24px;
    }

    .repo-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .repo-file {
        max-width: 100%;
    }
}



/* =========================================================
   VISOR DOCUMENTAL
   Modal propio: el PDF queda libre para usar sus controles
   nativos del navegador.
   ========================================================= */

body.repo-viewer-open {
    overflow: hidden;
}

.repo-viewer-modal {
    --repo-header-height: 80px;
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: none;
    padding-top: var(--repo-header-height);
    background: rgba(8, 16, 11, .72);
}

.repo-viewer-modal.is-open {
    display: block;
}

.repo-viewer-panel {
    width: 100%;
    height: calc(100vh - var(--repo-header-height));
    display: flex;
    flex-direction: column;
    background: #202223;
    box-shadow: 0 -12px 45px rgba(0,0,0,.18);
}

.repo-viewer-head {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    min-height: 78px;
    padding: 12px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    color: var(--white);
    background: #0f2f1e;
    border-bottom: 1px solid rgba(255,255,255,.13);
}

.repo-viewer-title {
    min-width: 0;
}

.repo-viewer-title h2 {
    margin: 0;
    color: var(--white);
    font-family: "DM Serif Display", serif;
    font-size: 1.65rem;
    font-weight: 400;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.repo-modal-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--gold-soft);
    font-size: .55rem;
    font-weight: 800;
    letter-spacing: .18em;
}

.repo-viewer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.repo-viewer-action,
.repo-viewer-close {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 15px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 3px;
    color: rgba(255,255,255,.90);
    background: rgba(255,255,255,.055);
    text-decoration: none;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.repo-viewer-action:hover,
.repo-viewer-close:hover {
    color: var(--white);
    border-color: rgba(223,200,137,.65);
    background: rgba(255,255,255,.10);
    transform: translateY(-1px);
}

.repo-viewer-action-primary {
    color: #0f2f1e;
    border-color: var(--gold-soft);
    background: var(--gold-soft);
}

.repo-viewer-action-primary:hover {
    color: #0f2f1e;
    border-color: #fff;
    background: #fff;
}

.repo-viewer-close {
    width: 42px;
    padding: 0;
    border-color: rgba(255,255,255,.25);
}

.repo-viewer-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #525659;
}

.repo-pdf-viewer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #525659;
}

.repo-pdf-viewer iframe {
    position: absolute;
    inset: 0;
    display: none;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #525659;
}

.repo-pdf-viewer iframe.visible {
    display: block;
}

.repo-image-viewer {
    display: none;
    width: auto;
    height: auto;
    max-width: min(94%, 1500px);
    max-height: 92%;
    object-fit: contain;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.repo-image-viewer.visible {
    display: block;
}

.repo-viewer-error {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 30px;
    text-align: center;
    color: rgba(255,255,255,.8);
}

.repo-viewer-error.visible {
    display: flex;
}

.repo-viewer-error i {
    margin-bottom: 8px;
    color: var(--gold-soft);
    font-size: 2.5rem;
}

.repo-viewer-error strong {
    color: var(--white);
    font-size: 1rem;
}

.repo-viewer-error span {
    font-size: .75rem;
}


/* =========================================================
   BOTÓN LEER DOCUMENTO
   ========================================================= */

.repo-open {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 16px;
    border: 1px solid var(--green-800);
    border-radius: 3px;
    color: var(--green-950);
    background: transparent;
    text-decoration: none;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all .22s ease;
}

.repo-open i {
    font-size: .68rem;
    transition: transform .22s ease;
}

.repo-open:hover {
    color: var(--white);
    border-color: var(--green-800);
    background: var(--green-800);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(12,38,21,.16);
}

.repo-open:hover i {
    transform: translateX(3px);
}

.repo-open:focus-visible,
.repo-viewer-action:focus-visible,
.repo-viewer-close:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}


/* =========================================================
   CARDS PRINCIPALES
   ========================================================= */

@media (min-width: 992px) {
    .principles-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px;
        border: 0;
    }

    .principle {
        min-height: 450px;
        padding: 0 24px 30px;
        border: 1px solid rgba(255,255,255,.09);
        border-radius: 2px;
        background: #173c29;
        box-shadow: 0 10px 24px rgba(3,18,10,.12);
        transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
    }

    .principle:hover {
        transform: translateY(-8px);
        border-color: rgba(223,200,137,.32);
        box-shadow: 0 22px 42px rgba(2,18,10,.25);
    }

    .values-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px;
        border: 0;
    }

    .values-grid > div,
    .values-grid > article {
        border: 1px solid var(--line);
        border-radius: 2px;
        box-shadow: 0 8px 22px rgba(12,38,21,.06);
    }
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 640px) {
    .repo-viewer-head {
        min-height: 68px;
        padding: 10px 14px;
        gap: 12px;
    }

    .repo-viewer-title h2 {
        font-size: 1.15rem;
    }

    .repo-viewer-actions {
        gap: 5px;
    }

    .repo-viewer-action {
        width: 38px;
        padding: 0;
    }

    .repo-viewer-action span {
        display: none;
    }

    .repo-viewer-close {
        width: 38px;
    }

    .repo-image-viewer {
        max-width: 96%;
        max-height: 88%;
    }
}

\n\n/* =========================================================\n   VISOR MULTIFORMATO — PDF / JPG / JPEG / PNG\n   ========================================================= */\n.repo-image-viewer {\n    max-width: min(92%, 1500px);\n    max-height: 90%;\n    width: auto;\n    height: auto;\n    object-fit: contain;\n    border-radius: 4px;\n}\n\n.repo-file-type {\n    display: inline-flex;\n    align-items: center;\n    gap: 7px;\n}\n