/**
 * Retro Recordings XR — Recording Studios Page
 *
 * Grid overview → click → detail panel layout.
 * Fallback tile for studios without photos.
 *
 * @package    RetroRecordingsXR
 * @since      2.1.0
 */

/* ==========================================================================
   Layout shell
   ========================================================================== */

.rs-layout {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2.5rem 5rem;
}

@media (max-width: 700px) {
    .rs-layout { padding: 0 1.25rem 3rem; }
}

/* ==========================================================================
   Search
   ========================================================================== */

.rs-search-wrap {
    margin-bottom: 1rem;
    position: relative;
}

.rs-search-wrap::before {
    content: '';
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.85rem;
    height: 0.85rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23d4a574' stroke-width='2' opacity='0.4'%3E%3Ccircle cx='8.5' cy='8.5' r='5.5'/%3E%3Cline x1='13' y1='13' x2='18' y2='18'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
}

.rs-search {
    width: 100%;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.84rem;
    letter-spacing: 0.04em;
    color: rgba(244, 228, 215, 0.75);
    background: rgba(44, 24, 16, 0.35);
    border: 1px solid rgba(212, 165, 116, 0.18);
    border-radius: 4px;
    padding: 0.65rem 1rem 0.65rem 2.4rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.rs-search::placeholder {
    color: rgba(212, 165, 116, 0.3);
}

.rs-search:focus {
    border-color: rgba(212, 165, 116, 0.45);
    background: rgba(44, 24, 16, 0.55);
}

/* hide the native × button Chrome/Safari add */
/* Native clear-X — restyled in brand colours, only shows when input has text */
.rs-search::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    width: 1rem;
    height: 1rem;
    margin-left: 0.5rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23d4a574' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='4' y1='4' x2='12' y2='12'/%3E%3Cline x1='12' y1='4' x2='4' y2='12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.55;
    transition: opacity 0.15s;
}
.rs-search::-webkit-search-cancel-button:hover { opacity: 1; }

/* ==========================================================================
   Flag filter bar
   ========================================================================== */

.rs-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.rs-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: rgba(212, 165, 116, 0.55);
    background: rgba(44, 24, 16, 0.3);
    border: 1px solid rgba(212, 165, 116, 0.15);
    border-radius: 3px;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
}

.rs-filter-btn:hover {
    color: rgba(212, 165, 116, 0.9);
    border-color: rgba(212, 165, 116, 0.4);
    background: rgba(44, 24, 16, 0.6);
}

.rs-filter-btn.rs-filter-active {
    color: #d4a574;
    border-color: rgba(212, 165, 116, 0.5);
    background: rgba(212, 165, 116, 0.08);
}

.rs-filter-count {
    font-size: 0.68rem;
    color: rgba(212, 165, 116, 0.35);
}

.rs-filter-active .rs-filter-count {
    color: rgba(212, 165, 116, 0.6);
}

/* Specificity bump: must beat .rs-tile { display: flex } that follows */
.rs-tile.rs-tile-hidden {
    display: none !important;
}

/* ==========================================================================
   Studio grid (overview)
   ========================================================================== */

.rs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding-bottom: 4rem;
}

@media (max-width: 900px) {
    .rs-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}

@media (max-width: 560px) {
    .rs-grid { grid-template-columns: 1fr; gap: 1rem; }
}

/* ==========================================================================
   Studio tile (card in overview grid)
   ========================================================================== */

.rs-tile {
    display: flex;
    flex-direction: column;
    background: rgba(44, 24, 16, 0.45);
    border: 1px solid rgba(212, 165, 116, 0.12);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    width: 100%;
    padding: 0;
}

.rs-tile:hover,
.rs-tile:focus-visible {
    border-color: rgba(212, 165, 116, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    outline: none;
}

/* Thumbnail */
.rs-tile-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #1a1a1a;
    position: relative;
}

.rs-tile-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.rs-tile:hover .rs-tile-thumb img {
    transform: scale(1.04);
}

