/* ============================================================
   Portada Descubriendo Palencia
   Solo afecta a la zona central de index.html.
   Cabecera, menú lateral y barra inferior mantienen sus estilos actuales.
   ============================================================ */

:root {
    --ovt-max-width: 800px;
    --ovt-gap: clamp(5px, 0.75dvh, 8px);
    --ovt-side: clamp(8px, 2.5vw, 16px);
    --ovt-green: #415f24;
    --ovt-green-dark: #7f9257;
    --ovt-text: #17242b;

    /* Alturas ocupadas por la cabecera y la barra inferior actual. */
    --ovt-header-height: 88px;
    --ovt-bottom-height: 48px;
}

/* La portada no debe generar scroll. */
html,
body {
    min-height: 100%;
}

body {
    overflow: hidden;
}

/* La zona de contenido queda exactamente entre cabecera y barra inferior. */
.content.width100.ovt-home-content {
    position: fixed;
    z-index: 1;
    top: var(--ovt-header-height);
    right: 0;
    bottom: var(--ovt-bottom-height);
    left: 0;
    width: 100%;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    line-height: normal;
    background: #fff;
}

/* App.js alterna entre municipios y mapa usando estos IDs. */
#descumunicipios {
    width: 100%;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    justify-content: center !important;
    overflow: hidden;
}

#descumapa {
    width: min(100%, var(--ovt-max-width));
    height: 100% !important;
    min-height: 0;
    margin: 0 auto !important;
    padding: 0;
    display: none;
}

#descumapa #map {
    width: 100%;
    height: 100%;
    margin: 0 !important;
}

/* ------------------------------------------------------------
   Estructura principal
   ------------------------------------------------------------ */
.ovt-portada {
    width: min(100%, var(--ovt-max-width));
    height: 100%;
    min-height: 0;
    margin: 0 auto;
    padding: clamp(6px, 1dvh, 10px) var(--ovt-side);

    display: grid;
    grid-template-rows: auto minmax(0, 1fr) clamp(66px, 11.5dvh, 94px) clamp(42px, 6.5dvh, 58px);
    gap: var(--ovt-gap);

    background: #fff;
    overflow: hidden;
}

/* ------------------------------------------------------------
   Presentación
   ------------------------------------------------------------ */
.ovt-portada-intro {
    position: relative;
    min-height: 0;
    overflow: hidden;
    padding: 0 3px clamp(3px, .6dvh, 7px);
}

.ovt-portada-intro::after {
    content: "";
    position: absolute;
    z-index: 0;
    top: -25%;
    right: -5%;
    width: 58%;
    height: 145%;
    opacity: .35;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 75% 80%, rgba(154,173,112,.30) 0, rgba(154,173,112,0) 58%),
        linear-gradient(155deg, transparent 45%, rgba(35,64,70,.07) 46%, transparent 48%);
}

.ovt-portada-intro > * {
    position: relative;
    z-index: 1;
}

.ovt-portada-linea {
    display: block;
    width: clamp(28px, 8vw, 42px);
    height: 4px;
    margin-bottom: clamp(2px, .45dvh, 5px);
    border-radius: 20px;
    background: var(--ovt-green);
}

.ovt-portada-antetitulo {
    display: block;
    margin-bottom: 2px;
    color: var(--ovt-green-dark);
    font-size: clamp(8px, 2.25vw, 12px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: .14em;
}

.ovt-portada-intro h1 {
    margin: 0;
    color: var(--ovt-text);
    font-family: 'Dosis', sans-serif;
    font-size: clamp(24px, 6.4vw, 42px);
    font-weight: 700;
    line-height: .98;
		letter-spacing: 0.0015em;
}

.ovt-portada-intro p {
    margin: clamp(2px, .35dvh, 5px) 0 0;
    color: #7d888c;
    font-size: clamp(11px, 3.9vw, 17px);
    line-height: 1.1;
}

/* ------------------------------------------------------------
   Municipios: siete tarjetas idénticas
   ------------------------------------------------------------ */
.ovt-municipios {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: var(--ovt-gap);
}

.ovt-municipio {
    position: relative;
    min-width: 0;
    min-height: 0;
    display: block;
    overflow: hidden;
    border-radius: clamp(7px, 2vw, 12px);
    text-decoration: none !important;
    background-image: linear-gradient(to top, rgba(4, 12, 17, .92) 0%, rgba(4, 12, 17, .58) 40%, rgba(4, 12, 17, .02) 78%), var(--ovt-img);
    background-position: center;
    background-size: cover;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
    isolation: isolate;
    transition: transform .18s ease, box-shadow .18s ease;
}

.ovt-municipio:hover,
.ovt-municipio:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
}

