/* ==========================================================================
   Lohabour — Family.css
   Reusable product-family template (Sofas, Coffee Tables, Dining
   Tables, ...). Assumes base.css is already loaded. Self-contained.
   ========================================================================== */

.display--sm {
    font-size: clamp(24px, 2.6vw, 32px);
    font-weight: 400;
    letter-spacing: -0.02em;
    margin: 10px 0 16px;
}

/* ---------------- Hero ---------------- */

.fam-hero {
    padding: 190px 0 90px;
    background: var(--bg);
}

.fam-hero__inner {
    max-width: 760px;
}

.fam-hero__back {
    display: inline-block;
    margin-bottom: 32px;
    color: var(--text-secondary);
    transition: color 0.25s var(--ease);
}

.fam-hero__back:hover {
    color: var(--accent);
}

.fam-hero__title {
    margin: 0 0 18px;
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(48px, 7vw, 90px);
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--text);
}

.fam-hero__statement {
    margin-bottom: 20px;
}

.fam-hero__text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 62ch;
    margin: 0 0 28px;
}

@media (max-width: 700px) {
    .fam-hero {
        padding: 130px 0 60px;
    }
}

/* ---------------- Introduction (centered) ---------------- */

.fam-intro {
    max-width: 720px;
    text-align: center;
}

.fam-intro .mono-label {
    justify-content: center;
}

.fam-intro .lede {
    margin: 0 auto 18px;
    text-align: left;
}

/* ---------------- Filter + collection head ---------------- */

.fam-collection-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 32px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.fam-count {
    color: var(--accent);
}

.fam-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.fam-filter-btn {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 9px 16px;
    cursor: pointer;
    transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.fam-filter-btn:hover {
    color: var(--text);
    border-color: rgba(241, 239, 232, 0.3);
}

.fam-filter-btn.is-active {
    color: #0A0A09;
    background: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 700px) {
    .fam-collection-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .fam-filter-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        width: 100%;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .fam-filter-bar::-webkit-scrollbar {
        display: none;
    }

    .fam-filter-btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

/* ---------------- Item list — large photo + text, alternating ---------------- */

.fam-list {
    display: flex;
    flex-direction: column;
}

.fam-item {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 48px;
    align-items: center;
    padding: 42px 0;
    border-bottom: 1px solid var(--border);
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 0.3s var(--ease),
        transform 0.3s var(--ease);
}

.fam-item.is-transitioning {
    opacity: 0;
    transform: translateY(10px);
}

.fam-item:last-child {
    border-bottom: none;
}

.fam-item--reverse {
    direction: rtl;
}

.fam-item--reverse>* {
    direction: ltr;
}

.fam-item__media {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg);
}

.fam-item__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.9s var(--ease-soft);
}

.fam-item__media:hover img {
    transform: scale(1.05);
}

.fam-item__num {
    color: var(--accent);
    display: block;
    margin-bottom: 10px;
}

.fam-item__content h2 {
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 400;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
}

.fam-item__title {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 12px;
}

.fam-item__style {
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0.03em;
    margin-bottom: 16px;
}

.fam-item__description {
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin: 0 0 20px;
    max-width: 46ch;
}

.fam-item__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.fam-item__tags span {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 12px;
}

