@charset "UTF-8";

/* ===========================================================================
   Cartografía - Archivo Juan Negrín — PORTADA (Inicio.aspx)
   Diseño responsive: fluido de móvil a escritorio.
   Reutiliza la paleta y tipografías del mapa para mantener la identidad.
   =========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=Spectral:ital,wght@0,300;0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
    --pergamino: #efe6cf;
    --pergamino-2: #e7dcc0;
    --papel: #fbf7ec;
    --papel-2: #fffdf7;
    --papel-borde: #ddcfa9;
    --tinta: #2c2218;
    --tinta-suave: #6b5d49;
    --oro: #c8860d;
    --oro-claro: #f5c842;
    --oro-oscuro: #7a6010;
    --rojo: #9d2f22;
    --rojo-claro: #c0432f;
    --fundacion: #90278f;
    --fundacion-claro: #ab5ba9;
    --fundacion-oscuro: #6c1d6b;
    --sombra: rgba(60, 44, 20, .18);
    --sombra-fuerte: rgba(36, 26, 16, .28);
    --r: 6px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* evita scroll horizontal por solapes/imagen a sangre */
    font-family: "Spectral", Georgia, serif;
    color: var(--tinta);
    background: radial-gradient(circle at 18% -6%, rgba(245, 200, 66, .14), transparent 42%), radial-gradient(circle at 108% 4%, rgba(157, 47, 34, .09), transparent 40%), var(--pergamino);
}

    /* Grano de papel envejecido, sutil */
    body::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 0;
        pointer-events: none;
        opacity: .05;
        mix-blend-mode: multiply;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    }

h1, h2, h3 {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 600;
    letter-spacing: .2px;
    margin: 0;
}

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

    a:hover {
        color: var(--rojo);
    }

/* ===========================================================================
   CABECERA — imagen a sangre. El recorte superior y el solape del contenido
   se controlan con --hero-shift / --solape para poder anularlos en móvil.
   =========================================================================== */
.hero {
    --hero-shift: 60px;
    position: relative;
    z-index: 1;
    line-height: 0;
    transform: translateY(calc(-1 * var(--hero-shift)));
    margin-bottom: calc(-1 * var(--hero-shift));
}

.hero-img {
    width: 100%;
    height: auto;
    image-rendering: crisp-edges;
}

/* ===========================================================================
   CUERPO — título, texto a dos columnas y fila de botones
   =========================================================================== */
.contenido {
    position: relative;
    z-index: 2; /* por encima del difuminado */
    width: 100%;
    max-width: 1300px;
    margin: clamp(-390px, -19vw, -70px) auto 0;
    padding: 0 clamp(16px, 3vw, 26px);
}

.intro {
    padding: clamp(22px, 2.6vw, 32px) clamp(20px, 3.2vw, 40px) clamp(24px, 2.6vw, 34px);
    background: linear-gradient(180deg, var(--papel-2) 0%, var(--papel) 100%);
    border: 1px solid var(--papel-borde);
    border-radius: var(--r);
    box-shadow: 0 18px 48px var(--sombra), 0 2px 0 rgba(255, 255, 255, .6) inset;
    margin-bottom: clamp(18px, 2.4vw, 30px);
}

.intro-kicker {
    display: block;
    text-align: center;
    font-size: .68rem;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--oro-oscuro);
}

.intro-titulo {
    margin-top: 6px;
    text-align: center;
    font-size: clamp(1.45rem, 1.1rem + 1.4vw, 1.8rem);
    line-height: 1.1;
    color: var(--tinta);
}

.intro-filete {
    width: 110px;
    margin: 14px auto 22px;
    border: 0;
    border-top: 1px solid var(--oro);
    position: relative;
}

    .intro-filete::before {
        content: "✦";
        position: absolute;
        top: -.72em;
        left: 50%;
        transform: translateX(-50%);
        padding: 0 10px;
        background: var(--papel-2);
        color: var(--oro);
        font-size: .78rem;
    }

/* Texto a dos columnas en pantallas anchas: reduce mucho la altura */
.intro-texto {
    column-gap: clamp(26px, 3vw, 38px);
    text-align: justify;
    hyphens: none;
}

    .intro-texto p {
        margin: 0 0 .82em;
        font-size: clamp(.92rem, .86rem + .3vw, 1rem);
        line-height: 1.6;
        color: #36291c;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    }

        .intro-texto p:last-child {
            margin-bottom: 0;
        }

        .intro-texto p a {
            color: inherit;
            text-decoration: underline;
            text-decoration-color: var(--papel-borde);
        }

            .intro-texto p a:hover {
                color: var(--fundacion);
                text-decoration-color: currentColor;
            }

        .intro-texto p:first-child::first-letter {
            font-family: "Fraunces", Georgia, serif;
            font-weight: 600;
            float: left;
            font-size: clamp(2.5rem, 2rem + 1.6vw, 3rem);
            line-height: .82;
            padding: 4px 10px 0 0;
            color: var(--fundacion);
        }

        .intro-texto.modo-creditos p:first-child::first-letter {
            all: unset;
        }

/* ----- Créditos: cuadrícula de tarjetas ----- */
.creditos-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(10px, 1.6vw, 16px);
}

