/**
 * R-eCycle Garage — Build Page Styles (Grit Design System)
 *
 * Prefixed with .rcb- to avoid theme conflicts.
 * Loaded on single build pages only.
 */

/* ─── Design Tokens ─────────────────────────────── */
:root {
    --rcb-bg-charcoal: #1E1D1B;
    --rcb-bg-surface: #2A2825;
    --rcb-bg-elevated: #3D3A35;
    --rcb-bg-scrim: rgba(26,25,24,0.85);

    --rcb-text-bone: #E8E4DC;
    --rcb-text-light-bone: #F5F2EC;
    --rcb-text-muted: #A09A90;
    --rcb-text-dim: #8A857C;
    --rcb-text-ghost: #5A5650;

    --rcb-signal-red: #CC4422;
    --rcb-signal-red-hover: #E05533;
    --rcb-signal-red-active: #AA3618;

    --rcb-border-subtle: #2A2825;
    --rcb-border-visible: #3D3A35;

    --rcb-font-display: 'Oswald', 'Arial Black', Impact, sans-serif;
    --rcb-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --rcb-font-mono: 'JetBrains Mono', Menlo, Consolas, monospace;
}

/* ─── Page Wrapper ──────────────────────────────── */
.rcb-build-page {
    background: var(--rcb-bg-charcoal);
    color: var(--rcb-text-bone);
    font-family: var(--rcb-font-body);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    /* Override GeneratePress content area */
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

/* Override GP container to go full-width */
.rcb-build-page .inside-article,
.rcb-build-page .entry-content {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Force dark background on body */
body.single-recycle_build {
    background: var(--rcb-bg-charcoal) !important;
}

body.single-recycle_build #page,
body.single-recycle_build .site-content {
    background: var(--rcb-bg-charcoal) !important;
}

/* Hide GP's default post title / meta / sidebar */
body.single-recycle_build .entry-header,
body.single-recycle_build .entry-meta,
body.single-recycle_build .post-image,
body.single-recycle_build #right-sidebar,
body.single-recycle_build .comments-area {
    display: none !important;
}

/* ─── Back Link ─────────────────────────────────── */
.rcb-back-bar {
    padding: 12px 32px;
    border-bottom: 1px solid var(--rcb-border-subtle);
    background: var(--rcb-bg-charcoal);
}

.rcb-back-link {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rcb-text-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.rcb-back-link:hover { color: var(--rcb-signal-red); }

.rcb-back-link svg {
    vertical-align: -1px;
    margin-right: 6px;
}

/* ─── Hero ──────────────────────────────────────── */
.rcb-hero {
    position: relative;
    width: 100%;
    min-height: 55vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-bottom: 3px solid var(--rcb-signal-red);
    background-color: var(--rcb-bg-elevated);
    background-size: cover;
    background-position: center;
}

.rcb-hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 30%, var(--rcb-bg-charcoal) 100%);
    z-index: 1;
}

.rcb-hero-content {
    position: relative;
    z-index: 2;
    padding: 48px 32px;
    max-width: 680px;
}

.rcb-hero-eyebrow {
    font-family: var(--rcb-font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rcb-signal-red);
    margin-bottom: 12px;
}

.rcb-hero-title {
    font-family: var(--rcb-font-display);
    font-weight: 700;
    font-size: 48px;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    line-height: 1.0;
    color: var(--rcb-text-bone);
    margin: 0;
    padding: 0;
}

.rcb-hero-sub {
    font-size: 15px;
    color: var(--rcb-text-muted);
    margin-top: 12px;
    line-height: 1.5;
    max-width: 480px;
}

/* ─── Section Heading (reusable) ────────────────── */
.rcb-section-heading {
    font-family: var(--rcb-font-display);
    font-weight: 500;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rcb-text-bone);
    margin: 0 0 20px 0;
    padding: 0;
}

