/* =========================================================
   REPOSITORIO VIRTUAL - HOME (rediseño fiel a la referencia)
   Prefijo de clases: repo-
   ========================================================= */

:root {
    --navy: #14284B;
    --blue: #2A5C94;
    --green: #2E7D5A;
    --purple: #5A4A8C;
    --text-muted: #5B6577;
    --border: #E6EBF2;
    --radius-card: 14px;
    --radius-pill: 999px;
    --shadow-card: 0 8px 24px rgba(20, 40, 75, .08);
    --font-serif: 'Poppins', 'Roboto', Georgia, 'Times New Roman', serif;
    --font-sans: 'Poppins', 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --container-wide: 1600px;
    --container-cards: 1400px;
}

/* ---------- Base ---------- */
body.repo-body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--navy);
    background: linear-gradient(180deg, #F4F7FB 0%, #EAF0F7 100%);
    background-attachment: fixed;
    line-height: 1.5;
}

.repo-body h1,
.repo-body h2,
.repo-body h3,
.repo-body h4,
.repo-body p {
    margin: 0;
}

.repo-body h1,
.repo-body h2,
.repo-body h3,
.repo-body h4 {
    font-family: var(--font-serif);
}

.repo-body img {
    max-width: 100%;
}

.repo-body a {
    text-decoration: none;
    color: inherit;
}

.repo-body :focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Contenedor ancho (navbar, hero, footer) */
.repo-container {
    max-width: var(--container-wide);
    margin-inline: auto;
    padding-inline: clamp(24px, 4vw, 64px);
}

/* ---------- NAVBAR ---------- */
.repo-nav {
    position: sticky;
    top: 0;
    z-index: 60;
    background: #ffffff;
    box-shadow: 0 1px 8px rgba(20, 40, 75, .08);
}

.repo-nav-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 72px;
}

.repo-nav-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* Icono edificio con columnas (línea, navy, sin fondo) */
.repo-nav-mark {
    display: inline-flex;
    width: 40px;
    height: 40px;
    color: var(--navy);
}

.repo-nav-mark svg {
    width: 100%;
    height: 100%;
}

.repo-nav-name {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 26px;
    line-height: 1;
    color: var(--navy);
    white-space: nowrap;
}

.repo-nav-divider {
    width: 1px;
    height: 26px;
    background: #C7D0DD;
    flex-shrink: 0;
}

.repo-nav-tagline {
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
}

.repo-nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 26px;
}

.repo-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 28px;
}

.repo-nav-links a {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 16px;
    color: var(--navy);
    padding: 6px 0;
    transition: color .16s ease;
}

.repo-nav-links a:hover {
    color: var(--blue);
}

.repo-nav-links a.repo-nav-active {
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--blue);
}

.repo-nav-search {
    display: inline-flex;
    color: var(--navy);
    padding: 6px;
    transition: color .16s ease;
}

.repo-nav-search:hover {
    color: var(--blue);
}

.repo-nav-login-divider {
    width: 1px;
    height: 26px;
    background: #C7D0DD;
}

.repo-nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--navy);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.repo-nav-avatar svg {
    width: 17px;
    height: 17px;
}

/* Hamburguesa móvil */
.repo-nav-burger {
    display: none;
    background: none;
    border: none;
    color: var(--navy);
    padding: 8px;
    cursor: pointer;
}

/* Drawer móvil */
.repo-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 40, 75, .4);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease;
    z-index: 70;
}

.repo-drawer-overlay.repo-open {
    opacity: 1;
    visibility: visible;
}

.repo-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 88vw);
    background: #ffffff;
    z-index: 80;
    transform: translateX(100%);
    transition: transform .2s ease;
    display: flex;
    flex-direction: column;
}

.repo-drawer.repo-open {
    transform: none;
}

.repo-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.repo-drawer-head .repo-nav-name {
    font-size: 20px;
}

.repo-drawer-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
}

.repo-drawer-nav {
    padding: 14px 8px;
}

.repo-drawer-nav a {
    display: block;
    padding: 12px 14px;
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 500;
    color: var(--navy);
    border-radius: 8px;
    transition: background .15s ease, color .15s ease;
}

.repo-drawer-nav a:hover {
    background: #EEF2F7;
}

.repo-drawer-nav a.repo-nav-active {
    box-shadow: inset 3px 0 0 var(--blue);
    background: rgba(42, 92, 148, .08);
}

/* ---------- HERO ---------- */
.repo-hero {
    position: relative;
    z-index: 1;
}

/* Foto de fondo a página completa (imagen institucional) */
.repo-hero-photo {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    pointer-events: none;
    opacity: .5;
}

/* Inscripciones sobre el entablamento */
.repo-hero-inscriptions {
    position: absolute;
    top: 30%;
    left: 54%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: rotate(-12deg);
    pointer-events: none;
    white-space: nowrap;
}

