/* ============================================================
   TENNESSEE CUSTOM HOMES — THEME CSS
   Table of contents:
   1. CSS Custom Properties (design tokens)
   2. Site Header & Navigation
   3. Mobile Nav
   4. Hero Banner
   5. CTA Buttons Row
   6. Section: Why Choose Us / Feature Cards
   7. Section: Model Cards (Models page)
   8. Section: Finishes Gallery (Custom Finishes page)
   9. Section: FAQ Accordion
  10. Contact Form
  11. About Page
  12. Footer
  13. 404 Page
  14. Utility / Shared
  15. Responsive breakpoints
   ============================================================ */

/* ============================================================
   1. CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
    --color-primary:      #588157;
    --color-primary-dk:   #3d6040;
    --color-primary-lt:   #A3C59E;
    --color-primary-tint: #EFF4F8;
    --color-dark:         #1C1917;
    --color-gray:         #FAFAF8;
    --color-surface:      #FFFFFF;
    --color-surface-alt:  #F5F2ED;
    --color-text:         #1C1917;
    --color-muted:        #78716C;
    --color-white:        #fff;
    --color-border:       #E7E5E0;
    --color-gold:         #C9A84C;
    --color-footer-bg:    #1C1917;

    --font-body:    'DM Sans', 'Segoe UI', sans-serif;
    --font-heading: 'Playfair Display', Georgia, serif;

    --radius:  6px;
    --shadow:  0 4px 20px rgba(0,0,0,0.10);
    --trans:   0.2s ease;

    --nav-height: 72px;
}

/* ============================================================
   2. SITE HEADER & NAVIGATION
   ============================================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    z-index: 1000;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
}

/* Brand */
.brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.brand-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-dark);
}

.brand-location {
    font-size: 0.75rem;
    color: var(--color-muted);
}

/* Nav list */
.site-nav__list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav__list a {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-dark);
    border-radius: var(--radius);
    transition: background var(--trans), color var(--trans);
    white-space: nowrap;
}

/* Login button in nav (WP menu: class on <li>; fallback: class on <li>) */
.site-nav__list li.nav-login-btn > a {
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
    padding: 0.45rem 1.1rem;
}
.site-nav__list li.nav-login-btn > a:hover {
    background: var(--color-primary-dk);
    color: var(--color-white);
}

.site-nav__list a:hover,
.site-nav__list .current-menu-item > a {
    background: var(--color-primary);
    color: var(--color-white);
}

/* Hamburger button — hidden on desktop */
.site-header__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 44px;
    height: 44px;
}

.hamburger-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-dark);
    border-radius: 2px;
    transition: transform var(--trans), opacity var(--trans);
}

/* ============================================================
   3. MOBILE NAV
   ============================================================ */

/* Desktop nav — visible in header on desktop, hidden on mobile */
.site-nav--desktop {
    display: flex;
}

/* Mobile drawer — full-screen dark overlay, slides in from right.
   Lives outside <header> to avoid backdrop-filter stacking context. */
.site-nav--mobile {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    background: var(--color-dark);
    padding: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 9999;
    flex-direction: column;
}

/* Backdrop — only meaningful on desktop/tablet partial drawers */
.nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.55);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.nav-backdrop.is-active {
    display: block;
    opacity: 1;
}

/* Mobile CTA — still referenced in footer block below */
.nav-mobile-cta {
    display: none;
}

