/* Pleasant Homestead - Modern Pioneer Home with Warm Historic Aesthetic */

/* UNIVERSAL INTERACTIVE FEATURES (Applied to all pages automatically):
 * - Directional scroll animations (fade-left, fade-right, fade-up)
 * - Number counting animations (auto-detects numbers in text)
 * - Image parallax and rotation effects (all content images)
 * - Text shifting on scroll (all section titles)
 * - Sticky scroll stacking (wrap 3+ sections in .sticky-scroll-container)
 */

:root {
    --primary: #000000;
    --secondary: #ffffff;
    --accent: #446924;
    --accent-light: #7dac54;
    --accent-super-light: #dfffe2;
    --text: #1a1a1a;
    --text-light: #4a4a4a;
    --text-muted: #6b6b6b;
    --bg: #ffffff;
    --bg-alt: #fafafa;
    --bg-card: #ffffff;
    --header-bg: #ffffff;
    --border: #e8e8e8;
    --border-light: #f5f5f5;
    --border-dark: #acacac;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-hover: rgba(0, 0, 0, 0.12);
    --transition: all 0.4s cubic-bezier(0.76, 0, 0.24, 1);
    /* Success/Error message colors */
    --success-bg: #e8f5e9;
    --success-border: #4caf50;
    --success-text: #2e7d32;
    --error-bg: #ffebee;
    --error-border: #f44336;
    --error-text: #c62828;
    /* Hero gradient colors */
    --hero-gradient-start: #314644;
    --hero-gradient-end: #83a7bb;
    /* Universal font sizes - base: 0.8rem */
    --font-base: 0.8rem;
    --font-xs: calc(var(--font-base) * 0.75);      /* 0.6rem */
    --font-sm: calc(var(--font-base) * 0.875);     /* 0.7rem */
    --font-md: var(--font-base);                  /* 0.8rem */
    --font-lg: calc(var(--font-base) * 1.125);    /* 0.9rem */
    --font-xl: calc(var(--font-base) * 1.25);     /* 1rem */
    --font-2xl: calc(var(--font-base) * 1.5);     /* 1.2rem */
    --font-3xl: calc(var(--font-base) * 1.875);   /* 1.5rem */
    --font-4xl: calc(var(--font-base) * 2.25);   /* 1.8rem */
    --font-5xl: calc(var(--font-base) * 2.5);     /* 2rem */
    --font-6xl: calc(var(--font-base) * 3.125);   /* 2.5rem */
    --font-7xl: calc(var(--font-base) * 3.75);    /* 3rem */
    --font-8xl: calc(var(--font-base) * 4.375);  /* 3.5rem */
    --font-9xl: calc(var(--font-base) * 8.75);   /* 7rem */
    /* Standardized spacing scale - base: 0.6rem */
    --spacing-xs: calc(var(--font-base) * 0.5);   /* 0.4rem */
    --spacing-sm: calc(var(--font-base) * 0.75);  /* 0.6rem */
    --spacing-md: calc(var(--font-base) * 1.125); /* 0.9rem */
    --spacing-lg: calc(var(--font-base) * 1.5);   /* 1.2rem */
    --spacing-xl: calc(var(--font-base) * 1.875);  /* 1.5rem */
    --spacing-2xl: calc(var(--font-base) * 2.25); /* 1.8rem */
    --spacing-3xl: calc(var(--font-base) * 3);    /* 2.4rem */
    --spacing-4xl: calc(var(--font-base) * 4.5);  /* 3.6rem */
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: clamp(80px, 10vh, 120px); /* Account for fixed header */
    font-size: 16px;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* Smooth scrolling with momentum */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-size: var(--font-md);
    line-height: 1.75;
    color: var(--text);
    background-color: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    letter-spacing: -0.01em;
}

/* Base font sizes and letter spacing for semantic elements */
p {
    font-size: var(--font-xl);
    letter-spacing: -0.01em;
    line-height: 1.8;
    color: var(--text-light);
}

h1 {
    font-weight: 800;
    font-size: clamp(var(--font-7xl), 9vw, var(--font-9xl));
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
    line-height: 1.1;
    }

h2 {
    font-weight: 700;
    font-size: clamp(var(--font-5xl), 5vw, var(--font-7xl));
    letter-spacing: -0.03em;
    margin-top: 1vh;
    margin-bottom: clamp(0.5rem, 1vw, 0.75rem);
    line-height: 1.2;
    will-change: transform;
}

h3 {
    font-weight: 600;
    font-size: clamp(var(--font-2xl), 3vw, var(--font-4xl));
    letter-spacing: -0.02em;
    margin-bottom: clamp(0.15rem, 0.25vw, 0.2rem);
    line-height: 1.3;
    will-change: transform;
}

h4, h5, h6 {
    font-weight: 600;
    font-size: var(--font-2xl);
    letter-spacing: -0.5px;
    margin-bottom: .2rem;
}

a {
    font-size: inherit;
    letter-spacing: inherit;
}

label {
    font-size: var(--font-lg);
    letter-spacing: 0.2px;
}

ul, ol {
    padding-left: clamp(0.9rem, 1.5vw, 1.2rem);
}

/* Remove default list styling where needed */
ul {
    list-style: none;
    padding-left: 0;
}


/* Modern Navigation with Historic Colors - Paper Tiger Inspired */
.main-nav {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background 0.4s cubic-bezier(0.76, 0, 0.24, 1), backdrop-filter 0.4s cubic-bezier(0.76, 0, 0.24, 1), box-shadow 0.4s cubic-bezier(0.76, 0, 0.24, 1), border-bottom-color 0.4s cubic-bezier(0.76, 0, 0.24, 1), padding 0.4s cubic-bezier(0.76, 0, 0.24, 1), transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
    padding: clamp(0.25rem, 0.5vw, 0.4rem) 0;
    transform: translateZ(0); /* Prevent scroll-related movement */
    will-change: background, backdrop-filter, box-shadow;
}

.main-nav.lightbox-open {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.main-nav.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    box-shadow: 0 2px 20px var(--shadow);
    border-bottom-color: rgba(0, 0, 0, 0.08);
    padding: clamp(0.2rem, 0.4vw, 0.3rem) 0;
}

.nav-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 clamp(1.5rem, 4vw, 2.5rem);
    height: clamp(35px, 5vh, 50px);
    position: relative;
    transform: translateZ(0); /* Prevent scroll-related movement */
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.logo-img {
    width: clamp(32px, 3.5vw, 42px);
    height: clamp(32px, 3.5vw, 42px);
    object-fit: contain;
    display: block;
    transition: var(--transition);
}

.nav-logo:hover .logo-img {
    transform: scale(1.05);
    opacity: 0.9;
}

.logo-text {
    font-weight: 600;
    color: var(--primary);
}

.nav-logo::after {
    content: '';
    position: absolute;
    bottom: clamp(-3px, -0.4vw, -4px);
    left: 0;
    width: 0;
    height: clamp(1px, 0.2vw, 2px);
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-logo:hover::after {
    width: 100%;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: clamp(1.25rem, 2.5vw, 2rem);
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: clamp(0.875rem, 1.1vw, 1rem);
    letter-spacing: -0.01em;
    transition: all 0.3s cubic-bezier(0.76, 0, 0.24, 1);
    position: relative;
    padding: clamp(0.25rem, 0.5vw, 0.5rem) 0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.4s cubic-bezier(0.76, 0, 0.24, 1);
    border-radius: 1px;
}

.nav-menu a:hover {
    color: var(--primary);
    transform: translateY(-1px);
}

.nav-menu a:hover::after {
    width: 100%;
}

/* Hamburger Menu Button - Enhanced */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: clamp(36px, 4.5vw, 44px);
    height: clamp(36px, 4.5vw, 44px);
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: clamp(4px, 0.5vw, 6px);
    cursor: pointer;
    padding: clamp(0.625rem, 0.875vw, 0.875rem);
    margin: 0;
    z-index: 1002;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.76, 0, 0.24, 1), background 0.3s cubic-bezier(0.76, 0, 0.24, 1), border-color 0.3s cubic-bezier(0.76, 0, 0.24, 1);
    gap: clamp(5px, 0.6vw, 6px);
    box-sizing: border-box;
    will-change: transform;
    transform: translateZ(0); /* Force hardware acceleration and prevent scroll movement */
}

.hamburger:hover {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
}

.hamburger:focus {
    outline: none;
}

.hamburger.active {
    border: none;
    background: transparent;
}

.hamburger-line {
    width: 100%;
    height: clamp(2px, 0.3vw, 3px);
    background: var(--primary);
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.76, 0, 0.24, 1);
    transform-origin: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    display: block;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background: var(--primary);
}

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

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

/* Menu Overlay - Enhanced */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.76, 0, 0.24, 1);
    pointer-events: none;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: all;
}

/* Main Content - Full Width */
.main-content {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0 clamp(1.5rem, 4vw, 3rem);
    position: relative;
    z-index: 2;
    background: var(--bg);
    border: none;
    outline: none;
}

/* Full-Screen Hero Section */
.hero-section {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    min-height: clamp(400px, 50vh, 600px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-top: 0;
    padding: 0;
    background: radial-gradient(ellipse 120% 180% at 50% 50%, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    z-index: 1;
    transition: opacity 0.3s ease;
    border: none;
    outline: none;
}

/* Hero section without image (other pages) */
.hero-section.no-image {
    height: auto;
    min-height: auto;
    background: var(--bg);
    padding: clamp(100px, 12vh, 120px) clamp(1.5rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem);
    width: clamp(320px, 95vw, 1800px);
    max-width: clamp(320px, 95vw, 1800px);
    margin-left: auto;
    margin-right: auto;
    margin-top: clamp(40px, 5.5vh, 55px); /* Account for shorter header height */
}

.hero-section.no-image .hero-title {
    color: var(--primary);
    text-shadow: none;
    max-width: clamp(320px, 95vw, 1800px);
    margin: 0 auto;
    text-align: left;
    overflow-wrap: normal;
    word-break: keep-all;
    hyphens: none;
    box-sizing: border-box;
    padding: 0;
}

.hero-section.no-image::before {
    display: none;
}

.hero-section.no-image .hero-scroll-indicator {
    display: none;
}

.hero-section::before {
    display: none;
}

/* Hero image - only applies inside hero-section (not no-image) */
.hero-section:not(.no-image) .hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100vw;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: translateZ(0) scale(1);
    transform-origin: center top;
    animation: heroZoom 25s ease-in-out infinite;
    backface-visibility: hidden;
    z-index: 0;
    transition: opacity 0.5s ease, transform 0.1s ease-out;
}

/* Hero image loading indicator */
.hero-image-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse 120% 180% at 50% 50%, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    transition: opacity 0.3s ease;
}

.hero-image-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.hero-loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.hero-loading-progress {
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    width: 0%;
    animation: heroLoadingProgress 2s ease-in-out infinite;
    position: relative;
}

.hero-loading-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: heroLoadingShimmer 1.5s ease-in-out infinite;
}

@keyframes heroLoadingProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

