.confTitleBox {
    position: relative;
    background-color: #1D3C6A;
    padding-top: 0;
    padding-bottom: 12vh;
    margin: 0;
    border-bottom: 3px solid #0f4c80;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;  /* texto abajo */
    align-items: center;
    overflow: hidden;
    cursor: pointer;
    max-width: 100%;
}

.confTitleBox::before {
    content: "";
    position: absolute;
    top: 3vh;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 900px;
    height: auto;
    aspect-ratio: 16 / 9;
    background-image: url('https://indico.ific.uv.es/event/8160/images/1162-COSMOVERSEBILBAO2026_2_page-0001.jpg');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center center;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(255, 243, 184, 0.6);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    z-index: 0;
}

.confTitleBox:hover::before {
    transform: translateX(-50%) scale(1.08);
    box-shadow: 0 12px 30px rgba(255, 243, 184, 0.8);
}

.confTitle {
    position: relative;
    margin: 0;
    /* Baja un poco más el título en todos los dispositivos */
    margin-top: calc((900px * 9 / 16) + 5vh);
    text-align: center;
    color: #1a1a1a;
    font-weight: bold;
    z-index: 1;
    width: 90%;
    max-width: 900px;
    font-size: 2.5rem;
}

/* MÓVILES Y TABLETS */

/* Móvil vertical: reduzco altura */
@media (max-width: 480px) and (orientation: portrait) {
    .confTitleBox {
        min-height: 280px;
        padding-bottom: 5vh;
        justify-content: flex-start;
        overflow: visible;
    }
    .confTitleBox::before {
        top: 1vh;
        width: 98vw;
        max-width: none;
    }
    .confTitle {
        font-size: 1.4rem;
        margin-top: calc((98vw * 9 / 16) + 2.5rem);
        max-width: 98vw;
    }
}

/* Móvil horizontal: título más abajo como antes */
@media (max-width: 480px) and (orientation: landscape) {
    .confTitleBox {
        min-height: 275px;
        padding-bottom: 3rem;
        justify-content: flex-start;
        overflow: visible;
    }
    .confTitleBox::before {
        top: 1vh;
        width: 40vw;
        max-width: none;
    }
    .confTitle {
        font-size: 1.4rem;
        margin-top: calc((40vw * 9 / 16) + 4rem); /* título abajo */
        max-width: 90%;
    }
}

/* Tablet vertical y móviles grandes */
@media (min-width: 481px) and (max-width: 768px) and (orientation: portrait) {
    .confTitleBox {
        min-height: 475px;
        padding-bottom: 4.5rem;
        justify-content: flex-start;
        overflow: visible;
    }
    .confTitleBox::before {
        top: 2vh;
        width: 95vw;
        max-width: none;
    }
    .confTitle {
        font-size: 1.8rem;
        margin-top: calc((95vw * 9 / 16) + 3.5rem);
        max-width: 95vw;
    }
}

/* Tablet horizontal y móviles grandes */
@media (min-width: 481px) and (max-width: 768px) and (orientation: landscape) {
    .confTitleBox {
        min-height: 450px; /* aumento un poco */
        padding-bottom: 5rem;
        justify-content: flex-start;
        overflow: visible;
    }
    .confTitleBox::before {
        top: 2vh;
        width: 75vw;
        max-width: 900px;
    }
    .confTitle {
        font-size: 2rem;
        margin-top: calc((75vw * 9 / 16) + 5rem);
        max-width: 900px;
    }
}

/* Tablets verticales y pantallas medianas */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .confTitleBox {
        min-height: 520px;
        padding-bottom: 6vh;
        justify-content: flex-start;
        overflow: visible;
    }
    .confTitleBox::before {
        top: 3vh;
        width: 85%;
        max-width: 900px;
    }
    .confTitle {
        font-size: 2rem;
        margin-top: calc((900px * 9 / 16) + 5rem);
        max-width: 900px;
    }
}

/* iPad horizontal: más altura y título más abajo */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .confTitleBox {
        min-height: 600px; /* un poco más alto */
        padding-bottom: 8vh;
        justify-content: flex-start;
        overflow: visible;
    }
    .confTitleBox::before {
        top: 2.5vh;
        width: 85%;
        max-width: 900px;
        max-height: 60%; /* limita altura de la imagen */
        background-size: contain;
    }
    .confTitle {
        font-size: 2.1rem;
        margin-top: calc((900px * 9 / 16) + 3rem);
        max-width: 900px;
    }
}

/* Escritorio */
@media (min-width: 1025px) {
    .confTitleBox {
        height: 80vh;
        padding-bottom: 12vh;
        justify-content: flex-start; /* para que el margin-top funcione */
        overflow: hidden;
    }
    .confTitleBox::before {
        top: 6vh;
        width: 95%;
        max-width: 1100px;
    }
    .confTitle {
        font-size: 2.5rem;
        margin-top: calc((1100px * 9 / 16) + 8vh); /* título un poco más arriba */
        max-width: 1100px;
    }
}