/* Fallback tile (no image) */
.rs-tile-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(44,24,16,0.9) 0%, rgba(26,26,26,0.95) 100%);
    padding: 1.5rem;
}

.rs-tile-fallback-flag {
    font-size: 2.25rem;
    line-height: 1;
    filter: grayscale(0.2);
}

.rs-tile-fallback-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(212, 165, 116, 0.35);
    text-align: center;
    max-width: 140px;
    line-height: 1.4;
}

/* Tile body */
.rs-tile-body {
    padding: 1rem 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.rs-tile-name {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(244, 228, 215, 0.92);
    line-height: 1.3;
    margin: 0;
}

.rs-tile-loc {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    color: rgba(212, 165, 116, 0.5);
    margin: 0;
    line-height: 1.4;
}

.rs-tile-iconic {
    font-family: 'Inter', sans-serif;
    font-size: 0.87rem;
    color: rgba(244, 228, 215, 0.45);
    margin: 0.25rem 0 0;
    line-height: 1.4;
    font-style: italic;
}

/* ==========================================================================
   Detail area
   ========================================================================== */

.rs-detail-area[hidden] { display: none; }

.rs-detail-topbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 0 2rem;
    border-bottom: 1px solid rgba(212, 165, 116, 0.1);
    margin-bottom: 2rem;
}

.rs-back-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.84rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(212, 165, 116, 0.6);
    background: none;
    border: 1px solid rgba(212, 165, 116, 0.2);
    border-radius: 3px;
    padding: 0.45rem 1rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.rs-back-btn:hover,
.rs-back-btn:focus-visible {
    color: #d4a574;
    border-color: rgba(212, 165, 116, 0.5);
    outline: none;
}

.rs-detail-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: rgba(212, 165, 116, 0.3);
}

.rs-detail-panel[aria-hidden="true"] { display: none; }

.rs-detail-panel {
    max-width: 900px;
}

/* ==========================================================================
   Photo strip
   ========================================================================== */

.rs-photo-strip {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(212,165,116,.2) transparent;
    padding-bottom: 0.75rem;
    margin-bottom: 2rem;
}

.rs-photo-strip::-webkit-scrollbar { height: 4px; }
.rs-photo-strip::-webkit-scrollbar-track { background: transparent; }
.rs-photo-strip::-webkit-scrollbar-thumb { background: rgba(212,165,116,.2); border-radius: 2px; }

.rs-photo-item {
    flex: 0 0 auto;
    position: relative;
    display: block;
    border-radius: 3px;
    overflow: hidden;
    background: #1a1a1a;
    cursor: zoom-in;
    border: 1px solid rgba(212,165,116,.08);
    transition: border-color 0.2s;
}

.rs-photo-item:first-child { flex-basis: 420px; height: 280px; }
.rs-photo-item:not(:first-child) { flex-basis: 220px; height: 280px; }

@media (max-width: 700px) {
    .rs-photo-item:first-child { flex-basis: 280px; height: 190px; }
    .rs-photo-item:not(:first-child) { flex-basis: 160px; height: 190px; }
}

.rs-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.rs-photo-item:hover img { transform: scale(1.03); }
.rs-photo-item:hover { border-color: rgba(212,165,116,.3); }

.rs-photo-cap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.4rem 0.6rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: rgba(244,228,215,0.65);
    letter-spacing: 0.04em;
    line-height: 1.3;
    pointer-events: none;
}

/* ==========================================================================
   Detail panel header
   ========================================================================== */

.rs-detail-header { margin-bottom: 1.5rem; }

.rs-name {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: rgba(244, 228, 215, 0.95);
    margin: 0 0 0.4rem;
    line-height: 1.2;
}

.rs-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    color: rgba(212, 165, 116, 0.5);
    margin: 0 0 0.6rem;
}

.rs-official-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    color: rgba(212, 165, 116, 0.5);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-block;
}