.fam-item__button {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 0 0 4px;
    cursor: pointer;
    transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.fam-item__button:hover {
    color: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 900px) {

    .fam-item,
    .fam-item--reverse {
        grid-template-columns: 1fr;
        gap: 18px;
        direction: ltr;
        padding: 28px 0;
    }

    .fam-item__media {
        aspect-ratio: 16 / 11;
    }
}

/* ---------------- Empty state ---------------- */

.fam-empty {
    padding: 60px 0;
    text-align: center;
}

.fam-empty p {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

/* ---------------- Customization ---------------- */

.fam-custom-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    background: var(--border);
    margin-top: 8px;
}

.fam-custom-col {
    background: var(--bg);
    padding: 26px 20px;
}

.fam-custom-col__label {
    display: block;
    color: var(--accent);
    margin-bottom: 14px;
}

.fam-custom-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fam-custom-col li {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
}

@media (max-width: 900px) {
    .fam-custom-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .fam-custom-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------------- Final CTA ---------------- */

.fam-final-cta {
    padding: 150px 0;
    text-align: center;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.fam-final-cta .display {
    margin: 0 0 16px;
}

.fam-final-cta .lede {
    margin: 0 auto 32px;
    max-width: 54ch;
}

@media (max-width: 700px) {
    .fam-final-cta {
        padding: 90px 0;
    }
}

/* =========================================================
   REUSABLE DETAIL MODAL
========================================================= */

.fam-modal {
    position: fixed;
    inset: 0;
    z-index: 200;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    opacity: 0;
    pointer-events: none;

    transition: opacity 0.3s var(--ease);
}

.fam-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}


/* =========================================================
   BACKDROP
========================================================= */

.fam-modal__backdrop {
    position: absolute;
    inset: 0;

    background: rgba(5, 5, 4, 0.85);

    backdrop-filter: blur(4px);
}


/* =========================================================
   MODAL PANEL
========================================================= */

.fam-modal__panel {
    position: relative;
    z-index: 1;

    width: 100%;
    max-width: 1100px;

    max-height: 88vh;

    overflow-y: auto;

    background: var(--bg-secondary);

    border: 1px solid var(--border);

    display: grid;

    grid-template-columns:
        1.15fr 1fr;

    transform:
        translateY(16px) scale(0.98);

    transition:
        transform 0.3s var(--ease);
}

.fam-modal.is-open .fam-modal__panel {
    transform:
        translateY(0) scale(1);
}


/* =========================================================
   CLOSE BUTTON
========================================================= */

.fam-modal__close {
    position: absolute;

    top: 16px;
    right: 16px;

    z-index: 10;

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        rgba(10, 10, 9, 0.65);

    border:
        1px solid var(--border);

    color: var(--text);

    font-size: 20px;
    line-height: 1;

    cursor: pointer;

    transition:
        border-color 0.25s var(--ease),
        color 0.25s var(--ease),
        background 0.25s var(--ease);
}

.fam-modal__close:hover {
    border-color: var(--accent);
    color: var(--accent);

    background:
        rgba(10, 10, 9, 0.85);
}


/* =========================================================
   LEFT IMAGE COLUMN
========================================================= */

.fam-modal__media {
    min-width: 0;

    background: var(--bg);

    /*
     * Important:
     * The image column stays visible while the
     * product information on the right scrolls.
     */
    position: sticky;

    top: 0;

    align-self: start;

    height: fit-content;
}


/* =========================================================
   MAIN PRODUCT IMAGE
========================================================= */

.fam-modal__main-image {
    width: 100%;

    aspect-ratio: 4 / 3;

    overflow: hidden;

    background: var(--bg);
}

.fam-modal__main-image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition:
        transform 0.5s var(--ease-soft);
}


/* =========================================================
   THREE PRODUCT THUMBNAILS
========================================================= */

.fam-modal__thumbs {

    /*
     * Maximum of 3 images.
     * Three equal columns look much better here.
     */
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 5px;

    padding: 5px;

    background: var(--border);
}


/* =========================================================
   THUMBNAIL
========================================================= */

.fam-modal__thumbs img {

    width: 100%;

    /*
     * Larger and more representative.
     */
    aspect-ratio: 4 / 3;

    height: auto;

    display: block;

    object-fit: cover;

    cursor: pointer;

    opacity: 0.55;

    border:
        1px solid transparent;

    transition:
        opacity 0.2s var(--ease),
        border-color 0.2s var(--ease),
        transform 0.2s var(--ease);
}

.fam-modal__thumbs img:hover {
    opacity: 0.9;

    border-color:
        rgba(241, 239, 232, 0.4);
}

.fam-modal__thumbs img.is-active {
    opacity: 1;

    border-color:
        var(--accent);
}


/* =========================================================
   PRODUCT DETAILS
========================================================= */

.fam-modal__details {

    padding: 42px;

    /*
     * The details column is the scrolling content.
     */
    min-width: 0;
}


/* =========================================================
   PRODUCT NAME
========================================================= */

.fam-modal__details h2 {

    font-family: var(--font-display);

    font-weight: 300;

    font-size: 32px;

    letter-spacing: -0.02em;

    margin: 0 0 6px;

    color: var(--text);
}


/* =========================================================
   PRODUCT TITLE
========================================================= */

.fam-modal__title {

    font-size: 14px;

    color: var(--text-secondary);

    margin: 0 0 10px;
}


/* =========================================================
   STYLE
========================================================= */

.fam-modal__details>.mono-label {

    color: var(--accent);

    margin-bottom: 20px;
}


/* =========================================================
   DESCRIPTION
========================================================= */

.fam-modal__description {

    font-size: 14.5px;

    line-height: 1.75;

    color: var(--text-secondary);

    margin: 0 0 24px;
}


/* =========================================================
   SPECIFICATIONS
========================================================= */

.fam-modal__specs {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 16px;

    padding: 20px 0;

    margin: 0 0 24px;

    border-top:
        1px solid var(--border);

    border-bottom:
        1px solid var(--border);
}

.fam-modal__specs dt {

    color: var(--text-secondary);

    margin-bottom: 6px;
}

.fam-modal__specs dd {

    margin: 0;

    font-size: 13px;

    color: var(--text);

    line-height: 1.5;
}


/* =========================================================
   LIST BLOCKS
========================================================= */

.fam-modal__list-block {

    margin-bottom: 24px;
}

.fam-modal__list-block>.mono-label {

    display: block;

    color: var(--text-secondary);

    margin-bottom: 10px;
}

.fam-modal__list-block ul {

    list-style: none;

    padding: 0;
    margin: 0;

    display: flex;

    flex-direction: column;

    gap: 6px;
}

.fam-modal__list-block li {

    position: relative;

    padding-left: 18px;

    font-size: 13.5px;

    line-height: 1.5;

    color: var(--text);
}

.fam-modal__list-block li::before {

    content: '';

    position: absolute;

    left: 0;
    top: 8px;

    width: 8px;
    height: 1px;

    background:
        var(--accent);
}


/* =========================================================
   CTA
========================================================= */

.fam-modal__cta {

    width: 100%;

    justify-content: center;
}


/* =========================================================
   TABLET / MOBILE — STICKY PRODUCT IMAGE
========================================================= */

@media (max-width: 900px) {

    .fam-modal {
        padding: 12px;
    }

    .fam-modal__panel {
        grid-template-columns: 1fr;
        max-height: 94vh;

        /*
         * The panel itself scrolls.
         */
        overflow-y: auto;
        overflow-x: hidden;
    }

    /*
     * KEEP PRODUCT IMAGE STICKY
     */
    .fam-modal__media {
        position: sticky;
        top: 0;

        z-index: 4;

        width: 100%;

        align-self: start;

        background: var(--bg);
    }

    .fam-modal__main-image {
        aspect-ratio: 16 / 10;
    }

    /*
     * Three thumbnails remain visible together.
     */
    .fam-modal__thumbs {
        grid-template-columns:
            repeat(3, 1fr);

        gap: 4px;

        padding: 4px;
    }

    .fam-modal__thumbs img {
        aspect-ratio: 4 / 3;
    }

    .fam-modal__details {
        padding: 32px;
    }

    .fam-modal__specs {
        grid-template-columns:
            repeat(3, 1fr);
    }
}


/* =========================================================
   SMALL MOBILE — STICKY IMAGE
========================================================= */

@media (max-width: 600px) {

    .fam-modal {
        padding: 0;
    }

    .fam-modal__panel {
        width: 100%;
        height: 100%;

        max-height: 100vh;

        border: none;

        /*
         * Scrolling happens inside the modal panel.
         */
        overflow-y: auto;
        overflow-x: hidden;
    }

    .fam-modal__close {
        position: sticky;

        top: 12px;
        left: calc(100% - 50px);

        z-index: 50;

        margin-left: auto;
        margin-right: 12px;

        margin-bottom: -50px;
    }

    /*
     * STICKY IMAGE AREA
     */
    .fam-modal__media {
        position: sticky;
        top: 0;

        z-index: 4;

        background: var(--bg);

        box-shadow:
            0 8px 20px rgba(0, 0, 0, 0.18);
    }

    /*
     * Slightly shorter main image so the
     * sticky area doesn't consume the entire screen.
     */
    .fam-modal__main-image {
        width: 100%;
        height: auto;
        aspect-ratio: auto;
        overflow: hidden;
        background: var(--bg);
    }

    .fam-modal__main-image img {
        width: 100%;
        height: auto;
        max-width: 100%;
        object-fit: contain;
        display: block;
    }

    /*
     * Three thumbnails.
     */
    .fam-modal__thumbs {
        grid-template-columns:
            repeat(3, 1fr);

        gap: 4px;

        padding: 4px;
    }

    .fam-modal__thumbs img {
        aspect-ratio: 4 / 3;
    }

    .fam-modal__details {
        padding: 28px 22px 40px;
    }

    .fam-modal__details h2 {
        font-size: 28px;
    }

    .fam-modal__specs {
        grid-template-columns:
            1fr 1fr;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .fam-item,
    .fam-item__media img,
    .fam-modal,
    .fam-modal__panel,
    .fam-modal__main-image img,
    .fam-modal__thumbs img {

        transition: none;
    }
}