/* ===================================
   CSS Reset & Base Styles
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* ===================================
   Design System Variables
   =================================== */

:root {
    /* Color Palette */
    --color-background: #F5F1E8;
    --color-background-alt: #EDE7DC;
    --color-primary-text: #3A3A3A;
    --color-secondary-text: #5A5A5A;
    --color-accent: #8B7355;
    --color-accent-hover: #725D44;
    --color-accent-light: #A68968;
    --color-border: #D4C5B0;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Open Sans', sans-serif;

    /* Spacing */
    --section-padding: 80px;
    --container-max-width: 1200px;
}

/* ===================================
   Typography
   =================================== */

body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-primary-text);
    background-color: var(--color-background);
    /* Subtle paper texture */
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,.02) 2px,
            rgba(0,0,0,.02) 4px
        );
}

h1, h2, h3 {
    font-family: var(--font-heading);
    line-height: 1.2;
    margin-bottom: 24px;
}

h1 {
    font-size: 48px;
    font-weight: 700;
}

h2 {
    font-size: 42px;
    font-weight: 700;
    position: relative;
    padding-bottom: 20px;
    margin-bottom: 40px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, var(--color-accent), transparent);
}

h3 {
    font-size: 24px;
    font-weight: 400;
}

p {
    margin-bottom: 24px;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover,
a:focus {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ===================================
   Layout
   =================================== */

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: var(--section-padding) 0;
    position: relative;
    overflow: visible;
}

/* Hero Section */
.hero-section {
    background-color: var(--color-background);
    text-align: center;
    padding: 100px 0;
}

.hero-heading {
    font-size: 48px;
    color: var(--color-accent);
    margin-bottom: 32px;
    line-height: 1.3;
}

.hero-text {
    font-size: 20px;
    line-height: 1.7;
    color: var(--color-primary-text);
    max-width: 900px;
    margin: 0 auto 40px;
}

.hero-section .cta-button {
    margin-top: 0;
}

/* Alternating section backgrounds */
section:nth-of-type(even) {
    background-color: var(--color-background-alt);
}

/* When upcoming sales is hidden, adjust alternation */
#upcoming-sales:not(.has-sales) ~ section:nth-of-type(odd) {
    background-color: var(--color-background-alt);
}

#upcoming-sales:not(.has-sales) ~ section:nth-of-type(even) {
    background-color: var(--color-background);
}

/* Decorative section dividers */
section::after {
    content: '◆\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0◆\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0◆\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0◆\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0◆';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-accent);
    font-size: 16px;
    z-index: 1;
    white-space: nowrap;
    letter-spacing: 0.5em;
    max-width: calc(100% - 32px);
    overflow: hidden;
    text-overflow: clip;
}

section:last-of-type::after {
    display: none;
}

/* Responsive spacing for diamonds */
@media screen and (max-width: 768px) {
    section {
        padding-bottom: 80px;
    }

    section::after {
        content: '◆\00a0\00a0\00a0◆\00a0\00a0\00a0◆\00a0\00a0\00a0◆\00a0\00a0\00a0◆';
        font-size: 14px;
        letter-spacing: 0.3em;
        bottom: 20px;
    }
}

/* ===================================
   Skip Link (Accessibility)
   =================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-accent);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--color-primary-text);
}

/* ===================================
   Header & Navigation
   =================================== */

header {
    background-color: var(--color-background);
    border-bottom: 2px solid var(--color-border);
    padding: 24px 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-link:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: 2px;
}

.logo h1 {
    margin-bottom: 4px;
    font-size: 32px;
}

.tagline {
    font-size: 14px;
    color: var(--color-secondary-text);
    font-style: italic;
    margin-bottom: 0;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 60;
}

.hamburger-line {
    width: 28px;
    height: 3px;
    background-color: var(--color-accent);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}

/* Hamburger animation when open */
.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Navigation */
nav ul {
    list-style: none;
    display: flex;
    gap: 32px;
}