@keyframes heroLoadingShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* Regular content images - should NOT use hero-image class */
/* Standalone images in content sections (not in .content-image or .gallery-item) */
.content-section img:not(.content-image img):not(.gallery-item img):not(.hero-image),
.content-section .hero-image:not(.content-image .hero-image) {
    position: static;
    width: 100%;
    height: auto;
    max-width: clamp(600px, 60vw, 900px); /* Limit size on desktop, full width on mobile */
    display: block;
    border-radius: clamp(6px, 1.2vw, 12px);
    box-shadow: 0 clamp(2px, 0.5vw, 4px) clamp(10px, 2vw, 20px) var(--shadow);
    object-fit: cover;
    animation: none;
    filter: none;
    transform: none;
    z-index: auto;
}

@keyframes heroZoom {
    0% { transform: translateZ(0) scale(1); }
    100% { transform: translateZ(0) scale(1.5); }
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: var(--secondary);
    padding: 0 clamp(1rem, 2vw, 1.5rem) clamp(3rem, 8vh, 6rem);
    max-width: clamp(320px, 85vw, 1000px);
    animation: heroFadeIn 1.2s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none;
    overflow-wrap: break-word;
    word-break: normal;
    box-sizing: border-box;
}

.hero-content * {
    pointer-events: auto;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    color: var(--secondary);
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.9), 0 2px 10px rgba(0, 0, 0, 0.7);
    animation: heroTitleSlide 1s ease-out 0.3s both;
    text-transform: uppercase;
    font-style: normal;
    overflow-wrap: normal;
    word-break: keep-all;
    hyphens: none;
    max-width: 100%;
    box-sizing: border-box;
}

@keyframes heroTitleSlide {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    color: var(--secondary);
    font-weight: 300;
    letter-spacing: 2px;
    text-shadow: 0 3px 20px rgba(0, 0, 0, 0.9), 0 1px 5px rgba(0, 0, 0, 0.7);
    animation: heroSubtitleSlide 1s ease-out 0.6s both;
    text-transform: uppercase;
    font-style: normal;
    opacity: 0.95;
}

.hero-logo {
    width: clamp(60px, 6vw, 90px);
    height: auto;
    margin: clamp(1.5rem, 3vh, 2.5rem) auto 0;
    display: block;
    object-fit: contain;
    animation: heroFadeIn 1.2s cubic-bezier(0.19, 1, 0.22, 1) 0.8s both;
    opacity: 0;
}

.hero-logo[style*="display: none"] {
    display: none !important;
}

@keyframes heroSubtitleSlide {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-scroll-indicator {
    display: none;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

.hero-scroll-indicator::after {
    content: '↓';
    display: block;
    font-size: var(--font-3xl);
}

/* Content Sections with Side-by-Side Layout - Paper Tiger Inspired */
.content-section {
    opacity: 1; /* Always visible - no fade animations */
    transform: none; /* No transform animations */
    border: none;
    outline: none;
}

/* Content sections with green background for emphasis - only key sections */
.content-section#home-ready,
.content-section#living-history,
.content-section#place-belong,
.content-section#enduring-advantage,
.content-section#setting-orientation,
.content-section#enduring-value,
.content-section#mechanical-upgrades,
.content-section#outbuildings-outdoor,
.content-section#poker-game,
.content-section#safe-community,
.content-section#proximity-matters,
.content-section#proven-stewardship,
.content-section#heritage-renewal,
.content-section#setting {
    background: var(--accent-super-light);
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-left: clamp(1.5rem, 4vw, 3rem);
    padding-right: clamp(1.5rem, 4vw, 3rem);
}

/* Highlights Intro Section - Bullet Points Style */
.content-section#introduction {
    background: var(--accent-super-light);
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-left: clamp(1.5rem, 4vw, 3rem);
    padding-right: clamp(1.5rem, 4vw, 3rem);
    padding-top: clamp(2rem, 4vw, 4rem);
    padding-bottom: clamp(2rem, 4vw, 4rem);
    margin-top: 0;
    display: block;
    opacity: 1;
    visibility: visible;
}

.content-section#introduction .highlights-intro {
    max-width: clamp(800px, 85vw, 1200px);
    margin: 0 auto;
    display: block;
    opacity: 1;
    visibility: visible;
}

.content-section#introduction .highlights-intro ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(clamp(250px, 30vw, 350px), 1fr));
    gap: clamp(1rem, 2vw, 1.5rem);
    opacity: 1 !important;
    visibility: visible !important;
}

.content-section#introduction .highlights-intro li {
    position: relative;
    padding-left: clamp(1.2rem, 2vw, 1.5rem);
    padding-top: clamp(0.3rem, 0.5vw, 0.5rem);
    color: var(--text);
    font-size: clamp(var(--font-base), 1.5vw, var(--font-lg));
    line-height: 1.6;
    word-wrap: break-word;
    opacity: 1 !important;
    visibility: visible !important;
    display: list-item !important;
}

.content-section#introduction .highlights-intro li::before {
    content: '→';
    position: absolute;
    left: 0;
    top: clamp(0.3rem, 0.5vw, 0.5rem);
    color: var(--accent);
    font-weight: bold;
    font-size: clamp(var(--font-lg), 2vw, var(--font-xl));
}

/* Setting Section - Enhanced Design */
.setting-container {
    max-width: clamp(800px, 85vw, 1200px);
    margin: 0 auto;
    padding: clamp(3rem, 6vw, 5rem) 0;
}

.setting-header {
    text-align: center;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.setting-intro {
    font-size: clamp(var(--font-lg), 2vw, var(--font-xl));
    color: var(--text);
    max-width: clamp(600px, 75vw, 900px);
    margin: clamp(1rem, 2vw, 1.5rem) auto 0;
    line-height: 1.7;
}

.setting-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 30vw, 350px), 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: clamp(3rem, 6vw, 5rem);
}

.setting-feature {
    background: rgba(255, 255, 255, 0.6);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border-radius: clamp(8px, 1.5vw, 16px);
    border: 1px solid rgba(68, 105, 36, 0.15);
    transition: all 0.3s cubic-bezier(0.76, 0, 0.24, 1);
}

.setting-feature:hover {
    transform: translateY(-4px);
    box-shadow: 0 clamp(8px, 2vw, 16px) clamp(20px, 4vw, 40px) rgba(68, 105, 36, 0.15);
    border-color: rgba(68, 105, 36, 0.3);
}

.setting-feature h3 {
    font-size: clamp(var(--font-xl), 2.5vw, var(--font-2xl));
    color: var(--accent);
    margin-bottom: clamp(0.75rem, 1.5vw, 1rem);
    font-weight: 600;
}

.setting-feature p {
    color: var(--text);
    line-height: 1.7;
    margin: 0;
}

.setting-recognition {
    text-align: center;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
    padding: clamp(2rem, 4vw, 3rem);
    background: rgba(255, 255, 255, 0.4);
    border-radius: clamp(8px, 1.5vw, 16px);
}

.setting-recognition-intro {
    font-size: clamp(var(--font-base), 1.8vw, var(--font-lg));
    color: var(--text);
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
    font-weight: 500;
}

.setting-publications {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(0.75rem, 1.5vw, 1.25rem);
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

/* Center publications buttons in welcome section */
.content-section#welcome .setting-publications {
    justify-content: center;
}


.setting-recognition-tagline {
    font-size: clamp(var(--font-base), 1.8vw, var(--font-lg));
    color: var(--text);
    font-style: italic;
    margin: 0;
}

.setting-growth {
    text-align: center;
    max-width: clamp(600px, 75vw, 900px);
    margin: 0 auto clamp(2.5rem, 5vw, 4rem);
}

.setting-growth p {
    font-size: clamp(var(--font-lg), 2vw, var(--font-xl));
    color: var(--text);
    line-height: 1.7;
    margin: 0;
}

.setting-cta {
    text-align: center;
    margin-top: clamp(2rem, 4vw, 3rem);
}

/* Any content section with a background should be full-width */
.content-section[style*="background"] {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-left: clamp(1.5rem, 4vw, 3rem);
    padding-right: clamp(1.5rem, 4vw, 3rem);
}

.content-section:first-of-type {
    padding-top: calc(clamp(1.2rem, 2vw, 1.8rem) + clamp(100px, 12vh, 120px));
    padding-bottom: clamp(2rem, 4vw, 4rem);
}

/* Introduction section should have proper spacing after hero */
.content-section#introduction:first-of-type {
    padding-top: clamp(2rem, 4vw, 4rem);
    margin-top: clamp(2rem, 4vw, 3rem);
}

.content-section:not(:first-of-type) {
    padding-bottom: clamp(2rem, 4vw, 4rem);
}

/* Don't apply default padding to sticky panels - they have their own padding */
.sticky-panel.content-section:not(:first-of-type) {
    padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 4vw, 3rem); /* Consistent padding */
}

/* Removed all directional animations on images - images are always visible */
.fade-left:not(.content-text):not(.section-title):not(h2):not(h3):not(p),
.fade-right:not(.content-text):not(.section-title):not(h2):not(h3):not(p),
.fade-up:not(.content-text):not(.section-title):not(h2):not(h3):not(p):not(.content-section) {
    opacity: 1;
    transform: none;
}

.fade-left.revealed:not(.content-text):not(.section-title):not(h2):not(h3):not(p),
.fade-right.revealed:not(.content-text):not(.section-title):not(h2):not(h3):not(p),
.fade-up.revealed:not(.content-text):not(.section-title):not(h2):not(h3):not(p):not(.content-section) {
    opacity: 1;
    transform: none;
}

/* Paragraphs and list items - always visible, no animations */
p,
li {
    opacity: 1 !important;
    transform: none !important;
}

/* Headings can have animations - restore them */
.section-title {
    color: var(--primary);
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 2vh;
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 1s cubic-bezier(0.19, 1, 0.22, 1), transform 1s cubic-bezier(0.19, 1, 0.22, 1);
    transition-delay: 0.1s;
    will-change: transform;
}

.content-section.visible .section-title {
    opacity: 1;
    transform: translateX(0);
}

h2:not(.hero-title),
h3 {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 1s cubic-bezier(0.19, 1, 0.22, 1), transform 1s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: transform;
}

.content-section.visible h2:not(.hero-title),
.content-section.visible h3 {
    opacity: 1;
    transform: translateX(0);
}

@keyframes sectionFadeIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* List items - always visible, no animations */
li {
    opacity: 1 !important;
    transform: none !important;
}

/* Sticky Scroll Container - Paper Tiger Style */
.sticky-scroll-container {
    position: relative;
    /* Height naturally determined by panel content - no fixed height needed */
    padding: 0;
    margin: 0;
    width: 100vw; /* Full width of viewport */
    max-width: 100vw;
    margin-left: calc(-50vw + 50%); /* Break out of parent padding */
    margin-right: calc(-50vw + 50%);
    /* Container height = sum of all panel heights (panels overlap with margin-top: -2px) */
    /* Sticky positioning handles the stacking effect as you scroll */
}

.sticky-panel {
    position: sticky;
    top: clamp(100px, 12vh, 120px);
    z-index: 1;
    padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 4vw, 3rem); /* Add horizontal padding */
    margin: 0; /* No margin at all */
    box-shadow: 0 -8px 40px var(--shadow-hover), 0 -2px 10px var(--shadow); /* Top shadow only */
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    /* Height fits content with padding - no fixed min-height */
    opacity: 1 !important; /* Always visible */
    transform: none !important; /* No transforms */
    width: 100%; /* Full width */
    overflow: visible; /* Allow next card to peek through at bottom */
    transition: box-shadow 0.3s ease-out; /* Smooth shadow growth */
}

