/* ── Inspiration Detail Page ─────────────────────────────────── */

/* ── Breadcrumb ──────────────────────────────────── */

.ref-breadcrumb-bar {
    background: var(--stone-50);
    border-bottom: 1px solid var(--stone-200);
    padding: 0.75rem 0;
}

.ref-breadcrumb {
    font-size: 0.8125rem;
    color: var(--stone-500);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.ref-breadcrumb a {
    color: var(--stone-500);
    text-decoration: none;
    transition: color 0.2s;
}

.ref-breadcrumb a:hover {
    color: var(--stone-900);
}

.ref-bc-sep { color: var(--stone-300); }
.ref-bc-current { color: var(--stone-700); font-weight: 500; }

/* ── Hero ────────────────────────────────────────── */

.ref-hero {
    padding: clamp(2rem, 4vw, 3rem) 0;
    background: var(--white);
}

.ref-hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: clamp(2rem, 4vw, 3rem);
    align-items: start;
}

.ref-hero-image {
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--stone-100);
}

.ref-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ref-hero-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--stone-100);
    color: var(--stone-600);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.ref-hero h1 {
    font-family: var(--font-serif);
    font-weight: var(--font-serif-weight);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    line-height: 1.15;
    color: var(--stone-900);
    margin: 0 0 1rem;
}

.ref-hero-processor {
    font-size: 0.9375rem;
    color: var(--stone-600);
    margin: 0 0 1.25rem;
}

.ref-hero-processor strong {
    color: var(--stone-800);
}

.ref-hero-desc {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--stone-600);
    margin: 0;
}

/* ── Sticky Section Nav ──────────────────────────── */

.ref-section-nav {
    position: sticky;
    top: 72px;
    z-index: 90;
    background: var(--white);
    border-bottom: 1px solid var(--stone-200);
}

.ref-section-nav-inner {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.ref-section-nav-inner::-webkit-scrollbar { display: none; }

.ref-nav-link {
    display: inline-block;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--stone-500);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.ref-nav-link:hover {
    color: var(--stone-800);
}

.ref-nav-link.active {
    color: var(--red);
    border-bottom-color: var(--red);
}

/* ── Section backgrounds ─────────────────────────── */

.ref-bg-alt { background: var(--stone-50); }
.ref-bg-white { background: var(--white); }

/* ── Description ─────────────────────────────────── */

.ref-description {
    max-width: 720px;
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--stone-700);
}

/* ── Gallery Grid ────────────────────────────────── */

.ref-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--gap);
}

.ref-gallery-item {
    display: block;
    border: none;
    padding: 0;
    background: var(--stone-100);
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    aspect-ratio: 4 / 3;
    transition: transform 0.3s, box-shadow 0.3s;
}

.ref-gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.ref-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Materials Table ─────────────────────────────── */

.ref-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ref-materials-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.ref-materials-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--stone-500);
    border-bottom: 2px solid var(--stone-200);
}

.ref-materials-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--stone-150, var(--stone-200));
    color: var(--stone-700);
}

.ref-materials-table tr:last-child td {
    border-bottom: none;
}

.ref-materials-table tr:hover td {
    background: var(--stone-50);
}

.ref-mat-link {
    color: var(--red);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.ref-mat-link:hover {
    color: var(--red-dark);
    text-decoration: underline;
}

/* ── Processor Card ──────────────────────────────── */

.ref-processor-card {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--white);
    border: 1px solid var(--stone-200);
    border-radius: 12px;
    max-width: 480px;
}

.ref-processor-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--stone-100);
    border-radius: 10px;
    color: var(--stone-600);
}

.ref-processor-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--stone-900);
    margin: 0 0 0.25rem;
}

.ref-processor-loc {
    font-size: 0.875rem;
    color: var(--stone-500);
    margin: 0 0 0.5rem;
}

.ref-processor-link {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--red);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.ref-processor-link:hover {
    color: var(--red-dark);
}

/* ── Lightbox ────────────────────────────────────── */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox[hidden] { display: none; }

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
}

.lightbox-img-wrap {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img-wrap img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    z-index: 10;
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    opacity: 0.7;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
}

.lightbox-close {
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2.5rem;
    line-height: 1;
    padding: 0.5rem;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    padding: 1rem;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-prev:hover { transform: translateY(-50%) translateX(-2px); }
.lightbox-next:hover { transform: translateY(-50%) translateX(2px); }

.lightbox-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    color: var(--white);
    font-size: 0.875rem;
    opacity: 0.7;
    margin: 0;
}

/* ── Reference Card Grid (related projects) ──────── */

.ref-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

.ref-grid--compact {
    grid-template-columns: repeat(3, 1fr);
}

.ref-card {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--stone-200);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ref-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.ref-card-img {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--stone-100);
}

.ref-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ref-card-body {
    padding: 1rem 1.25rem 1.25rem;
}

.ref-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--stone-900);
    margin: 0 0 0.375rem;
    line-height: 1.3;
}

.ref-card-processor {
    font-size: 0.8125rem;
    color: var(--stone-400);
    margin: 0;
}

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

@media (max-width: 1024px) {
    .ref-hero-grid {
        grid-template-columns: 1fr;
    }

    .ref-grid--compact {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ref-materials-table th:nth-child(4),
    .ref-materials-table td:nth-child(4),
    .ref-materials-table th:nth-child(5),
    .ref-materials-table td:nth-child(5) {
        display: none;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 2rem;
        padding: 0.5rem;
    }
}

@media (max-width: 640px) {
    .ref-section-nav {
        top: 60px;
    }

    .ref-hero h1 {
        font-size: 1.75rem;
    }

    .ref-grid--compact {
        grid-template-columns: 1fr;
    }

    .ref-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ref-processor-card {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
}