.repo-hero-inscriptions span {
    font-family: var(--font-serif);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .15em;
    color: rgba(20, 40, 75, .22);
    line-height: 1.4;
}

.repo-hero-inscriptions .repo-ins-lex { font-size: 34px; }
.repo-hero-inscriptions .repo-ins-iustitia { font-size: 46px; }
.repo-hero-inscriptions .repo-ins-societas { font-size: 58px; }

/* Fila central del hero */
.repo-hero-row {
    position: relative;
    z-index: 2;
    padding-top: 88px;
    padding-bottom: 48px;
}

/* Frase lateral (anclada al margen izquierdo, centrada en altura) */
.repo-hero-sidenote {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-70%);
    width: 200px;
}

.repo-hero-sidenote p {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 30px;
    line-height: 1.15;
    color: rgba(50, 74, 108, .85);
    text-shadow: 0 1px 2px rgba(255, 255, 255, .8);
}

.repo-hero-side-line {
    width: 56px;
    height: 2px;
    border-radius: 2px;
    background: var(--blue);
    margin-top: 18px;
}

/* Bloque central verdaderamente centrado */
.repo-hero-center {
    position: relative;
    text-align: center;
    max-width: 860px;
    margin-inline: auto;
}

/* Viñeta clara detrás del texto para contrastar con la foto */
.repo-hero-center::before {
    content: "";
    position: absolute;
    inset: -46px -90px;
    z-index: -1;
    background: radial-gradient(ellipse at center,
        rgba(244, 247, 251, .9) 0%,
        rgba(244, 247, 251, .55) 45%,
        rgba(244, 247, 251, 0) 75%);
}

.repo-hero-eyebrow {
    display: block;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .35em;
    text-transform: uppercase;
    color: #2A5C94;
    text-shadow: 0 1px 2px rgba(255, 255, 255, .85);
}

.repo-hero-title {
    font-weight: 700;
    font-size: clamp(44px, 5vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--navy);
    text-shadow: 0 1px 3px rgba(244, 247, 251, .95);
}

.repo-hero-sub {
    margin-top: 16px;
    font-size: 22px;
    font-weight: 500;
    color: #16263F;
    text-shadow: 0 1px 2px rgba(255, 255, 255, .9);
}

/* Buscador */
.repo-search-form {
    margin: 30px auto 0;
    max-width: 700px;
}

.repo-search-box {
    display: flex;
    align-items: stretch;
    height: 58px;
    background: #ffffff;
    border: 1px solid #DDE3EC;
    border-radius: 8px;
    padding: 4px;
    box-shadow: var(--shadow-card);
    transition: border-color .16s ease, box-shadow .16s ease;
}

.repo-search-box:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(42, 92, 148, .14);
}

.repo-search-icon {
    display: inline-flex;
    align-items: center;
    padding: 0 8px 0 14px;
    color: var(--navy);
}

.repo-search-icon svg {
    width: 22px;
    height: 22px;
}

.repo-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 18px;
    color: var(--navy);
    padding: 0 6px;
}

.repo-search-input::placeholder {
    color: #8A93A6;
    opacity: 1;
}

.repo-search-btn {
    margin: 4px;
    background: var(--navy);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding-inline: 32px;
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 18px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .16s ease;
}

.repo-search-btn:hover {
    background: #1d3b68;
}

.repo-search-hint {
    margin-top: 14px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text-muted);
}

/* ---------- TARJETAS ---------- */
.repo-cards {
    position: relative;
    z-index: 3;
    max-width: var(--container-cards);
    margin-inline: auto;
    padding-inline: 24px;
    padding-bottom: 64px;
}

.repo-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
}

.repo-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    height: auto;
    min-height: 0;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease;
}

.repo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(20, 40, 75, .14);
}

/* Cabecera: la imagen con tinte ocupa la parte superior */
.repo-card-head {
    position: relative;
    height: 200px;
    flex: 0 0 auto;
    overflow: hidden;
    background: linear-gradient(180deg, #F4F7FB 0%, #E7EDF5 100%);
}

.repo-card-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) contrast(1.05) brightness(1.02);
}

/* Tinte duotono uniforme con el color de la tarjeta */
.repo-card-veil {
    position: absolute;
    inset: 0;
    background: var(--card-color);
    mix-blend-mode: multiply;
    opacity: .8;
}

/* Curva blanca baja: su punto más alto (y = 160px) queda justo
   bajo el borde inferior del círculo (140–160px) */
.repo-card-head::after {
    content: "";
    position: absolute;
    left: -10%;
    right: -10%;
    bottom: -1px;
    height: 40px;
    background: #ffffff;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.repo-card-body {
    position: relative;
    text-align: center;
    margin-top: -24px;
    padding: 0 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
}

