/**
 * Deer Park HOA Theme - Main Stylesheet
 * Replicates the organic design aesthetic from the Next.js site
 */

/* ============================================
   CSS Variables (Design Tokens)
   ============================================ */
:root {
    /* Colors */
    --color-background: #FDFCF8;
    --color-foreground: #2C2C24;
    --color-primary: #5D7052;
    --color-primary-foreground: #F3F4F1;
    --color-secondary: #C18C5D;
    --color-secondary-foreground: #FFFFFF;
    --color-accent: #E6DCCD;
    --color-accent-foreground: #4A4A40;
    --color-muted: #F0EBE5;
    --color-muted-foreground: #78786C;
    --color-border: #DED8CF;
    --color-destructive: #A85448;
    
    /* Typography */
    --font-heading: 'Fraunces', serif;
    --font-body: 'Nunito', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-soft: 0 4px 20px -2px rgba(93, 112, 82, 0.15);
    --shadow-float: 0 10px 40px -10px rgba(193, 140, 93, 0.2);
    --shadow-soft-hover: 0 6px 24px -4px rgba(93, 112, 82, 0.25);
    --shadow-float-hover: 0 20px 40px -10px rgba(93, 112, 82, 0.15);
    
    /* Transitions */
    --transition-fast: 150ms;
    --transition-base: 300ms;
    --transition-slow: 700ms;
}

/* ============================================
   Base Styles
   ============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body), sans-serif;
    background-color: var(--color-background);
    color: var(--color-foreground);
    line-height: 1.6;
    font-feature-settings: "rlig" 1, "calt" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading), serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 2rem); }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--color-secondary);
    text-decoration: underline;
}

.text-link {
    color: var(--color-primary);
}

.text-link:hover {
    text-decoration: underline;
}

/* ============================================
   Texture Overlay (Paper Grain Effect)
   ============================================ */
.texture-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ============================================
   Organic Blob Shapes
   ============================================ */
.organic-blob {
    position: absolute;
    filter: blur(60px);
    opacity: 0.6;
    z-index: 0;
}

.blob-shape-1 {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
}

.blob-shape-2 {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

.blob-shape-3 {
    border-radius: 70% 30% 50% 50% / 50% 50% 30% 70%;
}

.blob-shape-4 {
    border-radius: 50% 50% 30% 70% / 40% 60% 40% 60%;
}

.blob-shape-5 {
    border-radius: 40% 60% 50% 50% / 60% 30% 70% 40%;
}

.blob-shape-6 {
    border-radius: 55% 45% 35% 65% / 50% 50% 50% 50%;
}

.blob-primary {
    background-color: rgba(93, 112, 82, 0.2);
}

.blob-secondary {
    background-color: rgba(193, 140, 93, 0.2);
}

.blob-accent {
    background-color: rgba(230, 220, 205, 0.4);
}

.blob-sm {
    width: 8rem;
    height: 8rem;
}

.blob-md {
    width: 16rem;
    height: 16rem;
}

.blob-lg {
    width: 24rem;
    height: 24rem;
}

.blob-xl {
    width: 32rem;
    height: 32rem;
}

.blob-left {
    left: -8rem;
    top: -8rem;
}

.blob-right {
    right: -6rem;
    top: 5rem;
}

/* ============================================
   Navigation
   ============================================ */
.site-header {
    position: sticky;
    top: 1rem;
    z-index: 50;
    margin: 1rem;
}

.main-navigation {
    max-width: 1280px;
    margin: 0 auto;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(222, 216, 207, 0.5);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-soft);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    background-color: var(--color-primary);
}

.logo-letter {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-primary-foreground);
}

.nav-brand-text {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-foreground);
}

.nav-menu {
    display: none;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-foreground);
    transition: color var(--transition-base);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
}

.nav-link:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.nav-link.active {
    color: var(--color-primary);
}

.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--color-foreground);
}

.mobile-menu-toggle .menu-close {
    display: none;
}

.mobile-menu-toggle[aria-expanded="true"] .menu-open {
    display: none;
}