/* ─── Specs Strip ───────────────────────────────── */
.rcb-specs-strip {
    display: flex;
    border-bottom: 1px solid var(--rcb-border-subtle);
    background: var(--rcb-bg-surface);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rcb-specs-strip::-webkit-scrollbar { display: none; }

.rcb-spec-item {
    flex: 1;
    min-width: 100px;
    padding: 16px 20px;
    border-right: 1px solid var(--rcb-border-visible);
}

.rcb-spec-item:last-child { border-right: none; }

.rcb-spec-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rcb-text-dim);
    margin-bottom: 4px;
}

.rcb-spec-val {
    font-family: var(--rcb-font-mono);
    font-size: 14px;
    color: var(--rcb-text-bone);
}

/* ─── Build Story ───────────────────────────────── */
.rcb-story {
    max-width: 720px;
    padding: 48px 32px;
}

.rcb-story-text {
    font-size: 16px;
    color: var(--rcb-text-muted);
    line-height: 1.7;
}

.rcb-story-text p { margin-bottom: 16px; }
.rcb-story-text p:last-child { margin-bottom: 0; }
.rcb-story-text strong { color: var(--rcb-text-bone); font-weight: 600; }

.rcb-story-text a {
    color: var(--rcb-signal-red);
    text-decoration: none;
}
.rcb-story-text a:hover { color: var(--rcb-signal-red-hover); }

/* ─── Photo Break ───────────────────────────────── */
.rcb-photo-break {
    position: relative;
    width: 100%;
    min-height: 50vh;
    overflow: hidden;
    border-top: 3px solid var(--rcb-signal-red);
    background-color: var(--rcb-bg-elevated);
    background-size: cover;
    background-position: center;
}

.rcb-photo-break-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px;
    background: linear-gradient(transparent, var(--rcb-bg-scrim));
}

.rcb-photo-break-caption {
    font-family: var(--rcb-font-display);
    font-weight: 700;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--rcb-text-bone);
    max-width: 500px;
}

/* ─── Video Section ─────────────────────────────── */
.rcb-video-section {
    background: var(--rcb-bg-surface);
    border-top: 1px solid var(--rcb-border-subtle);
    border-bottom: 1px solid var(--rcb-border-subtle);
}

.rcb-video-header {
    padding: 24px 32px 0;
}

.rcb-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-top: 16px;
    background: #000;
}

.rcb-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.rcb-video-meta {
    padding: 16px 32px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.rcb-video-title {
    font-family: var(--rcb-font-display);
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    color: var(--rcb-text-bone);
}

.rcb-video-duration {
    font-family: var(--rcb-font-mono);
    font-size: 12px;
    color: var(--rcb-text-dim);
}

/* ─── Full Specs Table ──────────────────────────── */
.rcb-specs-detail {
    padding: 48px 32px;
    max-width: 720px;
}

.rcb-specs-table { width: 100%; }

.rcb-specs-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid var(--rcb-border-subtle);
}

.rcb-specs-row:last-child { border-bottom: none; }

.rcb-specs-key {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rcb-text-dim);
    min-width: 140px;
    flex-shrink: 0;
}

.rcb-specs-value {
    font-family: var(--rcb-font-mono);
    font-size: 14px;
    color: var(--rcb-text-bone);
    text-align: right;
}

/* ─── Photo Gallery ─────────────────────────────── */
.rcb-gallery-section {
    border-top: 1px solid var(--rcb-border-subtle);
}

.rcb-gallery-header {
    padding: 24px 32px;
}

.rcb-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.rcb-gallery-item {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

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

.rcb-gallery-item:hover img { transform: scale(1.04); }

.rcb-gallery-wide {
    grid-column: span 2;
    aspect-ratio: 21 / 9;
}

/* ─── Parts Used ────────────────────────────────── */
.rcb-parts-section {
    background: var(--rcb-bg-surface);
    padding: 48px 32px;
    border-top: 1px solid var(--rcb-border-subtle);
}

.rcb-parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2px;
}

.rcb-part-card {
    display: flex;
    flex-direction: column;
    background: var(--rcb-bg-charcoal);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    overflow: hidden;
}

.rcb-part-card:hover { background: var(--rcb-bg-elevated); }

