/* ================================================================
   components.css — reusable across pages.
   nav · top marquee strip · buttons · eyebrow · lede · footer.
   Page-specific layouts live in /pages/*.css.
   ================================================================ */


/* === Top strip + marquee ======================================== */

.top-strip {
  background: var(--ink);
  color: var(--cream);
  padding: 8px 0;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  overflow: hidden;
}
.marquee {
  display: flex;
  gap: 50px;
  white-space: nowrap;
  animation: marquee-scroll 38s linear infinite;
}
.marquee span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.marquee .dot { color: var(--accent); }

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}


/* === Navigation ================================================= */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 241, 232, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cream-deep);
}
.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 16px var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.nav-brand { display: inline-flex; align-items: center; }
.nav-brand img { width: 130px; height: auto; display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-weight: 500;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink);
  opacity: 0.78;
  transition: opacity var(--t-fast), color var(--t-fast);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  opacity: 1;
  color: var(--accent);
}

/* Right-side group: nav links + language switcher + (mobile) hamburger */
.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Language switcher · globe dropdown. Links wired by partials.js from hreflang. */
.lang-switch { position: relative; }
.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: 1px solid var(--cream-deep);
  border-radius: 999px;
  padding: 6px 11px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity var(--t-fast), border-color var(--t-fast);
}
.lang-trigger:hover { opacity: 1; border-color: var(--accent); }
.lang-globe { opacity: 0.65; }
.lang-caret { opacity: 0.55; transition: transform var(--t-fast); }
.lang-switch.open .lang-caret { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 148px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--cream);
  border: 1px solid var(--cream-deep);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(42,36,56,0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
  z-index: 60;
}
.lang-switch.open .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-menu a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  opacity: 0.8;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
}
.lang-menu a:hover { background: rgba(42,36,56,0.05); opacity: 1; }
.lang-menu a.is-active { color: var(--accent); font-weight: 700; opacity: 1; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
  color: var(--ink);
}
.nav-toggle svg { display: block; }

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--cream);
    padding: 20px var(--container-pad);
    border-bottom: 1px solid var(--cream-deep);
    box-shadow: 0 10px 20px rgba(0,0,0,0.04);
  }
  .nav-links.open { display: flex; }
  /* Globe + hamburger stay together on the right; trim globe padding to fit. */
  .nav-right { gap: 10px; }
  .lang-trigger { padding: 6px 9px; }
}

/* Mobile: tighten the base section rhythm (other pages) — phones don't need 80px. */
@media (max-width: 768px) {
  .section { padding-top: 52px; padding-bottom: 52px; }
}


/* === Buttons ==================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  border-radius: var(--r-md);
  padding: 12px 22px;
  transition: transform var(--t-fast) var(--ease-soft),
              background var(--t-fast),
              box-shadow var(--t-fast);
}

.btn-primary {
  background: var(--accent);
  color: var(--cream);
  box-shadow: 0 4px 0 var(--accent-deep);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--accent-deep);
}

.btn-primary-lg {
  padding: 18px 30px;
  font-size: 1.05rem;
  box-shadow: 0 6px 0 var(--accent-deep);
}
.btn-primary-lg:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 var(--accent-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  padding: 18px 24px;
  border: 2px solid var(--cream-deep);
}
.btn-ghost:hover { background: rgba(42,36,56,0.04); }

.btn-ghost-on-dark {
  background: transparent;
  color: var(--cream);
  padding: 18px 24px;
  border: 2px solid rgba(254,248,240,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.btn-ghost-on-dark:hover { background: rgba(254,248,240,0.12); }


/* === Eyebrow + lede helpers ===================================== */

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}
/* Hide decorative Han suffixes inside eyebrows (e.g., "Letters home · 學員來信")
   per Round 3 — keep section labels English-direct, less Chinese-as-decoration. */
.eyebrow .han { display: none; }

/* Eyebrow placed on dark bg — slightly softer hue but no pill shape */
.eyebrow-on-dark {
  color: var(--hero-2);
}

.lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 660px;
  margin-bottom: var(--space-7);
}
/* Inline link inside .lede paragraphs */
.lede a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}


/* === Page layout primitives ====================================
   Shared by content pages (lessons, about, qna). Single source of
   truth — page-specific CSS only needs to override the bits that
   are intentionally different (e.g. page-header gradient overlay). */

.section {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 80px var(--container-pad);
}

.page-header {
  background: linear-gradient(180deg, var(--cream-deep) 0%, #ecd6b5 100%);
  border-bottom: 1px solid #e2c9a8;
  padding: 60px var(--container-pad) 60px;
  position: relative;
  overflow: hidden;
}
.page-header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3.3vw + 1rem, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 18px;
  color: var(--ink);
}
.page-header h1 em { font-style: italic; color: var(--accent-deep); }

.breadcrumb {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 8px; opacity: 0.4; }

.kicker {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
}

.deck {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 720px;
  margin: 0;
  line-height: 1.65;
}


/* === Section padding modifiers === */
.section--tight-top    { padding-top: 30px; }
.section--tight-bottom { padding-bottom: 30px; }


/* === Smaller in-section h2 (vs the hero h1).
       Apply to section heads that need a slightly tighter scale. === */
.section-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 2.4vw + 1rem, 2.8rem);
  margin-bottom: 14px;
}


/* === "See more →" anchor pattern.
       Used at the end of summary sections that route to a deeper page. === */
.see-all-link {
  margin-top: 30px;
  text-align: center;
}
.see-all-link a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1.5px;
}


/* === Footer ===================================================== */

.footer {
  background: var(--ink);
  color: rgba(254,248,240,0.85);
  padding: 80px var(--container-pad) 30px;
  position: relative;
  overflow: hidden;
}
.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(254,248,240,0.15);
}
.footer-grid h4 {
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 14px;
  font-weight: 700;
}
.footer-grid a {
  display: block;
  color: rgba(254,248,240,0.7);
  text-decoration: none;
  padding: 4px 0;
  font-size: 0.92rem;
}
.footer-grid a:hover { color: var(--hero-2); }

/* Social-icon row sits inside the Contact column, below the email link. */
.footer-socials {
  display: inline-flex;
  gap: 12px;
  margin-top: 12px;
}
.footer-grid .footer-social {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: rgba(254,248,240,0.08);
  color: rgba(254,248,240,0.78);
  transition: background var(--t-fast) var(--ease-soft),
              color var(--t-fast) var(--ease-soft),
              transform var(--t-fast) var(--ease-soft);
}
.footer-grid .footer-social svg { width: 18px; height: 18px; display: block; }
.footer-grid .footer-social:hover {
  background: rgba(254,248,240,0.14);
  color: var(--hero-2);
  transform: translateY(-2px);
}

/* Footer brand-column helpers (replaces inline styles) */
.footer-brand-logo {
  width: 140px;
  margin-bottom: 14px;
  filter: invert(1);            /* logo PNG is dark; invert for dark footer */
}
.footer-tagline {
  max-width: 320px;
  font-size: 0.92rem;
}

.footer-bottom {
  padding-top: 24px;
  font-size: 0.82rem;
  opacity: 0.7;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