/* Torquemada conserva exactamente el mismo ancho que el resto. */
.ovt-municipio--ultimo {
    grid-column: 1 / -1;
    width: calc((100% - var(--ovt-gap)) / 2);
    justify-self: center;
}

.ovt-municipio-info {
    position: absolute;
    z-index: 2;
    right: clamp(29px, 7.5vw, 42px);
    bottom: clamp(5px, .8dvh, 9px);
    left: clamp(7px, 2vw, 13px);
    color: #fff;
}

.ovt-municipio-nombre {
    display: block;
    overflow: hidden;
    color: #fff;
    font-family: 'Dosis', sans-serif;
    font-size: clamp(18px, 3.35vw, 24px);
    font-weight: 700;
    line-height: .98;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .65);
    text-transform: uppercase;
    text-align: left;
}

.ovt-municipio-accion {
    display: block;
    margin-top: 2px;
    color: rgba(255,255,255,.90);
    font-family: 'Dosis', sans-serif;
    font-size: clamp(8px, 2.25vw, 12px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: .14em;
}

.ovt-municipio-flecha {
    position: absolute;
    z-index: 2;
    right: clamp(5px, 1.5vw, 9px);
    bottom: clamp(5px, .8dvh, 9px);
    width: clamp(22px, 6vw, 32px);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--ovt-green);
    color: #fff;
    /*font-family: Arial, sans-serif;
    font-size: clamp(12px, 3.3vw, 17px);
    line-height: 1;*/
    box-shadow: 0 2px 5px rgba(0,0,0,.25);
}

/* ------------------------------------------------------------
   Eventos: ancho completo
   ------------------------------------------------------------ */
.ovt-eventos {
    position: relative;
    min-height: 0;
    display: block;
    overflow: hidden;
    border-radius: clamp(8px, 2vw, 12px);
    text-decoration: none !important;
    background-image:
        linear-gradient(90deg, rgba(15,25,30,.96) 0%, rgba(15,25,30,.88) 38%, rgba(15,25,30,.30) 72%, rgba(15,25,30,.12) 100%),
        var(--ovt-img);
    background-position: center;
    background-size: cover;
    box-shadow: 0 1px 3px rgba(0,0,0,.14);
}

.ovt-eventos-contenido {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    padding: clamp(7px, 1.1dvh, 12px) clamp(11px, 3vw, 20px);
    display: flex;
    flex-direction: column;
		justify-content: flex-end;
    color: #fff;
		
}

.ovt-eventos-etiqueta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 1px;
    color: #d9c470;
    font-family: 'Dosis', sans-serif;
    font-size: clamp(9px, 2.3vw, 12px);
    font-weight: 700;
    letter-spacing: .14em;
}

.ovt-eventos h2 {
    margin: 0;
    color: #fff;
    font-family: 'Dosis', sans-serif;
    font-size: clamp(21px, 5.4vw, 32px);
    font-weight: 700;
    line-height: .95;
		text-transform: uppercase;
    text-align: left;
}

.ovt-eventos p {
    margin: clamp(1px, .25dvh, 4px) 0 0;
    color: rgba(255,255,255,.88);
    font-size: clamp(10px, 2.7vw, 15px);
    line-height: 1.05;
}

