/**
 * Sanctuary Custom Homes - Clean Design System
 * Professional, minimal aesthetic inspired by luxury home builders
 */

/* ===== RESET ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== DESIGN TOKENS ===== */

:root {
    /* Colors - Brand Palette */
    --white: #FFFFFF;
    --off-white: #F8F6F2;          /* Warm White */
    --light-gray: #F5F5F5;
    --sanctuary-sand: #E9E4DC;     /* Section backgrounds/cards */
    --sage: #6F7E6A;               /* Hill Country Sage - accents, links */
    --gray: #9E9E9E;
    --dark-gray: #424242;
    --charcoal: #2B2B2B;           /* Cedar Charcoal */
    --copper: #B87333;             /* Copper Accent */
    --copper-dark: #9A5E28;

    /* Typography */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing - Balanced */
    --space-unit: 1rem;
    --space-xs: calc(var(--space-unit) * 0.5);
    --space-sm: var(--space-unit);
    --space-md: calc(var(--space-unit) * 1.5);
    --space-lg: calc(var(--space-unit) * 2.5);
    --space-xl: calc(var(--space-unit) * 4);
    --space-2xl: calc(var(--space-unit) * 5);
    --space-3xl: calc(var(--space-unit) * 6);

    /* Layout */
    --max-width: 1400px;
    --content-width: 800px;
    --header-height: 90px;
}

/* ===== BASE STYLES ===== */

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    color: var(--charcoal);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    padding-top: var(--header-height);
}

/* ===== TYPOGRAPHY ===== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.2;
    color: var(--charcoal);
}

h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); margin-bottom: var(--space-md); }
h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: var(--space-md); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: var(--space-sm); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); margin-bottom: var(--space-sm); }

p {
    margin-bottom: var(--space-sm);
    color: var(--dark-gray);
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===== HEADER ===== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: #363736;
    z-index: 1000;
}

.header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--charcoal);
    text-decoration: none;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.01em;
    transition: color 0.2s;
}

.nav a:hover,
.nav a.active {
    color: #FFFFFF;
}

.btn-contact {
    padding: 12px 28px !important;
    background: var(--white);
    color: #363736 !important;
    border-radius: 2px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-contact:hover {
    background: var(--copper);
    color: var(--white) !important;
}

/* ===== DROPDOWN MENU ===== */

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.nav-dropdown-toggle:after {
    content: '▾';
    margin-left: 0.35rem;
    font-size: 12px;
    transition: transform 0.2s;
}

.nav-dropdown.open .nav-dropdown-toggle:after {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 1rem;
    background: var(--white);
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s, margin-top 0.2s;
    z-index: 100;
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    margin-top: 0.5rem;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--dark-gray);
    font-size: 15px;
    transition: background 0.2s, color 0.2s;
    border-bottom: 1px solid var(--light-gray);
}

.nav-dropdown-menu a:first-child {
    border-radius: 4px 4px 0 0;
}

.nav-dropdown-menu a:last-child {
    border-bottom: none;
    border-radius: 0 0 4px 4px;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
    background: var(--off-white);
    color: var(--copper);
}

/* ===== MOBILE MENU ===== */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: white;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--charcoal);
    transition: all 0.3s;
}

.mobile-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--white);
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 999;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.mobile-nav.open {
    transform: translateY(0);
    opacity: 1;
}

.mobile-nav a {
    display: block;
    padding: var(--space-sm) var(--space-lg);
    color: var(--dark-gray);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background 0.2s;
}

.mobile-nav a:hover {
    background: var(--off-white);
}

.mobile-nav .btn-contact {
    margin: var(--space-sm) var(--space-lg);
    display: inline-block;
    text-align: center;
}

/* ===== LAYOUT ===== */

.section {
    padding: var(--space-2xl) var(--space-md);
}

.section-sm {
    padding: var(--space-xl) var(--space-md);
}

.section-lg {
    padding: var(--space-3xl) var(--space-md);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.container-narrow {
    max-width: var(--content-width);
    margin: 0 auto;
}

/* ===== SECTION HEADERS ===== */

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--space-lg);
}

.section-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--copper);
    margin-bottom: var(--space-sm);
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    line-height: 1.2;
    color: var(--charcoal);
    margin-bottom: var(--space-sm);
}

.section-description {
    font-size: 18px;
    line-height: 1.7;
    color: var(--gray);
    font-weight: 300;
}

/* ===== BACKGROUNDS ===== */

.bg-white { background: var(--white); }
.bg-off-white { background: var(--off-white); }
.bg-light { background: var(--light-gray); }
.bg-dark { background: var(--charcoal); color: var(--white); }
.bg-copper { background: var(--copper); color: var(--white); }

/* ===== BUTTONS ===== */

.btn {
    display: inline-block;
    padding: 16px 36px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 2px;
    transition: all 0.25s;
    letter-spacing: 0.02em;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--charcoal);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--copper);
}

.btn-secondary {
    background: transparent;
    color: var(--charcoal);
    border: 1px solid var(--charcoal);
}

.btn-secondary:hover {
    background: var(--charcoal);
    color: var(--white);
}

.btn-lg {
    padding: 18px 42px;
    font-size: 16px;
}

/* ===== GRID ===== */

.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* ===== CARDS ===== */

.card {
    background: var(--white);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card-elevated {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-body {
    padding: var(--space-lg);
}

/* ===== IMAGES ===== */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== FOOTER ===== */

.footer {
    background: var(--off-white);
    padding: var(--space-xl) var(--space-md) var(--space-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    max-width: var(--max-width);
    margin: 0 auto var(--space-lg);
}

.footer h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
}

.footer a {
    color: var(--gray);
    text-decoration: none;
    font-size: 15px;
    line-height: 2;
    transition: color 0.2s;
    display: block;
}

.footer a:hover {
    color: var(--charcoal);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--gray);
    font-size: 14px;
}

/* ===== UTILITIES ===== */

.text-center { text-align: center; }
.text-copper { color: var(--copper); }
.text-gray { color: var(--gray); }
.text-white { color: var(--white); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

/* ===== RESPONSIVE ===== */

@media (max-width: 1024px) {
    :root {
        --header-height: 70px;
    }

    .nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .header-content {
        padding: 0 var(--space-md);
    }

    .section {
        padding: var(--space-xl) var(--space-md);
    }

    .section-lg {
        padding: var(--space-2xl) var(--space-md);
    }
}

@media (max-width: 640px) {
    body {
        font-size: 16px;
    }

    .grid {
        gap: var(--space-md);
    }

    .card-body {
        padding: var(--space-md);
    }
}
