/********************* Estructura General *********************/
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body{
    background-color: white;
    font-family: "helvetica-lt-pro", sans-serif;
}

html{
    scroll-behavior: smooth;
}

html, body{
    width: 100%;
    -webkit-text-size-adjust: 100%; 
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden; 
}

/********************* Tipografías *********************/

:root{
    --master-height: 80px;
}

h1{
    padding: 20px 0;
}

h2{
    margin-bottom: 20px;
}

h2.Subtitulo-link {
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 10px;
    text-align: center; 
    margin-top: 4%;
}

p{
    font-size: 18px;
}

/* MASTER HEADER fijo */
header.masterheader{
    position: static;
    height: var(--master-height);
    background-color: black;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 300;
}

/* logo tamaño */
.logo{
    height: 50px;
    width: auto;
    display: block;
    max-width: 100%;
}

.logo-poliniza{
    height: 56px;
    width: auto;
    display: block;
}

/* ==================================================
   CONTENEDOR DE LOGOS (CORREGIDO)
   ================================================== */

/* 1. Estilo BASE (Móvil): Sin barra, separación pequeña */
.logo-container {
  display: flex;
  align-items: center; 
  gap: 12px; /* Separación vacía solo para móvil */
  flex-wrap: nowrap; /* Evitar que los logos se apilen en móvil */
}

/* El enlace base */
.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

/* 2. Estilo ESCRITORIO (Pantallas > 768px): Aparece la barra */
@media (min-width: 769px) {
    .logo-container {
        gap: 0; /* Quitamos el gap porque usaremos margenes en la barra */
    }

    /* Generamos la barra DESPUÉS del primer logo */
    .logo-link:first-child::after {
        content: '';
        display: block;
        height: 35px;           /* Altura de la barra */
        width: 1px;             /* Grosor */
        background-color: #fff; /* BLANCO (para que se vea en fondo negro) */
        
        /* Esta es la separación real en escritorio */
        margin-left: 25px;  
        margin-right: 25px; 
    }
}
/* ================================================== */


/* contenedor derecho (idiomas + botón) */
.header-right{
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right .val,
.header-right .es{
    display: inline-block;
    color: white;
    font-size: 16px;
    text-decoration: none;
    padding: 0 6px;
}

/* NAV en escritorio: integrado, no fijo */
.menu{
    display: flex;
    justify-content: center; 
    align-items: stretch;    
    position: static;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

/* cada opción ocupa el mismo espacio visual y es un contenedor flex */
.menu .opcion{
    flex: 1 1 0;
    max-width: 180px;
    text-align: center;
    display: flex;          
    align-items: stretch;
}

/* enlaces dentro del nav: ocupan todo el espacio de su .opcion */
.menu a{
    color: black;
    font-weight: 500;
    text-decoration: none;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 0;                 
    transition: background .18s ease, color .18s ease;
}

/* hover: texto blanco, fondo negro y ocupa toda la altura del recuadro */
.menu .opcion:hover a,
.menu a:hover{
    background: black;
    color: #e9e9e9;
}
 
/* ocultar idiomas dentro del nav en escritorio */
.menu .val,
.menu .es,
.nav-lang{
    display: none;
}


/* mostrar/ocultar iconos del botón móvil */
.mostrar-menu {
    display: none;
}



/* por defecto mostrar hamburguesa y ocultar la X */
.mostrar-menu .hamburger { display: inline-block; }
.mostrar-menu .close { display: none; }

/* cuando el checkbox está marcado, invertir iconos (funciona si #check está antes del header) */
#check:checked ~ header.masterheader .mostrar-menu .hamburger { display: none; }
#check:checked ~ header.masterheader .mostrar-menu .close { display: inline-block; }

#check{
    display: none;
}

/********************* MAIN PAGE *********************/
.page{
    width: 100%;
    display: block;
}

.page img{
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

.main-container{
    max-width: 1300px;
    margin: 15px auto 40px;
    padding: 0 16px;
    box-sizing: border-box;
}

/* FOTOS */
.galeria{
    padding: 0 16px;
}

.galeria .categoria{
    display: none;
    gap: 16px;
}

.galeria .categoria.activo{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 18px auto 40px;       
    max-width: 1200px;            
}

/********************* BOTONES *********************/

.boton-contenido{
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
    align-items: center;
    position: relative;
    margin-top: 40px;
}

.boton-contenido .info{
    grid-row: 1;
    grid-column: 1;
}

.boton-contenido .button{
    grid-row: 2;
    grid-column: 1;
    justify-self: center;
}

.boton-contenido .button2{
    grid-row: 2;
    grid-column: 2;
    justify-self: center;
}

.button {
  --main-focus: #2d8cf0;
  --font-color: #323232;
  --bg-color-sub: #dedede;
  --bg-color: #eee;
  --main-color: #323232;
  position: relative;
  width: 265px;
  height: 40px;
  display: flex;
  cursor: pointer;
  align-items: center;
  border: 2px solid var(--main-color);
  box-shadow: 4px 4px var(--main-color);
  background-color: var(--bg-color);
  border-radius: 10px;
  overflow: hidden;
}

#poliniza a {
  color: var(--main-color);
  text-decoration: none;
}

#poliniza a:hover {
  color: var(--main-color);
}

