/*
 * ========================================
 * BOOKS LIST PAGE - CLEAN REDESIGN
 * Reality Raincheck Theme
 * ========================================
 * Consistent design system matching single book page
 * Unified buttons, badges, and card styling
 */

/* ========================================
   PAGE WRAPPER
   ======================================== */

.rrc-books-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* ========================================
   HERO SECTION
   ======================================== */

.rrc-books-hero {
    position: relative;
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--rrc-primary-navy) 0%, var(--rrc-secondary-teal) 100%);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(30, 58, 95, 0.15);
    border-top: 4px solid var(--rrc-accent-coral);
    overflow: hidden;
}

.rrc-books-hero::after {
    content: '';
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    pointer-events: none;
}

.rrc-books-hero > * {
    position: relative;
    z-index: 1;
}

.rrc-books-hero h1 {
    font-family: var(--rrc-font-display);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 1rem 0;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.rrc-books-tagline {
    font-family: var(--rrc-font-display);
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    line-height: 1.4;
    font-style: italic;
    opacity: 0.92;
    margin-bottom: 1.5rem;
    color: #fff;
}

.rrc-books-intro {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.11);
    backdrop-filter: blur(10px);
    font-family: var(--rrc-font-body);
    font-size: 1.05rem;
    line-height: 1.7;
    color: #fff;
}

.rrc-books-intro p {
    margin: 0;
}

/* ========================================
   FILTER BUTTONS - UNIFIED SYSTEM
   ======================================== */

.rrc-books-filters {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 3rem auto 2.5rem;
    flex-wrap: wrap;
}

.rrc-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.75rem;
    border: 2px solid rgba(74, 124, 126, 0.3);
    border-radius: 28px;
    background: #fff;
    color: var(--rrc-primary-navy);
    font-family: var(--rrc-font-body);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.08);
    white-space: nowrap;
}

.rrc-filter-btn:hover,
.rrc-filter-btn:focus {
    background: linear-gradient(135deg, var(--rrc-secondary-teal) 0%, #3d6b6d 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(74, 124, 126, 0.25);
    transform: translateY(-2px);
}

.rrc-filter-btn:focus-visible {
    outline: 2px solid var(--rrc-accent-coral);
    outline-offset: 3px;
}

.rrc-filter-btn.active {
    background: linear-gradient(135deg, var(--rrc-primary-navy) 0%, var(--rrc-secondary-teal) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(30, 58, 95, 0.2);
}

/* ========================================
   FEATURED BOOK SECTION
   ======================================== */

.rrc-featured-book {
    position: relative;
    margin-bottom: 3rem;
    padding: 3rem;
    border-radius: 24px;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.97) 5%, rgba(250, 248, 246, 0.92) 55%, rgba(244, 235, 232, 0.9) 100%);
    box-shadow: 0 20px 55px rgba(30, 58, 95, 0.12);
    border: 1px solid rgba(30, 58, 95, 0.08);
    overflow: hidden;
}

.rrc-featured-book::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0) 55%);
    pointer-events: none;
}

.rrc-featured-book > * {
    position: relative;
    z-index: 1;
}

.rrc-featured-book-header {
    margin-bottom: 1.5rem;
}

/* Featured Badge - Matching Single Page Badge Style */
.rrc-featured-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--rrc-accent-coral) 0%, var(--rrc-dusty-rose) 100%);
    color: #fff;
    font-family: var(--rrc-font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 6px 16px rgba(201, 101, 103, 0.25);
}

.rrc-featured-indicator::before {
    content: '★';
    font-size: 16px;
}

.rrc-featured-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    align-items: start;
}

.rrc-featured-cover {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(30, 58, 95, 0.18);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rrc-featured-cover:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 28px 60px rgba(30, 58, 95, 0.22);
}

.rrc-featured-cover img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
}

