/**
 * Reviews Listing Page Styles
 *
 * Styles for /video-game-reviews/ and /board-game-reviews/ listing pages
 * Uses black background with green torn edges (standard page pattern)
 *
 * @package Genesis Sample
 * @since 2.0.0
 */

/* ===== GENESIS OVERRIDES FOR FULL WIDTH ===== */
body.page-template-page-video-game-reviews .site-inner,
body.page-template-page-board-game-reviews .site-inner {
    max-width: 100%;
    padding: 0;
}

body.page-template-page-video-game-reviews .content,
body.page-template-page-board-game-reviews .content {
    max-width: 100%;
    width: 100%;
    padding: 0;
}

/* ===== PAGE CONTAINER BASE STYLES ===== */
.reviews-listing-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 80px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    position: relative;
}

/* Ensure all content appears above the torn edges */
.reviews-listing-page > * {
    position: relative;
    z-index: 2;
}

/* ===== A-Z SECTION CONTAINER (bottom section of page) ===== */
.reviews-listing-page.reviews-listing-az-section {
    padding-top: 40px;
    margin-top: 0;
    /* Wavy borders on left and right only */
    clip-path: polygon(
        0% 0%, 100% 0%,
        98% 5%, 99% 10%, 97% 15%, 100% 20%, 98% 25%, 99% 30%, 97% 35%, 100% 40%, 98% 45%, 99% 50%, 97% 55%, 100% 60%, 98% 65%, 99% 70%, 97% 75%, 100% 80%, 98% 85%, 99% 90%, 97% 95%,
        100% 100%, 0% 100%,
        2% 95%, 1% 90%, 3% 85%, 0% 80%, 2% 75%, 1% 70%, 3% 65%, 0% 60%, 2% 55%, 1% 50%, 3% 45%, 0% 40%, 2% 35%, 1% 30%, 3% 25%, 0% 20%, 2% 15%, 1% 10%, 3% 5%
    );
}

/* No top edge on A-Z section */
.reviews-listing-page.reviews-listing-az-section::before {
    display: none;
}

/* Bottom torn edge - only on A-Z container */
.reviews-listing-page.reviews-listing-az-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: #4da44b;
    clip-path: polygon(0% 100%, 10% 20%, 20% 40%, 30% 10%, 40% 50%, 50% 15%, 60% 60%, 70% 25%, 80% 45%, 90% 20%, 100% 100%, 100% 100%, 0% 100%);
    z-index: 1;
}

/* ===== PAGE HEADER ===== */
.reviews-page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #333;
}

.reviews-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4da44b;
    margin: 0 0 15px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.reviews-page-description {
    font-size: 1.125rem;
    color: #b0b0b0;
    margin: 0;
}

.reviews-page-description .highlight-number {
    color: #4da44b;
    font-weight: 700;
}

/* ===== TOP SECTION (LATEST REVIEWS) ===== */
/* Full-width section outside containers - matches homepage layout */
.reviews-top-section {
    background: #1a1a1a;
    padding: 30px 20px 40px 20px;
    margin: 0;
    width: 100%;
}

/* When used as page header, add top padding for breathing room */
.reviews-top-section.reviews-top-section-with-title {
    padding-top: 40px;
}

/* Grid uses full width like homepage */
.reviews-top-section .reviews-grid-v3 {
    max-width: 100%;
    padding: 0 20px;
}

.reviews-top-section .section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #333;
    padding-left: 40px;
    padding-right: 40px;
}

.reviews-top-section .section-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #4da44b;
    margin: 0;
}

/* Review count badge on right side of header */
.reviews-top-section .reviews-count {
    font-size: 1rem;
    color: #888;
    font-weight: 500;
}

.reviews-top-section .reviews-count .highlight-number {
    color: #4da44b;
    font-weight: 700;
}

/* ===== A-Z DIVIDER ===== */
.reviews-az-divider {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 40px 0 30px 0;
}

.reviews-az-divider .divider-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4da44b, transparent);
}

.reviews-az-divider .divider-text {
    color: #4da44b;
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
}

/* ===== A-Z INDEX ===== */
.reviews-az-index {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 40px;
    padding: 15px 20px;
    background: #2d2d2d;
    border-radius: 12px;
    border: 1px solid #404040;
}

.reviews-az-index .az-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.reviews-az-index .az-letter.active {
    background: linear-gradient(135deg, #4da44b, #059669);
    color: white;
    cursor: pointer;
    text-decoration: none;
}

.reviews-az-index .az-letter.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 164, 75, 0.4);
}