/* Lower cards in DOM have higher z-index so they appear on top when scrolling */
.sticky-panel:first-child {
    z-index: 1; /* First card starts at bottom */
    border-top: none;
    background: linear-gradient(to bottom, var(--border-light) 0%, var(--bg) 100%); /* Light grey at top, white at bottom */
}

.sticky-panel:nth-child(2) {
    z-index: 2; /* Second card in middle */
    margin-bottom: 0; /* No margin - immediate overlap */
    background: linear-gradient(to bottom, var(--border-light) 0%, var(--bg) 100%); /* Light grey at top, white at bottom */
}

.sticky-panel:last-child {
    z-index: 3; /* Last card on top - highest z-index */
    margin-bottom: 0;
    box-shadow: 0 -8px 40px var(--shadow-hover), 0 -2px 10px var(--shadow); /* Top shadow only */
    background: linear-gradient(to bottom, var(--border-light) 0%, var(--bg) 100%); /* Light grey at top, white at bottom */
}

/* Progress indicator for sticky panels - Minimal smooth moving dot */
.sticky-progress-indicator {
    position: fixed;
    top: clamp(100px, 12vh, 120px);
    right: clamp(1rem, 2vw, 2rem);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(1.5rem, 3vw, 2rem) clamp(0.75rem, 1.5vw, 1rem);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sticky-scroll-container ~ .sticky-progress-indicator,
.sticky-scroll-container + .sticky-progress-indicator {
    opacity: 1;
}

/* Minimal vertical track */
.sticky-progress-track {
    position: relative;
    width: 1px;
    height: clamp(200px, 40vh, 400px);
    background: var(--border);
    border-radius: 1px;
}

/* Smooth moving dot */
.sticky-progress-dot {
    position: absolute;
    left: 50%;
    top: 0;
    width: clamp(8px, 1.2vw, 10px);
    height: clamp(8px, 1.2vw, 10px);
    border-radius: 50%;
    background: var(--accent);
    transform: translate(-50%, -50%);
    transition: transform 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 2;
    will-change: transform;
}

/* Trail/glow effect that responds to scroll speed */
.sticky-progress-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: -1;
}

.sticky-progress-dot.scrolling::before {
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(2);
    filter: blur(4px);
}

.sticky-progress-dot.scrolling-fast::before {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(2.5);
    filter: blur(6px);
}

/* Growing bottom shadow effect */
.sticky-panel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.15) 100%);
    pointer-events: none;
    transition: height 0.3s ease-out;
    z-index: -1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.sticky-panel.shadow-growing::after {
    height: var(--shadow-height, 0px);
}

/* Ensure content sections inside sticky panels work properly */
.sticky-panel.content-section {
    padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 4vw, 3rem); /* Consistent padding for all panels */
    opacity: 1 !important; /* Always visible */
    transform: none !important; /* No transforms */
}

/* Make sure sticky panels and all their content are visible immediately */
.sticky-panel.content-section.visible,
.sticky-panel .content-text,
.sticky-panel .section-title,
.sticky-panel h2:not(.hero-title),
.sticky-panel h3,
.sticky-panel p,
.sticky-panel li {
    opacity: 1 !important;
    transform: none !important;
}

/* Ensure proper text contrast in sticky panels with gradient backgrounds */
.sticky-panel:first-child,
.sticky-panel:first-child .section-title,
.sticky-panel:first-child h2:not(.hero-title),
.sticky-panel:first-child h3,
.sticky-panel:first-child p,
.sticky-panel:first-child li {
    color: var(--text); /* Dark text for light green gradient */
}

.sticky-panel:nth-child(2),
.sticky-panel:nth-child(2) .section-title,
.sticky-panel:nth-child(2) h2:not(.hero-title),
.sticky-panel:nth-child(2) h3,
.sticky-panel:nth-child(2) p,
.sticky-panel:nth-child(2) li {
    color: var(--primary); /* Black text for better contrast on gray gradient */
}

.sticky-panel:last-child,
.sticky-panel:last-child .section-title,
.sticky-panel:last-child h2:not(.hero-title),
.sticky-panel:last-child h3,
.sticky-panel:last-child p,
.sticky-panel:last-child li {
    color: var(--text); /* Dark text for light green-tinted gradient */
}

/* Prevent fade-up animation on sticky panels - they should always be visible */
.sticky-panel.fade-up,
.sticky-panel.fade-left,
.sticky-panel.fade-right {
    opacity: 1 !important;
    transform: none !important;
}

.sticky-panel.fade-up.revealed,
.sticky-panel.fade-left.revealed,
.sticky-panel.fade-right.revealed {
    opacity: 1 !important;
    transform: none !important;
}

/* Side-by-Side Content Layout */
.content-grid {
    display: flex;
    flex-direction: row;
    gap: clamp(1rem, 2vw, 1.5rem);
    align-items: start;
    margin: 0;
}

/* Universal layout: content-number always on right, aligned to top */
.content-grid .content-number {
    order: 2;
    align-self: flex-start; /* Align to top so it's never above text */
}

/* Right column container: wraps content-number and content-image when both present */
.content-right-column {
    display: flex;
    flex-direction: column;
    order: 2;
    flex: 1;
    align-items: stretch;
    min-width: 0; /* Allow flex items to shrink below content size */
}

/* When content-number is inside right column, remove its order and flex */
.content-right-column .content-number {
    order: 1;
    align-self: stretch;
    flex: 0 0 auto;
    width: 100%;
}

/* When content-image is inside right column, remove its order */
.content-right-column .content-image {
    order: 2;
    flex: 0 1 auto;
    max-width: 100%;
    margin: 0;
    width: 100%;
    min-width: 0; /* Allow images to shrink responsively */
}

/* Ensure gallery previews in right column are fully responsive */
.content-right-column .content-image .gallery-preview {
    width: 100%;
    max-width: 100%;
}

.content-right-column .content-image .gallery-carousel,
.content-right-column .content-image .gallery-preview-grid {
    width: 100%;
    max-width: 100%;
}

/* Text always visible - no sliding */
.content-grid .content-text {
    opacity: 1 !important;
    transform: none !important;
    order: 1; /* Default left position */
}

/* Removed all content-image animations - images are always visible */
.content-grid .content-image {
    opacity: 1;
    transform: none;
}

/* About page: two equal-width text columns */
#about-content .content-grid .content-text {
    flex: 1;
    min-width: 0; /* Allow text to wrap properly */
}

/* Remove conflicting rule - content images use .revealed class, not .visible */

/* Standalone sections - no fade-up for sections, only for images */
.content-section.fade-up {
    opacity: 1 !important; /* Sections always visible */
    transform: none !important;
}

.content-section.fade-up.revealed {
    opacity: 1 !important;
    transform: none !important;
}

.content-grid.reverse {
    flex-direction: row-reverse;
}

/* In reverse grids, swap the order so text is on right, image on left */
.content-grid.reverse .content-text {
    order: 2;
}

.content-grid.reverse .content-image {
    order: 1;
}

.content-text {
    display: flex;
    flex-direction: column;
    gap: clamp(0.6rem, 1.5vw, 1rem);
    padding: clamp(1rem, 2vw, 2rem) 0;
    flex: 1;
}

.content-image {
    position: relative;
    width: 100%;
    max-width: 75%; /* 25% smaller - universal size for all content images */
    height: auto;
    border-radius: clamp(8px, 1.5vw, 16px);
    overflow: visible; /* Changed to visible to allow gallery previews to display properly */
    box-shadow: 0 clamp(4px, 1vw, 10px) clamp(16px, 4vw, 40px) var(--shadow);
    margin: 0 auto; /* Center the smaller image */
    flex: 1;
    order: 2; /* Default right position (can be overridden by reverse class) */
}

/* Ensure floor plan viewer container clips content properly */
.content-image:has(#floorplan-viewer) {
    overflow: hidden; /* Clip the floor plan viewer to container borders */
}

/* Content images with gallery previews should be constrained like regular images */
.content-image:has(.gallery-preview) {
    max-width: 75%; /* Same as regular content images - 25% smaller */
    overflow: visible;
    box-shadow: none; /* Remove shadow for gallery previews */
    margin: 0 auto; /* Center like regular images */
}

/* Ensure gallery previews inside content-image are properly sized */
.content-image .gallery-preview {
    width: 100%;
    max-width: 100%;
}

.content-image .gallery-preview-grid {
    max-width: 100%;
}

.content-image .gallery-carousel {
    max-width: 100%;
}

/* Featured Number Display - Right side of content-grid */
.content-number {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 4vw, 3rem);
    min-height: clamp(200px, 30vh, 300px);
    flex: 1;
}

.content-number-value {
    font-size: clamp(var(--font-6xl), 8vw, var(--font-9xl));
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: clamp(0.5rem, 1vw, 0.75rem);
    text-align: center;
    position: relative;
    display: block;
}

.content-number-unit {
    font-size: clamp(var(--font-lg), 2vw, var(--font-xl));
    color: var(--text-light);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-align: center;
    margin-top: clamp(0.25rem, 0.5vw, 0.5rem);
    line-height: 1.4;
}

/* Content images inside sticky panels - already relative, no special handling needed */
.sticky-panel .content-image {
    position: relative;
}

/* Ensure gallery previews in sticky panels get proper max-width constraint */
/* Higher specificity than .content-image:has(.gallery-preview) */
.sticky-panel .content-image:has(.gallery-preview) {
    max-width: 75%; /* Same constraint as regular content images */
    margin: 0 auto; /* Center like regular images */
}

/* Remove sticky positioning from content-number inside sticky panels */
.sticky-panel .content-number {
    position: relative;
    top: auto;
}

.content-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0;
}

/* Document container for PDFs and historical documents */
.document-container {
    padding: clamp(1rem, 2vw, 1.5rem);
    border: 1px solid var(--border);
    border-radius: clamp(8px, 1.5vw, 12px);
    background: var(--bg-alt);
    width: 100%;
    max-width: 100%;
}

.document-title {
    margin-bottom: clamp(0.5rem, 1vw, 0.75rem);
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text);
}

.document-description {
    margin-bottom: clamp(0.75rem, 1.5vw, 1rem);
    font-size: var(--font-sm);
    color: var(--text-light);
    line-height: 1.5;
}

.image-credit {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--secondary);
    font-style: italic;
    text-align: right;
}

.image-credit a {
    color: var(--secondary);
    text-decoration: underline;
    transition: color var(--transition);
}

.image-credit a:hover {
    color: var(--primary);
}

.source-note {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
    color: var(--secondary);
    line-height: 1.6;
}

.source-note a {
    color: var(--secondary);
    text-decoration: underline;
    transition: color var(--transition);
}

.source-note a:hover {
    color: var(--primary);
}

/* Gallery images - no scroll animations */
.gallery-item img,
.gallery-grid img {
    transform: none !important;
    will-change: auto;
}

