﻿/* ----------------------------------------------------------------
   Variation page stylesheet (clean build)
   Screen + Print rules with predictable, minimal overrides.
   ---------------------------------------------------------------- */

/* =============
   Base / screen
   ============= */
.page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px
}

/* Breadcrumbs */
nav.breadcrumbs {
    font-size: .9rem;
    color: #6b7280;
    margin: 6px 0 10px
}

    nav.breadcrumbs a {
        color: inherit;
        text-decoration: none
    }

        nav.breadcrumbs a:hover {
            text-decoration: underline
        }

    nav.breadcrumbs .sep {
        opacity: .55;
        padding: 0 6px
    }

/* Hero */
.hero {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fff;
    color: #0f172a;
    border-bottom: 1px solid rgba(15,23,42,.08);
    box-shadow: 0 2px 8px rgba(15,23,42,.06)
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 0
}

.hero-title {
    font-weight: 700;
    letter-spacing: .2px
}

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
    margin-top: 6px
}

.pill {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: .92rem
}

.rarity.common {
    color: #3b82f6
}

.rarity.uncommon {
    color: #22c55e
}

.rarity.rare {
    color: #f59e0b
}

.rarity.ultra {
    color: #ef4444
}

/* Main grid */
.grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 16px
}

@media (max-width:980px) {
    .grid {
        grid-template-columns: 1fr
    }
}

/* Cards */
.card {
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 12px;
    padding: 12px;
    background: #fff
}

    .card h2 {
        font-size: 1.05rem;
        margin: 4px 0 10px
    }

/* Gallery */
.gallery {
    display: grid;
    grid-template-rows: auto auto;
    gap: 10px
}

.stage {
    background: #0b1220;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 12px;
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative
}

    .stage img {
        max-width: 100%;
        max-height: 62vh;
        border-radius: 8px
    }

    .stage figcaption {
        position: absolute;
        left: 10px;
        bottom: 10px;
        font-size: .8rem;
        color: #e5e7eb;
        background: rgba(0,0,0,.35);
        padding: 4px 8px;
        border-radius: 8px
    }

.thumbs {
    display: grid;
    grid-template-columns: repeat(6,1fr);
    gap: 10px
}

@media (max-width:720px) {
    .thumbs {
        grid-template-columns: repeat(4,1fr)
    }
}

.thumb {
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: #111827
}

    .thumb button {
        display: block;
        width: 100%;
        background: transparent;
        border: 0;
        padding: 0;
        cursor: pointer
    }

        .thumb button:focus-visible {
            outline: 2px solid #3b82f6
        }

    .thumb img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        aspect-ratio: 1/1
    }

    .thumb[aria-selected="true"] {
        border-color: #3b82f6
    }

/* Chips / swatches */
.chip {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    font-size: .85rem
}

.swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,.25)
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse
}

    .table th, .table td {
        padding: 8px 10px;
        border-bottom: 1px solid #e5e7eb;
        text-align: left
    }

.muted {
    color: #6b7280
}

.banner {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: linear-gradient(180deg, rgba(245,158,11,.15), rgba(245,158,11,.05));
    border: 1px solid rgba(245,158,11,.35);
    color: #92400e;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: .95rem
}

.pager {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px
}

.sr-only {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden
}


/* =============================
   PRINT (Letter, portrait)
   Goal: 1st row two columns (Media left, Highlights right),
         subsequent sections full width, compact spacing.
   ============================= */
@media print {
    @page {
        size: Letter;
        margin: 8mm;
    }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    html {
        zoom: .78;
    }

    body {
        font-size: 10pt;
        color: #000 !important;
        background: #fff !important;
    }

    /* Clean chrome */
    .hero {
        position: static !important;
        background: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
        border: 0 !important;
        margin: 0 0 3mm 0 !important
    }

        .hero .d-flex, .hero button, #shareBtn, .pager {
            display: none !important;
        }

    .pill {
        background: transparent !important;
        border-color: #000 !important;
    }

    /* Layout: 2 columns only for the first row, then full width */
    main#content.grid {
        display: grid !important;
        grid-template-columns: .9fr 1.1fr !important;
        column-gap: 6mm !important;
        align-items: start !important;
    }
    /* Place first two blocks explicitly */
    main#content > section.card:first-of-type {
        grid-column: 1 / 2 !important;
    }

    main#content > aside.card {
        grid-column: 2 / 3 !important;
    }
    /* Everything after the first two spans full width */
    main#content > section.card:not(:first-of-type),
    main#content > [aria-labelledby="specs-heading"],
    main#content > [aria-labelledby="packaging-heading"],
    main#content > [aria-labelledby="series-heading"],
    main#content > [aria-labelledby="refs-heading"],
    main#content > [aria-labelledby="inv-heading"] {
        grid-column: 1 / -1 !important;
    }

    /* Avoid massive blank space: allow breaking inside cards */
    .card {
        break-inside: auto;
        page-break-inside: auto
    }

    /* Gallery: modest image, hide thumbs */
    .gallery .stage {
        border: 0 !important;
        background: transparent !important;
        min-height: auto !important
    }

    .stage img {
        width: 100% !important;
        height: auto !important;
        max-height: 75mm !important;
        max-width: 75mm !important;
        object-fit: contain !important
    }

    .stage figcaption, .thumbs, .muted.mt-1, .banner {
        display: none !important;
    }

    /* Highlights: two columns; chips don’t word-wrap */
    [aria-labelledby="highlights-heading"] ul {
        columns: 2;
        column-gap: 3mm;
        margin: 0;
        padding-left: 3mm;
    }

    [aria-labelledby="highlights-heading"] li {
        break-inside: avoid;
        -webkit-column-break-inside: avoid;
        page-break-inside: avoid;
    }

    .chip {
        font-size: 8pt !important;
        padding: 1.2mm 2.2mm !important;
        white-space: nowrap
    }

    /* Specs: make the inner row two columns */
    [aria-labelledby="specs-heading"] .row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 4mm !important;
    }

    [aria-labelledby="specs-heading"] .table th,
    [aria-labelledby="specs-heading"] .table td {
        padding: 1.5mm 2mm !important;
        border-color: #000 !important;
    }

    /* Packaging: show names only (thumb strips hidden above) */
    [aria-labelledby="packaging-heading"] .d-flex {
        display: none !important;
    }

    /* Optional: hide extremely long sections to stay on one page. Comment out if not desired. */
    /* [aria-labelledby="inv-heading"] { display:none !important; } */

    /* Tables/links */
    thead {
        display: table-header-group
    }

    a, a:visited {
        color: #000 !important;
        text-decoration: none !important
    }
}
