﻿/* ============================================================
   Models — page-specific styles
   pages/models/models.css
   Global styles are in: assets/css/theme.css
   ============================================================ */

/* ============================================================
   SECTION 1: HERO — cream / sage gradient
   Mirrors cf-hero on the Custom Homes page (brand-consistent).
   ============================================================ */
.mo-hero {
    position: relative;
    min-height: 560px;
    display: flex;
    align-items: center;
    background: #F5F2ED;
    overflow: hidden;
    font-family: 'DM Sans', 'Segoe UI', sans-serif;
}

/* Soft sage radial + warm linear gradient overlay */
.mo-hero__overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 80% 10%, rgba(163,197,158,0.32) 0%, transparent 50%),
        radial-gradient(ellipse at 15% 90%, rgba(201,168,76,0.07) 0%, transparent 40%),
        linear-gradient(155deg, #FAFAF8 0%, #F5F2ED 55%, #E8F0E6 100%);
    z-index: 0;
}

/* Sage accent line at hero bottom */
.mo-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #588157 22%, #A3C59E 55%, transparent 100%);
    z-index: 2;
}

.mo-hero__content {
    position: relative;
    z-index: 1;
    text-align: center;
    /* page-content-offset already clears the 72px nav — reduce top padding to avoid extra gap */
    padding: 2.5rem 1.5rem 4rem;
    max-width: 760px;
    margin: 0 auto;
}

.mo-eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #588157;
    margin-bottom: 1rem;
}

.mo-hero__title {
    font-family: var(--font-heading);
    font-size: clamp(2.4rem, 5.5vw, 4rem);
    color: #1C1917;
    margin-bottom: 1.25rem;
    line-height: 1.08;
}

.mo-hero__sub {
    font-size: 1.08rem;
    color: #78716C;
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.75;
}

.mo-hero__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Ghost-light override: sage border on the cream hero background */
.mo-hero .btn--ghost-light {
    color: #588157;
    border-color: rgba(88,129,87,0.45);
}
.mo-hero .btn--ghost-light:hover {
    background: rgba(88,129,87,0.08);
    border-color: #588157;
    color: #3d6040;
}

/* ============================================================
   SECTION 2: MODEL CARDS
   ============================================================ */

/* Price label: gold per brand kit (gold = prices only) */
.model-card__price {
    color: var(--color-gold);
}

/* Card border uses brand border color */
.model-card {
    border: 1px solid var(--color-border);
}

/* Image wrapper — contains hero img + "View Photos" overlay button */
.model-card__img-wrap {
    position: relative;
    overflow: hidden;
}

/* Placeholder shown when no attachment image is set */
.model-card__image--placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #f5f2ed 0%, #e8f0e6 100%);
    display: block;
}

/* "View Photos" pill — fades in on card hover */
.model-card__gallery-btn {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.60);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 0.35rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 2;
}
.model-card:hover .model-card__gallery-btn,
.model-card:focus-within .model-card__gallery-btn {
    opacity: 1;
}
.model-card__gallery-btn:hover {
    background: rgba(0, 0, 0, 0.82);
}

/* ============================================================
   SECTION 3: FAQ
   Background overridden by .section--gray → var(--color-surface-alt) = #F5F2ED
   ============================================================ */

/* FAQ dividers use warm border */
.faq-item {
    border-bottom-color: var(--color-border);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .mo-hero {
        min-height: auto;
        align-items: flex-start;
    }

    .mo-hero__content {
        padding: 0.75rem 1.25rem 2.5rem;
    }

    .mo-hero__title {
        font-size: clamp(1.85rem, 7.5vw, 2.6rem);
    }

    .mo-hero__sub {
        font-size: 0.97rem;
    }

    .models-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .mo-hero__content {
        padding: 0.5rem 1rem 2rem;
    }

    .mo-eyebrow {
        font-size: 0.72rem;
    }
}

/* ============================================================
   SECTION 4: GALLERY LIGHTBOX
   .cf-gallery-modal mirrors custom-homes.css — required here
   because custom-homes.css is NOT loaded on the models page.
   ============================================================ */
.cf-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cfGalleryFadeIn 0.2s ease both;
}
.cf-gallery-modal[hidden] { display: none; }
@keyframes cfGalleryFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.cf-gallery-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.88);
    cursor: pointer;
}
.cf-gallery-modal__inner {
    position: relative;
    z-index: 1;
    width: min(92vw, 980px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.cf-gallery-modal__close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    opacity: 0.8;
    transition: opacity 0.15s;
}
.cf-gallery-modal__close:hover { opacity: 1; }
.cf-gallery-modal__title {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
}
.cf-gallery-modal__stage {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}
.cf-gallery-modal__img-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
}
.cf-gallery-modal__img {
    max-width: 100%;
    max-height: 62vh;
    object-fit: contain;
    display: block;
}
.cf-gallery-modal__arrow {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.cf-gallery-modal__arrow:hover { background: rgba(255, 255, 255, 0.3); }
.cf-gallery-modal__counter {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    margin: 0;
}
.cf-gallery-modal__thumbs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    max-height: 90px;
    overflow-y: auto;
}
.cf-gallery-modal__thumb {
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid transparent;
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
    background: transparent;
    transition: border-color 0.15s;
    overflow: hidden;
    flex-shrink: 0;
}
.cf-gallery-modal__thumb img {
    width: 70px;
    height: 50px;
    object-fit: cover;
    display: block;
    border-radius: 2px;
    opacity: 0.65;
    transition: opacity 0.15s;
}
.cf-gallery-modal__thumb:hover img,
.cf-gallery-modal__thumb.is-active img { opacity: 1; }
.cf-gallery-modal__thumb.is-active {
    border-color: var(--color-gold, #c9a84c);
}
@media (max-width: 600px) {
    .cf-gallery-modal__arrow   { width: 36px; height: 36px; font-size: 1.4rem; }
    .cf-gallery-modal__img     { max-height: 52vh; }
    .cf-gallery-modal__thumb img { width: 54px; height: 40px; }
}