.mobile-menu-toggle[aria-expanded="true"] .menu-close {
    display: block;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(222, 216, 207, 0.5);
    border-radius: 2rem;
    box-shadow: var(--shadow-soft);
}

.mobile-menu.active {
    display: flex;
}

.mobile-nav-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-foreground);
    transition: color var(--transition-base);
    padding: 0.5rem;
}

.mobile-nav-link:hover {
    color: var(--color-primary);
    text-decoration: none;
}

@media (min-width: 768px) {
    .nav-menu {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: none;
    }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    font-family: var(--font-body);
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-primary-foreground);
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-soft-hover);
    text-decoration: none;
    color: var(--color-primary-foreground);
}

.btn-primary:active {
    transform: scale(0.95);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-secondary);
    border: 2px solid var(--color-secondary);
}

.btn-outline:hover {
    background-color: rgba(193, 140, 93, 0.1);
    text-decoration: none;
    color: var(--color-secondary);
}

.btn-lg {
    padding: 0.875rem 2.5rem;
    font-size: 1.125rem;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background-color: #FEFEFA;
    border: 1px solid rgba(222, 216, 207, 0.5);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    transition: all var(--transition-base);
}

.card-hover-lift:hover {
    transform: translateY(-0.25rem);
    box-shadow: var(--shadow-float-hover);
}

.card-header {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-foreground);
    margin-bottom: 0;
}

.card-content {
    padding: 1.5rem;
    padding-top: 0;
}

.card-description {
    color: var(--color-muted-foreground);
    font-size: 1rem;
    line-height: 1.6;
}

.card-icon {
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background-color: rgba(93, 112, 82, 0.1);
    transition: all var(--transition-base);
}

.card-hover-lift:hover .card-icon {
    background-color: var(--color-primary);
}

.card-icon svg {
    width: 1.75rem;
    height: 1.75rem;
    color: var(--color-primary);
    transition: color var(--transition-base);
}

.card-hover-lift:hover .card-icon svg {
    color: var(--color-primary-foreground);
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
    position: relative;
    padding: 2rem 1rem 1rem 1rem; /* Reduced by another 50% - top: 2rem (was 4rem), bottom: 1rem (was 2rem) */
    min-height: auto; /* Changed from 60vh to auto to remove extra vertical space */
    display: flex;
    align-items: flex-start; /* Changed from center to flex-start to align content at top */
    justify-content: center;
    overflow: hidden;
}

.hero-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 1280px;
    margin: 0 auto;
    text-align: center;
    padding-top: 2rem; /* Add some top padding for visual spacing when align-items is flex-start */
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.75rem; /* Reduced by 50% from 1.5rem */
    color: var(--color-foreground);
}

.hero-title .text-primary {
    color: var(--color-primary);
}

.hero-description {
    max-width: 42rem;
    margin: 0 auto 1.25rem; /* Reduced by 50% from 2.5rem */
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--color-muted-foreground);
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

@media (min-width: 640px) {
    .hero-actions {
        flex-direction: row;
    }
}

/* ============================================
   Sections
   ============================================ */
section {
    position: relative;
    padding: 4rem 1rem;
}

/* Reduce top padding for content sections that follow hero sections */
.hero-section + .content-section,
.hero-section + section.content-section {
    padding-top: 2rem; /* Reduced from 4rem to halve the spacing */
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    color: var(--color-foreground);
    margin-bottom: 1rem;
}

.section-description {
    max-width: 42rem;
    margin: 0 auto;
    color: var(--color-muted-foreground);
}

/* ============================================
   Quick Links Grid
   ============================================ */
.quick-links-section {
    background-color: transparent;
}

.quick-links-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
    max-width: 1280px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .quick-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .quick-links-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.quick-link-card {
    display: block;
    height: 100%;
}

/* ============================================
   About Section
   ============================================ */
.about-section {
    background-color: rgba(240, 235, 229, 0.3);
}

.about-content {
    max-width: 1152px;
    margin: 0 auto;
    display: grid;
    gap: 3rem;
    grid-template-columns: 1fr;
    align-items: center;
}

.about-text {
    order: 1;
}

