/**
 * Go Secluded — mobile-first shared layout (touch-friendly, no horizontal scroll)
 */

@import url('https://fonts.googleapis.com/css2?family=Sacramento&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400&family=Noto+Serif+SC:wght@400;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* Autography: place Autography.woff2 (and optionally .woff) in assets/fonts/ to use */
@font-face {
    font-family: 'Autography';
    src: url('../fonts/Autography.woff2') format('woff2'),
         url('../fonts/Autography.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Typography: headlines = Playfair Display, body EN = Lora, Chinese = Noto Serif SC */
:root {
    --font-heading: 'Playfair Display', 'Noto Serif SC', serif;
    --font-body: Lora, 'Noto Serif SC', serif;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--color-cloud-white, #FAFAFA);
    color: var(--color-stone-gray, #424242);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    padding-top: calc(78px + env(safe-area-inset-top, 0px)); /* space for fixed header */
}

a { text-decoration: none; color: inherit; }

/* Headlines: Playfair Display (EN) / Noto Serif SC (Chinese) */
h1, h2, h3, h4, h5, h6,
.hero-title,
.hero-subtitle,
.footer-heading,
.secondary-title,
.explore-tagline {
    font-family: var(--font-heading);
}

a, button {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Minimum touch target ~44px (Apple HIG / Material) */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: max(4vw, env(safe-area-inset-left, 0px));
    padding-right: max(4vw, env(safe-area-inset-right, 0px));
}

@media (min-width: 480px) {
    .container {
        padding-left: max(20px, env(safe-area-inset-left, 0px));
        padding-right: max(20px, env(safe-area-inset-right, 0px));
    }
}

/* ----- Site header (mobile: hamburger + drawer) ----- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(161, 136, 127, 0.5); /* translucent so hero video shows through */
    color: #fff;
    padding: 4px 0;
    padding-top: max(4px, env(safe-area-inset-top));
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 70px;
}

.logo-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    padding: 2px 0 0;
    gap: 0;
}
.logo-img {
    height: 48px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    display: block;
}

.logo-wordmark {
    font-family: 'Autography', 'Sacramento', cursive;
    font-size: 1.15rem;
    line-height: 1.2;
    color: #fff;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

@media (min-width: 480px) {
    .logo-img { height: 52px; max-width: 180px; }
    .logo-wordmark { font-size: 1.35rem; }
}

/* Hamburger: visible only on small screens */
.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,0.95);
    cursor: pointer;
    border-radius: 8px;
    font-size: 1.25rem;
    -webkit-tap-highlight-color: transparent;
}
.nav-toggle:hover,
.nav-toggle:focus-visible {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.nav-toggle[aria-expanded="true"] {
    background: rgba(255,255,255,0.2);
}

@media (min-width: 768px) {
    .nav-toggle { display: none; }
}

/* Nav: drawer on mobile, row on desktop */
.main-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(300px, 85vw);
    height: 100vh;
    height: 100dvh;
    background: #A1887F; /* RGB: 161, 136, 127 - match header */
    padding: 60px 20px 24px;
    padding-top: max(60px, calc(env(safe-area-inset-top, 0px) + 52px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
    transform: translateX(100%);
    transition: transform 0.25s ease, visibility 0.25s;
    visibility: hidden;
    z-index: 99;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.main-nav.is-open {
    transform: translateX(0);
    visibility: visible;
}

.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 98;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.nav-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 768px) {
    .main-nav {
        position: static;
        width: auto;
        height: auto;
        padding: 0;
        transform: none;
        visibility: visible;
        background: transparent;
        overflow: visible;
    }
    .nav-backdrop { display: none; }
}

.main-nav .nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@media (min-width: 768px) {
    .main-nav .nav-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px 8px;
    }
}

.main-nav a {
    display: block;
    color: rgba(255,255,255,0.95);
    font-weight: 500;
    padding: 12px 14px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.main-nav a:hover,
.main-nav a:focus-visible {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

@media (min-width: 768px) {
    .main-nav a {
        padding: 8px 12px;
        min-height: 36px;
        display: inline-flex;
    }
}

/* Lang switch: touch-friendly */
.lang-switch {
    font-size: 15px;
    color: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-switch a {
    padding: 10px 12px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
}

.lang-switch a:hover,
.lang-switch a:focus-visible {
    background: rgba(255,255,255,0.15);
}

.lang-switch a.active {
    font-weight: 700;
    text-decoration: underline;
}

@media (min-width: 768px) {
    .lang-switch a {
        padding: 6px 10px;
        min-height: 36px;
    }
}

/* ----- Secondary header (sub-pages) ----- */
.secondary-header {
    padding: 20px 0;
    margin-bottom: 24px;
}

.secondary-header-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.secondary-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.3;
}

.secondary-header .search-wrap {
    width: 100%;
}

.secondary-header .search-input {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px; /* prevents zoom on focus on iOS */
    background: rgba(255,255,255,0.95);
    color: #333;
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
}

.secondary-header .search-input::placeholder {
    color: #757575;
}

@media (min-width: 480px) {
    .secondary-header {
        padding: 24px 0;
        margin-bottom: 32px;
    }
    .secondary-header-inner {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }
    .secondary-title { font-size: 1.75rem; }
    .secondary-header .search-wrap {
        flex: 1;
        min-width: 200px;
        max-width: 360px;
    }
    .secondary-header .search-input {
        min-height: 44px;
        padding: 10px 16px;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* ----- Footer ----- */
.site-footer {
    background: var(--color-stone-gray, #424242);
    color: var(--color-cloud-white, #FAFAFA);
    padding: 12px 0 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    margin-top: 0;
}

/* Footer over hero video (index only): original background at 40% opacity */
.site-footer--over-video {
    position: relative;
    z-index: 2;
    background: rgba(66, 66, 66, 0.4); /* fallback */
    background: color-mix(in srgb, var(--color-stone-gray, #424242) 40%, transparent);
    margin-top: 0;
}

/* Mobile: video ends at footer — solid footer background so video doesn't show through */
@media (max-width: 767px) {
    .site-footer--over-video {
        background: var(--color-stone-gray, #424242);
    }
}

.footer-heading {
    font-size: 1.2rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

@media (min-width: 640px) {
    .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

.footer-block {
    min-height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Mobile: expandable address block */
.footer-block--expandable .footer-expand-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    min-height: 44px;
}

.footer-block--expandable .footer-expand-toggle:focus-visible {
    outline: 2px solid var(--color-calm-teal, #4DB6AC);
    outline-offset: 2px;
}

.footer-block--expandable .footer-expand-toggle .footer-label {
    margin-bottom: 0;
}

.footer-expand-icon {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: 8px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.footer-block--expandable.is-expanded .footer-expand-icon {
    transform: rotate(-135deg);
}

.footer-block--expandable .footer-address-value {
    margin-top: 4px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.2s ease;
}

.footer-block--expandable.is-expanded .footer-address-value {
    max-height: 500px;
    opacity: 1;
}

@media (min-width: 640px) {
    .footer-block--expandable .footer-expand-toggle {
        cursor: default;
        pointer-events: none;
    }
    .footer-block--expandable .footer-expand-toggle .footer-expand-icon {
        display: none;
    }
    .footer-block--expandable .footer-address-value {
        max-height: none;
        opacity: 1;
        margin-top: 4px;
        display: block !important;
    }
}

.footer-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 4px;
}

.footer-value {
    font-size: 1rem;
    line-height: 1.5;
    word-break: break-word;
}

.footer-wechat-qr {
    display: block;
    width: 100px;
    height: auto;
    margin: 4px 0 0;
    border-radius: 8px;
}

.footer-copy {
    font-size: 0.8125rem;
    opacity: 0.8;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

/* ----- Hero with video background ----- */
.hero-video-wrap {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    margin-top: calc(-78px - env(safe-area-inset-top, 0px)); /* pull up so video sits behind fixed header */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
}

/* Single video stretches to fill entire wrap (hero + main + footer) */
.hero-video-wrap video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.hero-video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1;
}

.hero-video-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px 16px;
    padding-top: calc(90px + env(safe-area-inset-top, 0px)); /* clear of fixed header so title is readable */
    width: 100%;
    min-height: 98vh;
    min-height: 98dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-video-content .hero-title {
    font-size: clamp(1.5rem, 5vw, 2.75rem);
    font-weight: 700;
    margin-bottom: 10px;
    color: #BDBDBD;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.hero-video-content .hero-subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    margin-bottom: 20px;
    color: #BDBDBD;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.hero-video-content .btn-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 14px 28px;
    background: var(--color-calm-teal, #4DB6AC);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px;
    opacity: 0.5;
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
}

.hero-video-content .btn-hero:hover,
.hero-video-content .btn-hero:focus-visible {
    background: #389e94;
    transform: translateY(-1px);
    opacity: 1;
}

/* Poster image until video plays */
.hero-video-wrap .hero-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    z-index: 0;
}

.hero-video-wrap video.loaded ~ .hero-poster {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

@media (min-width: 768px) {
    .hero-video-wrap { min-height: 85vh; min-height: 85dvh; }
    .hero-video-content { padding: 24px; }
}

/* ----- Sub-pages: full-bleed background image (same layout as index) ----- */
.subpage-hero-wrap {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    margin-top: calc(-78px - env(safe-area-inset-top, 0px));
    padding-top: calc(78px + env(safe-area-inset-top, 0px)); /* clear fixed header so secondary header sits right below */
    background-color: #5D4037; /* fallback when image not loaded */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.subpage-hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1;
}

.subpage-hero-spacer {
    position: relative;
    z-index: 0;
    min-height: 0; /* secondary header sits right below top header; image continues behind and below */
}

@media (min-width: 768px) {
    .subpage-hero-spacer { min-height: 0; }
}

.subpage-hero-wrap .secondary-header {
    position: relative;
    z-index: 2;
    margin-top: 0;
    margin-bottom: 0;
}

.subpage-hero-wrap .secondary-header .container {
    padding-top: 24px;
    padding-bottom: 24px;
}

.subpage-hero-wrap main.main-content {
    position: relative;
    z-index: 2;
    margin-bottom: 48px;
}

@media (min-width: 768px) {
    .subpage-hero-wrap .secondary-header .container {
        padding-top: 28px;
        padding-bottom: 28px;
    }
    .subpage-hero-wrap main.main-content { margin-bottom: 64px; }
}

/* ----- Main content area ----- */
main.container {
    padding-top: 32px;
    padding-bottom: 40px;
}

/* Index: space between explore bar and footer; footer peeks ~25% on load */
.hero-video-wrap main.main-content--hero-bar {
    margin-bottom: 48px;
}

/* Index explore section: same color and opacity as header bar, over hero video */
.main-content--hero-bar {
    background: rgba(161, 136, 127, 0.5);
    color: rgba(255, 255, 255, 0.95);
    margin-top: -120px;
    position: relative;
    z-index: 2;
}

.main-content--hero-bar .explore-tagline {
    text-align: center;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
}

@media (min-width: 768px) {
    main.container {
        padding-top: 48px;
        padding-bottom: 56px;
    }
    .hero-video-wrap main.main-content--hero-bar {
        margin-bottom: 64px;
    }
}

/* Prevent focus ring being cut off */
main:focus-visible,
.site-footer a:focus-visible {
    outline: 2px solid var(--color-calm-teal, #4DB6AC);
    outline-offset: 2px;
}