/* Removed hover animations on gallery-item images */

/* Removed hover animations on content-image */

/* Image sizing handled above - container moves, image can move inside */

/* Section title styles moved to above rule */

/* Number counting animation styles */
.count-number {
    position: relative;
    display: inline-block;
}

.count-number.counted {
    transition: none;
}

/* Removed scroll-based transforms on images */

.section-title,
h2:not(.hero-title),
h3 {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

@keyframes titleSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: clamp(-8px, -1vh, -10px);
    left: 0;
    width: 0;
    height: clamp(2px, 0.4vw, 4px);
    background: linear-gradient(90deg, var(--accent), transparent);
    border-radius: clamp(1px, 0.2vw, 2px);
    transition: width 0.8s ease-out 0.3s;
}

.content-section.visible .section-title::after {
    width: 100%;
}

@keyframes underlineExpand {
    from {
        width: 0;
    }
    to {
        width: clamp(40px, 8vw, 80px);
    }
}

.content-section h3 {
    color: var(--primary);
    display: block;
    width: 100%;
    margin-top: clamp(0.3rem, 0.4vw, 0.4rem);
    margin-bottom: clamp(0.15rem, 0.25vw, 0.2rem);
    word-wrap: break-word;
}

.content-section h3:first-child {
    margin-top: 0;
}

.content-section p {
    text-align: left;
    color: var(--text);
    opacity: 1; /* Always visible - no animations */
    transform: none; /* No transforms */
    margin-bottom: clamp(0.3rem, 0.5vw, 0.4rem);
    max-width: 100%;
    word-wrap: break-word;
}

.content-section p:last-child {
    margin-bottom: 0;
}

@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section ul {
    list-style: none;
    margin-bottom: clamp(0.3rem, 0.5vw, 0.4rem);
    margin-top: clamp(0.3rem, 0.5vw, 0.4rem);
}

.content-section ul:last-child {
    margin-bottom: 0;
}

.content-section li {
    color: var(--text);
    position: relative;
    padding-left: clamp(0.9rem, 1.5vw, 1.2rem);
    margin-bottom: clamp(0.4rem, 0.8vw, 0.6rem);
    line-height: 1.6;
    word-wrap: break-word;
}

.content-section li:last-child {
    margin-bottom: 0;
}

.content-section li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

/* Heritage Renewal Section - Using Standard Spacing */
.heritage-renewal-content {
    margin: 0 auto;
}

.content-section.heritage-renewal .section-title {
    text-align: left;
}

.content-section.heritage-renewal .heritage-intro {
    text-align: left;
    color: var(--text-light);
}

.content-section.heritage-renewal .heritage-subtitle {
    text-align: left;
    font-weight: 500;
    color: var(--text);
    font-size: clamp(var(--font-lg), 1.5vw, var(--font-xl));
    line-height: 1.6;
    margin: clamp(1.5rem, 3vw, 2.5rem) 0 clamp(1rem, 2vw, 1.5rem) 0;
}

/* Modern Heritage List Container - Auto-fit responsive grid */
.heritage-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: clamp(1rem, 2vw, 1.5rem);
    padding: 0;
    margin: 0;
}

/* Modern Heritage List Styling */
.content-section.heritage-renewal .heritage-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(0.4rem, 0.8vw, 0.6rem);
}

.content-section.heritage-renewal .heritage-list li {
    color: var(--text);
    position: relative;
    margin: 0;
    padding: clamp(0.25rem, 0.5vw, 0.4rem) 0 clamp(0.25rem, 0.5vw, 0.4rem) clamp(1.5rem, 2vw, 1.75rem);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.6;
    font-size: clamp(var(--font-base), 1.1vw, var(--font-lg));
    border-left: 2px solid transparent;
    border-radius: 0 clamp(4px, 0.8vw, 6px) clamp(4px, 0.8vw, 6px) 0;
}

.content-section.heritage-renewal .heritage-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: clamp(0.5rem, 1vw, 0.75rem);
    color: var(--accent);
    font-weight: 700;
    font-size: clamp(var(--font-lg), 1.3vw, var(--font-xl));
    line-height: 1;
    width: clamp(1.25rem, 2vw, 1.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-section.heritage-renewal .heritage-list li:hover {
    color: var(--primary);
    background: rgba(68, 105, 36, 0.04);
    border-left-color: var(--accent);
    transform: translateX(2px);
}

.content-section.heritage-renewal .heritage-list li:hover::before {
    transform: scale(1.15);
    color: var(--accent-light);
}

/* Modern Heritage Category Card Design */
.heritage-category {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: clamp(12px, 2vw, 20px);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    opacity: 1;
    transform: none;
}

.heritage-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.heritage-category:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-light);
}

.heritage-category:hover::before {
    transform: scaleX(1);
}


.heritage-gallery-preview {
    width: 100%;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

/* Heritage Category Image - Optional, hidden by default, shown if image exists */
.heritage-category-image {
    display: none; /* Hide placeholder text - only show if actual image */
    width: 100%;
    height: clamp(220px, 50vh, 220px);
    border-radius: clamp(8px, 1.2vw, 12px);
    overflow: hidden;
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
    background: var(--bg-alt);
    border: 1px solid var(--border-light);
}

.heritage-category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.heritage-category:hover .heritage-category-image img {
    transform: scale(1.05);
}

/* Show image container if it contains an img element */
/* Modern browsers with :has() support */
@supports selector(:has(*)) {
    .heritage-category-image:has(img) {
        display: block;
    }
    
    .heritage-category-image:not(:has(img)) {
        display: none;
    }
}

/* Fallback for browsers without :has() support - hide by default, show via class if needed */
.heritage-category-image.has-image {
    display: block;
}

/* Interior Overview Gallery */
.interior-overview-gallery {
    width: 100%;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
    .interior-overview-gallery {
        margin-top: 2rem;
        padding-top: 2rem;
    }
}

/* Facade Sections on Exterior Page - Responsive Grid */
.facade-sections {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
    width: 100%;
}

/* Mobile: 1 column */
.facade-sections {
    grid-template-columns: 1fr;
}

/* Tablet: 2 columns */
@media (min-width: 640px) {
    .facade-sections {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
    .facade-sections {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

.facade-section {
    width: 100%;
}

.facade-title {
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

.facade-gallery {
    width: 100%;
}

/* Heritage Category Content */
.heritage-category-content {
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Modern Heritage Category Title */
.heritage-category-title {
    font-weight: 700;
    color: var(--primary);
    font-size: clamp(var(--font-xl), 2vw, var(--font-2xl));
    margin: 0 0 clamp(1rem, 2vw, 1.5rem) 0;
    padding-bottom: clamp(0.75rem, 1.5vw, 1rem);
    border-bottom: 2px solid var(--border);
    text-align: left;
    line-height: 1.3;
    letter-spacing: -0.02em;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.heritage-category:hover .heritage-category-title {
    color: var(--accent);
    border-bottom-color: var(--accent-light);
}

.content-section.heritage-renewal .heritage-conclusion {
    text-align: left;
    color: var(--text-light);
    font-style: italic;
    font-size: clamp(var(--font-base), 1.2vw, var(--font-lg));
    line-height: 1.7;
    margin-top: clamp(2rem, 4vw, 3rem);
    padding-top: clamp(1.5rem, 3vw, 2.5rem);
    border-top: 1px solid var(--border);
}

.content-section em {
    font-style: italic;
    color: var(--text-light);
}

.content-section a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
    transition: all 0.3s cubic-bezier(0.76, 0, 0.24, 1);
    font-weight: 500;
    position: relative;
}

.content-section a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
    transform: translateY(-1px);
}

/* Highlights Section */
.highlights-section {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
}

.highlights-stats {
    width: 100%;
    max-width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(2rem, 4vw, 3rem);
    padding: clamp(3rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem);
    background: transparent;
    border-radius: 0;
    justify-items: center;
    align-items: center;
}

.highlight-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: clamp(0.5rem, 1vw, 0.75rem);
    position: relative;
    padding: clamp(1.5rem, 3vw, 2rem);
    background: var(--primary);
    border-radius: clamp(8px, 1.5vw, 16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    overflow: hidden;
}

.highlight-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.15;
    z-index: 0;
    border-radius: inherit;
}

.highlight-stat > * {
    position: relative;
    z-index: 1;
}

.highlight-stat:nth-child(1)::before {
    background: linear-gradient(135deg, rgba(174, 213, 129, 0.3) 0%, rgba(174, 213, 129, 0.1) 100%);
    border-color: rgba(174, 213, 129, 0.4);
}

.highlight-stat:nth-child(1) {
    border-color: rgba(174, 213, 129, 0.4);
}

.highlight-stat:nth-child(2)::before {
    background: linear-gradient(135deg, rgba(124, 179, 66, 0.3) 0%, rgba(124, 179, 66, 0.1) 100%);
    border-color: rgba(124, 179, 66, 0.4);
}

.highlight-stat:nth-child(2) {
    border-color: rgba(124, 179, 66, 0.4);
}

.highlight-stat:nth-child(3)::before {
    background: linear-gradient(135deg, rgba(174, 213, 129, 0.4) 0%, rgba(174, 213, 129, 0.15) 100%);
    border-color: rgba(174, 213, 129, 0.5);
}

.highlight-stat:nth-child(3) {
    border-color: rgba(174, 213, 129, 0.5);
}

.highlight-stat:nth-child(4)::before {
    background: linear-gradient(135deg, rgba(124, 179, 66, 0.3) 0%, rgba(124, 179, 66, 0.1) 100%);
    border-color: rgba(124, 179, 66, 0.4);
}

.highlight-stat:nth-child(4) {
    border-color: rgba(124, 179, 66, 0.4);
}

.highlight-stat-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    border-radius: clamp(8px, 1.5vw, 16px);
    padding: clamp(1.5rem, 3vw, 2rem);
    background: var(--primary);
    border: 2px solid rgba(174, 213, 129, 0.5);
    box-shadow: 
        0 clamp(4px, 1vw, 8px) clamp(12px, 2vw, 20px) rgba(174, 213, 129, 0.2),
        0 0 20px rgba(174, 213, 129, 0.15);
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: clamp(0.5rem, 1vw, 0.75rem);
    position: relative;
    animation: subtleGlow 3s ease-in-out infinite;
}

@keyframes subtleGlow {
    0%, 100% {
        box-shadow: 
            0 clamp(4px, 1vw, 8px) clamp(12px, 2vw, 20px) rgba(174, 213, 129, 0.2),
            0 0 20px rgba(174, 213, 129, 0.15);
    }
    50% {
        box-shadow: 
            0 clamp(4px, 1vw, 8px) clamp(12px, 2vw, 20px) rgba(174, 213, 129, 0.3),
            0 0 30px rgba(174, 213, 129, 0.25);
    }
}

.highlight-stat-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(174, 213, 129, 0.4) 0%, rgba(174, 213, 129, 0.15) 100%);
    z-index: 0;
    border-radius: inherit;
    transition: all 0.3s ease-in-out;
}

.highlight-stat-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid rgba(174, 213, 129, 0.5);
    border-radius: 50%;
    opacity: 0.5;
    z-index: 0;
    animation: ringPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ringPulse {
    0% {
        width: 30px;
        height: 30px;
        opacity: 0.5;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

.highlight-stat-link > * {
    position: relative;
    z-index: 1;
}

.highlight-stat-link:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 clamp(8px, 2vw, 16px) clamp(20px, 4vw, 40px) rgba(174, 213, 129, 0.4),
        0 0 50px rgba(174, 213, 129, 0.3);
    border-color: var(--accent-light);
}

.highlight-stat-link:hover::before {
    background: linear-gradient(135deg, rgba(174, 213, 129, 0.5) 0%, rgba(174, 213, 129, 0.2) 100%);
    box-shadow: inset 0 0 0 1px rgba(174, 213, 129, 0.4);
}

.highlight-stat-link:hover::after {
    animation: none;
    display: none;
}

.highlight-stat-link .highlight-stat-value {
    color: var(--accent-super-light);
}

.highlight-stat-link:hover .highlight-stat-value {
    color: var(--accent-light);
    transform: scale(1.05);
}

.highlight-stat-link:hover .highlight-stat-unit {
    color: var(--accent-light);
}

.highlight-stat-value {
    font-size: clamp(var(--font-5xl), 6vw, var(--font-8xl));
    font-weight: 800;
    color: var(--secondary);
    line-height: 1;
    letter-spacing: -0.02em;
    display: block;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.highlight-stat:nth-child(1) .highlight-stat-value {
    color: var(--accent-light);
}

.highlight-stat:nth-child(2) .highlight-stat-value {
    color: var(--accent-light);
}

.highlight-stat:nth-child(3) .highlight-stat-value {
    color: var(--accent-super-light);
}

.highlight-stat:nth-child(4) .highlight-stat-value {
    color: var(--accent-light);
}

.highlight-stat-unit {
    font-size: clamp(var(--font-sm), 1.5vw, var(--font-lg));
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.05em;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.highlight-stat-link .highlight-stat-unit {
    color: rgba(255, 255, 255, 0.8);
}

.highlights-container {
    max-width: clamp(800px, 90vw, 1200px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(200px, 25vw, 280px), 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
}

.highlight-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: clamp(1.5rem, 3vw, 2rem);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-alt) 100%);
    border-radius: clamp(12px, 2vw, 20px);
    border: 1px solid var(--border);
    box-shadow: 
        0 clamp(4px, 1vw, 8px) clamp(12px, 2vw, 24px) var(--shadow),
        0 0 0 0 rgba(68, 105, 36, 0),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
    animation: highlightFloat 6s ease-in-out infinite;
}

@keyframes highlightFloat {
    0%, 100% {
        transform: translateY(0) rotateX(0deg);
    }
    50% {
        transform: translateY(-4px) rotateX(2deg);
    }
}

.highlight-item:nth-child(1) {
    animation-delay: 0s;
}

.highlight-item:nth-child(2) {
    animation-delay: 0.5s;
}

.highlight-item:nth-child(3) {
    animation-delay: 1s;
}

.highlight-item:nth-child(4) {
    animation-delay: 1.5s;
}

.highlight-item:nth-child(5) {
    animation-delay: 2s;
}

.highlight-item:nth-child(6) {
    animation-delay: 2.5s;
}

.highlight-item:nth-child(7) {
    animation-delay: 3s;
}

.highlight-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(68, 105, 36, 0) 0%, rgba(68, 105, 36, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: inherit;
    z-index: 0;
}

.highlight-item > * {
    position: relative;
    z-index: 1;
}

.highlight-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.highlight-link:hover {
    text-decoration: none;
    color: inherit;
}

.highlight-item:hover {
    transform: translateY(clamp(-8px, -1.5vw, -12px)) rotateX(5deg) scale(1.02);
    box-shadow: 
        0 clamp(12px, 2.5vw, 20px) clamp(24px, 5vw, 48px) rgba(68, 105, 36, 0.25),
        0 0 0 clamp(2px, 0.5vw, 4px) rgba(68, 105, 36, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(68, 105, 36, 0.03) 50%, var(--bg-card) 100%);
    animation: none;
}

.highlight-item:hover::before {
    opacity: 1;
}

.highlight-link:hover .highlight-title {
    color: var(--accent);
    transform: translateY(-2px);
}

.highlight-item:hover .highlight-icon {
    transform: translateY(-4px) scale(1.1) rotateY(10deg);
    filter: drop-shadow(0 clamp(4px, 1vw, 8px) clamp(8px, 1.5vw, 16px) rgba(68, 105, 36, 0.3));
}

.highlight-icon {
    font-size: clamp(var(--font-5xl), 5vw, var(--font-7xl));
    margin-bottom: clamp(0.75rem, 1.5vw, 1rem);
    line-height: 1;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
    transform-style: preserve-3d;
}

.highlight-content {
    display: flex;
    flex-direction: column;
    gap: clamp(0.5rem, 1vw, 0.75rem);
}

.highlight-title {
    font-size: clamp(var(--font-xl), 2.5vw, var(--font-3xl));
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    line-height: 1.2;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.highlight-text {
    font-size: clamp(var(--font-sm), 1.5vw, var(--font-lg));
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

/* Zillow Listing Section */
.zillow-section {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-alt) 100%);
    padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 4vw, 3rem);
    margin-top: clamp(2rem, 4vw, 4rem);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.zillow-container {
    max-width: clamp(600px, 80vw, 900px);
    margin: 0 auto;
    text-align: center;
}

.zillow-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1.5rem, 3vw, 2rem);
}