.rcb-part-img {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--rcb-bg-elevated);
}

.rcb-part-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rcb-part-info { padding: 12px 16px; }

.rcb-part-name {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    color: var(--rcb-text-bone);
    line-height: 1.3;
    margin-bottom: 4px;
}

.rcb-part-sku {
    font-family: var(--rcb-font-mono);
    font-size: 11px;
    color: var(--rcb-text-ghost);
    margin-bottom: 8px;
}

.rcb-part-price {
    font-family: var(--rcb-font-mono);
    font-size: 14px;
    color: var(--rcb-text-bone);
}

.rcb-part-link {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rcb-signal-red);
    margin-top: 8px;
    display: inline-block;
    transition: color 0.2s;
}

.rcb-part-card:hover .rcb-part-link { color: var(--rcb-signal-red-hover); }

/* ─── Prev / Next Build Nav ─────────────────────── */
.rcb-build-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--rcb-border-subtle);
}

.rcb-build-nav-item {
    padding: 24px 32px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.rcb-build-nav-prev { border-right: 1px solid var(--rcb-border-subtle); }
.rcb-build-nav-next { text-align: right; }
.rcb-build-nav-item:hover { background: var(--rcb-bg-surface); }
.rcb-build-nav-empty { pointer-events: none; }

.rcb-build-nav-dir {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rcb-text-dim);
    margin-bottom: 6px;
}

.rcb-build-nav-dir svg { vertical-align: -1px; }

.rcb-build-nav-title {
    font-family: var(--rcb-font-display);
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--rcb-text-bone);
    line-height: 1.2;
}

/* ─── CTA Bar ───────────────────────────────────── */
.rcb-cta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    background: var(--rcb-signal-red);
}

.rcb-cta-text {
    font-family: var(--rcb-font-display);
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--rcb-text-light-bone);
}

.rcb-cta-btn {
    display: inline-block;
    padding: 10px 24px;
    font-family: var(--rcb-font-body);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rcb-text-light-bone);
    border: 1px solid rgba(255,255,255,0.45);
    background: none;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.rcb-cta-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.7);
    color: #fff;
}

/* ─── Responsive ────────────────────────────────── */
@media (max-width: 768px) {
    .rcb-back-bar { padding: 12px 20px; }

    .rcb-hero { min-height: 40vh; }
    .rcb-hero-content { padding: 32px 20px; }
    .rcb-hero-title { font-size: 32px; }

    .rcb-specs-strip { flex-wrap: wrap; }
    .rcb-spec-item {
        min-width: calc(50% - 1px);
        flex: unset;
        width: calc(50% - 1px);
    }
    .rcb-spec-item:nth-child(2n) { border-right: none; }

    .rcb-story { padding: 32px 20px; }
    .rcb-specs-detail { padding: 32px 20px; }

    .rcb-photo-break { min-height: 40vh; }
    .rcb-photo-break-overlay { padding: 24px 20px; }
    .rcb-photo-break-caption { font-size: 22px; }

    .rcb-video-header { padding: 20px 20px 0; }
    .rcb-video-meta { padding: 12px 20px 20px; }

    .rcb-gallery-grid { grid-template-columns: 1fr 1fr; }
    .rcb-gallery-header { padding: 20px; }

    .rcb-parts-section { padding: 32px 20px; }
    .rcb-parts-grid { grid-template-columns: 1fr 1fr; }

    .rcb-build-nav { grid-template-columns: 1fr; }
    .rcb-build-nav-prev {
        border-right: none;
        border-bottom: 1px solid var(--rcb-border-subtle);
    }

    .rcb-cta-bar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 20px;
    }
    .rcb-cta-text { font-size: 16px; }
}

@media (max-width: 400px) {
    .rcb-hero-title { font-size: 26px; }
    .rcb-hero-sub { font-size: 13px; }
    .rcb-spec-item { padding: 12px 14px; }
    .rcb-spec-val { font-size: 13px; }
    .rcb-parts-grid { grid-template-columns: 1fr; }
    .rcb-build-nav-title { font-size: 14px; }
}