@media (min-width: 620px) {
    .creditos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.credito-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
    padding: clamp(16px, 2vw, 20px) 14px;
    background: var(--papel-2);
    border: 1px solid var(--papel-borde);
    border-radius: var(--r);
    box-shadow: 0 6px 16px var(--sombra);
    transition: transform .15s ease, box-shadow .15s ease;
}

    .credito-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 22px var(--sombra);
    }

.credito-rol {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.6em;
    font-size: .66rem;
    line-height: 1.3;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--oro-oscuro);
}

.credito-nombre {
    font-family: Georgia, serif;
    font-weight: 600;
    font-size: 1.02rem;
    color: var(--tinta);
}

    .credito-nombre a {
        color: inherit;
        text-decoration: none;
    }

        .credito-nombre a::after {
            content: "\2197";
            margin-left: .25em;
            font-size: .85em;
        }

        .credito-nombre a:hover {
            color: var(--fundacion);
        }

.credito-puesto {
    position: relative;
    margin-top: 4px;
    padding-top: 7px;
    font-size: .74rem;
    color: #10100f;
}

    .credito-puesto::before {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 24px;
        height: 1px;
        background: var(--papel-borde);
    }

@media (min-width: 1300px) {
    .intro-texto {
        columns: 2;
    }

    .intro-texto.modo-creditos {
        columns: 1;
    }
}

/* ----- Botones ----- */
.acciones {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: clamp(10px, 1.2vw, 12px);
    justify-content: center;
    margin-top: clamp(16px, 2vw, 26px);
    padding-top: clamp(14px, 1.8vw, 22px);
    border-top: 1px solid var(--papel-borde);
}

/* Envoltorio sin efecto en el layout: los 4 botones quedan como hijos
   directos de .acciones, centrados exactamente igual que antes. */
.acciones-principales {
    display: contents;
}

/* Botón de créditos fuera del flujo flex para no desplazar al resto. */
.cta-creditos {
    position: absolute;
    right: 0;
    top: 64%;
    transform: translateY(-50%);
    min-height: auto;
    padding: 6px 14px;
    font-size: .78rem;
    font-weight: 500;
    border: 1px dashed var(--papel-borde);
    background: transparent;
    color: var(--tinta-suave);
    box-shadow: none;
}

    .cta-creditos:hover {
        color: var(--fundacion);
        border-color: var(--fundacion);
        transform: translateY(-50%);
        box-shadow: none;
    }

.cta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 clamp(16px, 2vw, 22px);
    border-radius: var(--r);
    font-family: "Fraunces", Georgia, serif;
    font-weight: 600;
    font-size: clamp(.9rem, .86rem + .2vw, .98rem);
    letter-spacing: .2px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, color .15s ease, border-color .15s ease;
}

.cta-principal {
    color: #fff;
    border-color: var(--fundacion-oscuro);
    background: linear-gradient(180deg, var(--fundacion-claro) 0%, var(--fundacion-oscuro) 100%);
    box-shadow: 0 6px 13px rgba(144, 39, 143, .35);
}

    .cta-principal:hover {
        border: 1px solid var(--fundacion);
        background: var(--papel-2);
        color: var(--fundacion);
        transform: translateY(-2px);
    }

.cta-secundario {
    border: 1px solid var(--fundacion);
    background: var(--papel-2);
    color: var(--fundacion);
}

    .cta-secundario:hover {
        color: var(--fundacion);
        border-color: var(--fundacion);
        transform: translateY(-2px);
        box-shadow: 0 8px 18px var(--sombra);
    }

/* El enlace externo se distingue con un matiz más tenue */
.cta-externo {
    border-style: dashed;
    color: var(--fundacion);
}

.cta .ico {
    font-size: 1.05em;
    line-height: 1;
}

/* ===========================================================================
   PIE — capa superior translúcida con los logos
   =========================================================================== */
.pie {
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding: clamp(6px, 1.vw, 8px) clamp(16px, 3vw, 26px) clamp(12px, 1.6vw, 13px);
    background: rgba(251, 247, 236, .62);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-top: 1px solid var(--fundacion);
    box-shadow: 0 -10px 30px rgba(60, 44, 20, .10);
}

.pie-inner {
    max-width: 1700px;
    margin: 0 auto;
    text-align: center;
}

.pie-rotulo {
    display: block;
    font-size: .64rem;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--tinta-suave);
    margin-bottom: 12px;
}

/* ===========================================================================
   LOGOS DEL PIE
   Fila centrada que envuelve (wrap) cuando no caben todos; en móvil se
   apilan uno debajo de otro. Alturas y separación fluidas.
   =========================================================================== */

.pie-logos {
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: clamp(20px, 4vw, 60px);
    row-gap: 20px;
}

