/* =============================================================================
   archive-publication.css
   Dark "Text A" editorial skin for the Publications archive.

   Enqueued only on is_post_type_archive('publication') in functions.php, AFTER
   main.css (dependency: saab-main-css), so the --brand-* custom properties used
   below resolve from main.css's :root.

   Scope: body.post-type-archive-publication + the .publication-archive wrapper.
   Palette: cream = var(--brand-cream, #FEFEFE). Never use --white (undefined).
   ============================================================================= */


/* =============================================================================
   (1) DARK SCAFFOLD — fixed background image, veil, section reset
   ============================================================================= */

/* Neutralise the theme's body fill so nothing white shows behind the fixed
   layers (the fixed ::before already covers the viewport; this is a safety). */
body.post-type-archive-publication {
    background-color: transparent;
}

/* Fixed full-viewport background: the shared Beirut image behind everything. */
.publication-archive::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image: url('../images/BeyrouthMaVille15_1.1.18.tif.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Soft darkening veil so cream text reads cleanly over the photo. */
.publication-archive::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.30) 0%, rgba(0, 0, 0, 0.45) 100%);
    pointer-events: none;
}

/* GOTCHA: null the inherited opaque fills (the .section-white gradient and any
   hero background) so the fixed background shows through. Reset BOTH
   background-color and background-image. */
.publication-archive .section-white,
.publication-archive .hero,
.publication-archive .archive-hero,
.publication-archive section {
    background-color: transparent !important;
    background-image: none !important;
}


/* =============================================================================
   (2) HERO — title + subtitle over the fixed background
   ============================================================================= */

.publication-archive .archive-hero .hero-content {
    text-align: center;
}

.publication-archive .archive-hero h1 {
    color: var(--brand-cream, #FEFEFE);
}

.publication-archive .archive-hero .hero-subtitle {
    color: rgba(254, 254, 254, 0.82);
}


/* =============================================================================
   (3) FILTER BAR — translucent cream-on-dark controls
   ============================================================================= */

.publication-archive .archive-filters {
    margin-bottom: 3rem;
}

.publication-archive .publication-filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.publication-archive .publication-filters-form select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.65rem 2.5rem 0.65rem 1rem;
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--brand-cream, #FEFEFE);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23FEFEFE' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.publication-archive .publication-filters-form select option {
    color: #111827;
}

.publication-archive .publication-filters-form select:hover,
.publication-archive .publication-filters-form select:focus {
    border-color: rgba(255, 255, 255, 0.4);
    outline: none;
}

.publication-archive .publication-filters-form .btn-filter {
    padding: 0.65rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--brand-cream, #FEFEFE);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.publication-archive .publication-filters-form .btn-filter:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}


/* =============================================================================
   (4) GRID + MINIMAL CARDS — cover + type chip + title only
   ============================================================================= */

/* Override the inherited 2-column .films-grid for book-cover proportions. */
.publication-archive .films-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2.5rem 2rem;
}

.publication-archive .publication-card {
    margin: 0;
}

.publication-archive .publication-card-link {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-decoration: none;
    color: var(--brand-cream, #FEFEFE);
}

.publication-archive .publication-cover {
    position: relative;
}

.publication-archive .publication-frame {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background-color: rgba(17, 24, 39, 0.30);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Out-specify any global card/grid img rule (e.g. fixed-height swiper crops). */
.publication-archive .publication-card .publication-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.publication-archive .publication-card-link:hover .publication-frame {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

/* Cover fallback when no thumbnail. */
.publication-archive .publication-cover-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 1.5rem;
    text-align: center;
    color: rgba(254, 254, 254, 0.72);
}

.publication-archive .publication-cover-placeholder svg {
    opacity: 0.5;
}

.publication-archive .publication-cover-placeholder span {
    font-size: 0.9rem;
    line-height: 1.4;
}

.publication-archive .publication-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.publication-archive .publication-type {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-slate-light, #9FB3C8);
}

.publication-archive .publication-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--brand-cream, #FEFEFE);
}


/* =============================================================================
   (5) PAGINATION + EMPTY STATE
   ============================================================================= */

.publication-archive .pagination a,
.publication-archive .pagination span {
    color: var(--brand-cream, #FEFEFE);
    border-color: rgba(255, 255, 255, 0.22);
}

.publication-archive .pagination .current {
    background-color: rgba(255, 255, 255, 0.15);
}

.publication-archive .films-grid > p {
    color: rgba(254, 254, 254, 0.82);
}


/* =============================================================================
   (6) RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
    .publication-archive .films-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1.75rem 1.25rem;
    }

    .publication-archive .publication-filters-form {
        flex-direction: column;
        align-items: stretch;
    }

    .publication-archive .publication-filters-form select,
    .publication-archive .publication-filters-form .btn-filter {
        width: 100%;
    }
}