@media (max-width: 768px) {
    /* Hide desktop nav, show mobile hamburger */
    .site-nav--desktop {
        display: none;
    }

    .site-header__toggle {
        display: flex;
    }

    /* Full-screen drawer: off-screen until .is-open */
    .site-nav--mobile {
        display: flex;
    }

    .site-nav--mobile.is-open {
        transform: translateX(0);
    }

    /* Backdrop not needed — drawer is full-screen */
    .nav-backdrop {
        display: none !important;
    }

    /* ── Drawer top bar: brand + close button ── */
    .nav-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 1.25rem;
        height: var(--nav-height);
        border-bottom: 3px solid var(--color-primary);
        flex-shrink: 0;
    }

    .nav-mobile-brand .brand-name {
        color: var(--color-white);
        font-family: var(--font-heading);
    }

    .nav-mobile-brand .brand-location {
        color: var(--color-primary-lt);
    }

    .nav-mobile-brand .brand-icon {
        color: var(--color-primary-lt);
    }

    .nav-mobile-close {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: 1.5px solid rgba(88, 129, 87, 0.5);
        color: var(--color-primary-lt);
        font-size: 1.2rem;
        line-height: 1;
        width: 40px;
        height: 40px;
        border-radius: var(--radius);
        cursor: pointer;
        transition: background var(--trans), border-color var(--trans), color var(--trans);
        flex-shrink: 0;
    }

    .nav-mobile-close:hover {
        background: rgba(88, 129, 87, 0.15);
        border-color: var(--color-primary);
        color: var(--color-white);
    }

    /* ── Nav list items ── */
    .site-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        flex: 1;
    }

    .site-nav__list li {
        border-bottom: 1px solid rgba(88, 129, 87, 0.18);
    }

    .site-nav__list a {
        font-family: var(--font-heading);
        font-size: 1.35rem;
        font-weight: 400;
        color: rgba(255, 255, 255, 0.88);
        padding: 1rem 1.5rem;
        width: 100%;
        min-height: 62px;
        display: flex;
        align-items: center;
        border-radius: 0;
        background: transparent;
        letter-spacing: 0.01em;
        transition: color var(--trans), background var(--trans), padding-left var(--trans);
    }

    .site-nav--mobile .site-nav__list a:hover {
        background: rgba(88, 129, 87, 0.10);
        color: var(--color-white);
        padding-left: 1.875rem;
    }

    /* Current page: sage left-border + subtle sage tint (gold reserved for prices) */
    .site-nav--mobile .site-nav__list .current-menu-item > a {
        color: var(--color-white);
        border-left: 3px solid var(--color-primary);
        padding-left: calc(1.5rem - 3px);
        font-weight: 700;
        background: rgba(88, 129, 87, 0.12);
    }

    /* Login button: sage outline on dark background */
    .site-nav__list li.nav-login-btn > a {
        margin: 0.75rem 1.5rem;
        width: calc(100% - 3rem);
        border-radius: var(--radius);
        justify-content: center;
        min-height: 50px;
        background: transparent;
        border: 1.5px solid rgba(88, 129, 87, 0.55);
        color: var(--color-primary-lt);
        font-family: var(--font-body);
        font-size: 1rem;
        font-weight: 600;
        letter-spacing: 0;
        padding-left: 1.5rem;
    }

    .site-nav__list li.nav-login-btn > a:hover {
        background: rgba(88, 129, 87, 0.15);
        border-color: var(--color-primary);
        color: var(--color-white);
        padding-left: 1.5rem;
    }

    /* Logged-in state: sage filled pill */
    .site-nav__list li.nav-login-btn.nav-login-btn--active > a {
        background: var(--color-primary);
        color: var(--color-white);
        border-color: var(--color-primary);
    }

    .site-nav__list li.nav-login-btn.nav-login-btn--active > a:hover {
        background: var(--color-primary-dk);
        border-color: var(--color-primary-dk);
        padding-left: 1.5rem;
    }

    /* ── Drawer footer: phone + CTA ── */
    .nav-mobile-footer {
        padding: 1.5rem;
        border-top: 1px solid rgba(88, 129, 87, 0.25);
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-top: auto;
    }

    .nav-mobile-phone {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        color: var(--color-primary-lt);
        font-size: 1.05rem;
        font-weight: 600;
        text-decoration: none;
        transition: color var(--trans);
    }

    .nav-mobile-phone:hover {
        color: var(--color-white);
    }

    .nav-mobile-cta__btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 0.9rem 1.5rem;
        background: var(--color-primary);
        color: var(--color-white);
        font-family: var(--font-body);
        font-size: 1rem;
        font-weight: 600;
        border-radius: var(--radius);
        text-decoration: none;
        transition: background var(--trans);
        min-height: 54px;
    }

    .nav-mobile-cta__btn:hover {
        background: var(--color-primary-dk);
        color: var(--color-white);
    }

    /* Hamburger → X animation */
    .site-header__toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .site-header__toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) {
        opacity: 0;
    }
    .site-header__toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}

/* ============================================================
   4. HERO BANNER
   ============================================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    overflow: hidden;
    margin-top: 0; /* full-bleed behind fixed nav */
}

.hero__bg {
    position: absolute;
    inset: 0;
    background-image: url('../images/hero-bg.jpg'); /* TODO: upload real hero image */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.55) 100%);
    z-index: 1;
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: 820px;
    padding: 6rem 1.5rem 4rem;
}

.hero__subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.hero__title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--color-white);
    margin-bottom: 1.25rem;
    line-height: 1.1;
}

.hero__description {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.hero__buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   5. CTA BUTTONS ROW
   ============================================================ */
.cta-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
}