.ovt-eventos-boton {
    align-self: flex-start;
    margin-top: clamp(3px, .5dvh, 6px);
    padding: clamp(4px, .55dvh, 7px) clamp(10px, 2.7vw, 16px);
    border-radius: 30px;
    background: var(--ovt-green);
    color: #fff;
    font-family: 'Dosis', sans-serif;
    font-size: clamp(9px, 2.3vw, 12px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: .06em;
}

/* ------------------------------------------------------------
   Acceso al canal de WhatsApp
   ------------------------------------------------------------ */
.ovt-whatsapp {
    position: relative;
    min-height: 0;
    display: grid;
    grid-template-columns: auto 1px minmax(0, 1fr);
    align-items: center;
    gap: clamp(8px, 2.6vw, 15px);
    padding: clamp(5px, .8dvh, 9px) clamp(10px, 3vw, 18px);
    overflow: hidden;
    border: 1px solid rgba(154,173,112,.12);
    border-radius: clamp(8px, 2vw, 12px);
    color: #213237 !important;
    text-decoration: none !important;
    background:
        radial-gradient(circle at 92% 110%, rgba(154,173,112,.18) 0 22%, transparent 23%),
        radial-gradient(circle at 79% 105%, rgba(154,173,112,.10) 0 17%, transparent 18%),
        linear-gradient(90deg, #fbfdf9 0%, #f6fbf3 57%, #eef7e9 100%);
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.ovt-whatsapp::after {
    content: "";
    position: absolute;
    right: 4%;
    bottom: 8%;
    width: 30%;
    height: 48%;
    opacity: .20;
    pointer-events: none;
    background:
        linear-gradient(155deg, transparent 47%, #8ea86a 48% 50%, transparent 51%) 0 100% / 45% 80% no-repeat,
        linear-gradient(205deg, transparent 47%, #8ea86a 48% 50%, transparent 51%) 30% 100% / 45% 75% no-repeat,
        linear-gradient(155deg, transparent 47%, #8ea86a 48% 50%, transparent 51%) 62% 100% / 45% 65% no-repeat;
}

.ovt-whatsapp > * {
    position: relative;
    z-index: 1;
}

.ovt-whatsapp-icono {
    width: clamp(31px, 8.5vw, 46px);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #24d366;
    color: #fff;
    font-size: clamp(20px, 5.7vw, 30px);
    box-shadow: 0 2px 5px rgba(0,0,0,.16);
}

.ovt-whatsapp-separador {
    width: 1px;
    height: 72%;
    background: #c3a95f;
}

.ovt-whatsapp-texto {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: 'Dosis', sans-serif;
    line-height: 1;
}

.ovt-whatsapp-texto small {
    margin-bottom: 2px;
    color: #82935f;
    font-size: clamp(6.5px, 1.75vw, 9px);
    font-weight: 700;
    letter-spacing: .10em;
}

.ovt-whatsapp-texto strong {
    color: #213237;
    font-size: clamp(12px, 5.35vw, 18px);
    font-weight: 700;
    line-height: .96;
}

/* ------------------------------------------------------------
   Pantallas móviles bajas: prioriza que todo siga entrando.
   ------------------------------------------------------------ */
@media (max-height: 740px) {
    :root {
        --ovt-gap: 4px;
    }

    .ovt-portada {
        padding-top: 5px;
        padding-bottom: 5px;
        grid-template-rows: auto minmax(0, 1fr) clamp(57px, 9.5dvh, 70px) clamp(36px, 5.7dvh, 44px);
    }

    .ovt-portada-intro h1 {
        font-size: clamp(18px, 5vw, 26px);
    }

    .ovt-portada-intro p {
        font-size: 9px;
    }

    .ovt-municipio-accion {
        display: none;
    }

    .ovt-municipio-nombre {
        font-size: clamp(13px, 3.7vw, 18px);
    }

    .ovt-eventos h2 {
        font-size: clamp(18px, 4.6vw, 24px);
    }
}

@media (max-height: 650px) {
    .ovt-portada-antetitulo,
    .ovt-portada-intro p,
    .ovt-eventos-etiqueta,
    .ovt-eventos p,
    .ovt-whatsapp-texto small {
        display: none;
    }

    .ovt-portada-linea {
        height: 3px;
        margin-bottom: 2px;
    }

    .ovt-portada-intro h1 {
        font-size: clamp(17px, 4.7vw, 22px);
        line-height: 1;
    }

    .ovt-portada {
        grid-template-rows: auto minmax(0, 1fr) 52px 34px;
    }

    .ovt-whatsapp {
        padding-top: 3px;
        padding-bottom: 3px;
    }

    .ovt-whatsapp-icono {
        width: 27px;
        font-size: 18px;
    }

    .ovt-whatsapp-texto strong {
        font-size: 11px;
    }
}

/* ------------------------------------------------------------
   Escritorio: misma portada, centrada y nunca más ancha de 800px.
   ------------------------------------------------------------ */
@media (min-width: 801px) {
    body {
        background: #ececec;
    }

    .content.width100.ovt-home-content {
        background: #ececec;
    }

    .ovt-portada,
    #descumapa {
        box-shadow: 0 0 20px rgba(0,0,0,.06);
    }

    .ovt-portada {
        padding-right: 18px;
        padding-left: 18px;
    }

    .ovt-municipio-nombre {
        font-size: clamp(18px, 2.5vw, 24px);
    }
}

/* Fallback para navegadores antiguos sin dvh. */
@supports not (height: 100dvh) {
    .content.width100.ovt-home-content {
        height: calc(100vh - var(--ovt-header-height) - var(--ovt-bottom-height)) !important;
    }
}