nav a {
    font-size: 16px;
    letter-spacing: 0.5px;
    font-weight: 600;
    padding: 8px 0;
}

nav a:hover,
nav a:focus {
    text-decoration: underline;
}

/* ===================================
   Planning Section
   =================================== */

.planning-intro {
    font-size: 18px;
    line-height: 1.7;
    color: var(--color-primary-text);
    text-align: center;
    max-width: 800px;
    margin: 0 auto 48px;
}

.planning-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin-bottom: 48px;
}

.planning-card {
    background: white;
    border: 2px solid var(--color-border);
    padding: 32px;
    border-radius: 2px;
    border-left: 4px solid var(--color-accent);
}

.planning-card h3 {
    color: var(--color-accent);
    margin-bottom: 16px;
    font-size: 22px;
}

.planning-card p {
    color: var(--color-primary-text);
    line-height: 1.7;
    margin: 0;
}

#planning-section .cta-button {
    display: block;
    margin: 0 auto;
    width: fit-content;
}

/* ===================================
   Sales Cards
   =================================== */

#sales-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
}

.sale-card {
    background: white;
    border: 2px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 28px;
    border-radius: 2px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid var(--color-accent);
    display: flex;
    gap: 32px;
    align-items: center;
}

.sale-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.sale-card-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sale-card-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sale-neighborhood {
    color: var(--color-accent);
    margin: 0;
    font-size: 26px;
}

.sale-dates {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary-text);
    margin: 0;
}

.sale-address {
    font-size: 17px;
    color: var(--color-secondary-text);
    margin: 0;
}

.sale-time {
    font-size: 16px;
    color: var(--color-primary-text);
    margin: 0;
    line-height: 1.6;
}

/* Hide sales section by default until JavaScript loads */
#upcoming-sales {
    display: none;
}

#upcoming-sales.has-sales {
    display: block;
}

/* ===================================
   Services List
   =================================== */

.services-list {
    list-style: none;
    padding-left: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.services-list li {
    padding: 20px 20px 20px 50px;
    position: relative;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    min-height: 70px;
}

.services-list li:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.services-list li::before {
    content: "✓";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-accent);
    font-weight: 600;
    font-size: 24px;
}

/* ===================================
   Special Text Styles
   =================================== */

.lead {
    font-size: 20px;
    line-height: 1.8;
    color: var(--color-secondary-text);
}

/* Call-to-Action Button */
.cta-button {
    display: inline-flex;
    align-items: center;
    margin: 32px auto 0;
    padding: 16px 40px;
    background-color: var(--color-accent);
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    border-radius: 2px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-height: 56px;
}

/* Center the button only */
#about .container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.cta-button:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.cta-button:active {
    transform: translateY(0);
}

.cta-button:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}

/* ===================================
   Contact Section
   =================================== */

.contact-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 60px;
    margin-top: 40px;
    align-items: start;
}

.contact-methods h3,
.contact-form-wrapper h3 {
    color: var(--color-accent);
    margin-bottom: 24px;
    font-size: 28px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-info p {
    font-size: 18px;
    margin-bottom: 0;
    padding: 20px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.contact-info a {
    font-weight: 600;
    color: var(--color-accent);
}

.contact-info a:hover {
    color: var(--color-accent-hover);
}

/* Contact Form */
.contact-form-wrapper {
    max-width: 100%;
}

.contact-form {
    background: white;
    padding: 40px;
    border: 2px solid var(--color-border);
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-primary-text);
    font-size: 16px;
}

.required {
    color: var(--color-accent);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--color-border);
    border-radius: 2px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--color-primary-text);
    background-color: var(--color-background);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-secondary-text);
    opacity: 0.7;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.submit-button {
    background-color: var(--color-accent);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-body);
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    min-height: 56px;
}

.submit-button:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}

/* ===================================
   Footer
   =================================== */