/* Tamaño de cada logo (el orden visual lo da el orden en el HTML) */
.logo-fundacion {
    --logo-height: clamp(58px, 7vw, 95px);
    --logo-max-width: 260px;
}

.logo-iatext {
    --logo-height: clamp(80px, 9.5vw, 130px);
    --logo-max-width: 380px;
}

.logo-clariah {
    --logo-height: clamp(18px, 6.4vw, 30px);
    --logo-max-width: 260px;
}

.logo-ayto {
    --logo-height: clamp(48px, 6vw, 78px);
    --logo-max-width: 150px;
}

.logo-consejeria {
    --logo-height: clamp(28px, 7vw, 50px);
    --logo-max-width: 220px;
}

.logo-gobcan {
    --logo-height: clamp(40px, 6vw, 70px);
    --logo-max-width: 200px;
}

/* Enlace contenedor */
.pie-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

    /* Imagen del logo */
    .pie-logo img {
        display: block;
        height: var(--logo-height);
        max-width: var(--logo-max-width);
        width: 100%;
        object-fit: contain;
        opacity: 1;
        transition: opacity .15s ease, transform .15s ease;
    }

    .pie-logo:hover img {
        opacity: 1;
        transform: translateY(-1px);
    }


.logo-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 130px;
    height: 50px;
    border: 1px dashed var(--papel-borde);
    border-radius: var(--r);
    color: var(--tinta-suave);
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    background: rgba(255, 253, 247, .5);
}

.pie-credito {
    margin: 14px 0 0;
    font-size: .78rem;
    color: var(--tinta-suave);
}

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

/* --- Tablet: reduce el ancho útil y la separación de logos --- */
@media (max-width: 980px) {
    .contenido {
        max-width: 860px;
    }

    .pie-logos {
        column-gap: clamp(16px, 3vw, 40px);
    }
}

/* --- Móvil: una columna, cabecera completa, texto a bandera --- */
@media (max-width: 1300px) {
    .hero {
        --hero-shift: 0px;
        /* al estrechar, la caja se mantiene más alta que la imagen (3:1),
           así que object-fit:cover "hace zoom" recortando los lados y el
           texto central conserva tamaño en vez de encogerse */
        height: clamp(180px, 50vw, 367px);
    }
    /* imagen completa, sin recorte superior */

    .hero-img {
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    .contenido {
        margin-top: clamp(-190px, -25vw, -16px);
    }
    /* solape suave, no agresivo */

    .intro-texto {
        columns: 1;
        column-gap: 0;
        text-align: left; /* sin justificar: evita huecos en líneas cortas */
        hyphens: manual;
    }

        .intro-texto p {
            font-size: 1rem;
            line-height: 1.62;
        }

            .intro-texto p:first-child::first-letter {
                font-size: 2.6rem;
                padding: 2px 8px 0 0;
            }

    .acciones {
        gap: 10px;
    }

    .cta-creditos {
        position: static;
        transform: none;
        width: 100%;
        justify-content: center;
        margin-top: 4px;
    }

    .cta {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }

    .pie-logos {
        flex-direction: column;
        row-gap: 28px;
        column-gap: 0;
        padding: 16px 0;
    }

    .logo-fundacion,
    .logo-iatext,
    .logo-clariah,
    .logo-ayto,
    .logo-consejeria,
    .logo-gobcan {
        --logo-height: 56px;
        --logo-max-width: 70vw;
        margin-left: 0;
    }

    .logo-fundacion {
        --logo-height: 72px;
    }

    .logo-iatext {
        margin-top: -12px;
    }

    .logo-clariah {
        --logo-height: 32px;
    }

    .logo-ayto {
        --logo-height: 64px;
    }

    .logo-consejeria {
        --logo-height: 48px;
    }

    .logo-gobcan {
        --logo-height: 52px;
    }
}

/* --- Móvil pequeño --- */
@media (max-width: 420px) {
    .intro {
        padding: 18px 16px 20px;
    }

    .intro-texto p {
        font-size: .97rem;
        line-height: 1.58;
    }

        .intro-texto p:first-child::first-letter {
            font-size: 2.3rem;
        }

    .pie {
        padding: 10px 14px 14px;
    }
}


/* ===========================================================================
   BARRAS DE SCROLL GLOBALES — estilo archivo / pergamino
   =========================================================================== */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(200, 134, 13, .65) rgba(255, 253, 247, .35);
}

    /* Chrome, Edge, Safari */
    *::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }

    *::-webkit-scrollbar-track {
        background: rgba(255, 253, 247, .35);
        border-radius: 999px;
    }

    *::-webkit-scrollbar-thumb {
        background: rgba(200, 134, 13, .58);
        border: 2px solid rgba(255, 253, 247, .55);
        background-clip: padding-box;
        border-radius: 999px;
    }

        *::-webkit-scrollbar-thumb:hover {
            background: var(--oro);
            background-clip: padding-box;
        }

    *::-webkit-scrollbar-corner {
        background: transparent;
    }
