/**
 * Retro Recordings XR — Console History Page Styles
 *
 * Custom component CSS for the Console History page template
 * (page-consoles-history.php). Loaded only on that template.
 * All brand variables mirror the compiled Tailwind theme tokens.
 *
 * @package    RetroRecordingsXR
 * @since      1.3.0
 */

/* ─── Filter Bar ─────────────────────────────────────────────── */

.ch-filter-bar {
    position: sticky;
    top: 52px;
    z-index: 40;
    background: #1a1a1a;
    border-bottom: 1px solid rgba(212, 165, 116, 0.15);
    padding: 10px 24px;
}

.ch-filter-inner {
    max-width: 80rem;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.ch-search-wrap {
    position: relative;
    min-width: 180px;
    max-width: 240px;
    flex-shrink: 0;
}

.ch-search-input {
    width: 100%;
    background: rgba(44, 24, 16, 0.7);
    border: 1px solid rgba(212, 165, 116, 0.22);
    color: #f4e4d7;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    padding: 6px 10px 6px 28px;
    border-radius: 2px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.ch-search-input:focus {
    border-color: rgba(212, 165, 116, 0.55);
}

.ch-search-input::placeholder {
    color: rgba(244, 228, 215, 0.28);
}

.ch-search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(212, 165, 116, 0.45);
    pointer-events: none;
    width: 13px;
    height: 13px;
}

.ch-brand-filters {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
}

.ch-filter-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 2px;
    border: 1px solid rgba(212, 165, 116, 0.18);
    color: rgba(244, 228, 215, 0.45);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.ch-filter-btn:hover {
    border-color: rgba(212, 165, 116, 0.45);
    color: rgba(244, 228, 215, 0.75);
}

.ch-filter-btn.is-active {
    background: rgba(212, 165, 116, 0.14);
    border-color: #d4a574;
    color: #d4a574;
}

.ch-filter-btn[data-filter="all"].is-active {
    background: rgba(232, 160, 84, 0.14);
    border-color: #e8a054;
    color: #e8a054;
}

.ch-no-results {
    display: none;
    text-align: center;
    padding: 80px 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(244, 228, 215, 0.28);
}


/* ─── Era Sections ───────────────────────────────────────────── */

.ch-eras {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 24px;
}

.ch-era {
    padding: 52px 0;
    border-bottom: 1px solid rgba(212, 165, 116, 0.07);
}

.ch-era:last-child {
    border-bottom: none;
    padding-bottom: 20px;
}

.ch-era-header {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 28px;
}

.ch-era-dot {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 3px;
    background: rgba(26, 26, 26, 0.8);
}

.ch-era-dot svg {
    width: 18px;
    height: 18px;
}

.ch-era-decade {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 4px;
    opacity: 0.9;
}

.ch-era-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 26px;
    font-weight: 700;
    color: #f4e4d7;
    line-height: 1.2;
    margin-bottom: 7px;
}

.ch-era-desc {
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    font-weight: 300;
    line-height: 1.75;
    color: rgba(244, 228, 215, 0.52);
    max-width: 620px;
}


/* ─── Console Cards Grid ─────────────────────────────────────── */

.ch-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.ch-card {
    background: rgba(22, 14, 10, 0.6);
    border: 1px solid rgba(212, 165, 116, 0.11);
    border-radius: 2px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
    position: relative;
}

.ch-card:hover {
    border-color: rgba(212, 165, 116, 0.32);
    transform: translateY(-2px);
}

.ch-card.ch-hidden {
    display: none !important;
}

/* Whole-card link to the brand's /consoles/ page (stretched link) */
.ch-card.ch-has-link {
    cursor: pointer;
}
.ch-card-link {
    position: absolute;
    inset: 0;
    z-index: 3;
}
.ch-card.ch-has-link:hover {
    border-color: rgba(212, 165, 116, 0.5);
}
.ch-card.ch-has-link:focus-within {
    outline: 1px solid rgba(212, 165, 116, 0.6);
    outline-offset: 2px;
}

