/**
 * Kayjah Atelier — Cabinetry Catalogue Styles
 *
 * Extends collection.css grid/card system for the cabinetry archive.
 * Components: detail panel, process steps, cards.
 *
 * @package KayjahAtelier
 * @since   1.0.0
 */


/* ═══════════════════════════════════════════════════════════════════
   HERO — Gold overline variant
   ═══════════════════════════════════════════════════════════════════ */

.cl-overline--gold {
    color: var(--gold, #C8A97E);
    background: rgba(200, 169, 126, 0.15);
    border-color: rgba(200, 169, 126, 0.3);
}


/* ═══════════════════════════════════════════════════════════════════
   CARD OVERRIDES — 4:5 portrait, category badge
   ═══════════════════════════════════════════════════════════════════ */

.cab-card .cab-panel-trigger {
    display: block;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
    color: inherit;
    font: inherit;
}

.cab-card .cab-card-img {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    aspect-ratio: 4 / 5;
}

.cab-card .cab-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease, cubic-bezier(0.16, 1, 0.3, 1));
}

.cab-card:hover .cab-card-img img {
    transform: scale(1.04);
}

/* Image count badge */
.cab-card-count {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border-radius: 100px;
    color: rgba(248, 246, 241, 0.9);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    pointer-events: none;
    z-index: 2;
}

.cab-card-count svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

/* Category badge */
.cab-card-badge {
    display: inline-block;
    font-family: var(--sans);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold, #C8A97E);
    background: rgba(200, 169, 126, 0.12);
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 0.4rem;
}

/* Card body */
.cab-card .cl-card-body {
    padding: 0.85rem 0.25rem 0.6rem;
}

/* Card hover: shadow elevation */
.cab-card {
    transition: box-shadow 0.4s var(--ease, cubic-bezier(0.16, 1, 0.3, 1)),
                transform 0.4s var(--ease, cubic-bezier(0.16, 1, 0.3, 1));
    border-radius: 14px;
}

.cab-card:hover {
    box-shadow: var(--shadow-lg, 0 16px 56px rgba(26, 20, 15, 0.12));
    transform: translateY(-2px);
}


/* ═══════════════════════════════════════════════════════════════════
   GRID — Responsive 3/2/1 columns
   ═══════════════════════════════════════════════════════════════════ */

.post-type-archive-kayjah_cabinet .cl-grid {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .post-type-archive-kayjah_cabinet .cl-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .post-type-archive-kayjah_cabinet .cl-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ═══════════════════════════════════════════════════════════════════
   DETAIL PANEL — Visual-dominant slide-in
   ═══════════════════════════════════════════════════════════════════ */

.cab-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 13, 10, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 4999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.cab-panel-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.cab-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: clamp(520px, 38vw, 640px);
    max-width: 100%;
    height: 100%;
    background: #FFFFFF;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: -12px 0 48px rgba(0, 0, 0, 0.10),
                -2px 0 8px rgba(0, 0, 0, 0.04);
}

.cab-panel.open {
    transform: translateX(0);
}

/* Close button */
.cab-panel-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 50%;
    color: var(--ink, #1A1A1E);
    cursor: pointer;
    transition: background 0.2s ease;
}

.cab-panel-close:hover {
    background: rgba(255, 255, 255, 0.95);
}

/* Scrollable content */
.cab-panel-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Hero image */
.cab-panel-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: 70vh;
    overflow: hidden;
    background: #F5F5F5;
}

.cab-panel-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.cab-panel-hero-img.is-switching {
    opacity: 0;
}

