/* =============================================================
   IMPORTS
   ============================================================= */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500;1,600&display=swap');

/* =============================================================
   CSS VARIABLES
   ============================================================= */
:root {
    --color-bg-dark:  #1B2354;
    --color-bg-main:  #39499D;
    --color-bg-soft:  #6271B4;
    --color-text:     #F4F1E8;
    --color-line:     rgba(244, 241, 232, 0.25);
    --font-main:      'Cormorant Garamond', Georgia, serif;
    --max-content:    700px;
    --spacing-page:   4rem;
}

/* =============================================================
   BASE STYLES
   ============================================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--color-text);
    background-color: var(--color-bg-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =============================================================
   BACKGROUND
   Uses a fixed pseudo-element for iOS compatibility.
   ============================================================= */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

body.page-home::before {
    background-image: url('../assets/background/bg-mobile-home.png');
}

body.page-internal::before {
    background-image: url('../assets/background/bg-mobile-page.png');
}

@media (min-width: 768px) {
    body.page-home::before {
        background-image: url('../assets/background/bg-home.png');
    }
    body.page-internal::before {
        background-image: url('../assets/background/bg-page.png');
    }
}

/* =============================================================
   LAYOUT
   ============================================================= */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem 2rem;
}

/* =============================================================
   HEADER
   ============================================================= */
.site-header {
    padding: 1.5rem;
    position: relative;
    z-index: 10;
}

.header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    max-width: 480px;
    margin: 0 auto;
}

.header-symbol {
    width: 44px;
    height: auto;
    opacity: 0.9;
}

.header-symbol:first-child {
    justify-self: end;
}

.header-symbol:last-child {
    justify-self: start;
}

/* =============================================================
   BURGER BUTTON
   ============================================================= */
.burger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: center;
    transition: opacity 0.2s;
    justify-self: center;
}

.burger-btn:hover,
.burger-btn:focus-visible {
    opacity: 0.65;
    outline: none;
}

.burger-btn span {
    display: block;
    width: 26px;
    height: 1px;
    background-color: var(--color-text);
}

/* =============================================================
   NAV OVERLAY
   ============================================================= */
.nav-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(27, 35, 84, 0.97);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.nav-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}

.nav-close {
    position: absolute;
    top: 1.5rem;
    right: 1.75rem;
    background: none;
    border: none;
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.45;
    padding: 0.5rem;
    transition: opacity 0.2s;
}

.nav-close:hover,
.nav-close:focus-visible {
    opacity: 1;
    outline: none;
}

.nav-overlay ul {
    list-style: none;
    text-align: center;
    padding: 0;
}

.nav-overlay li {
    margin: 1rem 0;
}

.nav-overlay a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.nav-overlay a:hover,
.nav-overlay a:focus-visible,
.nav-overlay a.active {
    opacity: 1;
    outline: none;
}

/* =============================================================
   HOMEPAGE
   ============================================================= */
.home-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 0 2rem;
}

.home-pre-title {
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
    opacity: 1;
    text-shadow: 0 2px 18px rgba(0,0,0,0.45);
}

.home-signature {
    width: min(420px, 92vw);
    height: auto;
    margin: 0 auto;
    filter: drop-shadow(0 2px 16px rgba(0,0,0,0.4));
}

.home-subtitle {
    margin-top: 0.5rem;
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    opacity: 1;
    text-shadow: 0 2px 18px rgba(0,0,0,0.45);
}

.home-separator {
    display: block;
    width: 48px;
    height: 1px;
    background: var(--color-line);
    margin: 1.75rem auto;
}

.home-tagline-1 {
    font-size: 1.6rem;
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.04em;
    opacity: 1;
    text-shadow: 0 2px 14px rgba(0,0,0,0.4);
}

.home-tagline-2 {
    margin-top: 0.4rem;
    font-size: 1.6rem;
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.04em;
    opacity: 1;
    text-shadow: 0 2px 14px rgba(0,0,0,0.4);
}

/* =============================================================
   INTERNAL PAGE — HEADER
   ============================================================= */
.page-header {
    width: 100%;
    max-width: 480px;
    text-align: center;
    margin-bottom: 2rem;
    padding-top: 0.5rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 300;
    letter-spacing: 0.06em;
    line-height: 1.25;
    text-shadow: 0 1px 8px rgba(0,0,0,0.35);
}