.rs-official-link:hover { color: #d4a574; }

/* ==========================================================================
   Story
   ========================================================================== */

.rs-story {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    color: rgba(244, 228, 215, 0.72);
    margin: 0 0 2rem;
    max-width: 820px;
}

/* ==========================================================================
   Gear rows
   ========================================================================== */

.rs-gear {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.rs-gear-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.rs-gear-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(212, 165, 116, 0.45);
    white-space: nowrap;
    padding-top: 0.2rem;
    min-width: 70px;
}

.rs-gear-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.rs-gear-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: rgba(244, 228, 215, 0.6);
    background: rgba(212, 165, 116, 0.07);
    border: 1px solid rgba(212, 165, 116, 0.12);
    border-radius: 2px;
    padding: 0.2rem 0.5rem;
    letter-spacing: 0.03em;
}

a.rs-gear-tag--link {
    display: inline-block;
    text-decoration: none;
    color: rgba(212, 165, 116, 0.85);
    background: rgba(212, 165, 116, 0.09);
    border-color: rgba(212, 165, 116, 0.28);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
a.rs-gear-tag--link:hover {
    background: rgba(212, 165, 116, 0.18);
    color: rgba(244, 228, 215, 0.95);
    border-color: rgba(212, 165, 116, 0.5);
}

/* ==========================================================================
   Artists + Iconic recording
   ========================================================================== */

.rs-bottom {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(212, 165, 116, 0.08);
}

.rs-section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(212, 165, 116, 0.4);
    display: block;
    margin-bottom: 0.6rem;
}

.rs-artists {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.rs-artist-tag {
    font-family: 'Inter', sans-serif;
    font-size: 0.87rem;
    color: rgba(244, 228, 215, 0.55);
    background: rgba(26, 26, 26, 0.6);
    border: 1px solid rgba(212, 165, 116, 0.1);
    border-radius: 2px;
    padding: 0.2rem 0.55rem;
}

.rs-iconic {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rs-iconic-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-style: italic;
    color: rgba(212, 165, 116, 0.85);
}

.rs-iconic-year {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: rgba(212, 165, 116, 0.45);
    letter-spacing: 0.04em;
}

/* ==========================================================================
   Extras
   ========================================================================== */

.rs-extras {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(212, 165, 116, 0.08);
}

.rs-extra-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.rs-screen-tags,
.rs-listen-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.rs-screen-tag {
    font-family: 'Inter', sans-serif;
    font-size: 0.84rem;
    color: rgba(244, 228, 215, 0.5);
    background: rgba(26, 26, 26, 0.5);
    border: 1px solid rgba(212, 165, 116, 0.1);
    border-radius: 2px;
    padding: 0.2rem 0.55rem;
}

.rs-screen-tag span {
    color: rgba(212, 165, 116, 0.4);
    margin-left: 0.3rem;
}

.rs-listen-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: rgba(212, 165, 116, 0.55);
    text-decoration: none;
    border: 1px solid rgba(212, 165, 116, 0.15);
    border-radius: 2px;
    padding: 0.2rem 0.6rem;
    transition: color 0.2s, border-color 0.2s;
}

.rs-listen-link:hover {
    color: #d4a574;
    border-color: rgba(212, 165, 116, 0.4);
}

/* ==========================================================================
   Detail footer
   ========================================================================== */

.rs-detail-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(212, 165, 116, 0.08);
}

.rs-back-btn--footer { font-size: 0.82rem; }

/* ==========================================================================
   Heritage back link
   ========================================================================== */

.rs-heritage-back {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 1px solid rgba(212, 165, 116, 0.12);
    text-align: center;
}

.rs-heritage-back[hidden] { display: none; }

/* ==========================================================================
   Ads / ephemera strip
   ========================================================================== */

.rs-ads {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(212, 165, 116, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.rs-ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.rs-ad-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.rs-ad-figure a { display: block; }

.rs-ad-figure img {
    width: 100%;
    height: auto;
    border: 1px solid rgba(212, 165, 116, 0.12);
    border-radius: 3px;
    transition: border-color 0.2s;
}

.rs-ad-figure a:hover img { border-color: rgba(212, 165, 116, 0.4); }

.rs-ad-figure figcaption {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    color: rgba(212, 165, 116, 0.45);
    line-height: 1.4;
}
