/* ═══════════════════════════════════════════════════════════════
   riesgo-detail.css — Estilos para páginas de detalle de riesgos
   (lluvias.php / sismos.php / inundaciones.php / incendios.php)
   ═══════════════════════════════════════════════════════════════ */

/* ── Hero de página de riesgo ── */
.riesgo-hero {
    min-height: 380px;
    display: flex;
    align-items: flex-end;
    position: relative;
    background-size: cover;
    background-position: center;
    padding-top: 80px;
    /* compensa navbar fijo */
    overflow: hidden;
}

.riesgo-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.80) 30%, rgba(0, 0, 0, 0.35) 100%);
    z-index: 1;
}

.riesgo-hero-content {
    position: relative;
    z-index: 2;
    padding-bottom: 60px;
}

.riesgo-hero-badge {
    width: 70px;
    height: 70px;
    background: var(--primary-color);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 20px;
    border-bottom: 4px solid var(--accent-orange);
}

.riesgo-hero-badge--orange {
    background: var(--accent-orange);
    border-bottom-color: #fff;
}

.riesgo-hero-content h1 {
    font-size: 3.2rem;
    color: #ffffff;
    text-shadow: 2px 4px 12px rgba(0, 0, 0, 0.8);
    margin-bottom: 12px;
}

.riesgo-hero-content p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-family: var(--font-body);
    font-weight: 400;
}

/* ── Breadcrumb ── */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-family: var(--font-body);
}

.breadcrumb-nav a {
    color: var(--accent-orange);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.breadcrumb-nav a:hover {
    color: var(--primary-color);
}

.breadcrumb-nav span {
    color: var(--text-muted);
}

/* ── Sección principal ── */
.riesgo-main {
    padding-top: 60px;
    padding-bottom: 60px;
}

.riesgo-container {
    max-width: 960px;
}

/* ── Introducción ── */
.riesgo-intro {
    margin-bottom: 3rem;
    border-left: 5px solid var(--accent-orange);
    padding-left: 24px;
}

.riesgo-intro h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.riesgo-lead {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin: 0;
}

/* ── Grid de tarjetas de info ── */
.riesgo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-bottom: 3.5rem;
}

.riesgo-info-card {
    background: var(--bg-light);
    border: 1px solid var(--bg-lines);
    border-top: 4px solid var(--primary-color);
    padding: 32px 28px;
    transition: var(--transition);
}

.riesgo-info-card:hover {
    box-shadow: var(--shadow-large);
    border-top-color: var(--accent-orange);
}

.riesgo-info-card--full {
    grid-column: 1 / -1;
    /* ocupa las dos columnas */
}

.riesgo-info-icon {
    font-size: 2rem;
    margin-bottom: 16px;
    line-height: 1;
}

.riesgo-info-card h3 {
    font-size: 1.15rem;
    margin-bottom: 16px;
}

.riesgo-info-card p {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

/* ── Lista dentro de tarjeta ── */
.riesgo-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.riesgo-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.5;
}

.riesgo-list li i {
    margin-top: 3px;
    flex-shrink: 0;
}

/* ── CTA ── */
.riesgo-cta {
    background: var(--primary-color);
    color: #fff;
    padding: 50px 40px;
    border-radius: 2px;
    text-align: center;
    border-bottom: 5px solid var(--accent-orange);
}

.riesgo-cta h3 {
    color: #fff;
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.riesgo-cta p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.1rem;
    margin-bottom: 28px;
}

.riesgo-cta .btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* ── Otros riesgos ── */
.otros-riesgos {
    padding: 60px 0;
}

.otros-riesgos-grid {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.otro-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--bg-lines);
    border-top: 3px solid transparent;
    padding: 28px 36px;
    text-decoration: none;
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    min-width: 150px;
}

.otro-card i {
    font-size: 2rem;
}

.otro-card:hover {
    border-top-color: var(--accent-orange);
    box-shadow: var(--shadow-large);
    transform: translateY(-4px);
}

/* ── Footer mini ── */
.footer-mini {
    background: var(--primary-color);
    padding: 28px 0;
}

.footer-mini-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-mini p {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    margin: 0;
}

/* ── Grid de factores (incendios) ── */
.incendio-factores-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: none;
}

.incendio-factor-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 24px;
    border-bottom: 1px solid var(--bg-lines);
    transition: background 0.2s ease;
}

.incendio-factor-card:nth-child(odd) {
    border-right: 1px solid var(--bg-lines);
}

.incendio-factor-card:hover {
    background: var(--bg-light);
}

.incendio-factor-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    margin-top: 2px;
    line-height: 1;
}

.incendio-factor-body h4 {
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--primary-color);
    font-family: var(--font-heading);
}

