/* ==========================================
   Archive Search & Filters
   ========================================== */

.archive-search {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   Search Bar
   ========================================== */

.archive-search-bar {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 20px 0;
    border-bottom: 1px solid #e5e5e5;
    flex-wrap: wrap;
}

.archive-search-input-wrap {
    flex: 1;
    min-width: 200px;
}

.archive-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    height: 42px;
}

.archive-search-input:focus {
    outline: none;
    border-color: #1a1a1a;
}

.archive-search-input::placeholder {
    color: #999;
}

/* Filter Dropdowns */

.archive-filter-wrap {
    min-width: 160px;
}

.archive-filter-select {
    width: 100%;
    padding: 10px 32px 10px 14px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
    height: 42px;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%23333' stroke-width='1.5' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.archive-filter-select:focus {
    outline: none;
    border-color: #1a1a1a;
}

/* Action Buttons */

.archive-search-actions {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.archive-search-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    height: 42px;
    box-sizing: border-box;
}

.archive-btn-search {
    background: #1a1a1a;
    color: #fff;
}

.archive-btn-search:hover {
    background: #333;
}

.archive-btn-reset {
    background: #e5e5e5;
    color: #666;
}

.archive-btn-reset:hover {
    background: #d0d0d0;
    color: #333;
}

/* ==========================================
   Results Info
   ========================================== */

.archive-results-info {
    padding: 12px 0;
    font-size: 0.85rem;
    color: #999;
}

.archive-results-count {
    font-weight: 500;
}

/* ==========================================
   Results Grid
   ========================================== */

.archive-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
    min-height: 200px;
}

/* No Results */

.archive-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.1rem;
}

/* ==========================================
   Card Base
   ========================================== */

.archive-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.archive-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.archive-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Card Thumbnail */

.archive-card-thumb {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #f5f5f5;
}

.archive-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.archive-card:hover .archive-card-thumb img {
    transform: scale(1.05);
}

/* Portrait thumbnail (for persons) */
.archive-card-thumb--portrait {
    aspect-ratio: 3 / 4;
}

/* Card Body */

.archive-card-body {
    padding: 15px;
}

.archive-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #1a1a1a;
    line-height: 1.3;
}

.archive-card-meta {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.archive-card-duration {
    display: inline-block;
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 8px;
}

.archive-card-excerpt {
    font-size: 0.85rem;
    color: #666;
    margin: 8px 0 0 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================
   Film Card Specifics
   ========================================== */

.archive-card--film .archive-card-thumb {
    aspect-ratio: 2 / 3;
}

/* ==========================================
   Chronology Card Specifics
   ========================================== */

.archive-card--chronology .archive-card-title {
    font-size: 1.2rem;
    color: #1a1a1a;
}

.archive-card--chronology .archive-card-thumb {
    aspect-ratio: 16 / 9;
}

/* ==========================================
   Load More
   ========================================== */

.archive-load-more-wrap {
    text-align: center;
    padding: 30px 0;
}

.archive-btn-load-more {
    background: transparent;
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
    padding: 12px 40px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    font-family: inherit;
    border-radius: 3px;
}

.archive-btn-load-more:hover {
    background: #1a1a1a;
    color: #fff;
}

/* ==========================================
   Loading Overlay
   ========================================== */

.archive-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.archive-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e5e5;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: archive-spin 0.7s linear infinite;
}

@keyframes archive-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 768px) {
    
    .archive-search {
        padding: 0 15px;
    }
    
    .archive-search-bar {
        flex-direction: column;
        gap: 8px;
    }
    
    .archive-search-input-wrap,
    .archive-filter-wrap {
        min-width: 100%;
    }
    
    .archive-search-actions {
        width: 100%;
    }
    
    .archive-search-actions .archive-search-btn {
        flex: 1;
    }
    
    .archive-results {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .archive-card-body {
        padding: 10px;
    }
    
    .archive-card-title {
        font-size: 0.9rem;
    }
    
    .archive-card-excerpt {
        display: none;
    }
}

@media (max-width: 480px) {
    
    .archive-results {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}
