:root {
    --azul: #0b2454;
    --azul-claro: #174b99;
    --verde: #55a33f;
    --verde-oscuro: #4d9e36;
    --fondo: #f6f8fb;
    --rojo: #c8192e;
    --sombra: 0 6px 18px rgba(0,0,0,0.12);
    --sombra-suave: 0 4px 14px rgba(0,0,0,0.06);
    --amarillo: #f4b000;
    --turquesa: #0ca9a3;
    --rosa:     #d6336c;
    --gris:     #6c7a89;
    --marron:   #8b5a2b;
}
:root {
    --naranja: #f4a900;
    --morado: #7d43b3;
}
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    background: var(--fondo);
    color: var(--azul);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-body {
    flex-grow: 1;
}

/* BARRA DE PROGRESO DE NAVEGACIÓN */
#app-nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--rojo);
    box-shadow: 0 0 8px rgba(200, 25, 46, 0.6);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
}

/* HEADER */
.site-header {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.site-header .navbar {
    min-height: 85px;
}

.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.navbar-logo {
    width: 110px;
    height: auto;
    display: block;
}

/* Logo de la aplicación (barras) a la derecha del logo de la Cámara */
.navbar-logo-app {
    width: 34px;
    height: auto;
    display: block;
    margin-left: 12px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 14px;
    line-height: 1.05;
    font-weight: 800;
    color: var(--azul);
}

.logo-text small {
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: .3px;
}

.navbar-nav .nav-link {
    color: var(--azul) !important;
    font-weight: 800;
    font-size: 13px;
    margin-left: 14px;
    text-transform: uppercase;
    white-space: nowrap; /* "Formas Jurídicas" no debe partirse en dos líneas */
}

/* Pantallas medianas: menos separación para que el menú quepa junto a los dos logos */
@media (min-width: 1200px) and (max-width: 1499.98px) {
    .navbar-nav .nav-link {
        margin-left: 6px;
    }
}
@media (min-width: 1200px) and (max-width: 1379.98px) {
    .navbar-nav .nav-link {
        font-size: 12px;
        margin-left: 2px;
    }
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--verde) !important;
}

/* HERO */
.hero-portada {
    background:
        linear-gradient(rgba(255,255,255,0.72), rgba(255,255,255,0.72)),
        url("../img/cordoba_hero.jpg");
    background-size: cover;
    background-position: center;
    text-align: center;
    padding: 80px 20px 170px;
}
.hero-portada h1 {
    font-size: clamp(36px, 5vw, 52px);
    font-weight: 900;
    margin-bottom: 12px;
    color: #dc3545;
}

.hero-portada h2 {
    font-size: clamp(20px, 3vw, 24px);
    font-style: italic;
    color: #dc3545;
    margin-bottom: 12px;
}

.hero-portada p {
   font-size: 19px;
    line-height: 1.5;
    max-width: 900px;
    margin: auto;
    color: var(--azul);
}

/* CONTENEDOR FLOTANTE */
.portada-container {
    max-width: 1120px;
    margin: -90px auto 0;
    padding: 0 20px;
}

/* TARJETAS SUPERIORES */
.home-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.home-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px 25px;
    text-align: center;
    box-shadow: var(--sombra);
    min-height: 260px;
    color: var(--azul);
    text-decoration: none;
    display: block;
    transition: transform .2s ease, box-shadow .2s ease;
}

.home-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 26px rgba(0,0,0,0.16);
}

.home-icon {
    width: 70px;
    height: 70px;
    background: var(--verde);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 34px;
}

.home-card h3 {
    color: var(--verde);
    font-size: 23px;
    font-weight: 800;
    margin-bottom: 15px;
}

.home-card p {
    font-size: 16px;
    line-height: 1.5;
    color: #12224a;
    margin-bottom: 18px;
}

.home-btn {
    background: var(--verde-oscuro);
    color: white;
    border: none;
    padding: 12px 35px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 16px;
    display: inline-block;
    text-decoration: none;
}

.home-btn:hover {
    background: #3d842a;
    color: white;
}