.incendio-factor-body p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* Dark mode */
body.dark-theme .incendio-factor-card {
    border-color: #334155;
}

body.dark-theme .incendio-factor-card:hover {
    background: #0f172a;
}

@media (max-width: 768px) {
    .incendio-factores-grid {
        grid-template-columns: 1fr;
    }

    .incendio-factor-card:nth-child(odd) {
        border-right: none;
    }
}

/* ── Tabla de clasificación ── */
.riesgo-tabla-wrapper {
    margin-bottom: 2.5rem;
    border: 1px solid var(--bg-lines);
    border-top: 4px solid var(--primary-color);
    background: #fff;
    overflow: hidden;
}

.riesgo-tabla-titulo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    margin: 0;
    padding: 20px 24px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--bg-lines);
    color: var(--primary-color);
}

.riesgo-tabla-scroll {
    overflow-x: auto;
}

.riesgo-tabla {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: 0.97rem;
}

.riesgo-tabla thead tr {
    background: var(--primary-color);
    color: #fff;
}

.riesgo-tabla thead th {
    padding: 14px 20px;
    text-align: left;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.riesgo-tabla tbody tr {
    border-bottom: 1px solid var(--bg-lines);
    transition: background 0.2s ease;
}

.riesgo-tabla tbody tr:last-child {
    border-bottom: none;
}

.riesgo-tabla tbody tr:hover {
    background: var(--bg-light);
}

.riesgo-tabla tbody td {
    padding: 14px 20px;
    vertical-align: top;
    line-height: 1.55;
    color: var(--text-main);
}

.riesgo-tabla tbody td:first-child {
    font-weight: 700;
    white-space: nowrap;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Dark mode */
body.dark-theme .riesgo-tabla-wrapper {
    background: #1e293b;
    border-color: #334155;
}

body.dark-theme .riesgo-tabla-titulo {
    background: #0f172a;
}

body.dark-theme .riesgo-tabla tbody tr:hover {
    background: #0f172a;
}

body.dark-theme .riesgo-tabla tbody td {
    color: #e0e6ed;
    border-color: #334155;
}

/* ── Galería de 2 imágenes ── */
.riesgo-galeria {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 3rem;
}

.riesgo-galeria-item {
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    aspect-ratio: 4 / 3;
    /* más alto — de 16/10 a 4/3 */
    min-height: 280px;
    border: 1px solid var(--bg-lines);
    box-shadow: var(--shadow-large);
}

.riesgo-galeria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease, filter 0.4s ease;
    /* Boost de nitidez visual: más contraste y saturación */
    filter: contrast(1.08) saturate(1.15) brightness(1.02);
    image-rendering: high-quality;
}

.riesgo-galeria-item:hover img {
    transform: scale(1.06);
    filter: contrast(1.12) saturate(1.25) brightness(1.04);
}

.riesgo-galeria-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.80) 0%, transparent 100%);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 500;
    font-family: var(--font-body);
    padding: 28px 16px 12px 16px;
    letter-spacing: 0.3px;
}

@media (max-width: 768px) {
    .riesgo-galeria {
        grid-template-columns: 1fr;
    }

    .riesgo-galeria-item {
        min-height: 220px;
    }
}

/* ── Banner pregunta apertura ── */
.riesgo-pregunta-banner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--primary-color);
    color: #fff;
    padding: 24px 28px;
    border-left: 5px solid var(--accent-orange);
    margin-bottom: 3rem;
}

.riesgo-pregunta-banner i {
    font-size: 1.8rem;
    color: var(--accent-orange);
    flex-shrink: 0;
    margin-top: 2px;
}

.riesgo-pregunta-banner p {
    font-size: 1.1rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.6;
}

/* ── Callout destacado (ej: "¿El Perú es sísmico?") ── */
.riesgo-callout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    background: var(--bg-light);
    border: 1px solid var(--bg-lines);
    border-left: 5px solid var(--primary-color);
    padding: 32px 28px;
    margin-bottom: 3rem;
}

.riesgo-callout-icon {
    font-size: 2.2rem;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 4px;
}

.riesgo-callout h3 {
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.riesgo-callout p {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

/* dark mode callout */
body.dark-theme .riesgo-callout {
    background: #1e293b;
    border-color: #334155;
}

body.dark-theme .riesgo-pregunta-banner {
    background: #0b1120;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .riesgo-hero-content h1 {
        font-size: 2.2rem;
    }

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

    .riesgo-info-card--full {
        grid-column: 1;
    }

    .riesgo-cta {
        padding: 36px 24px;
    }

    .footer-mini-inner {
        flex-direction: column;
        text-align: center;
    }

    .otros-riesgos-grid {
        gap: 16px;
    }
}