.zillow-section .section-title {
    margin-bottom: clamp(0.75rem, 1.5vw, 1rem);
}

.zillow-section p {
    color: var(--text);
    font-size: clamp(var(--font-lg), 2vw, var(--font-xl));
    max-width: clamp(400px, 70vw, 600px);
    margin: 0;
}


.zillow-icon {
    font-size: clamp(var(--font-2xl), 3vw, var(--font-4xl));
    line-height: 1;
}

.zillow-arrow {
    font-size: clamp(var(--font-xl), 2.5vw, var(--font-3xl));
    line-height: 1;
    transition: transform 0.3s ease;
}

.zillow-button:hover .zillow-arrow {
    transform: translateX(5px);
}

.zillow-price-display {
    padding: clamp(1rem, 2vw, 1.5rem);
    background: var(--bg-card);
    border-radius: clamp(8px, 1.5vw, 12px);
    border: 2px solid var(--accent);
    margin: clamp(1rem, 2vw, 1.5rem) 0;
    min-width: clamp(250px, 50vw, 400px);
}

.zillow-price-label {
    font-size: clamp(var(--font-sm), 1.5vw, var(--font-md));
    color: var(--text-muted);
    margin: 0 0 clamp(0.5rem, 1vw, 0.75rem) 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.zillow-price-value {
    font-size: clamp(var(--font-4xl), 6vw, var(--font-7xl));
    font-weight: 800;
    color: var(--primary);
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.zillow-note {
    font-size: clamp(var(--font-sm), 1.5vw, var(--font-md));
    color: var(--text-muted);
    font-style: italic;
    margin-top: clamp(0.5rem, 1vw, 0.75rem);
}

/* Inline CTA Button */
.cta-inline {
    margin-top: clamp(1.5rem, 3vw, 2rem);
    display: flex;
    justify-content: center;
    gap: clamp(1rem, 2vw, 1.5rem);
    flex-wrap: wrap;
}

.cta-section .cta-inline {
    justify-content: center;
    margin-top: clamp(2rem, 4vw, 3rem);
}

/* Universal Flip Button System - Exact styling as requested */
/* Applies to all buttons across all pages */
/* Exclude hamburger menu button, carousel dots, and lightbox navigation which have their own styling */
button:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close),
.cta-button,
.zillow-button,
.cta-section a,
button.btn-flip,
a.btn-flip,
input[type="submit"]:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close),
input[type="button"]:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close),
input[type="submit"].btn-flip,
input[type="button"].btn-flip,
.submit-btn {
    opacity: 1;
    outline: 0;
    color: var(--secondary);
    line-height: clamp(36px, 4vw, 44px);
    position: relative;
    text-align: center;
    letter-spacing: clamp(0.5px, 0.1vw, 1px);
    display: inline-block;
    text-decoration: none;
    font-family: inherit;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    border-bottom: none !important;
    background: transparent;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    height: clamp(36px, 4vw, 44px);
    font-size: clamp(0.75rem, 1.5vw, 1rem);
}

button:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close):hover::after,
.cta-button:hover::after,
.zillow-button:hover::after,
.cta-section a:hover::after,
button.btn-flip:hover::after,
a.btn-flip:hover::after,
input[type="submit"]:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close):hover::after,
input[type="button"]:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close):hover::after,
input[type="submit"].btn-flip:hover::after,
input[type="button"].btn-flip:hover::after,
.submit-btn:hover::after {
    opacity: 1;
    transform: translateY(0) rotateX(0);
}

button:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close):hover::before,
.cta-button:hover::before,
.zillow-button:hover::before,
.cta-section a:hover::before,
button.btn-flip:hover::before,
a.btn-flip:hover::before,
input[type="submit"]:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close):hover::before,
input[type="button"]:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close):hover::before,
input[type="submit"].btn-flip:hover::before,
input[type="button"].btn-flip:hover::before,
.submit-btn:hover::before {
    opacity: 0;
    transform: translateY(50%) rotateX(90deg);
}

button:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close)::after,
.cta-button::after,
.zillow-button::after,
.cta-section a::after,
button.btn-flip::after,
a.btn-flip::after,
input[type="submit"]:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close)::after,
input[type="button"]:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close)::after,
input[type="submit"].btn-flip::after,
input[type="button"].btn-flip::after,
.submit-btn::after {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.5s;
    position: absolute;
    background: var(--accent-light);
    content: attr(data-back);
    transform: translateY(-50%) rotateX(90deg);
    z-index: 2;
    border-radius: clamp(4px, 0.5vw, 6px) clamp(4px, 0.5vw, 6px) 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    padding: 0 clamp(20px, 3vw, 30px);
    line-height: clamp(36px, 4vw, 44px);
    text-align: center;
    margin: 0;
    box-sizing: border-box;
}

button:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close)::before,
.cta-button::before,
.zillow-button::before,
.cta-section a::before,
button.btn-flip::before,
a.btn-flip::before,
input[type="submit"]:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close)::before,
input[type="button"]:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close)::before,
input[type="submit"].btn-flip::before,
input[type="button"].btn-flip::before,
.submit-btn::before {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 1;
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(20px, 3vw, 30px);
    line-height: clamp(36px, 4vw, 44px);
    transition: 0.5s;
    position: relative;
    background: var(--accent);
    content: attr(data-front);
    transform: translateY(0) rotateX(0);
    z-index: 1;
    border-radius: 0 0 clamp(4px, 0.5vw, 6px) clamp(4px, 0.5vw, 6px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    text-align: center;
    margin: 0;
    box-sizing: border-box;
}

/* Fallback for buttons without data-front - use button text or value */
button:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close):not([data-front])::before,
input[type="submit"]:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close):not([data-front])::before,
input[type="button"]:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close):not([data-front])::before {
    content: attr(value);
}

button:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close):not([data-front]):not([value])::before {
    content: attr(aria-label);
}