.button, .button__icon, .button__text {
  transition: all 0.3s;
}

.button .button__text {
  transform: translateX(5px);
  color: var(--font-color);
  font-weight: 600;
}

.button .button__icon {
  position: absolute;
  transform: translateX(215px);
  height: 100%;
  width: 46px;
  background-color: var(--bg-color-sub);
  display: flex;
  align-items: center;
  justify-content: center;
}

.button .svg {
  width: 20px;
  fill: var(--main-color);
}
  
.button:hover {
  background: var(--bg-color);
}
  
.button:hover .button__text {
  color: transparent;
}
  
.button:hover .button__icon {
  width: 100%;
  transform: translateX(0);
}
  
.infor {
    padding: 10px;
}

/********************* GALERIA *********************/

/* Alinear el H1 con la columna izquierda de la galería */
.galeria {
    /* contenedor centrado que define el ancho de referencia */
    max-width: 1200px;
    margin: 18px auto 40px;
    padding: 0 16px; /* espacio interior para pantallas pequeñas */
    box-sizing: border-box;
}

.galeria h1 {
    /* mismo ancho que la galería, centrado horizontalmente pero texto a la izquierda */
    max-width: 1200px;
    margin: 0 auto 16px;
    padding: 0;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
}

/* asegurar que la grilla de imágenes use el mismo ancho y alineamiento */
.galeria .categoria.activo{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 0 auto;
    padding: 0 0 0;
    box-sizing: border-box;
}

.columna{
    overflow: hidden;
    background: #fff;
}

.columna img{
    width: 100%;
    height: 220px;         
    object-fit: cover;
    display: block;
}

.menu-fotos{
    display: flex;
    gap: 12px;
    list-style: none;
    padding: 12px 16px;
    margin: 18px auto;            
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;      
    max-width: 1200px;            
}

.opcion-fotos{
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 8px;
    background: transparent;
    color: #808080;           
    font-weight: 500;
    user-select: none;
    font-size: 18px;
}

.opcion-fotos:focus{
    outline: 2px solid rgba(25,118,255,.18);
    outline-offset: 2px;
}

.opcion-fotos.activo{
    background: #808080;     
    color: #fff;             
    box-shadow: 0 2px 6px rgba(25,118,255,.12);
}

/* pequeño efecto al pasar el ratón sobre opciones no activas */
.opcion-fotos:not(.activo):hover{
    background: rgba(25,118,255,.06);
}

/********************* HOVER ARTISTAS *********************/
.hover-img {
    background-color: transparent;
    color: #fff;
    display: block;
    margin: 0;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    position: relative;
    text-align: center;
    width: 100%;
}

.hover-img * {
    box-sizing: border-box;
    transition: all 0.45s ease;
}

.hover-img::before,
.hover-img::after {
  background-color: rgba(0, 0, 0, 0.5);
  border-top: 32px solid rgba(0, 0, 0, 0.5);
  border-bottom: 32px solid rgba(0, 0, 0, 0.5);
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  content: '';
  transition: all 0.3s ease;
  z-index: 1;
  opacity: 0;
  transform: scaleY(2);
}

.hover-img figcaption {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  align-items: center;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.1em;
  opacity: 0;
  z-index: 2;
  transition-delay: 0.1s;
  font-size: 24px;
  font-family: sans-serif;
  font-weight: 400;
  letter-spacing: 1px;
}