/* ============================================================
   6. FEATURE CARDS (Why Choose Us)
   ============================================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform var(--trans);
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-card__icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card__title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--color-dark);
}

.feature-card__text {
    color: var(--color-muted);
    font-size: 0.95rem;
}

/* ============================================================
   7. MODEL CARDS (Models page)
   ============================================================ */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.model-card {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--color-white);
    transition: transform var(--trans);
}

.model-card:hover {
    transform: translateY(-4px);
}

.model-card__image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    background: var(--color-border); /* warm linen placeholder */
}

.model-card__body {
    padding: 1.5rem;
}

.model-card__title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.model-card__meta {
    font-size: 0.875rem;
    color: var(--color-muted);
    margin-bottom: 1rem;
}

.model-card__price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-gold);
    margin-bottom: 1rem;
}

/* ============================================================
   8. FINISHES GALLERY (Custom Finishes page)
   ============================================================ */
.finishes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.finish-card {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--color-white);
}

.finish-card__image {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: #e8e8e8;
}

.finish-card__body {
    padding: 1.25rem;
}

.finish-card__category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* ============================================================
   9. FAQ ACCORDION
   ============================================================ */
.faq-list {
    max-width: 780px;
    margin: 3rem auto 0;
}

.faq-item {
    border-bottom: 1px solid #e0e0e0;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 1.25rem 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-primary);
    flex-shrink: 0;
    transition: transform var(--trans);
}

.faq-item.is-open .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer p {
    padding-bottom: 1.25rem;
    color: var(--color-muted);
    line-height: 1.7;
}

.faq-item.is-open .faq-answer {
    max-height: 400px;
}

/* ============================================================
   10. CONTACT FORM
   ============================================================ */
.contact-form {
    max-width: 680px;
    margin: 3rem auto 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--color-dark);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ccc;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--color-text);
    transition: border-color var(--trans);
    background: var(--color-white);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74,92,247,0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 140px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 560px) {
    .form-row { grid-template-columns: 1fr; }
}

/* ============================================================
   11. ABOUT PAGE
   ============================================================ */
.about-hero {
    padding: 8rem 0 4rem;
    background: var(--color-gray);
    text-align: center;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.team-card {
    text-align: center;
}

.team-card__photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    background: #ccc;
}

/* ============================================================
   12. FOOTER
   ============================================================ */
.site-footer {
    background: var(--color-footer-bg);
    color: #b8b0a8;
    padding-top: 4rem;
    border-top: 2px solid #588157;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
}

.footer-brand-name {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 0.75rem;
}

.footer-tagline {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #9e9890;
}

.footer-heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #A3C59E;
    margin-bottom: 1rem;
    font-weight: 700;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li + li {
    margin-top: 0.5rem;
}

.footer-links a {
    color: #9e9890;
    font-size: 0.9rem;
    transition: color var(--trans);
}

.footer-links a:hover {
    color: #A3C59E;
}

.footer-address {
    font-style: normal;
    font-size: 0.9rem;
    color: #9e9890;
    line-height: 1.7;
}

.footer-address a {
    color: #9e9890;
    transition: color var(--trans);
}

.footer-address a:hover {
    color: #A3C59E;
}

.site-footer__bottom {
    background: rgba(0,0,0,0.25);
    border-top: 1px solid rgba(88,129,87,0.18);
    padding: 1.5rem 0;
    text-align: center;
}

.footer-copy {
    font-size: 0.85rem;
    color: #78716C;
    margin: 0;
}

/* ============================================================
   13. 404 PAGE
   ============================================================ */
.page-404 {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem;
}

.page-404__code {
    font-size: clamp(5rem, 15vw, 9rem);
    font-weight: 900;
    color: var(--color-primary);
    line-height: 1;
}

/* ============================================================
   14. UTILITY / SHARED
   ============================================================ */
.section-tag {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.section-title {
    font-family: var(--font-heading);
    color: var(--color-dark);
    margin-bottom: 1rem;
}

.section-intro {
    color: var(--color-muted);
    font-size: 1.05rem;
    max-width: 620px;
    margin: 0 auto;
}

.placeholder-box {
    background: #e8e8e8;
    border: 2px dashed #ccc;
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Offset for fixed header */
.page-content-offset {
    padding-top: var(--nav-height);
}

/* ============================================================
   15. RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (max-width: 1024px) {
    .site-footer__grid {
        grid-template-columns: 1fr 1fr;
    }

    .site-footer__col--brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .site-footer__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero__buttons {
        flex-direction: column;
        align-items: center;
    }

    .section {
        padding: 3rem 0;
    }
}



@media (max-width: 540px) {
    .cf-hero.page-content-offset {
        padding-top: calc(var(--nav-height, 72px) * -0.1);
    }
}