/* Fallback for buttons without data-back - use same as front */
button:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close):not([data-back])::after,
input[type="submit"]:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close):not([data-back])::after,
input[type="button"]:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close):not([data-back])::after {
    content: attr(data-front);
}

button:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close):not([data-back]):not([data-front])::after,
input[type="submit"]:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close):not([data-back]):not([data-front])::after,
input[type="button"]:not(.hamburger):not(.carousel-dot):not(.lightbox-nav):not(.lightbox-close):not([data-back]):not([data-front])::after {
    content: attr(value);
}

/* CTA Section */
.cta-section {
    background: var(--accent-super-light);
    text-align: center;
    border-radius: clamp(8px, 1.5vw, 16px);
    border: 1px solid rgba(174, 213, 129, 0.3);
    box-shadow: 0 clamp(4px, 1vw, 10px) clamp(16px, 4vw, 40px) rgba(174, 213, 129, 0.15);
    transition: var(--transition);
    padding: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: clamp(3rem, 6vw, 5rem);
    max-width: clamp(600px, 80vw, 900px);
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 10;
}

.cta-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 clamp(8px, 2vw, 20px) clamp(24px, 6vw, 60px) rgba(174, 213, 129, 0.25);
    border-color: rgba(174, 213, 129, 0.5);
}

.cta-section h2 {
    color: var(--primary);
    font-weight: 700;
    font-size: clamp(var(--font-2xl), 3vw, var(--font-4xl));
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
    opacity: 1 !important;
    transform: none !important;
    position: relative;
    z-index: 11;
}

.cta-section > p {
    color: var(--primary);
    font-size: clamp(var(--font-lg), 2vw, var(--font-xl));
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.6;
}

.cta-section p:last-of-type {
    margin-top: clamp(2rem, 4vw, 3rem);
    margin-bottom: 0;
}


.contact-info {
    font-size: var(--font-xl);
}

.cta-section .contact-info {
    margin: clamp(1.5rem, 3vw, 2rem) 0;
    text-align: center;
}

.contact-info p {
    color: var(--primary);
    margin-bottom: clamp(1rem, 2vw, 1.25rem);
}

.contact-info p:last-child {
    margin-bottom: 0;
}

.cta-section .contact-info p {
    color: var(--primary) !important;
    font-size: clamp(var(--font-md), 1.5vw, var(--font-lg));
    font-weight: 500;
}

.cta-section .contact-info a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.cta-section .contact-info a:hover {
    color: var(--accent-light);
    border-bottom-color: var(--accent-light);
}

/* Ensure all text in CTA section is dark and visible */
.cta-section,
.cta-section h2,
.cta-section h3,
.cta-section p,
.cta-section div,
.cta-section span {
    color: var(--primary) !important;
}

.cta-section a:not(.cta-button) {
    color: var(--accent) !important;
}

.cta-section a.cta-button {
    color: var(--secondary) !important;
}

.cta-section a.cta-button::before,
.cta-section a.cta-button::after {
    color: var(--secondary) !important;
}

/* Contact Layout - Side by Side */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1rem, 2vw, 1.5rem);
    align-items: start;
}

.contact-left {
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 2vw, 1.5rem);
}

.contact-left p {
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

.contact-info-box {
    background: var(--bg-alt);
    border-radius: clamp(8px, 1.5vw, 16px);
    border: 1px solid var(--border);
    box-shadow: 0 clamp(2px, 0.5vw, 4px) clamp(10px, 2vw, 20px) var(--shadow);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    margin-top: clamp(1.5rem, 3vw, 2rem);
}

.contact-info-box h3 {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

.contact-right {
    position: sticky;
    top: clamp(80px, 10vh, 120px);
}

/* Contact Form Styles */
.contact-form-container {
    width: 100%;
}

.contact-form {
    background: var(--bg-card);
    border-radius: clamp(8px, 1.5vw, 16px);
    border: 1px solid var(--border);
    box-shadow: 0 clamp(2px, 0.5vw, 4px) clamp(10px, 2vw, 20px) var(--shadow);
    padding: clamp(2rem, 4vw, 3rem);
}


.form-group {
    margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
}

.form-group:last-of-type {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    color: var(--primary);
    font-weight: 600;
    font-size: clamp(var(--font-lg), 1.8vw, var(--font-xl));
    margin-bottom: clamp(0.625rem, 1.2vw, 0.875rem);
    letter-spacing: -0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 2px solid var(--border-dark);
    border-radius: clamp(6px, 1vw, 10px);
    font-size: var(--font-xl);
    font-family: inherit;
    color: var(--text);
    background: var(--bg-alt);
    transition: all 0.3s cubic-bezier(0.76, 0, 0.24, 1);
    padding: clamp(0.875rem, 1.5vw, 1.125rem) clamp(1.125rem, 2vw, 1.5rem);
    box-shadow: 0 2px 4px var(--shadow);
    appearance: none;
    -webkit-appearance: none;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--accent-light);
    background: var(--bg);
    box-shadow: 0 2px 6px var(--shadow);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg);
    box-shadow: 0 0 0 4px var(--accent-super-light), 0 2px 8px var(--shadow-hover);
    transform: translateY(-1px);
}

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

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23446924' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right clamp(1rem, 2vw, 1.25rem) center;
    background-size: 12px;
    padding-right: clamp(2.5rem, 4vw, 3rem);
    cursor: pointer;
}

.form-group textarea {
    resize: vertical;
    min-height: clamp(100px, 18vh, 140px);
    line-height: 1.6;
}


.form-message {
    border-radius: clamp(4px, 0.8vw, 8px);
}

.form-message.success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.form-message.error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

.form-message ul {
    margin: 0;
    padding-left: clamp(0.6rem, 1.2vw, 0.9rem);
}


/* Instagram-Style Gallery Grid - Full Width, No Scroll Animations */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(200px, 25vw, 280px), 1fr));
    gap: 0;
    background: var(--bg);
    border: none;
    outline: none;
    width: 100%;
    max-width: 100%;
    margin-top: 2vh;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-card);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    margin: 0;
    padding: 0;
    transform: none !important; /* No scroll animations on gallery items */
}

.gallery-item::before {
    display: none;
}

.gallery-item:hover {
    z-index: 10;
    box-shadow: 0 clamp(4px, 1vw, 10px) clamp(16px, 4vw, 40px) var(--shadow-hover);
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transform: none;
}

/* Removed hover animations on gallery-item images */

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: var(--font-lg);
    color: var(--secondary);
    font-style: italic;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    z-index: 3;
    pointer-events: none;
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   GALLERY PREVIEW - UNIFIED SYSTEM
   Mobile: Swipeable Carousel
   Desktop: Grid Layout
   Photos ALWAYS come AFTER text
   ============================================ */

.gallery-preview {
    width: 100%;
    margin: 0.2rem 0;
}

/* Mobile: Carousel (swipeable) */
.gallery-carousel {
    display: block;
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 1rem;
}

.gallery-carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    cursor: grab;
}

.gallery-carousel-track:active {
    cursor: grabbing;
}

.gallery-carousel-slide {
    flex: 0 0 85%;
    margin-right: 1rem;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background: var(--bg-alt);
    position: relative;
}

.gallery-carousel-slide:last-child {
    margin-right: 0;
}

.gallery-carousel-slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0;
    min-width: 100%;
    min-height: 100%;
}

/* Removed active animations on carousel slide images */

/* Carousel dots - Explicitly override any button styles */
.gallery-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.gallery-carousel-dots .carousel-dot {
    /* Reset all button styles */
    all: unset;
    /* Explicit styles */
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: background 0.3s ease, transform 0.3s ease;
    /* Override button text styles */
    text-transform: none;
    font-size: 0;
    line-height: 0;
    letter-spacing: 0;
    color: transparent;
    /* Remove pseudo-elements */
    position: relative;
    display: inline-block;
}

.gallery-carousel-dots .carousel-dot::before,
.gallery-carousel-dots .carousel-dot::after {
    display: none;
    content: none;
}

.gallery-carousel-dots .carousel-dot.active {
    background: var(--accent);
    transform: scale(1.2);
}

.gallery-carousel-dots .carousel-dot:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Desktop: Grid (hidden on mobile) */
.gallery-preview-grid {
    display: none;
}