.rrc-featured-details {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.rrc-featured-title {
    font-family: var(--rrc-font-display);
    font-size: clamp(2rem, 3vw, 2.75rem);
    line-height: 1.2;
    font-weight: 700;
    color: var(--rrc-primary-navy);
    margin: 0;
    letter-spacing: -0.01em;
}

.rrc-featured-author {
    font-family: var(--rrc-font-serif);
    font-size: 1.4rem;
    font-style: italic;
    color: var(--rrc-secondary-teal);
    margin: 0;
}

.rrc-discussion-date {
    display: inline-flex;
    align-items: center;
    font-family: var(--rrc-font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(30, 58, 95, 0.65);
    padding: 4px 12px;
    background: rgba(74, 124, 126, 0.08);
    border-radius: 12px;
    width: fit-content;
}

.rrc-featured-description {
    font-family: var(--rrc-font-body);
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--rrc-text-dark);
    opacity: 0.92;
}

.rrc-featured-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* Featured Buttons - Matching Single Page Button System */
.rrc-featured-primary-btn,
.rrc-featured-book .rrc-amazon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 28px;
    font-family: var(--rrc-font-body);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid transparent;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    white-space: nowrap;
}

.rrc-featured-primary-btn {
    background: linear-gradient(135deg, var(--rrc-secondary-teal) 0%, #3d6b6d 100%);
    color: #fff !important;
    border: 1px solid var(--rrc-secondary-teal);
}

.rrc-featured-primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(74, 124, 126, 0.25);
    color: #fff !important;
}

.rrc-featured-book .rrc-amazon-button {
    background: #fff;
    color: #111 !important;
    border: 1px solid rgba(30, 58, 95, 0.12);
}

.rrc-featured-book .rrc-amazon-button:hover {
    background: #fff9f0;
    border-color: #FF9900;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(255, 153, 0, 0.15);
    color: #111 !important;
}

.rrc-amazon-logo-container {
    display: flex;
    align-items: center;
    width: 16px;
    height: 16px;
}

.rrc-amazon-logo {
    width: 100%;
    height: auto;
}

/* ========================================
   BOOK CARDS GRID
   ======================================== */

.rrc-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2.5rem auto;
    max-width: 1200px;
}

.rrc-book-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 20px;
    border: 1px solid rgba(30, 58, 95, 0.08);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(30, 58, 95, 0.06);
    height: 100%;
}

.rrc-book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 45px rgba(30, 58, 95, 0.14);
    border-color: rgba(74, 124, 126, 0.15);
}

/* Book Cover Container */
.rrc-book-card .rrc-book-cover-container {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: radial-gradient(circle at 30% 30%, rgba(244, 235, 232, 0.92), rgba(250, 248, 246, 0.98));
    border-bottom: 1px solid rgba(30, 58, 95, 0.06);
    overflow: hidden;
}

.rrc-book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.rrc-book-card:hover .rrc-book-cover {
    transform: scale(1.05);
}

/* Improved NO COVER Placeholder - Matching Single Page Style */
.rrc-book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f7f4 0%, #e8e3dc 100%);
    border: 2px dashed rgba(212, 197, 185, 0.4);
    position: relative;
}

.rrc-book-cover-placeholder::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234a7c7e' opacity='0.15'%3E%3Cpath d='M18 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM6 4h5v8l-2.5-1.5L6 12V4z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.rrc-book-cover-placeholder span {
    font-family: var(--rrc-font-display);
    font-size: 4rem;
    font-weight: 300;
    color: var(--rrc-primary-navy);
    opacity: 0.2;
    position: relative;
    z-index: 1;
}

/* Status Badges - Unified Design */
.rrc-book-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    border-radius: 16px;
    font-family: var(--rrc-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    z-index: 10;
}

.rrc-book-badge.current {
    background: linear-gradient(135deg, var(--rrc-accent-coral) 0%, var(--rrc-dusty-rose) 100%);
}