/* BLOQUES */
.home-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 24px;
    box-shadow: var(--sombra-suave);
}

.home-section h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 26px;
    font-weight: 800;
    color: var(--azul);
}

/* CIFRAS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.stat-card {
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 110px;
}

.stat-green {
    background: #edf6e9;
    color: var(--verde-oscuro);
}

.stat-yellow {
    background: #fff5df;
    color: #f4a900;
}

.stat-blue {
    background: #edf5ff;
    color: #005ecb;
}

.stat-purple {
    background: #f6eafa;
    color: #7d43b3;
}

.stat-icon {
    font-size: 44px;
}

.stat-card strong {
    font-size: 30px;
    display: block;
    font-weight: 900;
}

.stat-card small {
    color: var(--azul);
    font-weight: bold;
    font-size: 15px;
}

.stat-card .diff {
    display: block;
    font-size: 22px;
    margin-top: 8px;
    font-weight: 800;
}

/* Variación % respecto al año anterior (mismo formato que analisis/index.php) */
.stat-card .stat-pct {
    display: block;
    font-size: 15px;
    font-weight: 700;
    margin-top: 2px;
}
.stat-white {
    background: #ffffff !important;
}

.stat-provincia {
    color: #55a33f;
}

.stat-provincia .stat-icon,
.stat-provincia strong,
.stat-provincia small {
   
}

.stat-provincia strong {
    font-size: 24px;
}

.stat-provincia .stat-note {
    color: #55a33f;
    opacity: .8;
}
/* FEATURES */
.features-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.feature-card {
    background: white;
    border-radius: 12px;
    padding: 28px 18px;
    text-align: center;
    min-height: 240px;
    box-shadow: var(--sombra-suave);
}

.feature-card .big-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: inherit;
}

.feature-card h3 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 15px;
    color: inherit;
}

.feature-card p {
    font-size: 15px;
    line-height: 1.45;
    color: #17254a;
}

.feature-green {
    background: #edf6e9;
    color: var(--verde-oscuro);
}

.feature-yellow {
    background: #fff5df;
    color: #f4a900;
}

.feature-blue {
    background: #edf5ff;
    color: #005ecb;
}

.feature-pink {
    background: #fdebf4;
    color: #e7558d;
}

.feature-purple {
    background: #f6eafa;
    color: #7d43b3;
}

.feature-bg-white {
    background: #ffffff !important;
}
/* AUDIENCE */
.audience-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    text-align: center;
}

.audience-item {
    border-right: 1px solid #ddd;
    padding: 10px;
    font-weight: 600;
    color: var(--azul);
}

.audience-item:last-child {
    border-right: none;
}

.audience-item span {
    font-size: 36px;
    color: var(--verde);
    display: block;
    margin-bottom: 10px;
}

/* POR QUÉ ES ÚNICA (acordeón) */
.why-box {
    background: rgb(216, 213, 213);
    border-radius: 12px;
    padding: 30px 36px;
    margin-bottom: 20px;
}

.why-title {
    color: var(--verde);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 18px;
    text-align: center;
}

.why-item {
    background: #fff;
    border: none;
    border-radius: 10px !important;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: var(--sombra-suave);
}

.why-btn {
    font-weight: 700;
    color: var(--azul);
    background: #fff;
    font-size: 16px;
    padding: 14px 18px;
}

.why-btn:not(.collapsed) {
    color: var(--verde);
    background: #fff;
    box-shadow: none;
}

.why-btn:focus {
    box-shadow: none;
}

.why-body {
    color: #17254a;
    line-height: 1.55;
    font-size: 15px;
    padding: 4px 18px 18px 18px;
}

.camara-text {
    font-size: 42px;
    color: var(--rojo);
    font-weight: bold;
    font-family: Georgia, serif;
}

/* FOOTER */
.site-footer {
    background: #002d5c;
    color: white;
    padding: 28px 60px 12px;
    margin-top: 40px;
}