/* Desktop Grid Layout */
@media (min-width: 1024px) {
    .gallery-carousel {
        display: none;
    }
    
    .gallery-preview-grid {
        display: grid;
        gap: 1rem;
        margin-bottom: 1rem;
        width: 100%;
    }
    
    .gallery-preview-grid[data-image-count="1"] {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .gallery-preview-grid[data-image-count="2"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-preview-grid[data-image-count="3"] {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .gallery-preview-grid[data-image-count="4"] {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* For 5+ images, use 3 columns to keep images reasonably sized */
    .gallery-preview-grid[data-image-count="5"],
    .gallery-preview-grid[data-image-count="7"],
    .gallery-preview-grid[data-image-count="8"] {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Regular 6-image grids use 3 columns (2 rows) */
    .gallery-preview-grid[data-image-count="6"] {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Welcome section: Force single row of 6 images - override above rule */
    #welcome .gallery-preview-fullwidth .gallery-preview-grid[data-image-count="6"] {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: clamp(0.5rem, 1vw, 1rem);
    }
    
    /* Historic gallery section: Force single row of 6 images - same as welcome */
    #historic-gallery .gallery-preview-fullwidth .gallery-preview-grid[data-image-count="6"] {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: clamp(0.5rem, 1vw, 1rem);
    }
    
    /* Preservation section: Ensure 6 images in 2 rows of 3 */
    #preservation .gallery-preview-grid[data-image-count="6"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.gallery-preview-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    aspect-ratio: 1;
    background: var(--bg-alt);
    width: 100%;
}

/* Removed hover animations on gallery-preview-item */

.gallery-preview-item img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
}

/* Removed hover animations on gallery-preview-item images */

.gallery-preview-link {
    text-align: center;
    margin-top: 1.5rem;
}

/* Full-width gallery preview for welcome section */
.gallery-preview-fullwidth {
    width: 100%;
    max-width: 100%;
    margin: clamp(0.2rem, 0.4vw, 0.3rem) 0;
    padding: 0;
}

.gallery-preview-fullwidth .gallery-preview {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.gallery-preview-fullwidth .gallery-preview-grid {
    max-width: 100%;
    width: 100%;
}

.gallery-preview-fullwidth .gallery-carousel {
    width: 100%;
    max-width: 100%;
}


/* Comprehensive Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    padding: 0;
    z-index: 10010; /* Above sticky progress indicator (z-index: 1000) - high enough to overcome stacking context */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-sizing: border-box;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 1;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease, transform 0.2s ease;
    cursor: grab;
}

.lightbox-image:active {
    cursor: grabbing;
}

/* Simple arrow styling - not button-like - Explicitly override all button styles */
.lightbox .lightbox-close {
    /* Reset all button styles */
    all: unset;
    /* Explicit styles */
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10003; /* Above lightbox backdrop */
    background: transparent;
    border: none;
    color: white;
    font-size: 2.5rem;
    width: auto;
    height: auto;
    border-radius: 0;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: opacity 0.2s ease;
    line-height: 1;
    /* Override button text styles */
    text-transform: none;
    letter-spacing: 0;
    padding: 0;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 300;
    text-align: center;
    vertical-align: middle;
    /* Remove pseudo-elements */
}

.lightbox .lightbox-close::before {
    content: '✕';
    display: block;
    line-height: 1;
    font-size: 1em;
}

.lightbox .lightbox-close::after {
    display: none;
    content: none;
}

.lightbox .lightbox-close:hover {
    opacity: 0.7;
}

.lightbox .lightbox-nav {
    /* Reset all button styles */
    all: unset;
    /* Explicit styles */
    position: fixed;
    top: 50%;
    z-index: 10003; /* Above lightbox backdrop */
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: white;
    font-size: 2.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    font-weight: 300;
    padding: 0;
    margin: 0;
    /* Override button text styles */
    text-transform: none;
    letter-spacing: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    backdrop-filter: blur(8px);
    text-align: center;
    vertical-align: middle;
    /* Remove pseudo-elements */
}

.lightbox .lightbox-nav {
    box-sizing: border-box;
}

.lightbox .lightbox-nav::after {
    display: none;
    content: none;
}

.lightbox .lightbox-prev::before {
    content: '◀';
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    width: 100%;
    height: 100%;
    font-size: 1em;
}

.lightbox .lightbox-next::before {
    content: '▶';
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    width: 100%;
    height: 100%;
    font-size: 1em;
}

.lightbox .lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.lightbox .lightbox-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.lightbox .lightbox-prev {
    left: 2rem;
}

.lightbox .lightbox-next {
    right: 2rem;
}

.lightbox-counter {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
    .lightbox .lightbox-close {
        top: 1rem;
        right: 1rem;
        font-size: 2rem;
    }
    
    .lightbox .lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 2rem;
    }
    
    .lightbox .lightbox-prev {
        left: 0.5rem;
    }
    
    .lightbox .lightbox-next {
        right: 0.5rem;
    }
    
    .lightbox-content {
        padding: 1rem;
    }
    
    .lightbox-image {
        max-width: 95%;
        max-height: 85%;
    }
    
    .lightbox-counter {
        bottom: 1rem;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Footer */
.site-footer {
    background: var(--primary);
    color: var(--secondary);
    border-top: 1px solid rgba(232, 232, 232, 0.2);
}

.footer-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    padding: 0 clamp(1.5rem, 4vw, 3rem);
}

.footer-container p {
    color: var(--secondary);
}

.footer-container a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
    transition: var(--transition);
}

.footer-container a:hover {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        padding: 0 clamp(1rem, 3vw, 2rem);
    }
    
    
    .nav-menu {
        gap: clamp(0.6rem, 1.2vw, 0.9rem);
    }
}

/* Tablet breakpoint - 2 columns */
@media (min-width: 640px) and (max-width: 1023px) {
    .heritage-list-container {
        grid-template-columns: repeat(2, 1fr);
        gap: clamp(1.5rem, 2.5vw, 2rem);
    }
    
    .heritage-category {
        padding: clamp(1.5rem, 2.5vw, 2rem);
    }
}

/* Mobile breakpoint - single column */
@media (max-width: 639px) {
    .heritage-list-container {
        grid-template-columns: 1fr;
        gap: clamp(1.25rem, 2.5vw, 2rem);
        margin: clamp(1.5rem, 3vw, 2.5rem) 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0;
        position: fixed;
        top: 0;
        right: 0;
        width: clamp(300px, 85vw, 380px);
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(32px) saturate(180%);
        -webkit-backdrop-filter: blur(32px) saturate(180%);
        border-left: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: -4px 0 40px var(--shadow-hover);
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.5s cubic-bezier(0.76, 0, 0.24, 1);
        overflow-y: auto;
        z-index: 1001;
        padding: clamp(5rem, 10vh, 7rem) clamp(2rem, 5vw, 3rem) clamp(2rem, 4vw, 3rem);
        align-items: flex-start;
    }
    
    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: all;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        opacity: 0;
        transform: translateX(20px);
        transition: opacity 0.4s cubic-bezier(0.76, 0, 0.24, 1), transform 0.4s cubic-bezier(0.76, 0, 0.24, 1);
    }
    
    .nav-menu.active li {
        opacity: 1;
        transform: translateX(0);
    }
    
    .nav-menu.active li:nth-child(1) { transition-delay: 0.05s; }
    .nav-menu.active li:nth-child(2) { transition-delay: 0.1s; }
    .nav-menu.active li:nth-child(3) { transition-delay: 0.15s; }
    .nav-menu.active li:nth-child(4) { transition-delay: 0.2s; }
    .nav-menu.active li:nth-child(5) { transition-delay: 0.25s; }
    .nav-menu.active li:nth-child(6) { transition-delay: 0.3s; }
    .nav-menu.active li:nth-child(7) { transition-delay: 0.35s; }
    .nav-menu.active li:nth-child(8) { transition-delay: 0.4s; }
    .nav-menu.active li:nth-child(9) { transition-delay: 0.45s; }
    
    .nav-menu a {
        display: block;
        width: 100%;
        color: var(--text);
        padding: clamp(1rem, 2vw, 1.25rem) 0;
        font-size: clamp(1.125rem, 2.5vw, 1.5rem);
        font-weight: 500;
        letter-spacing: -0.02em;
    }
    
    .nav-menu a::after {
        display: none;
    }
    
    .nav-menu a:hover {
        color: var(--accent);
        transform: translateX(8px);
        padding-left: 0;
    }
    
    .main-content {
        padding: 0 clamp(1rem, 3vw, 2rem);
    }
    
    
    .content-section:first-of-type {
        padding-top: calc(clamp(0.9rem, 1.5vw, 1.2rem) + clamp(100px, 12vh, 120px));
    }
    
    .content-section:not(:first-of-type) {
        padding-bottom: clamp(2rem, 4vw, 3rem);
    }
    
    /* Mobile: Ensure titles are block-level and have proper spacing */
    .content-section .section-title {
        display: block;
        width: 100%;
        margin-bottom: clamp(0.2rem, 0.3vw, 0.25rem);
        margin-right: 0;
        clear: both;
    }
    
    /* Mobile: Prevent text overlapping with proper spacing */
    .content-section p {
        margin-bottom: clamp(0.3rem, 0.5vw, 0.4rem);
        margin-top: 0;
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
        clear: both;
    }
    
    .content-section ul {
        margin-top: clamp(0.3rem, 0.5vw, 0.4rem);
        margin-bottom: clamp(0.3rem, 0.5vw, 0.4rem);
        clear: both;
    }
    
    .content-section li {
        margin-bottom: clamp(0.2rem, 0.3vw, 0.25rem);
        padding-right: clamp(0.5rem, 1vw, 1rem);
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .content-section h3 {
        margin-top: clamp(0.3rem, 0.4vw, 0.4rem);
        margin-bottom: clamp(0.15rem, 0.25vw, 0.2rem);
        clear: both;
    }
    
    /* Mobile: Highlights intro section */
    .content-section#introduction .highlights-intro ul {
        grid-template-columns: 1fr;
        gap: clamp(0.8rem, 1.5vw, 1.2rem);
    }
    
    .content-section#introduction .highlights-intro li {
        padding-left: clamp(1.2rem, 2vw, 1.5rem);
        font-size: clamp(var(--font-base), 1.2vw, var(--font-lg));
    }
    
    .hero-section.no-image {
        padding: clamp(100px, 12vh, 120px) clamp(1rem, 3vw, 2rem) clamp(2rem, 4vw, 3rem);
        width: clamp(320px, 95vw, 1800px);
        max-width: clamp(320px, 95vw, 1800px);
    }
    
    .hero-section.no-image .hero-title {
        text-align: left;
        overflow-wrap: normal;
        word-break: keep-all;
        hyphens: none;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* On mobile, standalone images can be full width */
    .content-section img:not(.content-image img):not(.gallery-item img):not(.hero-image) {
        max-width: 100%;
    }
    
    /* Reset directional animations on mobile for heritage categories */
    .heritage-category:nth-child(odd),
    .heritage-category:nth-child(even) {
        transform: translateY(40px);
    }
    
    .heritage-category.revealed {
        transform: translateY(0);
    }
    
    /* Mobile: Ensure cards don't transform on hover */
    .heritage-category:hover {
        transform: translateY(-2px);
    }
    
    .content-grid {
        flex-direction: column;
        gap: clamp(0.6rem, 1.2vw, 0.9rem);
    }
    
    /* On mobile: right column stacks normally */
    .content-right-column {
        order: 2;
        flex-direction: column;
        width: 100%;
    }
    
    /* On mobile: number appears right after title (before text) */
    .content-grid .content-number {
        order: 1; /* First in stack, right after title */
    }
    
    .content-right-column .content-number {
        order: 1; /* First in right column on mobile */
    }
    
    .content-grid .content-text {
        order: 1; /* Always first (after number if present) */
    }
    
    .content-grid .content-image {
        order: 2; /* Always after text */
    }
    
    .content-right-column .content-image {
        order: 2; /* After number in right column on mobile */
    }
    
    /* Reset reverse direction on mobile - everything stacks normally */
    .content-grid.reverse {
        flex-direction: column;
    }
    
    /* In reverse grids on mobile, number still comes first after title */
    .content-grid.reverse .content-number {
        order: 0; /* Before everything if present */
    }
    
    .content-grid.reverse .content-text {
        order: 1; /* Always first (after number if present) */
    }
    
    .content-grid.reverse .content-image {
        order: 2; /* Always after text */
    }
    
    /* On mobile, both text and images are always visible - no animations */
    .content-grid .content-text {
        transform: none !important;
        opacity: 1 !important;
    }
    
    .content-grid .content-image {
        transform: none !important;
        opacity: 1 !important;
    }
    
    .content-image {
        position: static;
        width: 100%;
    }
    
    .content-image img {
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
    }
    
    /* Gallery previews inside content-image should be full width on mobile */
    .content-image .gallery-preview {
        width: 100%;
        margin: 0.1rem 0;
        max-width: 100%;
    }
    
    .content-image .gallery-preview-grid {
        width: 100%;
        max-width: 100%;
    }
    
    /* Ensure content-image with gallery previews doesn't have max-width constraint on mobile */
    .content-image:has(.gallery-preview) {
        max-width: 100%;
    }
    
    .content-number {
        position: static;
        top: auto;
        min-height: auto;
        padding: clamp(1.5rem, 3vw, 2rem);
    }
    
    /* Right column on mobile */
    .content-right-column {
        width: 100%;
        gap: clamp(1rem, 2vw, 1.5rem);
    }
    
    .content-right-column .content-number {
        width: 100%;
    }
    
    .content-right-column .content-image {
        width: 100%;
        max-width: 100%;
    }
    
    /* Sticky scroll container on mobile */
    .sticky-scroll-container {
        min-height: auto;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    .sticky-panel {
        position: static;
        top: auto;
        margin: 0;
        box-shadow: none;
        padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem); /* Mobile padding */
    }
    
    /* Content images inside sticky panels should also be static on mobile */
    .sticky-panel .content-image {
        position: static;
        top: auto;
    }
    
    .hero-section {
        height: 70vh;
        min-height: clamp(400px, 50vh, 500px);
        margin-top: 0;
    }
    
    .hero-section.no-image {
        margin-top: clamp(35px, 5vh, 50px); /* Account for shorter header on mobile */
    }
    
    
    .contact-layout {
        grid-template-columns: 1fr;
        gap: clamp(0.9rem, 1.5vw, 1.2rem);
    }
    
    .contact-right {
        position: static;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 25vw, 200px), 1fr));
    }
    
    /* Gallery preview grids on mobile */
    .gallery-preview {
        margin: 0.1rem 0;
    }
    
    .gallery-preview-grid {
        gap: 0.5rem;
    }
    
    .gallery-preview-item {
        border-radius: 6px;
    }
    
    /* Welcome section gallery on mobile - use carousel (default behavior) */
    #welcome .gallery-preview-fullwidth .gallery-preview-grid {
        display: none; /* Hide grid on mobile, use carousel */
    }
    
    #welcome .gallery-preview-fullwidth .gallery-carousel {
        display: block; /* Show carousel on mobile */
    }
    
    /* Facade sections on mobile */
    .facade-sections {
        gap: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .facade-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    /* Heritage gallery preview on mobile */
    .heritage-gallery-preview {
        margin: 1.5rem 0;
        padding: 1.5rem 0;
    }
    
    /* Interior overview gallery on mobile */
    .interior-overview-gallery {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }
    
    
    /* Mobile: Heritage categories stack vertically */
    .heritage-category {
        padding: clamp(1.25rem, 2.5vw, 1.75rem);
        border-radius: clamp(10px, 1.8vw, 16px);
    }
    
    .heritage-category-image {
        height: clamp(220px, 50vh, 220px);
        margin-bottom: clamp(0.875rem, 1.75vw, 1.25rem);
    }
    
    .heritage-category-title {
        font-size: clamp(var(--font-lg), 1.8vw, var(--font-xl));
        margin-bottom: clamp(0.875rem, 1.75vw, 1.25rem);
        padding-bottom: clamp(0.625rem, 1.25vw, 0.875rem);
    }
    
    .content-section.heritage-renewal .heritage-list {
        gap: clamp(0.625rem, 1.25vw, 0.875rem);
    }
    
    .content-section.heritage-renewal .heritage-list li {
        padding: clamp(0.4rem, 0.8vw, 0.625rem) 0 clamp(0.4rem, 0.8vw, 0.625rem) clamp(1.5rem, 2.2vw, 2rem);
        font-size: clamp(var(--font-sm), 1vw, var(--font-base));
    }
    
    /* Highlights section mobile */
    .highlights-stats {
        grid-template-columns: 1fr;
        gap: clamp(1.5rem, 3vw, 2rem);
        padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2rem);
        margin-bottom: 0;
        justify-items: center;
        align-items: center;
    }
    
    .highlight-stat {
        padding: clamp(1rem, 2vw, 1.5rem);
        max-width: clamp(250px, 80vw, 400px);
        width: 100%;
    }
    
    .highlight-stat-link {
        grid-column: span 1;
        max-width: clamp(250px, 80vw, 400px);
        width: 100%;
    }
    
    /* Button mobile styles */
    .zillow-button,
    .cta-button,
    .cta-section a {
        width: 100%;
        justify-content: center;
        /* Maintain responsive height from main button styles */
        /* padding removed to preserve flip animation pseudo-elements */
    }
    
    .cta-inline {
        justify-content: center;
    }
    
    /* Setting section mobile */
    .setting-container {
        padding: clamp(2rem, 4vw, 3rem) 0;
    }
    
    .setting-header {
        margin-bottom: clamp(2rem, 4vw, 3rem);
    }
    
    .setting-features {
        grid-template-columns: 1fr;
        gap: clamp(1.5rem, 3vw, 2rem);
        margin-bottom: clamp(2.5rem, 5vw, 4rem);
    }
    
    .setting-feature {
        padding: clamp(1.25rem, 2.5vw, 2rem);
    }
    
    .setting-recognition {
        padding: clamp(1.5rem, 3vw, 2rem);
    }
    
    .setting-publications {
        flex-direction: column;
        align-items: center;
        gap: clamp(0.75rem, 1.5vw, 1rem);
    }
    
    /* Center publications buttons in welcome section on mobile */
    .content-section#welcome .setting-publications {
        align-items: center;
    }
    
    .setting-publications .cta-button {
        width: 100%;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(clamp(120px, 30vw, 150px), 1fr));
        gap: clamp(0.5px, 0.1vw, 1px);
    }
}