/* Círculo del icono: fijo dentro de la cabecera, completo sobre el color */
.repo-card-ico {
    position: absolute;
    top: -136px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--card-color);
    border: 4px solid #ffffff;
    box-shadow: 0 8px 20px rgba(20, 40, 75, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.repo-card-ico svg {
    width: 56px;
    height: 56px;
}

.repo-card-title {
    margin-top: 0;
    font-weight: 600;
    font-size: 32px;
    line-height: 1.15;
    color: var(--navy);
}

.repo-card-rule {
    width: 56px;
    height: 2px;
    border-radius: 2px;
    background: var(--card-color);
    opacity: .35;
    margin: 4px 0 6px;
}

.repo-card-desc {
    font-size: 17px;
    line-height: 1.5;
    color: var(--text-muted);
    max-width: 300px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.repo-card-btn {
    margin-top: 16px;
    margin-bottom: 0;
}

.repo-card-btn a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 222px;
    height: 50px;
    background: var(--card-color);
    color: #ffffff;
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 18px;
    border-radius: var(--radius-pill);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.repo-card-btn a:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(20, 40, 75, .18);
    filter: brightness(1.05);
}

.repo-card-btn svg {
    width: 20px;
    height: 20px;
}

.repo-card--blue { --card-color: var(--blue); }
.repo-card--green { --card-color: var(--green); }
.repo-card--purple { --card-color: var(--purple); }

/* ---------- FRANJA DE CONFIANZA ---------- */
.repo-trust {
    position: relative;
    z-index: 1;
    background: #E9EEF5;
}

.repo-trust-inner {
    max-width: var(--container-wide);
    margin-inline: auto;
    padding-inline: clamp(24px, 4vw, 64px);
    padding-block: 28px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
}

.repo-trust-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 clamp(18px, 1.6vw, 30px);
}

/* Separadores verticales cortos (~40px) */
.repo-trust-item:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 40px;
    background: rgba(20, 40, 75, .15);
}

.repo-trust-icon {
    color: var(--navy);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
}

.repo-trust-icon svg {
    width: 34px;
    height: 34px;
}

.repo-trust-label {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.35;
    color: var(--navy);
}

.repo-trust-quote {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.5;
    color: #4A5568;
    text-align: center;
}

/* ---------- FOOTER ---------- */
.repo-footer {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-top: 1px solid var(--border);
}

.repo-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-block: 20px;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-muted);
}

.repo-footer-copy {
    margin: 0;
}

.repo-footer-sep {
    color: #C7D0DD;
    padding-inline: 6px;
}

.repo-footer-links a {
    color: var(--text-muted);
    transition: color .16s ease;
}

.repo-footer-links a:hover {
    color: var(--navy);
}

/* ---------- MOVIMIENTO REDUCIDO ---------- */
@media (prefers-reduced-motion: reduce) {
    .repo-body *,
    .repo-body *::before,
    .repo-body *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
    .repo-drawer {
        transition: none;
    }
}

@media (max-width: 1240px) {
    .repo-nav-tagline,
    .repo-nav-divider {
        display: none;
    }
    /* Evita que la frase lateral se solape con el bloque centrado */
    .repo-hero-sidenote {
        display: none;
    }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1023px) {
    .repo-hero-sidenote {
        display: none;
    }
    .repo-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .repo-trust-inner {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px 0;
    }
    .repo-trust-item:nth-child(2)::after {
        display: none;
    }
}

@media (max-width: 640px) {
    .repo-nav-tagline,
    .repo-nav-divider,
    .repo-nav-links,
    .repo-nav-login-divider,
    .repo-nav-search,
    .repo-nav-avatar {
        display: none;
    }
    .repo-nav-burger {
        display: inline-flex;
    }

    .repo-hero-row {
        padding-top: 56px;
        padding-bottom: 40px;
    }
    .repo-hero-title {
        font-size: 40px;
    }
    .repo-hero-sub {
        font-size: 18px;
    }
    .repo-search-form {
        max-width: 100%;
    }
    .repo-search-input {
        font-size: 16px;
    }
    .repo-search-btn {
        font-size: 16px;
        padding-inline: 18px;
    }
    .repo-hero-inscriptions {
        display: none;
    }

    .repo-cards {
        padding-inline: 18px;
        padding-bottom: 48px;
    }
    .repo-cards-grid {
        grid-template-columns: 1fr;
    }

    .repo-trust-inner {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding-block: 24px;
    }
    .repo-trust-item:nth-child(2)::after {
        display: none;
    }

    .repo-footer-inner {
        justify-content: center;
        text-align: center;
    }
    .repo-footer-links {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        justify-content: center;
    }
}