.ch-card-accent {
    height: 2px;
    width: 100%;
    flex-shrink: 0;
}

.ch-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: rgba(44, 24, 16, 0.5);
}

.ch-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    transition: opacity 0.3s, transform 0.4s;
    display: block;
}

.ch-card:hover .ch-card-image img {
    opacity: 1;
    transform: scale(1.03);
}

.ch-card-body {
    padding: 14px 16px 16px;
}

.ch-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.ch-card-maker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(244, 228, 215, 0.4);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.ch-card-rarity {
    font-family: 'JetBrains Mono', monospace;
    font-size: 7.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 1px;
    border: 1px solid rgba(232, 160, 84, 0.55);
    color: #e8a054;
    white-space: nowrap;
    flex-shrink: 0;
}

.ch-card-model {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    color: rgba(244, 228, 215, 0.90);
    line-height: 1.25;
    margin-bottom: 9px;
}

.ch-card-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.5px;
    color: rgba(244, 228, 215, 0.32);
    letter-spacing: 0.08em;
}

.ch-card-meta-div {
    width: 1px;
    height: 9px;
    background: rgba(212, 165, 116, 0.2);
    flex-shrink: 0;
}

.ch-card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 11px;
}

.ch-card-spec {
    font-family: 'JetBrains Mono', monospace;
    font-size: 7.5px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 1px;
    background: rgba(44, 24, 16, 0.9);
    border: 1px solid rgba(212, 165, 116, 0.13);
    color: rgba(244, 228, 215, 0.45);
    white-space: nowrap;
}

.ch-card-note {
    font-family: 'Inter', sans-serif;
    font-size: 11.5px;
    font-weight: 300;
    line-height: 1.65;
    color: rgba(244, 228, 215, 0.48);
}

.ch-card-famous {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid rgba(212, 165, 116, 0.09);
    font-family: 'Inter', sans-serif;
    font-size: 10.5px;
    font-weight: 400;
    font-style: italic;
    line-height: 1.5;
    color: rgba(212, 165, 116, 0.7);
}

.ch-card-famous-icon {
    flex-shrink: 0;
    margin-top: 1px;
    opacity: 0.6;
}


/* ─── Key Findings Grid ──────────────────────────────────────── */

.ch-findings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 24px;
}

.ch-finding-card {
    background: rgba(44, 24, 16, 0.35);
    border: 1px solid rgba(212, 165, 116, 0.1);
    border-radius: 2px;
    padding: 18px 20px;
}

.ch-finding-icon {
    font-size: 22px;
    line-height: 1;
    margin-bottom: 10px;
    display: block;
}

.ch-finding-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 14px;
    font-weight: 700;
    color: rgba(244, 228, 215, 0.88);
    margin-bottom: 6px;
}

.ch-finding-text {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 300;
    line-height: 1.7;
    color: rgba(244, 228, 215, 0.48);
}


/* ─── Manufacturer Grid ──────────────────────────────────────── */

.ch-maker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 24px;
}

.ch-maker-card {
    background: rgba(44, 24, 16, 0.38);
    border: 1px solid rgba(212, 165, 116, 0.1);
    border-radius: 2px;
    padding: 18px 20px;
    transition: border-color 0.2s;
}

.ch-maker-card:hover {
    border-color: rgba(212, 165, 116, 0.28);
}

.ch-maker-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.ch-maker-flag {
    font-size: 22px;
    line-height: 1;
}

.ch-maker-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 17px;
    font-weight: 700;
    color: #f4e4d7;
}

.ch-maker-country {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.5px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(244, 228, 215, 0.3);
    margin-bottom: 4px;
}

.ch-maker-founded {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.5px;
    letter-spacing: 0.1em;
    color: rgba(232, 160, 84, 0.65);
    margin-bottom: 8px;
}

.ch-maker-models {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: rgba(212, 165, 116, 0.6);
    margin-bottom: 9px;
    line-height: 1.6;
}