footer {
    background-color: var(--color-background);
    border-top: 2px solid var(--color-border);
    padding: 40px 0;
    text-align: center;
}

footer p {
    color: var(--color-secondary-text);
    font-size: 14px;
    margin-bottom: 0;
}

/* ===================================
   Responsive Design - Mobile
   =================================== */

@media screen and (max-width: 768px) {
    /* Reduce heading sizes by 25% */
    h1 {
        font-size: 36px;
    }

    h2 {
        font-size: 27px;
    }

    h3 {
        font-size: 18px;
    }

    /* Reduce section padding */
    section {
        padding: 40px 0;
    }

    /* Hero section mobile adjustments */
    .hero-section {
        padding: 60px 0;
    }

    .hero-heading {
        font-size: 32px;
    }

    .hero-text {
        font-size: 18px;
    }

    /* Header adjustments */
    .header-content {
        flex-wrap: nowrap;
    }

    .logo h1 {
        font-size: 24px;
    }

    .tagline {
        font-size: 12px;
    }

    /* Show hamburger menu */
    .hamburger {
        display: flex;
    }

    /* Mobile navigation */
    nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--color-background);
        border-bottom: 2px solid var(--color-border);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    nav.active {
        max-height: 400px;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
        padding: 0;
    }

    nav li {
        border-bottom: 1px solid var(--color-border);
    }

    nav li:last-child {
        border-bottom: none;
    }

    nav a {
        display: block;
        padding: 16px 24px;
        min-height: 56px;
        display: flex;
        align-items: center;
        font-size: 18px;
    }

    nav a:hover,
    nav a:focus {
        background-color: rgba(139, 115, 85, 0.1);
    }

    /* Ensure touch targets are large enough */
    .contact-info a {
        display: inline-block;
        min-height: 44px;
        line-height: 44px;
    }

    /* Adjust container padding */
    .container {
        padding: 0 16px;
    }

    /* Better spacing for services list on mobile */
    .services-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .services-list li {
        padding: 16px 16px 16px 48px;
        font-size: 16px;
    }

    .services-list li::before {
        font-size: 20px;
        left: 14px;
    }

    /* Adjust contact info for mobile */
    .contact-info {
        grid-template-columns: 1fr;
    }

    .contact-info p {
        font-size: 18px;
        padding: 16px;
    }

    /* Single column layout for sales on mobile */
    #sales-container {
        grid-template-columns: 1fr;
    }

    /* Stack sale cards on mobile */
    .sale-card {
        flex-direction: column;
        gap: 20px;
    }

    .sale-card-left,
    .sale-card-right {
        flex: none;
        width: 100%;
    }

    /* Make h2 decorative line responsive */
    h2 {
        font-size: 32px;
    }

    h2::after {
        width: 60px;
        height: 2px;
    }

    /* Lead text */
    .lead {
        font-size: 18px;
    }

    /* Section dividers smaller on mobile */
    section::after {
        font-size: 16px;
        padding: 0 16px;
    }

    /* Contact section mobile adjustments */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-methods h3,
    .contact-form-wrapper h3 {
        font-size: 24px;
    }

    .contact-info p {
        font-size: 18px;
        padding: 16px;
    }

    .contact-form {
        padding: 24px 20px;
    }

    .form-group input,
    .form-group textarea {
        font-size: 16px;
        padding: 12px 14px;
    }

    .submit-button {
        width: 100%;
        padding: 16px 24px;
    }
}

/* Tablet/Medium screens - intermediate breakpoint */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 32px;
    }

    nav ul {
        gap: 24px;
    }

    nav a {
        font-size: 15px;
    }

    .logo h1 {
        font-size: 28px;
    }
}

/* ===================================
   Focus Visible Enhancement
   =================================== */

/* Enhanced focus styles for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ===================================
   Print Styles
   =================================== */

@media print {
    header {
        position: static;
    }

    nav {
        display: none;
    }

    section {
        page-break-inside: avoid;
    }
}