.hover-img:hover::before,
.hover-img:hover::after {
  transform: scale(1);
  opacity: 1;
}

.hover-img:hover > img {
  opacity: 0.7;
}

.hover-img:hover figcaption {
  opacity: 1;
}

a{
    text-decoration: none;
    color: inherit;
}

/********************* HISTORICO *********************/

.ediciones{
    display: grid;
    grid-template-columns: repeat(3,30vw);
    gap: 20px;
    row-gap: 3vw;
    margin: 3vw 3vw;
}

.edicion{
    display: flex;
    flex-direction: column;
    text-align: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.edicion img{ 
    width: 30vw;
    height: 15vw;
    object-fit: cover;

}
.edicion p{
    font-family: "code-saver", sans-serif;
    font-size:1.2vw;
    color: black;
    justify-content: center;
    margin-top: 1%;
}

.edicion a{
    text-decoration: none;
    margin:0 !important;
}

.edicion:hover p{
    color: white;
}
.edicion:hover{
    background-color: black;
}

/* FOOTER */
footer{
    width: 100%;
    margin-top: 100px;
    padding: 0;
    overflow: hidden;
    color: white;
    background-color: black;
}

.footer-container{
    margin: 4% 0;
    padding: 0 50px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "left-apartado center-apartado right-apartado"
        "left-contenido center-contenido right-contenido";
    gap: 24px 40px;
    justify-items: center; 
    align-items: start;    
}

/* asignar áreas a los elementos existentes */
.col .apartado{ grid-area: left-apartado; }
.col .contenido{ grid-area: left-contenido; }

.col2 .apartado{ grid-area: center-apartado; }
.upv{ grid-area: center-contenido; }

.col3 .apartado{ grid-area: right-apartado; }
.colaboradores{ grid-area: right-contenido; }

/* estilo de títulos (misma altura visual, ajustar si quieres altura fija) */
.col .apartado, .col2 .apartado, .col3 .apartado{
    font-size: 25px;
    margin: 0;
    padding-bottom: 8px;
    text-align: center;
    align-self: start;
}

/* contenido debajo del título */
.contenido{
    grid-area: left-contenido;
    font-size: 18px;
    text-align: center;
    align-self: start;
}

/* centrar y espaciar iconos de redes */
.redes{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    margin-right: 0;
    margin-left: 0;
}

.redes img{
    width: 28px;
    height: 28px;
}

/* centrar logo UPV */
.upv{
    width: 150px;
    display: block;
    margin: 0 auto;
}

.colaboradores{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    margin-right: 0;
    margin-left: 0;
}

.pinturas{
    width: 100px;
    display: block;
    margin: 0 auto;
}

.generalitat{
    width: 150px;
    display: block;
    margin: 0 auto;
}

.ecsa{
    width: 150px;
    display: block;
    margin: 0 auto;
}


/********************* MÓVIL *********************/
@media (max-width: 768px) {
    html{
        overflow-x: hidden;
        width: 100%;
    }

    /* Hacer el header fijo SOLO en móvil */
    header.masterheader{
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 300;
    }

    .logo{
        height: 40px;
    }

    /* Reservar espacio para el header fijo en móvil */
    body{
        padding-top: var(--master-height);
    }

    .mostrar-menu, .esconder-menu{
        display: block;
    }

    .menu{
        position: fixed;
        left: 0;
        right: 0;
        top: var(--master-height); /* empieza justo debajo del masterheader */
        height: calc(100vh - var(--master-height));
        background-color: white;
        padding: 18px 0;
        z-index: 250;
        transform: translateY(-100%); /* oculto hacia arriba */
        transition: transform .36s ease;
        display: flex;
        flex-direction: column; /* apilar en columna */
        align-items: center;
        gap: 10px;
    }

    .header-right .val,
    .header-right .es{
        display: none; /* esconder en móvil */
    }

    .menu .val,
    .menu .es,
    .nav-lang{
        display: block; /* mostrar en móvil */
        text-align: center;
    }

    .nav-lang {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        margin-top: 8px;
    }

    .nav-lang a, .nav-lang span{
        display: inline-block;
        padding: 6px 12px;
        color: black;
        text-decoration: none;
    }
    
    /* mantener visible en header pero no tan pegado */
    .mostrar-menu{
        display: inline-flex;
        cursor: pointer;
        font-size: 28px;
        align-items: center;
        justify-content: center;
        gap: 6px;
        position: absolute;
        right: 12px; /* separación del borde */
        top: 50%;
        transform: translateY(-50%);
        color: white;
        z-index: 400;
    }

    .opcion {
        display: flex;
        flex-direction: column; /* Apila los elementos verticalmente */
        align-items: center;
        justify-content: center;
        gap: 5px;
    }

    .es {
        margin: 0;
        padding: 0;
        font-size: 20px;
    }

    .val{
        margin: 0;
        padding-top: 20px;
    }

    .lang-sep-web{
        display: none;
    }

    .esconder-menu{ display: none; }

    /* cuando el checkbox está activo, baja el menú */
    #check:checked ~ .menu{
        transform: translateY(0);
    }

    /* cada opción ocupa toda la anchura y se apila */
    .menu a{
        display: block;
        padding: 14px 20px;
        width: 100%;
        text-align: center;
        color: black;
    }

    .menu .opcion{
        flex: none;
        max-width: none;
        width: 100%;
    }

    /********************* BOTONES *********************/

    /* Apilar botones en móvil: una columna, cada botón ocupa toda la anchura */
    .boton-contenido{
        grid-template-columns: 1fr; /* una columna */
        gap: 12px;
        justify-items: center;
    }

    .boton-contenido .info{
        grid-row: 1;
        grid-column: 1;
    }

    .boton-contenido .button{
        grid-row: 2;
        grid-column: 1;
    }

    .boton-contenido .button2{
        grid-row: 3;
        grid-column: 1;
    }

    /* opcional: separar un poco más los botones */
    .boton-contenido .button,
    .boton-contenido .button2{
        margin-top: 6px;
    }

    /********************* FOTOS *********************/

    .artista{
        margin-bottom: 10px;
    }

    .galeria .categoria.activo{
        grid-template-columns: 1fr;
    }

    /* Mostrar el figcaption debajo de cada imagen en móvil y desactivar overlays de hover */
    .hover-img::before,
    .hover-img::after{
        display: none !important; /* quitar máscaras */
    }

    .hover-img:hover::before,
    .hover-img:hover::after{
        opacity: 0;
        transform: none;
    }

    .hover-img:hover > img{
        opacity: 1 !important; /* evitar oscurecer la imagen al tocar */
    }

    .hover-img figcaption{
        position: static !important;
        display: block !important;
        opacity: 1 !important;
        z-index: auto !important;
        background: transparent !important;
        color: #000 !important;
        font-size: 16px;
        padding: 8px 0 0;
        line-height: 1.2;
        align-items: normal;
        justify-content: normal;
        height: auto;
        text-align: center; /* opcional: centrar el texto bajo la imagen */
    }

    /* si el figcaption está dentro del <a>, asegurar que ocupe el ancho */
    .hover-img > a { display: block; }

    /********************* HISTORICO *********************/

    .ediciones{
        display: grid;
        grid-template-columns: repeat(1,90vw);
        gap: 20px;
        row-gap: 10vw;
        margin: 3vw 3vw;
        justify-content: center;
    }

    .edicion{
        display: flex;
        flex-direction: column;
        text-align: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }
    
    .edicion img{ 
        width: 90vw;
        height: 45vw;
        object-fit: cover;
    
    }
    .edicion p{
        font-family: "code-saver", sans-serif;
        font-size:3.5vw;
        color: black;
        justify-content: center;
    }
    
    .edicion a{
        text-decoration: none;
    }
    
    .edicion:hover p{
        color: white;
    }
    .edicion:hover{
        background-color: black;
    }

    /********************* FOOTER *********************/

    .footer-container{
        grid-template-columns: 1fr;
        grid-template-areas:
            "left-apartado"
            "left-contenido"
            "center-apartado"
            "center-contenido"
            "right-apartado"
            "right-contenido";
        padding: 20px;
    }
    .upv{
        margin-bottom: 20px;
    }
    .colaboradores{
        display: flex;
        flex-direction: column; /* apila imágenes verticalmente */
        align-items: center;
        gap: 12px;
    }
    .colaboradores img{
        width: 120px; /* ajusta el tamaño según sea necesario */
        height: auto;
        margin-top: 15px;
    }
}