/* Thumbnail strip */
.cab-panel-thumbs {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.cab-panel-thumbs::-webkit-scrollbar {
    display: none;
}

.cab-panel-thumbs:empty {
    display: none;
}

.cab-panel-thumb {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: opacity 0.2s ease, border-color 0.2s ease;
    padding: 0;
    background: none;
}

.cab-panel-thumb:hover {
    opacity: 0.85;
}

.cab-panel-thumb.active {
    opacity: 1;
    border-color: var(--gold, #C8A97E);
}

.cab-panel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info section */
.cab-panel-info {
    padding: 28px 32px 32px;
}

.cab-panel-name {
    font-family: var(--serif);
    font-size: clamp(1.4rem, 2.5vw, 1.75rem);
    font-weight: 600;
    color: var(--ink, #1A1A1E);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
}

.cab-panel-desc {
    font-family: var(--sans);
    font-size: 0.92rem;
    color: var(--ink-2, #6E6E73);
    line-height: 1.6;
    margin: 0 0 24px;
    max-width: 48ch;
}

.cab-panel-desc:empty {
    display: none;
}

/* Meta: dimensions + materials */
.cab-panel-meta {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.cab-panel-meta:empty {
    display: none;
}

.cab-panel-dimensions,
.cab-panel-materials {
    font-family: var(--sans);
    font-size: 0.82rem;
    color: var(--ink-2, #6E6E73);
}

.cab-panel-dimensions:empty,
.cab-panel-materials:empty {
    display: none;
}

.cab-panel-meta-label {
    font-weight: 600;
    color: var(--ink, #1A1A1E);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 6px;
}

.cab-panel-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cab-panel-pill {
    display: inline-block;
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ink-2, #6E6E73);
    background: #F2F2F2;
    padding: 5px 14px;
    border-radius: 100px;
}

/* WhatsApp CTA */
.cab-panel-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 52px;
    padding: 0 2rem;
    margin-top: 4px;
    background: var(--gold, #C8A97E);
    color: var(--ink, #1A1A1E);
    border: 1px solid var(--gold, #C8A97E);
    border-radius: 14px;
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.cab-panel-cta:hover {
    background: transparent;
    color: var(--ink, #1A1A1E);
}

.cab-panel-cta:active {
    transform: scale(0.98);
}

.cab-panel-cta svg {
    flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════════
   PROCESS STEPS — Consult → Design → Install
   ═══════════════════════════════════════════════════════════════════ */

.cab-process {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: var(--space-sm, 2rem) 0;
}

.cab-process-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0 clamp(12px, 3vw, 28px);
}

.cab-process-num {
    font-family: var(--sans);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--gold, #C8A97E);
    letter-spacing: 0.05em;
}

.cab-process-label {
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink, #1A1A1E);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cab-process-divider {
    width: clamp(24px, 6vw, 60px);
    height: 1px;
    background: var(--surface-3, #E8E4DF);
    flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════════
   VIDEO SHOWCASE — Extends home.css .video-showcase
   ═══════════════════════════════════════════════════════════════════ */

.cab-video-showcase {
    padding: var(--space-xl, 6rem) 0;
}


/* ═══════════════════════════════════════════════════════════════════
   FOCUS VISIBLE
   ═══════════════════════════════════════════════════════════════════ */

.cab-panel-trigger:focus-visible,
.cab-panel-close:focus-visible,
.cab-panel-cta:focus-visible,
.cab-panel-thumb:focus-visible,
.filter-pill:focus-visible {
    outline: 2px solid var(--accent, #0071E3);
    outline-offset: 3px;
}

.cab-panel-trigger:focus:not(:focus-visible),
.cab-panel-close:focus:not(:focus-visible),
.cab-panel-cta:focus:not(:focus-visible),
.cab-panel-thumb:focus:not(:focus-visible),
.filter-pill:focus:not(:focus-visible) {
    outline: none;
}


/* ═══════════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .cab-card .cab-card-img img,
    .cab-card,
    .cab-panel,
    .cab-panel-overlay,
    .cab-panel-hero-img,
    .cab-panel-close,
    .cab-panel-thumb {
        transition: none;
    }

    .cab-panel-overlay {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .cab-card:hover .cab-card-img img {
        transform: none;
    }

    .cab-card:hover {
        transform: none;
    }

    .cab-panel.open {
        transform: translateX(0);
    }
}


/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet
   ═══════════════════════════════════════════════════════════════════ */

@media (min-width: 768px) and (max-width: 1023px) {
    .cab-panel {
        width: 480px;
    }

    .cab-panel-hero {
        aspect-ratio: 1 / 1;
        max-height: 480px;
    }

    .cab-panel-thumb {
        width: 64px;
        height: 64px;
    }

    .cab-panel-info {
        padding: 24px;
    }
}


/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
    /* Panel: full screen on mobile */
    .cab-panel {
        width: 100%;
    }

    .cab-panel-hero {
        aspect-ratio: 4 / 5;
        max-height: 60vh;
    }

    .cab-panel-thumbs {
        padding: 12px 16px;
    }

    .cab-panel-thumb {
        width: 60px;
        height: 60px;
    }

    .cab-panel-info {
        padding: 24px 20px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    }

    .cab-panel-name {
        font-size: 1.35rem;
    }

    .cab-process-step {
        padding: 0 10px;
    }

    .cab-process-label {
        font-size: 0.7rem;
    }
}


/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile Landscape
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) and (orientation: landscape) {
    .cab-panel-hero {
        aspect-ratio: 16 / 9;
        max-height: 50vh;
    }
}


/* Body scroll lock when panel is open */
body.cab-panel-open {
    overflow: hidden;
}