/* Smooth scrollbar - Paper Tiger inspired */
::-webkit-scrollbar {
    width: clamp(6px, 1vw, 10px);
}

::-webkit-scrollbar-track {
    background: var(--bg-alt);
}

::-webkit-scrollbar-thumb {
    background: rgba(68, 105, 36, 0.4);
    border-radius: clamp(3px, 0.5vw, 5px);
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Content images fade in - handled by directional animations (.revealed class) */
/* Removed conflicting .content-section.visible .content-image rule - images use .revealed class */

/* Quote Popouts - Beautiful highlighted quotes */
.quote-popout {
    position: relative;
    padding: clamp(1rem, 2vw, 1.5rem);
    margin: clamp(1rem, 2vw, 1.5rem) 0;
    background: linear-gradient(135deg, rgba(125, 172, 84, 0.5) 0%, var(--accent-super-light) 100%);
    border-radius: clamp(8px, 1.5vw, 12px);
    box-shadow: 0 clamp(4px, 1vw, 8px) clamp(16px, 3vw, 24px) rgba(68, 105, 36, 0.1);
    font-style: italic;
    font-size: clamp(var(--font-lg), 2vw, var(--font-xl));
    line-height: 1.8;
    color: var(--text-light);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quote-popout:hover {
    transform: translateY(-2px);
    box-shadow: 0 clamp(6px, 1.5vw, 12px) clamp(24px, 4vw, 32px) rgba(68, 105, 36, 0.15);
}

.quote-popout::before {
    content: '"';
    position: absolute;
    top: clamp(0.5rem, 1vw, 1rem);
    left: clamp(1rem, 2vw, 1.5rem);
    font-size: clamp(var(--font-5xl), 6vw, var(--font-7xl));
    color: var(--accent);
    opacity: 0.2;
    font-family: Georgia, serif;
    line-height: 1;
    pointer-events: none;
}

.quote-popout p {
    margin: 0 auto;
    margin-bottom: 0 !important;
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 100%;
    padding-left: clamp(2.5rem, 5vw, 4rem);
    padding-right: clamp(2.5rem, 5vw, 4rem);
}

/* Related Pages Navigation Section */
.related-pages-section {
    margin: clamp(3rem, 6vw, 5rem) 0;
    padding: clamp(2rem, 4vw, 3rem) 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.related-pages-title {
    font-size: clamp(var(--font-2xl), 3vw, var(--font-3xl));
    font-weight: 600;
    color: var(--text);
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
    text-align: center;
}

.related-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(200px, 25vw, 280px), 1fr));
    gap: clamp(1rem, 2vw, 1.5rem);
    margin-top: clamp(1.5rem, 3vw, 2rem);
}

.related-page-link {
    display: flex;
    align-items: center;
    padding: clamp(1rem, 2vw, 1.25rem);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: clamp(8px, 1.5vw, 12px);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.related-page-link:hover {
    background: var(--accent-super-light);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(68, 105, 36, 0.15);
    color: var(--accent);
}

.related-page-link::after {
    content: '→';
    margin-left: auto;
    font-size: clamp(var(--font-lg), 2vw, var(--font-xl));
    opacity: 0.6;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.related-page-link:hover::after {
    transform: translateX(4px);
    opacity: 1;
}

/* Prevent number animation on specific spans */
.no-count-number {
    display: inline;
}

.no-count-number * {
    pointer-events: none;
}

/* About page specific improvements */
#about-content .content-text p {
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
    text-align: justify;
    hyphens: auto;
}

#about-content .content-text h3 {
    margin-top: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: clamp(0.75rem, 1.5vw, 1rem);
    font-size: clamp(var(--font-xl), 2.5vw, var(--font-2xl));
    color: var(--accent);
    font-weight: 600;
}

#about-content .content-text ul {
    margin: clamp(1rem, 2vw, 1.5rem) 0;
    padding-left: clamp(1.5rem, 3vw, 2rem);
}

#about-content .content-text li {
    margin-bottom: clamp(0.5rem, 1vw, 0.75rem);
    line-height: 1.7;
}

#about-content .content-text strong {
    color: var(--accent);
    font-weight: 600;
}

/* Floor Plan Viewer Styles */
#floorplan-viewer {
    width: 100%;
    height: clamp(400px, 60vh, 800px);
    min-height: 400px;
    background: var(--bg-alt);
    border: 3px solid var(--border-dark);
    border-radius: clamp(4px, 0.5vw, 8px);
    box-shadow: 0 2px 8px var(--shadow);
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
    display: block;
}

/* Ensure floor plan viewer respects content-image container borders */
.content-image #floorplan-viewer {
    border: 3px solid var(--border-dark);
    border-radius: clamp(8px, 1.5vw, 16px);
    overflow: hidden;
    display: block;
}

/* OpenSeadragon Container Overrides */
.openseadragon-container {
    width: 100% !important;
    height: 100% !important;
    background: var(--bg-alt) !important;
    border-radius: inherit !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Ensure OpenSeadragon doesn't cover the border - position it inside */
#floorplan-viewer .openseadragon-container {
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* OpenSeadragon Navigator (Overview Map) */
.openseadragon-container .navigator {
    bottom: clamp(10px, 1.5vw, 20px) !important;
    right: clamp(10px, 1.5vw, 20px) !important;
    width: clamp(120px, 15vw, 180px) !important;
    height: clamp(120px, 15vw, 180px) !important;
    border: 2px solid var(--border-dark) !important;
    border-radius: clamp(4px, 0.5vw, 8px) !important;
    box-shadow: 0 2px 8px var(--shadow) !important;
    background: var(--bg) !important;
}

/* OpenSeadragon Controls Styling */
.openseadragon-container .openseadragon-controls {
    top: clamp(10px, 1.5vw, 20px) !important;
    left: clamp(10px, 1.5vw, 20px) !important;
}

.openseadragon-container .openseadragon-button {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid var(--border) !important;
    border-radius: clamp(4px, 0.5vw, 6px) !important;
    box-shadow: 0 2px 4px var(--shadow) !important;
    transition: var(--transition) !important;
}

.openseadragon-container .openseadragon-button:hover {
    background-color: var(--bg) !important;
    box-shadow: 0 4px 8px var(--shadow-hover) !important;
    transform: translateY(-1px) !important;
}

/* Mobile Responsive Adjustments for Floor Plan Viewer */
@media (max-width: 768px) {
    #floorplan-viewer {
        height: clamp(300px, 50vh, 500px);
    }
    
    .openseadragon-container .navigator {
        width: clamp(80px, 20vw, 120px) !important;
        height: clamp(80px, 20vw, 120px) !important;
        bottom: clamp(5px, 1vw, 10px) !important;
        right: clamp(5px, 1vw, 10px) !important;
    }
}

