/**
 * Page Exploration / Catalogue - explore.php
 */

.page-explore {
    background: var(--bg-secondary);
}

.explore-header {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-xl) 0;
}

.explore-header h1 {
    color: var(--text-primary);
    font-size: var(--font-size-3xl);
}

.filters {
    background: var(--bg-card);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow);
}

.filters form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    align-items: flex-end;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    width: 100%;
}

.form-group {
    margin-bottom: 0;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.form-input, .form-select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

/* ── WORKS GRID ── */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

/* ── WORK CARD ── */
.work-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
    height: 100%;
    width: 100%;
}

.work-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(139, 90, 43, 0.2);
    border-color: var(--primary);
}

/* Card full-size link overlay */
.work-card-link {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    text-indent: -9999px;
    overflow: hidden;
}

/* Card inner: flex column so info grows to fill */
.work-card-inner {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ── COVER ── */
.work-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: block;
    line-height: 0;
    position: relative;
}

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

/* ── BADGE ── */
.work-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--primary);
    color: #000;
    pointer-events: none;
}

.badge-type-original { background: var(--primary); color: #000; }
.badge-type-canvas   { background: #8b5cf6;         color: #fff; }

/* ── INFO ── */
.work-info {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.work-title {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.work-author {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: auto;
    gap: 8px;
    flex-wrap: wrap;
}

.work-meta span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.work-meta .badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
}

/* publication status badges */
.status-ongoing   { background: #d1fae5; color: #065f46; }
.status-hiatus    { background: #fef3c7; color: #92400e; }
.status-finished  { background: #dbeafe; color: #1e3a8a; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-announced { background: #cffafe; color: #0e7490; } /* or #17a2b8 / #155e75 */
.no-results {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-secondary);
    grid-column: 1 / -1;
}

.no-results h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .works-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .filters form {
        flex-direction: column;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }

    .work-info {
        padding: var(--spacing-sm);
    }

    .work-title {
        font-size: 0.85rem;
