.mapa-marco {
    position: relative;
    border: 1px solid var(--borde);
    border-radius: 12px;
    overflow: hidden;
}

#mapa {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 420px;
    background: #ffffff;
}

.nota {
    font-family: "Roboto Condensed", sans-serif;
    font-size: 0.9rem;
    color: var(--texto-tenue);
}

/* Leyenda */

.leyenda {
    position: absolute;
    left: 12px;
    bottom: 12px;
    width: 230px;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(10, 10, 10, 0.85);
    color: white;
    font-family: "Roboto Condensed", sans-serif;
    font-size: 0.8rem;
    pointer-events: none;
}

.leyenda-titulo {
    margin-bottom: 0.4rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.leyenda-rampa {
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(
        to right,
        #ffffff,
        #fef0d9,
        #fdcc8a,
        #fc8d59,
        #e34a33,
        #b30000
    );
}

.leyenda-extremos {
    display: flex;
    justify-content: space-between;
    color: var(--texto-suave);
    margin-top: 0.2rem;
}

/* Popup y controles de MapLibre */

.maplibregl-popup-content {
    background: #0a0a0a;
    color: white;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-family: "Inter", sans-serif;
    font-size: 0.85rem;
    line-height: 1.4;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.maplibregl-popup-content strong {
    font-family: "Outfit", sans-serif;
    font-weight: 600;
}

.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
    border-top-color: #0a0a0a;
}
.maplibregl-popup-anchor-top .maplibregl-popup-tip {
    border-bottom-color: #0a0a0a;
}
.maplibregl-popup-anchor-left .maplibregl-popup-tip {
    border-right-color: #0a0a0a;
}
.maplibregl-popup-anchor-right .maplibregl-popup-tip {
    border-left-color: #0a0a0a;
}

.maplibregl-ctrl-attrib a {
    color: #333;
}

@media (max-width: 576px) {
    #mapa {
        aspect-ratio: auto;
        height: 70vh;
    }

    .leyenda {
        width: 160px;
    }
}

/* ---- Componentes de la nota (compartidos con los reportajes) ---- */

.firma {
    font-family: "Roboto Condensed", sans-serif;
    font-size: 0.95rem;
    color: var(--texto-tenue);
    margin-top: 1.5rem;
}

/* Cifras principales */

.cifra {
    height: 100%;
    border-top: 2px solid var(--borde);
    padding-top: 1rem;
}

.cifra-num {
    font-family: "Outfit", sans-serif;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 600;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.cifra-txt {
    font-size: 0.95rem;
    color: var(--texto-suave);
    margin: 0;
}

/* Texto del reportaje */

.relato {
    max-width: 44rem;
    margin: 3.5rem 0 2rem 0;
}

.relato h2 {
    margin-bottom: 1.25rem;
}

.relato p {
    font-size: 1.1rem;
    line-height: 1.7;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
}

/* Gráficas */

.grafica {
    margin: 0 0 3rem 0;
}

.grafica-titulo {
    font-family: "Outfit", sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.grafica-sub {
    font-family: "Roboto Condensed", sans-serif;
    font-size: 0.95rem;
    color: var(--texto-tenue);
    margin-bottom: 1rem;
}

.muestra {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    margin-right: 0.3rem;
    vertical-align: -1px;
}

.lienzo {
    width: 100%;
}

.lienzo svg {
    display: block;
    overflow: visible;
}

.lienzo text,
.mini text {
    font-family: "Roboto Condensed", sans-serif;
    fill: var(--texto-tenue);
    font-size: 12px;
}

.eje .domain {
    display: none;
}

.eje line {
    stroke: #262626;
}

.anotacion {
    fill: white !important;
    font-size: 13px !important;
}

.leyenda-linea {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
    margin-top: 0.75rem;
    font-family: "Roboto Condensed", sans-serif;
    font-size: 0.9rem;
    color: var(--texto-suave);
}

/* Múltiplos pequeños */

.mini {
    border-top: 1px solid var(--borde);
    padding-top: 0.75rem;
}

.mini-titulo {
    font-family: "Roboto Condensed", sans-serif;
    font-size: 0.95rem;
    color: var(--texto-suave);
    margin-bottom: 0.25rem;
}

.mini-valores {
    font-family: "Outfit", sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.mini-valores .flecha {
    color: var(--texto-tenue);
    font-weight: 300;
    margin: 0 0.3rem;
}

/* Tabla */

.tabla-contenedor {
    overflow-x: auto;
}

.tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.tabla th {
    font-family: "Roboto Condensed", sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.8rem;
    color: var(--texto-tenue);
    border-bottom: 1px solid var(--borde);
    padding: 0.6rem 0.75rem;
    text-align: left;
}

.tabla td {
    border-bottom: 1px solid #1a1a1a;
    padding: 0.7rem 0.75rem;
    vertical-align: top;
    color: var(--texto-suave);
}

.tabla td:first-child {
    color: white;
    font-family: "Outfit", sans-serif;
    font-weight: 600;
}

.tabla .lugar {
    color: white;
}

.tabla .num {
    text-align: right;
    white-space: nowrap;
}

.tabla .barra-ha {
    display: inline-block;
    height: 8px;
    border-radius: 4px;
    background: var(--color-rojo);
    margin-right: 0.5rem;
    vertical-align: 1px;
}

.tabla .desconocida {
    color: var(--color-amarillo);
}

/* Metodología */

.metodologia {
    max-width: 44rem;
    border-top: 1px solid var(--borde);
    margin-top: 4rem;
    padding-top: 2rem;
}

.metodologia ul {
    padding-left: 1.1rem;
}

.metodologia li {
    color: var(--texto-suave);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.metodologia strong {
    color: white;
    font-weight: 500;
}

/* Tooltip */

.tooltip-pirah {
    position: fixed;
    z-index: 1000;
    max-width: 260px;
    padding: 0.65rem 0.9rem;
    border-radius: 12px;
    background: #111111;
    border: 1px solid var(--borde);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    color: white;
    font-size: 0.85rem;
    line-height: 1.45;
    pointer-events: none;
}

.tooltip-pirah strong {
    font-family: "Outfit", sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
}

.tooltip-pirah .tt-dato {
    color: var(--texto-suave);
}


/* ---- Propios de la nota metodológica ---- */

.leyenda-nota {
    margin: 0.2rem 0 0 0;
    color: var(--texto-suave);
    line-height: 1.35;
}

.paso-titulo {
    font-size: 1.15rem;
    margin: 2rem 0 0.75rem 0;
}

.formula {
    overflow-x: auto;
    padding: 0.5rem 0;
    font-size: 1.1rem;
}

.lista-limites {
    padding-left: 1.1rem;
}

.lista-limites li {
    font-size: 1.05rem;
    line-height: 1.65;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.9rem;
}

.lista-limites strong {
    font-weight: 600;
    color: white;
}

.tabla .boton-ver {
    background: transparent;
    border: 1px solid var(--borde);
    border-radius: 999px;
    color: var(--texto-suave);
    padding: 0.15rem 0.7rem;
    font-family: "Roboto Condensed", sans-serif;
    font-size: 0.85rem;
}

.tabla .boton-ver:hover {
    border-color: white;
    color: white;
}

.katex {
    color: white;
}

@media (max-width: 576px) {
    .leyenda {
        position: static;
        width: auto;
        border-radius: 0;
    }
}