.page-divider {
    display: block;
    width: 48px;
    height: 1px;
    background: var(--color-line);
    margin: 1.5rem auto 0;
}

/* =============================================================
   INTERNAL PAGE — IMAGE
   ============================================================= */
.page-image-wrapper {
    width: min(300px, 80vw);
    height: min(300px, 80vw);
    margin: 0 auto 2.5rem;
    flex-shrink: 0;
}

.page-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    -webkit-mask-image: radial-gradient(circle, black 42%, transparent 70%);
    mask-image: radial-gradient(circle, black 42%, transparent 70%);
}

/* =============================================================
   INTERNAL PAGE — CONTENT
   ============================================================= */
.page-content {
    width: 80%;
    max-width: 600px;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 300;
    line-height: 2;
    color: var(--color-text);
    text-shadow: 0 1px 8px rgba(0,0,0,0.35);
}

.page-content p {
    margin-bottom: 1.5rem;
}

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

.page-content h2 {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    opacity: 0.85;
}

.page-content h2:first-child {
    margin-top: 0;
}

.page-content em {
    font-style: italic;
    opacity: 0.9;
}

/* List */
.page-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
}

.page-content ul li {
    padding: 0.3rem 0 0.3rem 1.25rem;
    position: relative;
    opacity: 0.9;
}

.page-content ul li::before {
    content: '—';
    position: absolute;
    left: 0;
    opacity: 0.4;
}

/* Schedule table */
.schedule {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0 1.5rem;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.7;
}

.schedule tr {
    border-bottom: 1px solid var(--color-line);
}

.schedule tr:first-child {
    border-top: 1px solid var(--color-line);
}

.schedule td {
    padding: 0.75rem 0.5rem;
    vertical-align: top;
}

.schedule td:first-child {
    white-space: nowrap;
    opacity: 0.85;
    padding-right: 2rem;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

/* =============================================================
   CONTACT PAGE
   ============================================================= */
.contact-content {
    width: 100%;
    max-width: var(--max-content);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
    text-align: center;
}

.contact-email {
    font-size: 1.3rem;
}

.contact-email a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 300;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--color-line);
    padding-bottom: 3px;
    transition: border-color 0.25s;
}

.contact-email a:hover,
.contact-email a:focus-visible {
    border-color: rgba(244, 241, 232, 0.75);
    outline: none;
}

.contact-closing {
    font-size: 1.4rem;
    font-weight: 300;
    font-style: italic;
    line-height: 1.9;
    text-shadow: 0 1px 8px rgba(0,0,0,0.35);
}

.contact-chinese-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 160px;
}

.contact-chinese-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.08) 45%, transparent 72%);
    pointer-events: none;
}

.contact-chinese {
    width: 72px;
    height: auto;
    position: relative;
    z-index: 1;
}

/* =============================================================
   RESPONSIVE — TABLET 768px+
   ============================================================= */
@media (min-width: 768px) {
    html {
        font-size: 19px;
    }

    .site-header {
        padding: 1.75rem 2rem;
    }

    .header-inner {
        max-width: 580px;
    }

    .header-symbol {
        width: 54px;
    }

    .burger-btn span {
        width: 28px;
    }

    .home-signature {
        width: min(480px, 62vw);
    }

    .home-pre-title {
        font-size: 2rem;
    }

    .home-subtitle {
        font-size: 2rem;
    }

    .home-tagline-1,
    .home-tagline-2 {
        font-size: 1.8rem;
    }

    .page-title {
        font-size: 2.2rem;
    }

    .nav-overlay a {
        font-size: 1.45rem;
    }

    .nav-overlay li {
        margin: 1.2rem 0;
    }
}

/* =============================================================
   RESPONSIVE — DESKTOP 1200px+
   ============================================================= */
@media (min-width: 1200px) {
    html {
        font-size: 20px;
    }

    .site-header {
        padding: 2rem 3rem;
    }

    .header-inner {
        max-width: 720px;
    }

    .header-symbol {
        width: 62px;
    }

    .home-signature {
        width: 520px;
    }

    main {
        padding-top: 3rem;
    }

    .page-title {
        font-size: 2.5rem;
    }

    .page-content {
        font-size: 1.1rem;
    }
}
