/* ========================================
   CATALOGUE PAGE - Against Stones
   Design professionnel avec filtres et recherche
   ======================================== */

/* Wide content column (style.css .content loads after layout.css) */
.content.content--wide {
    max-width: min(1400px, 98vw);
}

/* Shared width for search, collection header, and artwork grid (3 × 360px + 2 × 28px gap) */
.catalogue-stage {
    --catalogue-col-max: 360px;
    --catalogue-gap: 28px;
    --catalogue-cols: 3;
    width: 100%;
    max-width: calc(var(--catalogue-cols) * var(--catalogue-col-max) + (var(--catalogue-cols) - 1) * var(--catalogue-gap));
    margin-inline: auto;
}

.catalogue-intro {
    margin-bottom: var(--as-space-stack-sm, 16px);
}

.catalogue-intro__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   SEARCH CONTAINER
   ======================================== */
.search-container {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: stretch;
}

#quick-search {
    width: calc(100% - 70px);
    padding: 14px 20px 14px 52px;
    background: var(--as-surface-2, #1a1f28);
    border: 1px solid var(--as-border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-sm, 10px);
    color: var(--as-text-secondary, #E5E7EB);
    font-size: 15px;
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: var(--shadow-soft, 0 2px 12px rgba(0, 0, 0, 0.18));
}

#quick-search::placeholder {
    color: var(--as-text-muted, #64748B);
}

#quick-search:focus {
    outline: none;
    border-color: var(--as-gold-muted, #c9a227);
    box-shadow: 0 0 0 3px var(--as-gold-glow, rgba(255, 215, 0, 0.12));
    background: var(--as-surface-2, #1a1f28);
}

.btn-filters {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--as-surface-2, #1a1f28);
    border: 1px solid var(--as-border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-sm, 10px);
    padding: 14px 20px;
    color: var(--as-text-secondary, #b0b0b0);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
    white-space: nowrap;
    min-height: 52px;
    box-shadow: var(--shadow-soft, 0 2px 12px rgba(0, 0, 0, 0.18));
}

.btn-filters-label {
    display: inline;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--as-gold-muted, #c9a227);
    color: var(--as-text-on-gold, #111);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.btn-filters--active,
.btn-filters[aria-expanded="true"] {
    border-color: var(--as-border-gold, rgba(255, 215, 0, 0.18));
    color: var(--as-gold-muted, #c9a227);
    background: rgba(255, 215, 0, 0.06);
}

.btn-filters:hover {
    border-color: var(--as-border-gold, rgba(255, 215, 0, 0.18));
    color: var(--as-gold-muted, #c9a227);
    background: var(--as-surface-3, #222833);
    transform: none;
    box-shadow: var(--shadow-soft, 0 2px 12px rgba(0, 0, 0, 0.18));
}

.btn-filters:hover .filter-badge {
    background: var(--as-ink);
    color: #FFD700;
}

.catalogue-stage .active-filters-bar {
    margin-inline: 0;
}

.active-filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: -24px 0 28px;
    padding: 12px 16px;
    background: rgba(255, 215, 0, 0.06);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 12px;
}

.active-filters-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94A3B8;
}

.active-filters-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.filter-chip {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    font-size: 13px;
}

.filter-clear-all {
    font-size: 13px;
    color: #FFD700;
    text-decoration: none;
    white-space: nowrap;
}

.filter-clear-all:hover {
    text-decoration: underline;
}

/* ========================================
   ADVANCED SEARCH PANEL
   ======================================== */
.catalogue-stage .advanced-panel {
    margin-inline: 0;
}

.advanced-panel {
    background: var(--as-surface-2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0 32px 32px;
    margin: 0 0 32px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}

.advanced-panel[hidden] {
    display: block !important;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    opacity: 0;
    pointer-events: none;
}

.advanced-panel.is-open {
    max-height: 1200px;
    opacity: 1;
    pointer-events: auto;
}

.advanced-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 20px;
}

.advanced-panel-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
}

.advanced-panel-close {
    background: transparent;
    border: none;
    color: #94A3B8;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.advanced-panel-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

/* ========================================
   FILTER GRID
   ======================================== */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px 20px;
    margin-bottom: 24px;
}

.filter-grid > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-grid label,
.filter-row label {
    font-size: 13px;
    font-weight: 600;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Montserrat', sans-serif;
}

.filter-grid select,
.filter-row select,
.filter-row input[type="date"] {
    background: var(--as-surface);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-grid select:hover,
.filter-row select:hover,
.filter-row input[type="date"]:hover {
    border-color: rgba(255, 215, 0, 0.3);
    background: var(--as-surface-2);
}

.filter-grid select:focus,
.filter-row select:focus,
.filter-row input[type="date"]:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

/* Date inputs styling */
.filter-row input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.6);
    cursor: pointer;
}

.filter-row input[type="date"]::-webkit-calendar-picker-indicator:hover {
    filter: invert(1) opacity(1);
}

/* ========================================
   FILTER ROW
   ======================================== */
.filter-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.filter-row > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ========================================
   FILTER ACTIONS
   ======================================== */
.filter-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-apply,
.btn-reset {
    padding: 12px 32px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-apply {
    background: linear-gradient(135deg, #FFD700, #D4AF37);
    color: #000000;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

.btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.btn-reset {
    background: transparent;
    color: #94A3B8;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

/* ========================================
   ARTWORK GRID
   ======================================== */
.artwork-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--catalogue-gap, 28px);
    margin-bottom: 60px;
    justify-content: stretch;
    align-items: stretch;
}

.artwork-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--as-card-bg, linear-gradient(145deg, #161618, #111113));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
    transition: all 0.3s ease;
}

.artwork-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7),
                0 0 0 2px rgba(255, 215, 0, 0.3);
}

.artwork-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 225px;
    height: auto;
    overflow: hidden;
    flex-shrink: 0;
}

.artwork-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.artwork-card:hover .artwork-image {
    transform: scale(1.1);
}

/* Video badge (play icon) */
.video-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #FFD700;
    color: #111;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    z-index: 1;
}

.artwork-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.artwork-title {
    margin: 0 0 6px 0;
    font-size: 18px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.artwork-meta {
    color: #94A3B8;
    font-size: 14px;
    margin-bottom: 8px;
    font-family: 'Montserrat', sans-serif;
}

.artwork-details {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
    color: #b0b8c4;
    font-family: 'Montserrat', sans-serif;
}

.artwork-grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #64748B;
}

/* ========================================
   PAGINATION (pill — pagination.css)
   ======================================== */
.catalogue-stage .catalogue-pagination {
    margin: 60px auto 40px;
}

/* ========================================
   MUSEUM COLLECTION HEADER
   ======================================== */
.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
    padding-top: 20px;
    color: #94A3B8;
    font-size: 15px;
    font-family: 'Montserrat', sans-serif;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.collection-label {
    font-weight: 500;
}

.collection-count {
    color: var(--as-gold-muted, #c9a227);
    font-weight: 600;
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #64748B;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
}

.empty-state::before {
    content: '🎨';
    display: block;
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */
@media (max-width: 1024px) {
    .catalogue-stage {
        --catalogue-col-max: 340px;
        --catalogue-gap: 24px;
        --catalogue-cols: 2;
    }

    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .artwork-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */
@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        gap: 12px;
    }

    .advanced-panel {
        padding: 24px 20px;
    }

    .filter-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .filter-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .filter-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn-apply,
    .btn-reset {
        width: 100%;
        padding: 14px 32px;
    }

    .artwork-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        justify-content: stretch;
    }

    .artwork-grid > a:only-child {
        width: 100%;
        max-width: 400px;
    }

    .artwork-image-wrapper {
        max-height: 200px;
    }

    .catalogue-stage .catalogue-pagination {
        margin: 48px auto 32px;
    }

    .collection-header {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    #quick-search {
        padding: 14px 16px;
        font-size: 14px;
    }

    .btn-filters {
        padding: 14px 20px;
        font-size: 14px;
    }

    .advanced-panel {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .artwork-grid {
        gap: 12px;
    }

    .artwork-image-wrapper {
        max-height: 180px;
    }

    .artwork-title {
        font-size: 16px;
    }

    .artwork-meta,
    .artwork-details {
        font-size: 13px;
    }

    .catalogue-stage .catalogue-pagination {
        margin: 36px auto 28px;
    }
}

/* ========================================
   SEARCH BAR - Catalogue (Responsive)
   ======================================== */
.catalogue-intro .forum-search-container {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: none;
    margin: 0 0 32px;
    padding: 0;
}

.forum-search-wrapper {
    flex: 1;
    min-width: 0;
}

.search-bar {
    flex: 1;
    position: relative;
    background: #1F2937;
    border: 1px solid #374151;
    border-radius: 10px;
    height: 58px;
    display: flex;
    align-items: center;
    padding: 0 8px 0 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.search-icon {
    color: #94A3B8;
    margin-right: 14px;
    font-size: 20px;
}

#quick-search {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #E5E7EB;
    font-size: 16px;
    padding: 0;
}

#quick-search::placeholder {
    color: #9CA3AF;
}

.search-arrow-btn {
    width: 46px;
    height: 46px;
    background: rgba(201, 162, 39, 0.12);
    color: var(--as-gold-muted, #c9a227);
    border: 1.5px solid var(--as-gold-muted, #c9a227);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 2px 10px rgba(201, 162, 39, 0.12);
}

.search-arrow-btn:hover {
    background: rgba(201, 162, 39, 0.22);
    color: #f0d78c;
    border-color: var(--as-gold-muted, #c9a227);
    box-shadow: 0 4px 14px rgba(201, 162, 39, 0.2);
}

/* Bouton Nouvelle discussion */
.btn-new-discussion {
    background: #FFD700;
    color: #111827;
    padding: 0 28px;
    height: 58px;
    border-radius: 9999px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-new-discussion:hover {
    background: #FACC15;
    transform: translateY(-2px);
}

.plus-icon {
    font-size: 20px;
    font-weight: bold;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .catalogue-stage {
        --catalogue-cols: 1;
        max-width: 100%;
    }

    .catalogue-intro .forum-search-container {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 28px;
    }

    .catalogue-intro .forum-search-wrapper,
    .catalogue-intro #catalog-search-form,
    .catalogue-intro .search-bar {
        width: 100%;
    }

    .btn-filters {
        width: 100%;
        justify-content: center;
        min-height: 54px;
    }

    .active-filters-bar {
        margin: -8px 0 24px;
    }

    .advanced-panel {
        margin: 0 0 28px;
        padding: 0 20px 24px;
    }

    .filter-actions {
        flex-direction: column;
    }

    .btn-apply,
    .btn-reset {
        width: 100%;
        text-align: center;
    }

    .search-bar {
        height: 54px;
    }

    #quick-search {
        font-size: 15.5px;
    }

    .search-arrow-btn {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .btn-new-discussion {
        width: 100%;
        height: 54px;
        justify-content: center;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .search-bar {
        height: 52px;
        padding: 0 6px 0 20px;
    }

    #quick-search {
        font-size: 15px;
    }
}

.catalogue-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}