.rrc-book-badge.favorite {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.rrc-book-badge.upcoming {
    background: linear-gradient(135deg, var(--rrc-deep-plum) 0%, var(--rrc-primary-navy) 100%);
}

/* Book Details Section */
.rrc-book-card .rrc-book-details {
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.rrc-book-card .rrc-book-title {
    font-family: var(--rrc-font-display);
    font-size: 1.25rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    font-weight: 600;
    color: var(--rrc-primary-navy);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rrc-book-card .rrc-book-author {
    font-family: var(--rrc-font-serif);
    font-size: 1.05rem;
    line-height: 1.35;
    font-style: italic;
    color: var(--rrc-secondary-teal);
    margin: 0;
}

/* Genre Tags */
.rrc-book-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.rrc-genre-tag {
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(74, 124, 126, 0.08);
    color: var(--rrc-secondary-teal);
    font-family: var(--rrc-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Card Actions */
.rrc-book-card-actions {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(30, 58, 95, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Book Flags (Podcast/Kit indicators) - Unified Style */
.rrc-book-flags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rrc-book-flag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 14px;
    font-family: var(--rrc-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(74, 124, 126, 0.1);
    color: var(--rrc-secondary-teal);
}

.rrc-book-flag svg {
    width: 14px;
    height: 14px;
}

.rrc-book-flag--kit {
    background: rgba(168, 192, 154, 0.15);
    color: var(--rrc-soft-sage);
}

.rrc-book-flag--podcast {
    background: rgba(97, 64, 81, 0.1);
    color: var(--rrc-deep-plum);
}

/* View Details Link - Matching Button System */
.rrc-book-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--rrc-secondary-teal) 0%, #3d6b6d 100%);
    color: #fff !important;
    font-family: var(--rrc-font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(74, 124, 126, 0.15);
    white-space: nowrap;
}

.rrc-book-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 124, 126, 0.25);
    color: #fff !important;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 992px) {
    .rrc-books-wrapper {
        padding: 2.5rem 1.25rem;
    }

    .rrc-featured-content {
        grid-template-columns: 240px 1fr;
        gap: 2rem;
    }

    .rrc-books-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.75rem;
    }
}

@media (max-width: 768px) {
    .rrc-books-wrapper {
        padding: 2rem 1rem;
    }

    .rrc-books-hero {
        padding: 2.5rem 1.5rem;
    }

    .rrc-books-hero::after {
        inset: 12px;
    }

    .rrc-books-intro {
        padding: 1.25rem 1rem;
    }

    .rrc-books-filters {
        gap: 0.5rem;
        margin: 2rem auto 2rem;
    }

    .rrc-filter-btn {
        padding: 0.6rem 1.5rem;
        font-size: 13px;
    }

    .rrc-featured-book {
        padding: 2rem 1.5rem;
    }

    .rrc-featured-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .rrc-featured-cover {
        max-width: 280px;
        margin: 0 auto;
    }

    .rrc-featured-details {
        text-align: center;
        align-items: center;
    }

    .rrc-featured-actions {
        justify-content: center;
        width: 100%;
    }

    .rrc-featured-primary-btn,
    .rrc-featured-book .rrc-amazon-button {
        flex: 1;
        min-width: 140px;
    }

    .rrc-books-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }

    .rrc-book-card-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .rrc-book-link {
        width: 100%;
        padding: 0.65rem 1.25rem;
    }

    .rrc-book-flags {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .rrc-books-hero {
        padding: 2rem 1.25rem;
    }

    .rrc-books-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .rrc-filter-btn {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .rrc-featured-book {
        padding: 1.5rem 1rem;
    }

    .rrc-featured-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .rrc-featured-primary-btn,
    .rrc-featured-book .rrc-amazon-button {
        width: 100%;
    }
}

/* ========================================
   ANIMATION & TRANSITIONS
   ======================================== */

/* Fade in animation for cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rrc-book-card {
    animation: fadeInUp 0.4s ease-out backwards;
}

.rrc-book-card:nth-child(1) { animation-delay: 0.05s; }
.rrc-book-card:nth-child(2) { animation-delay: 0.1s; }
.rrc-book-card:nth-child(3) { animation-delay: 0.15s; }
.rrc-book-card:nth-child(4) { animation-delay: 0.2s; }
.rrc-book-card:nth-child(5) { animation-delay: 0.25s; }
.rrc-book-card:nth-child(6) { animation-delay: 0.3s; }

/* Focus states for accessibility */
.rrc-book-link:focus-visible,
.rrc-featured-primary-btn:focus-visible,
.rrc-featured-book .rrc-amazon-button:focus-visible {
    outline: 2px solid var(--rrc-accent-coral);
    outline-offset: 3px;
}