.reviews-az-index .az-letter.inactive {
    color: #555;
    background: #252525;
    cursor: not-allowed;
}

/* ===== ALPHABETICAL LIST ===== */
.reviews-alphabetical-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Letter Group */
.reviews-letter-group {
    background: linear-gradient(135deg, #2d2d2d 0%, #1f1f1f 100%);
    border-radius: 16px;
    border: 2px solid #404040;
    padding: 25px;
    transition: border-color 0.3s ease;
}

.reviews-letter-group:hover {
    border-color: #4da44b;
}

/* Letter Header */
.letter-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #404040;
}

.letter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4da44b, #059669);
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(77, 164, 75, 0.3);
}

.letter-count {
    color: #888;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Letter Reviews Container - 3 per row grid */
.letter-reviews {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

/* ===== REVIEW LIST ENTRY ===== */
/* 3-row layout: Row 1 = title, Row 2 = date, Row 3 = badges */
/* Box art spans all rows on the left */
.review-list-entry {
    display: grid;
    grid-template-columns: 72px 1fr;
    grid-template-rows: auto auto auto;
    gap: 2px 10px;
    padding: 15px 12px;
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
    transition: all 0.3s ease;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
}

.review-list-entry:hover {
    border-color: #4da44b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 164, 75, 0.1);
}

/* Box Art - spans all rows, pinned top-left */
.review-entry-boxart {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 72px;
    align-self: start;
}

.review-entry-boxart img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.review-list-entry:hover .review-entry-boxart img {
    transform: scale(1.05);
}

.review-entry-boxart .boxart-placeholder {
    width: 100%;
    height: 75px;
    background: linear-gradient(135deg, #2d2d2d, #1f1f1f);
    border-radius: 6px;
    border: 1px dashed #444;
}

/* Review Info - Row 1: title on its own line */
.review-entry-info {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.review-entry-title {
    color: #e0e0e0;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.review-entry-title:hover {
    color: #4da44b;
}

.review-entry-meta {
    flex-shrink: 0;
}

.review-entry-date {
    color: #555;
    font-size: 0.7rem;
    white-space: nowrap;
}

/* Badges - Row 2 onwards, block pushed right but internally left-aligned */
.review-entry-badges {
    grid-column: 2;
    grid-row: 2 / -1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    justify-self: end;
}

/* Video games: badges side by side in a row */
.review-list-entry-video .review-entry-badges {
    flex-direction: row;
    gap: 4px;
}

/* Smaller Solo/Multi labels in review listing cards */
.review-entry-badges .badge-group-label {
    font-size: 7px;
    padding: 1px 6px 1px 3px;
}

/* ===== NO REVIEWS MESSAGE ===== */
.no-reviews-message {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 1.125rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .reviews-listing-page {
        padding: 30px 15px;
    }

    /* Disable wavy clip-path on mobile (eats ~22px per side on 375px) */
    .reviews-listing-page.reviews-listing-az-section {
        clip-path: none;
    }

    .reviews-page-title {
        font-size: 2rem;
    }

    .reviews-az-index {
        padding: 12px;
        gap: 4px;
    }

    .reviews-az-index .az-letter {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .reviews-az-divider .divider-text {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .reviews-letter-group {
        padding: 15px;
    }

    .letter-badge {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    /* A-Z entries: single column on mobile */
    .letter-reviews {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Card grid: smaller box art column */
    .review-list-entry {
        grid-template-columns: 50px 1fr;
        gap: 2px 8px;
        padding: 10px;
    }

    .review-entry-boxart {
        width: 50px;
    }

    .review-entry-boxart img {
        max-height: 70px;
    }

    .review-entry-title {
        font-size: 0.9rem;
    }

    .review-entry-date {
        font-size: 0.7rem;
    }

    /* Scale down badge groups on mobile */
    .review-entry-badges .badge-group {
        transform: scale(0.85);
        transform-origin: left center;
    }
}

@media (max-width: 480px) {
    .reviews-listing-page {
        padding: 20px 10px;
    }

    .reviews-page-title {
        font-size: 1.75rem;
    }

    .reviews-az-index .az-letter {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .review-list-entry {
        grid-template-columns: 45px 1fr;
        padding: 8px;
    }

    .review-entry-boxart {
        width: 45px;
    }

    .review-entry-boxart img {
        max-height: 60px;
    }

    .review-entry-title {
        font-size: 0.85rem;
    }

    /* Further scale down badges on small phones */
    .review-entry-badges .badge-group {
        transform: scale(0.75);
        transform-origin: left center;
    }
}
