/* ===============================
   HERO
   =============================== */

section.poster-hero {
    background: #070A62;
    background: linear-gradient(90deg, #070A62 0%, #0F49B6 50%, #09ADD3 100%);
    color: #fff;
    padding: 40px 0 48px;
}

.poster-hero__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

.poster-hero__logo img {
    max-height: 140px;
    width: auto;
    display: block;
}

.poster-hero__text {
    flex: 1;
    min-width: 240px;
    text-align: center;
}

.poster-hero__title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.poster-hero__subtitle {
    font-size: 16px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ===============================
   LAYOUT ARCHIVE
   =============================== */

.a-poster-conter {
    max-width: 1200px;
    margin: 24px auto 40px;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 32px;
    align-items: flex-start;
}

/* ===============================
   FILTROS (SIDEBAR DESKTOP)
   =============================== */

.poster-filters__toggle {
    display: none; /* solo mobile */
}

section.poster-filters {
    width: 100%;
    position: sticky;
    top: 120px; /* ajusta según la altura de tu header */
    align-self: flex-start;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    padding: 16px 20px 20px;
    height: 100%;
}

.poster-filters__inner {
    width: 100%;
}

.poster-filters__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.poster-filters__field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: #4f4f4f;
    margin-bottom: 4px;
}

.poster-filters__field select {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #dcdcdc;
    padding: 8px 10px;
    font-size: 14px;
    background-color: #fff;
}

/* Backdrop (para mobile, pero definimos base aquí) */
.poster-filters__backdrop {
    display: none;
}

/* ===============================
   LISTA DE PÓSTERES
   =============================== */

section.poster-list {
    width: 100%;
}

.poster-list__inner {
    width: 100%;
}

.poster-list__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
}

/* ===============================
   TARJETA POSTER
   =============================== */

.poster-card {
    width: calc(100% - 20px);
    margin: 10px;
}

.poster-card__inner {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    height: 100%;
}

.poster-card__thumb img {
    width: 100%;
    aspect-ratio: 9 / 9;
    object-fit: cover;
    display: block;
}

.poster-card__thumb--placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #e0e0e0;
}

.poster-card__content {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.poster-card__header {
    margin-bottom: 4px;
}

h2.poster-card__title {
    font-size: 18px;
    line-height: 1.25;
    margin: 0 0 4px;
}

.poster-card__title a {
    text-decoration: none;
    color: #111827;
}

.poster-card__title a:hover {
    text-decoration: underline;
}

.poster-card__meta {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2563eb;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.poster-card__year {
    font-weight: 700;
}

.poster-card__tipo {
    font-weight: 600;
}

.poster-card__investigadores {
    font-size: 13px;
    color: #374151;
}

.poster-card__excerpt {
    font-size: 13px;
    line-height: 1.45;
    color: #4b5563;
}

/* Botones dentro de la tarjeta */
.poster-card__actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.poster-card__btn {
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

.poster-card__btn--primary {
    background-color: #111827;
    color: #ffffff;
}

.poster-card__btn--secondary {
    background-color: #ffffff;
    color: #111827;
    border-color: #d1d5db;
}

.poster-card__btn--primary:hover {
    background-color: #000000;
}

.poster-card__btn--secondary:hover {
    background-color: #f3f4f6;
}

/* Compartir */
.poster-card__share {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.poster-card__share a {
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: #1d4ed8;
}

.poster-card__share a:hover {
    text-decoration: underline;
}

/* Botón "Ver más" */
.poster-load-more {
    margin: 24px auto 0;
    display: block;
    padding: 10px 22px;
    border-radius: 999px;
    border: 1px solid #0F49B6;
    background: #ffffff;
    color: #0F49B6;
    font-weight: 600;
    cursor: pointer;
}

/* ===============================
   MODAL PDF
   =============================== */

.poster-pdf-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.poster-pdf-modal.is-open {
    display: flex;
}

.poster-pdf-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}

.poster-pdf-modal__content {
    position: relative;
    background: #ffffff;
    border-radius: 10px;
    max-width: 960px;
    width: 95%;
    max-height: 90vh;
    padding: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.poster-pdf-modal__close {
    position: absolute;
    top: 8px;
    right: 10px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.poster-pdf-modal__frame-wrapper {
    width: 100%;
    height: 70vh;
    margin-top: 16px;
}

.poster-pdf-modal__frame-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ===============================
   RESPONSIVE
   =============================== */

@media (max-width: 1024px) {
    .poster-card {
        width: calc(50% - 20px);
    }
}

@media (max-width: 768px) {

    .poster-card__inner {
        flex-direction: column;
    }

    section.poster-hero {
        padding: 28px 0 32px;
    }

    .poster-hero__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .poster-hero__title {
        font-size: 24px;
    }

    .a-poster-conter {
        display: block;
        margin-top: 16px;
    }

    /* Botón Filtros visible en mobile */
    .poster-filters__toggle {
        display: inline-flex;
        margin: 0 auto 12px;
        padding: 8px 16px;
        border-radius: 999px;
        border: 1px solid #0F49B6;
        background: #ffffff;
        color: #0F49B6;
        font-weight: 600;
        align-items: center;
        gap: 8px;
        cursor: pointer;
    }

    .poster-filters__toggle-icon {
        font-size: 18px;
    }

    /* Panel filtros como bottom sheet: OCULTO por defecto */
    section.poster-filters {
        display: none !important;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: 100%;
        width: 100%;
        max-height: 80vh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -10px 30px rgba(0,0,0,0.25);
        padding: 16px 20px 24px;
        background: #ffffff;
        transform: translateY(100%);
        transition: transform 0.25s ease;
        z-index: 1001;
        overflow-y: auto;
    }

    section.poster-filters.is-open {
        display: block !important;
        transform: translateY(0);
    }

    /* Backdrop visible cuando .is-visible */
    .poster-filters__backdrop.is-visible {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.35);
        z-index: 1000;
    }

    section.poster-list {
        width: 100%;
        margin-top: 12px;
    }

    .poster-card {
        width: 100%;
        margin: 8px 0;
    }

    .poster-pdf-modal__frame-wrapper {
        height: 65vh;
    }
}
