/* =========================================================
   VARIABLES Y BASE
   ========================================================= */
:root {
    --bg-1: linear-gradient(135deg, rgb(130, 115, 225) 0%, rgb(86, 108, 220) 16%, rgb(34, 54, 88) 65%, rgb(12, 18, 32) 100%);
    --bg-2: linear-gradient(135deg, rgb(130, 115, 225) 0%, rgb(86, 108, 220) 16%, rgb(64, 152, 190) 36%, rgb(34, 54, 88) 65%, rgb(12, 18, 32) 100%);
    --bg-3: radial-gradient(circle at 0% 15%, rgb(129, 122, 230) 0%, rgba(129, 122, 230, 0) 45%),
        radial-gradient(circle at 90% 100%, rgb(66, 201, 186) 0%, rgba(66, 201, 186, 0) 40%),
        linear-gradient(135deg, rgb(32, 36, 56) 0%, rgb(38, 51, 92) 35%, rgb(32, 66, 86) 60%, rgb(18, 24, 35) 100%);
    --bg-dark: #0c1220;
    --bg-light: #f7f9fc;
    --text: #e8eefc;
    --text-dark: #1b2430;
    --accent: #42c9ba;
    --accent-card: #42c9b98c;
    --glass: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.12);
}

html,
body {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
    font-family: 'Nunito', 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial;
    color: var(--text);
    background: var(--bg-dark);
}

.container {
    width: min(1200px, 92%);
    margin-inline: auto;
}

.imagen-logo {
    max-width: 400px;
}

/* =========================================================
   NAVBAR
   ========================================================= */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}

.nav__brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-left: 12px;
}

.nav__links a {
    color: #fff;
    text-decoration: none;
    opacity: .9;
    font-weight: 600;
}

.nav__links a:hover {
    opacity: 1;
}

.nav__auth {
    display: flex;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap;
}

/* BOTONES */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #0a0f1a;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 800;
    letter-spacing: .3px;
    box-shadow: 0 6px 18px rgba(66, 201, 186, 0.35);
    transition: transform .2s ease, box-shadow .2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(66, 201, 186, 0.45);
}

.btn--ghost {
    background: transparent;
    color: #fff;
    border: 1px solid var(--border);
}

.btn--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn--sm {
    padding: 8px 12px;
    font-size: .9rem;
}

/* =========================================================
   SECCIONES GENERALES
   ========================================================= */
#inicio, #cloaca, #calidad{
    min-height: 100vh;
}

.inicio, .section{
    box-shadow:
        0 -10px 20px -5px rgba(0, 0, 0, 0.35), /* offset-y negativo para arriba */
        /* Sombra inferior */
        0 10px 20px -5px rgba(0, 0, 0, 0.35);   /* offset-y positivo para abajo */
}

.section {
    padding: 30px 0;
}

.section--light {
    background: var(--bg-light);
    color: var(--text-dark);
    scroll-margin-top: var(--nav-height);
}

.section-cloaca {
    background: var(--bg-2);
    scroll-margin-top: var(--nav-height);
}

.section-nosotros {
    background: var(--bg-3);
    scroll-margin-top: var(--nav-height);
}

.section__title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(28px, 4vw, 38px);
    margin-bottom: 16px;
    scroll-margin-top: var(--nav-height);
}

.lead {
    font-size: 18px;
    opacity: .9;
}

/* =========================================================
   LISTAS Y GRID
   ========================================================= */
.list {
    padding-left: 18px;
}

.list li {
    margin: 6px 0;
}

.grid {
    display: grid;
    gap: 24px;
}

/* =========================================================
   STATS
   ========================================================= */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 24px 0;
}

.stat {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 18px;
    border-radius: 14px;
    background: var(--glass);
    border: 1px solid var(--border);
    box-shadow: 8px 10px 24px rgba(0, 0, 0, 0.25),
        2px 4px 8px rgba(0, 0, 0, 0.18);
}

.stat__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.stat__value {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
}

.stat__label {
    opacity: .85;
    font-size: .9rem;
}

/* Variantes */
.stats--warn .stat {
    background: rgba(255, 193, 7, 0.08);
    border-color: rgba(255, 193, 7, 0.28);
}

.stats--danger .stat {
    background: rgba(220, 53, 69, 0.10);
    border-color: rgba(220, 53, 69, 0.34);
}

/* Estado inicial: oculto y ligeramente desplazado */
.grid.stats.reveal-init {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease-in, transform 600ms ease-in;
}

/* Estado visible: opaco y en posición */
.grid.stats.reveal-show {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid.stats.reveal-show .stat {
    animation: fadeUp 1300ms ease forwards;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
    background: #0a0f1a;
    padding: 24px 0;
}

.footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: min(1200px, 92%);
    margin-inline: auto;
}

.footer__inner a {
    color: #fff;
    opacity: .85;
    text-decoration: none;
}

.footer__inner a:hover {
    opacity: 1;
}

/* =========================================================
   SECCIÓN INICIO (logo a la izquierda / noticias a la derecha)
   ========================================================= */