.footer-grid {
    max-width: 1300px;
    margin: auto;
    display: grid;
    /* La columna "Objetivo" (texto largo) es más ancha para que el pie no crezca en altura */
    grid-template-columns: 1.6fr 1fr 1fr 1fr 2.1fr;
    gap: 30px;
}

/* Logo (barras de colores) a la izquierda del bloque de marca */
.footer-marca {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.footer-logo {
    width: 56px;
    height: auto;
    flex-shrink: 0;
    margin-top: 4px;
}

.site-footer h4 {
    color: #6bbb45;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 800;
}

.site-footer p,
.site-footer a {
    color: white;
    display: block;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.6;
}

.copy {
    /* Subvención y copyright en una sola línea (se reparten en dos si no caben) */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 28px;
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    border-top: 1px solid rgba(255,255,255,.2);
    padding-top: 10px;
}

.copy-subvencion {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.copy-subvencion-texto {
    opacity: .85;
}

/* AVISO DE COOKIES (assets/js/cookies.js) */
.cookies-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 2000;
    max-width: 980px;
    margin: 0 auto;
    background: #fff;
    color: #2c3e50;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
    border-top: 4px solid #002d5c;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.cookies-banner[hidden] {
    display: none;
}

.cookies-banner-texto {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex: 1;
}

.cookies-banner-texto i {
    font-size: 1.6rem;
    color: #002d5c;
    flex-shrink: 0;
}

.cookies-banner-texto p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.cookies-banner-texto a {
    color: #0d6efd;
    font-weight: 600;
    white-space: nowrap;
}

.cookies-banner-botones {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Aceptar y Rechazar con el mismo tamaño y el mismo peso visual (criterio AEPD) */
.cookies-btn {
    min-width: 120px;
    padding: 9px 18px;
    border: 2px solid #002d5c;
    border-radius: 8px;
    background: #002d5c;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.cookies-btn:hover,
.cookies-btn:focus-visible {
    background: #0b4a8f;
    border-color: #0b4a8f;
}

@media (max-width: 767.98px) {
    .cookies-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        left: 8px;
        right: 8px;
        bottom: 8px;
    }

    .cookies-banner-botones .cookies-btn {
        flex: 1;
    }
}

/* Logo oficial de la Junta: se usa tal cual, sobre fondo blanco (está pensado para fondo claro) */
.copy-logo-junta {
    display: inline-flex;
    background: #fff;
    border-radius: 6px;
    padding: 6px 10px;
}

.copy-logo-junta img {
    height: 46px;
    width: auto;
    display: block;
}

/* RESPONSIVE */
@media (max-width: 1100px) {
    .home-cards,
    .stats-grid,
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .audience-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* En dos columnas, el Objetivo ocupa toda la fila */
    .footer-objetivo {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .site-header .navbar {
        min-height: auto;
    }

    .logo-text {
        font-size: 18px;
    }

    .navbar-nav .nav-link {
        margin-left: 0;
        padding: 10px 0;
    }

    .hero-portada {
        padding: 60px 20px 140px;
    }

    .portada-container {
        margin-top: -70px;
    }

    .home-cards,
    .stats-grid,
    .features-grid,
    .audience-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .audience-item {
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    .site-footer {
        padding: 30px 20px 15px;
    }
}
.audience-section {
    padding: 48px 0;
    margin-bottom: 24px;
}

.audience-section .section-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 26px;
    font-weight: 800;
    color: var(--azul);
}

.audience-card {
    height: 100%;
    background: #ffffff;
    border-radius: 14px;
    padding: 30px 24px;
    text-align: center;
    box-shadow: var(--sombra-suave);
    transition: transform .2s ease, box-shadow .2s ease;
}

.audience-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra);
}

.audience-card i {
    display: block;
    font-size: 46px;
    margin-bottom: 16px;
}

.audience-card h4 {
    color: var(--azul);
    font-size: 21px;
    font-weight: 800;
    margin-bottom: 12px;
}

.audience-card p {
    color: #17254a;
    font-size: 15px;
    line-height: 1.55;
    margin-bottom: 0;
}
