/**
 * Questionable Choice Archive Styles
 * Add this to your questionable-choice-spotlight.css file
 * OR save as separate: css/questionable-choice-archive.css
 */

/* ================================
   Archive Page Layout
   ================================ */
.questionable-choices-archive {
    padding: 2rem 1.5rem 4rem;
}

/* ================================
   Archive Header
   ================================ */
.archive-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px dashed #d0d0d0;
}

.archive-title {
    font-family: 'Caveat', cursive;
    font-size: 3.3rem;
    color: #2d2d2d;
    margin: 0 0 0.5rem 0;
}

.archive-description {
    font-family: 'Inter', sans-serif;
    font-size: 1.3rem;
    color: #666;
    margin: 0 0 0.5rem 0;
}

.archive-tagline {
    font-family: 'Caveat', cursive;
    font-size: 1.15rem;
    color: #999;
    font-style: italic;
    margin: 0;
}

/* ================================
   Archive Grid - Masonry Layout (CSS Columns)
   ================================ */
.archive-grid {
    column-count: 3;
    column-gap: 2rem;
}

.qc-polaroid-card {
    break-inside: avoid;
    margin-bottom: 2rem;
}

/* ================================
   Polaroid Card (the frame IS the card)
   ================================ */
.qc-polaroid-card {
    background: #ffffff;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

/* Landscape cards */
.qc-polaroid-card.landscape {
    padding: 12px 12px 16px 12px;
}

/* Portrait cards */
.qc-polaroid-card.portrait {
    padding: 14px 14px 18px 14px;
}

/* Subtle rotation for scattered look */
.qc-polaroid-card:nth-child(odd) {
    transform: rotate(-1deg);
}

.qc-polaroid-card:nth-child(even) {
    transform: rotate(0.8deg);
}

.qc-polaroid-card:nth-child(3n) {
    transform: rotate(1.5deg);
}

.qc-polaroid-card:hover {
    transform: rotate(0) translateY(-6px) scale(1.02);
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.15),
        0 16px 32px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* ================================
   Tape Elements
   ================================ */
.qc-polaroid-card::before,
.qc-polaroid-card::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 28px;
    background: linear-gradient(
        90deg,
        rgba(255, 248, 220, 0.65) 0%,
        rgba(255, 248, 220, 0.8) 50%,
        rgba(255, 248, 220, 0.65) 100%
    );
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

/* Hide second tape by default */
.qc-polaroid-card::after {
    content: none;
}

/* Variation 1: top left corner */
.qc-polaroid-card:nth-child(4n + 1)::before {
    top: -8px;
    left: -12px;
    transform: rotate(-38deg);
}

/* Variation 2: top right corner */
.qc-polaroid-card:nth-child(4n + 2)::before {
    top: -8px;
    left: auto;
    right: -12px;
    transform: rotate(38deg);
}

/* Variation 3: top center */
.qc-polaroid-card:nth-child(4n + 3)::before {
    top: -12px;
    left: 50%;
    right: auto;
    transform: translateX(-50%) rotate(-3deg);
}

/* Variation 4: TWO tapes - both corners */
.qc-polaroid-card:nth-child(4n)::before {
    top: -8px;
    left: -12px;
    transform: rotate(-38deg);
}

.qc-polaroid-card:nth-child(4n)::after {
    content: '';
    top: -8px;
    left: auto;
    right: -12px;
    transform: rotate(38deg);
}

/* ================================
   Polaroid Media Area
   ================================ */
.qc-polaroid-media {
    width: 100%;
    overflow: hidden;
}

.qc-polaroid-media img {
    width: 100%;
    display: block;
}

/* Landscape images */
.qc-polaroid-card.landscape .qc-polaroid-media img {
    aspect-ratio: 4/3;
    object-fit: cover;
}

/* Portrait images */
.qc-polaroid-card.portrait .qc-polaroid-media img {
    aspect-ratio: 3/4;
    object-fit: cover;
}

/* Video iframes */
.qc-polaroid-media iframe {
    width: 100% !important;
    height: auto !important;
    display: block;
}

.qc-polaroid-card.landscape .qc-polaroid-media iframe {
    aspect-ratio: 16/9;
}

.qc-polaroid-card.portrait .qc-polaroid-media iframe {
    aspect-ratio: 9/16;
}

/* ================================
   Polaroid Caption Area (the white space)
   ================================ */
.qc-polaroid-caption {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 4px 8px 4px;
    min-height: 36px;
}

.qc-polaroid-handwriting {
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    color: #333;
}

.qc-polaroid-date {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    color: #888;
}

/* ================================
   Content Below Polaroid
   ================================ */
.qc-polaroid-content {
    padding: 8px 4px 4px 4px;
    border-top: 1px solid #eee;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.qc-polaroid-title {
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    color: #2d2d2d;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.qc-polaroid-excerpt {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #666;
    line-height: 1.5;
    flex: 1;
}

.qc-polaroid-excerpt p {
    margin: 0;
}

.qc-polaroid-content {
    text-align: center;
}

.qc-polaroid-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-family: 'Caveat', cursive;
    font-size: 1.25rem;
    color: #555;
    text-decoration: none;
    padding: 0.3rem 1.5rem;
    background: linear-gradient(
        90deg,
        rgba(255, 248, 220, 0.65) 0%,
        rgba(255, 248, 220, 0.8) 50%,
        rgba(255, 248, 220, 0.65) 100%
    );
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: rotate(-1deg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.qc-polaroid-link:hover {
    color: #333;
    text-decoration: none;
    transform: rotate(0deg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* ================================
   Pagination
   ================================ */
.archive-pagination {
    grid-column: 1 / -1;
    margin-top: 2rem;
    text-align: center;
}

.archive-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.archive-pagination a,
.archive-pagination span {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    text-decoration: none;
    color: #555;
    transition: all 0.2s ease;
}

.archive-pagination a:hover {
    background: #4a9b9b;
    border-color: #4a9b9b;
    color: #fff;
}

.archive-pagination .current {
    background: #2d2d2d;
    border-color: #2d2d2d;
    color: #fff;
}

/* ================================
   No Results
   ================================ */
.no-choices {
    grid-column: 1 / -1;
    text-align: center;
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    color: #888;
    padding: 3rem;
}

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

/* Tablet - 2 columns */
@media (max-width: 1024px) {
    .archive-grid {
        column-count: 2;
        column-gap: 1.5rem;
    }

    .qc-polaroid-card {
        margin-bottom: 1.5rem;
    }
}

/* Mobile - single column */
@media (max-width: 768px) {
    .questionable-choices-archive {
        margin: 10px;
        border-width: 12px;
        padding: 1.5rem 1rem 3rem;
    }

    .archive-title {
        font-size: 2.6rem;
    }

    .archive-grid {
        column-count: 1;
    }

    .qc-polaroid-card {
        margin-bottom: 2rem;
    }

    /* Remove rotation on mobile for cleaner stacking */
    .qc-polaroid-card:nth-child(odd),
    .qc-polaroid-card:nth-child(even),
    .qc-polaroid-card:nth-child(3n) {
        transform: rotate(0);
    }

    .qc-polaroid-card:hover {
        transform: translateY(-4px);
    }
}