.ch-maker-desc {
    font-family: 'Inter', sans-serif;
    font-size: 11.5px;
    color: rgba(244, 228, 215, 0.44);
    font-weight: 300;
    line-height: 1.65;
}


/* ─── Studio Grid ────────────────────────────────────────────── */

.ch-studio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 24px;
}

.ch-studio-card {
    background: rgba(22, 14, 10, 0.55);
    border: 1px solid rgba(212, 165, 116, 0.09);
    border-radius: 2px;
    padding: 16px 18px;
    transition: border-color 0.2s;
}

.ch-studio-card:hover {
    border-color: rgba(212, 165, 116, 0.24);
}

.ch-studio-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 14.5px;
    font-weight: 700;
    color: rgba(244, 228, 215, 0.88);
    margin-bottom: 3px;
}

.ch-studio-location {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.5px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(244, 228, 215, 0.3);
    margin-bottom: 7px;
}

.ch-studio-consoles {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.5px;
    letter-spacing: 0.08em;
    color: rgba(212, 165, 116, 0.65);
    margin-bottom: 6px;
}

.ch-studio-recordings {
    font-family: 'Inter', sans-serif;
    font-size: 11.5px;
    color: rgba(244, 228, 215, 0.42);
    font-style: italic;
    line-height: 1.5;
}


/* ─── Milestone Timeline ─────────────────────────────────────── */

.ch-milestones {
    display: flex;
    overflow-x: auto;
    padding: 32px 24px 8px;
    max-width: 80rem;
    margin: 0 auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 165, 116, 0.25) transparent;
    position: relative;
}

.ch-milestones::before {
    content: '';
    position: absolute;
    top: 48px;
    left: 24px;
    right: 24px;
    height: 1px;
    background: rgba(212, 165, 116, 0.15);
    pointer-events: none;
}

.ch-milestone {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 22px;
    position: relative;
    min-width: 110px;
}

.ch-milestone-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d4a574;
    position: relative;
    z-index: 1;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.ch-milestone-year {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    font-weight: 700;
    color: #e8a054;
    margin-bottom: 4px;
    text-align: center;
    white-space: nowrap;
}

.ch-milestone-text {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    color: rgba(244, 228, 215, 0.42);
    text-align: center;
    line-height: 1.45;
    max-width: 100px;
}

/* Count badge for filter buttons */
.ch-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(212, 165, 116, 0.15);
    font-size: 7px;
    font-weight: 700;
    color: rgba(212, 165, 116, 0.6);
    margin-left: 3px;
    vertical-align: middle;
}

/* Section divider */
.ch-section-rule {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(212, 165, 116, 0.2) 20%, rgba(212, 165, 116, 0.2) 80%, transparent);
    margin: 0;
    border: none;
}

/* Hidden era (all cards filtered out) */
.ch-era.ch-era-hidden {
    display: none;
}


/* ─── Responsive ─────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .ch-cards-grid      { grid-template-columns: repeat(2, 1fr); }
    .ch-findings-grid   { grid-template-columns: repeat(2, 1fr); }
    .ch-maker-grid      { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .ch-filter-inner    { gap: 8px; }
    .ch-search-wrap     { max-width: 100%; min-width: 0; width: 100%; order: -1; }
    .ch-brand-filters   { order: 1; }
    .ch-cards-grid      { grid-template-columns: 1fr; }
    .ch-findings-grid   { grid-template-columns: 1fr; }
    .ch-maker-grid      { grid-template-columns: 1fr; }
    .ch-studio-grid     { grid-template-columns: 1fr; }
    .ch-era-title       { font-size: 21px; }
    .ch-era-header      { gap: 12px; }
    .ch-filter-bar      { top: 0; padding: 8px 16px; }
    .ch-eras            { padding: 0 16px; }
    .ch-findings-grid,
    .ch-maker-grid,
    .ch-studio-grid     { padding: 0 16px; }
    .ch-milestones      { padding-left: 16px; padding-right: 16px; }
}