.inicio {
    background: var(--bg-3);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0px 0 50px;
    height: calc(100vh - 280px);
}

#calidad{
    min-height: 100vh;
}

.inicio>div {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 90%;
    gap: 40px;
}

/* Logo (25%) */
.inicio>div>div:first-child {
    flex: 0 0 25%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.imagen-logo {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
    transition: transform 0.3s ease;
}

.imagen-logo:hover {
    transform: scale(1.05);
}

/* Noticias (Swiper 75%) */
.inicio .swiper {
    flex: 0 0 75%;
    height: auto;
    position: relative;
    /* referencia para las flechas */
}

/* =========================================================
   SWIPER NOTICIAS
   ========================================================= */
.swiper {
    width: 100%;
    padding: 40px 0;
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 8px 10px 5px rgba(0, 0, 0, 0.19),
        2px 4px 8px rgba(0, 0, 0, 0.15);
    color: var(--text);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 300px;
    position: relative;
    z-index: 2;
    /* las cards por encima si hiciera falta */
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 10px 12px 7px rgba(0, 0, 0, 0.35);
}

.card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.card-fechas {
    margin-top: auto;
    font-size: 0.9rem;
    opacity: 0.9;
    text-align: center;
}

.card-fechas span {
    display: block;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: rgb(255, 255, 255);
    text-align: center;
}

.subtitulo-card {
    background-color: var(--accent-card);
    border-radius: 8px;
    padding: 8px;
    font-weight: 600;
    margin-bottom: 10px;
    height: 95%;
    width: 85%;
    margin: auto;
    margin-bottom: 20px;
}

.divisor-titulo-card,
.divisor-card {
    width: 100%;
    height: 2px;
    background-color: rgb(255, 255, 255);
    margin: 8px 0;
}

/* Flechas Swiper: fuera del carrusel para no tapar cards */
.inicio .swiper-button-prev,
.inicio .swiper-button-next {
    color: var(--accent);
    transition: color 0.3s, transform 0.2s;
    width: 36px;
    /* área clicable contenida */
    height: 36px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    /* por debajo de la card (z=2) */
}

.inicio .swiper-button-prev::after,
.inicio .swiper-button-next::after {
    font-size: 22px;
    /* tamaño del ícono */
}

.inicio .swiper-button-prev {
    left: -28px;
}

/* mover hacia afuera */
.inicio .swiper-button-next {
    right: -28px;
    z-index: 3;
}

.swiper-slide .card {
    z-index: 2;
}

.inicio .swiper-button-prev:hover,
.inicio .swiper-button-next:hover {
    color: #ffcb00;
    transform: translateY(-50%) scale(1.1);
}

/* =========================================================
RESPONSIVO
========================================================= */
@media (min-width: 901px) {
    .inicio .swiper-button-prev {
        left: -12px;
    }

    .inicio .swiper-button-next {
        right: -12px;
    }
}

@media (max-width: 900px) {
    .card-text {
        text-align: center;
    }

    .inicio {
        flex-direction: column;
        padding: 180px 20px 20px;
        min-height: auto;
    }

    .inicio>div {
        flex-direction: column;
        gap: 30px;
        width: 100%;
    }

    .inicio>div>div:first-child,
    .inicio .swiper {
        flex: 1 1 auto;
        width: 100%;
        max-width: 600px;
    }

    .card {
        width: 95%;
        max-width: 350px;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .subtitulo-card {
        font-size: 0.9rem;
    }

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

    /* En móviles, traemos las flechas un poco hacia adentro */
    .inicio .swiper-button-prev {
        left: 6px;
    }

    .inicio .swiper-button-next {
        right: 6px;
    }
}

@media (max-width: 820px) {
    main {
        margin-top: 50px;
    }

    .nav__inner {
        flex-direction: column;
        align-items: flex-start;
        /* alinear al inicio */
        gap: 10px;
        /* separación entre brand y links */
        padding: 12px 16px;
        /* un poco más compacto */
    }

    .nav__brand {
        margin-right: 0;
    }

    .nav__links {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        /* permite que baje a otra fila */
        gap: 10px 12px;
        /* fila x columna */
        margin-left: 0;
        /* quitar margen en móvil */
    }

    /* Que los enlaces text (no .btn) usen altura consistente */
    .nav__links a:not(.btn) {
        padding: 6px 0;
        /* algo de respiro en móvil */
    }

    /* Opcional: que los botones no rompan el layout */
    .nav__links .btn {
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {

    main {
        margin-top: 180px;
    }

    .nav__links {
        gap: 8px;
    }

    /* Que cada link ocupe la mitad del ancho aprox (dos columnas) */
    .nav__links a {
        flex: 1 1 calc(50% - 12px);
    }

    /* Los botones pueden ocupar el 100% para destacarse */
    .nav__links .btn {
        flex: 1 1 100%;
        text-align: center;
    }
}

@media (max-width: 380px) {
    .inicio {
        padding: 30px 20px 0px;
    }

    .inicio>div{
        gap: 0px;
    }
}