.about-image {
    order: 2;
}

.about-description {
    font-size: 1.125rem;
    color: var(--color-muted-foreground);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.about-actions {
    margin-top: 2rem;
}

.image-wrapper {
    position: relative;
    transform: rotate(-2deg);
    border: 4px solid white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-float);
    overflow: hidden;
}

.image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-xl);
    object-fit: cover;
}

@media (min-width: 1024px) {
    .about-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .about-text {
        order: 1;
    }
    
    .about-image {
        order: 2;
    }
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    border-top: 1px solid var(--color-border);
    background-color: rgba(240, 235, 229, 0.3);
    padding: 3rem 1rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    background-color: var(--color-primary);
}

.footer-brand-text {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-foreground);
}

.footer-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
    transition: color var(--transition-base);
}

.footer-social-link:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.footer-copyright {
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
    text-align: center;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
    }
    
    .footer-links {
        align-items: flex-end;
    }
    
    .footer-copyright {
        text-align: right;
    }
}

/* ============================================
   Content Area
   ============================================ */
.content-area {
    max-width: 1280px;
    margin: 0 auto;
    padding: 4rem 1rem;
}

/* Reduce top padding for content-area in first content-section after hero */
.hero-section + .content-section .content-area,
.hero-section + section.content-section .content-area {
    padding-top: 2rem; /* Reduced from 4rem to halve the spacing */
}

/* ============================================
   Archive Pages
   ============================================ */
.archive-header {
    text-align: center;
    margin-bottom: 4rem;
}

.archive-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.archive-description {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--color-muted-foreground);
    max-width: 42rem;
    margin: 0 auto;
}

.minutes-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .minutes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .minutes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.minute-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-primary {
    color: var(--color-primary);
}

.text-secondary {
    color: var(--color-secondary);
}

.text-muted {
    color: var(--color-muted-foreground);
}

.bg-muted {
    background-color: var(--color-muted);
}

.no-posts {
    text-align: center;
    padding: 4rem 1rem;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
/* Reduce spacing below mission card on association page to match hero spacing */
.mission-card {
    margin-bottom: 0; /* Remove margin, spacing handled by content-area */
}

/* Reduce bottom padding for content-area in first content-section (contains mission card) */
.hero-section + .content-section .content-area {
    padding-bottom: 1rem; /* Reduced from 4rem to match reduced spacing */
}

/* Reduce spacing between first and second content sections (mission section and board section) */
.hero-section + .content-section + .content-section {
    padding-top: 1rem; /* Reduced spacing between sections */
}

@media (max-width: 767px) {
    .hero-section {
        padding: 1rem 1rem 0.5rem 1rem; /* Reduced by another 50% on mobile - top: 1rem (was 2rem), bottom: 0.5rem (was 1rem) */
        min-height: auto; /* Changed from 50vh to auto to remove extra vertical space on mobile */
    }
    
    .hero-content {
        padding-top: 1rem; /* Reduced top padding on mobile */
    }
    
    .mission-card {
        margin-bottom: 0; /* Remove margin on mobile */
    }
    
    /* Reduce bottom padding for content-area in first content-section on mobile */
    .hero-section + .content-section .content-area {
        padding-bottom: 0.5rem; /* Reduced from 2rem on mobile */
    }
    
    /* Reduce spacing between first and second content sections on mobile */
    .hero-section + .content-section + .content-section {
        padding-top: 0.5rem; /* Reduced spacing between sections on mobile */
    }
    
    section {
        padding: 2rem 1rem;
    }
    
    /* Reduce top padding for content sections that follow hero sections on mobile */
    .hero-section + .content-section,
    .hero-section + section.content-section {
        padding-top: 1rem; /* Reduced from 2rem to halve the spacing on mobile */
    }
    
    /* Reduce top padding for content-area in first content-section after hero on mobile */
    .hero-section + .content-section .content-area,
    .hero-section + section.content-section .content-area {
        padding-top: 1rem; /* Reduced from 2rem to halve the spacing on mobile */
    }
    
    .content-area {
        padding: 2rem 1rem;
    }
}
