/* HangzhouLease — shared site chrome (matches index.asp) */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #e0e7ff;
    --secondary: #ec4899;
    --accent: #14b8a6;
    --dark: #0f172a;
    --dark-lighter: #1e293b;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light: #f8fafc;
    --white: #ffffff;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --radius-sm: 0.375rem;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: Georgia, 'Times New Roman', serif;
    /* legacy styles.css aliases */
    --primary-color: var(--primary);
    --primary-dark: #4f46e5;
    --text-color: var(--dark);
    --text-light: var(--gray);
    --background-light: var(--light);
    --border-radius: var(--radius);
    --font-heading: var(--font-sans);
    --font-body: var(--font-sans);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.site-body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
    margin: 0;
    overflow-x: hidden;
}
body.site-body main.site-main { padding-top: 0; }

.fas, .far, .fa-solid { font-family: "Font Awesome 6 Free" !important; font-weight: 900; }
.fab, .fa-brands { font-family: "Font Awesome 6 Brands" !important; font-weight: 400; }

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.9);
    transition: var(--transition);
}
header#header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-lg);
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    gap: 1rem;
}
.logo a {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    white-space: nowrap;
}
nav#navLinks ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
}
nav#navLinks a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    transition: var(--transition);
}
nav#navLinks a:hover,
nav#navLinks a.active { color: var(--primary); }
nav#navLinks a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}
nav#navLinks a:hover::after,
nav#navLinks a.active::after { width: 100%; }

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    align-items: center;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--dark);
    margin: 3px 0;
    border-radius: 2px;
    transition: var(--transition);
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -4px); }

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 998;
}
.nav-overlay.active { opacity: 1; visibility: visible; }

@media (max-width: 991px) {
    .hamburger { display: flex; }
    nav#navLinks {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(320px, 85vw);
        height: 100vh;
        background: var(--white);
        box-shadow: var(--shadow-xl);
        transition: var(--transition);
        z-index: 999;
    }
    nav#navLinks.active { right: 0; }
    nav#navLinks ul {
        flex-direction: column;
        padding: 5rem 1.5rem 2rem;
        gap: 1.25rem;
        align-items: flex-start;
    }
}

/* Page hero (inner pages) */
.page-hero,
.section.page-hero-top {
    margin-top: 64px;
    padding: 3.5rem 0 2.5rem;
    background: linear-gradient(160deg, #1e3a5f 0%, #334155 45%, #475569 100%);
    color: var(--white);
    text-align: center;
}
.page-hero h1,
.page-hero .hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 900;
    margin: 0 0 0.75rem;
    line-height: 1.2;
}
.page-hero p,
.page-hero .hero-subtitle {
    max-width: 640px;
    margin: 0 auto;
    opacity: 0.92;
    font-size: 1.05rem;
    line-height: 1.65;
}

/* Sections & typography */
.section { padding: 3rem 0 4rem; }
.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 0.75rem;
}
.section-subtitle { color: var(--gray); max-width: 640px; margin: 0 auto; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    font-size: 0.95rem;
    border: none;
}
.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary-light);
}
.btn-secondary:hover { background: var(--primary-light); }

.search-box { margin-bottom: 2rem; }
.search-box form,
.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}
.search-input {
    flex: 1;
    min-width: 200px;
    max-width: 480px;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
    font-size: 1rem;
}
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2.5rem;
}
.pagination a,
.pagination b,
.pagination span {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
}
.pagination a {
    background: var(--white);
    color: var(--dark);
    box-shadow: var(--shadow-sm);
}
.pagination a:hover { background: var(--primary); color: var(--white); }
.pagination b { background: var(--primary); color: var(--white); }

/* Footer */
footer.site-footer {
    background: var(--dark);
    color: var(--white);
    padding: 3.5rem 0 1.5rem;
    margin-top: 3rem;
}
footer.site-footer .footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}
footer.site-footer .footer-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 0.75rem;
}
footer.site-footer .footer-text { color: var(--gray-light); line-height: 1.6; margin-bottom: 1rem; font-size: 0.95rem; }
footer.site-footer .footer-title { font-weight: 700; margin-bottom: 1rem; font-size: 1rem; }
footer.site-footer .footer-links { list-style: none; margin: 0; padding: 0; }
footer.site-footer .footer-links li { margin-bottom: 0.5rem; }
footer.site-footer .footer-links a {
    color: var(--gray-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}
footer.site-footer .footer-links a:hover { color: var(--white); }
footer.site-footer .footer-social { display: flex; gap: 0.75rem; }
footer.site-footer .social-link {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-decoration: none;
}
footer.site-footer .social-link:hover { background: var(--primary); }
footer.site-footer .footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    text-align: center;
    color: var(--gray-light);
    font-size: 0.875rem;
}

.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 900;
    box-shadow: var(--shadow-lg);
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-3px); }

/* Map page top bar */
.site-map-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.site-map-bar .logo a { font-size: 1.15rem; }
.site-map-bar nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}
.site-map-bar nav a {
    text-decoration: none;
    color: var(--dark);
    font-size: 0.8rem;
    font-weight: 500;
}
.site-map-bar nav a:hover { color: var(--primary); }
body.map-page #container { height: calc(100vh - 52px); margin-top: 52px; }
body.map-page .map-controls { top: 62px; }

/* Override legacy #header from styles.css when both loaded */
body.site-body #header.header-scrolled,
body.site-body #header { padding: 0; }

/* Property cards (same as index.asp) */
.properties-section-early { padding-top: 2rem; }
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}
/* Override legacy styles.css flex + calc(33%) widths when both sheets load */
body.site-body .properties-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)) !important;
    gap: 2rem !important;
    width: 100% !important;
    flex-wrap: unset !important;
    justify-content: unset !important;
}
body.site-body .properties-grid .property-card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    border: none;
    box-sizing: border-box;
    flex: none !important;
}
.property-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}
.property-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}
.property-image-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.property-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}
.image-carousel {
    position: relative;
    height: 100%;
}
.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.carousel-slide.active { opacity: 1; }
.property-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.property-card:hover .property-img { transform: scale(1.05); }
.property-description { padding: 1.5rem; }
.property-date {
    font-size: 0.8rem;
    color: var(--gray-light);
    margin-bottom: 0.75rem;
}
.des-container {
    max-height: 140px;
    overflow-y: auto;
    margin-bottom: 1.25rem;
    color: var(--gray);
    line-height: 1.75;
    word-wrap: break-word;
    font-family: var(--font-sans), "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}
.property-buttons {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}
.property-buttons .btn {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}
.properties-grid .property-buttons .btn-primary {
    background: var(--primary);
    color: var(--white);
}
.properties-grid .property-buttons .btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary-light);
}
.properties-grid .property-buttons .btn-secondary:hover {
    background: var(--primary-light);
}
@media (max-width: 768px) {
    .properties-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    body.site-body .properties-grid .property-card {
        width: 100% !important;
    }
}
