/* =====================================================
   our-reads.css — Cally's Library Staff Reads Page
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,700;1,500&family=DM+Sans:wght@400;500;600&display=swap');

:root {
    --gold: #F8BA00;
    --gold-dark: #c9960a;
    --gold-pale: #fff9e6;
    --ink: #111111;
    --charcoal: #2d2d2d;
    --muted: #777;
    --border: #e8e8e8;
    --bg: #fafafa;
    --white: #ffffff;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.14);
    --max-w: 1400px;
    --px: 3.5rem;
}

/* ── Base ──────────────────────────────────────────── */
.our-reads {
    background: var(--bg);
    padding: 0 0 5rem;
    font-family: 'DM Sans', sans-serif;
}

.our-reads__container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--px);
}

/* ── Stats Bar ─────────────────────────────────────── */
.stats-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 2.5rem 0;
    margin-bottom: 3rem;
}

.stats-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    text-align: center;
}

.stat-item {
    padding: 0 2rem;
    position: relative;
}

.stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: var(--border);
}

.stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.stat-label {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* ── Filter Bar ────────────────────────────────────── */
.filter-bar {
    max-width: var(--max-w);
    margin: 0 auto 2.5rem;
    padding: 0 var(--px);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.filter-select {
    padding: 0.6rem 1.4rem;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-size: 0.88rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--charcoal);
    background: var(--white);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.filter-select:focus,
.filter-select:hover {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(248, 186, 0, 0.12);
}

.clear-filter {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.clear-filter:hover {
    border-color: var(--gold);
    color: var(--gold-dark);
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: #f0f0f0;
    padding: 0.25rem;
    border-radius: 999px;
}

.view-btn {
    padding: 0.45rem 1.2rem;
    border: none;
    background: transparent;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    color: var(--muted);
    transition: all 0.2s;
}

.view-btn.active {
    background: var(--gold);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(248, 186, 0, 0.3);
}

/* ── Reviews Section ────────────────────────────────── */
.reviews-section {
    max-width: var(--max-w);
    margin: 0 auto 4rem;
    padding: 0 var(--px);
}

/* ── GRID VIEW — book-cover-first portrait cards ─────── */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.75rem;
    align-items: start;
    /* key: don't stretch cards to equal height */
}

.review-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.review-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

/* ── Cover: full-height portrait (like in the product card image) */
.card-cover {
    position: relative;
    width: 100%;
    /* Natural aspect ratio — tall portrait book covers */
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #e8e0d4;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.5s ease;
}

.review-card:hover .card-cover img {
    transform: scale(1.04);
}

/* placeholder when no image */
.card-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f5efe0, #e8dcc8);
    gap: 0.75rem;
    color: #b0a090;
}

.card-cover-placeholder i {
    font-size: 2.5rem;
}

.card-cover-placeholder span {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.card-rating {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.78);
    color: var(--gold);
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    backdrop-filter: blur(6px);
}

/* ── Card body ──────────────────────────────────────── */
.card-content {
    padding: 1.1rem 1.2rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.card-staff {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold-dark);
    margin-bottom: 0.35rem;
}

.card-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 0.2rem;
    line-height: 1.35;
}

.card-author {
    color: var(--muted);
    font-size: 0.82rem;
    margin-bottom: 0.85rem;
    font-style: italic;
}

.card-excerpt {
    color: #555;
    font-size: 0.83rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.card-date {
    font-size: 0.78rem;
    color: var(--muted);
}

.card-link {
    color: var(--gold-dark);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: gap 0.2s ease;
}

.card-link:hover {
    gap: 0.6rem;
}

/* ── LIST VIEW ──────────────────────────────────────── */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-item {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    gap: 1.5rem;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    align-items: flex-start;
}

.review-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.item-cover {
    flex-shrink: 0;
    width: 80px;
    /* portrait ratio */
    aspect-ratio: 2 / 3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #e8e0d4;
    box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.15);
}

.item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.item-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.item-info {
    flex: 2;
    min-width: 250px;
}

.item-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 0.2rem;
}

.item-info .author {
    color: var(--muted);
    font-size: 0.88rem;
    font-style: italic;
    margin-bottom: 0.65rem;
}

.item-info .excerpt {
    color: #555;
    font-size: 0.88rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-meta {
    flex: 1;
    min-width: 160px;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    align-items: flex-end;
}

.item-staff {
    font-weight: 700;
    color: var(--gold-dark);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.item-rating {
    color: var(--gold);
    font-size: 0.95rem;
    letter-spacing: 1px;
}

.item-date {
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

/* ── Pagination ─────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 42px;
    height: 42px;
    border: 1.5px solid var(--border);
    background: var(--white);
    border-radius: var(--radius-sm);
    color: var(--charcoal);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pagination-btn:hover {
    border-color: var(--gold);
    color: var(--gold-dark);
}

.pagination-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--white);
    box-shadow: 0 3px 10px rgba(248, 186, 0, 0.35);
}

/* ── Empty State ─────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 6rem 2rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 3.5rem;
    color: #d4cfc7;
    margin-bottom: 1.25rem;
    display: block;
}

.empty-state h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--muted);
    font-size: 0.95rem;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1400px) {
    :root {
        --px: 3rem;
    }

    .reviews-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    :root {
        --px: 2rem;
    }

    .reviews-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .stat-item:nth-child(2)::after {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --px: 1.25rem;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.1rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-wrap: wrap;
    }

    .view-toggle {
        align-self: flex-start;
    }

    .review-item {
        flex-direction: column;
    }

    .item-cover {
        width: 100%;
        aspect-ratio: 16/9;
    }

    .item-cover img {
        object-position: center;
    }

    .item-meta {
        text-align: left;
        align-items: flex-start;
    }

    .stat-number {
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    :root {
        --px: 1rem;
    }

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

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

    .filter-select {
        width: 100%;
    }

    .pagination {
        gap: 0.3rem;
    }
}