/* ==========================================================
   Let's Chinese — Global Stylesheet
   A warm, culturally rich, modern bilingual community site
   ========================================================== */

/* --- Google Fonts --- */
@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=Inter:wght@300;400;500;600&display=swap');

/* --- CSS Custom Properties --- */
/* Palette: 宣纸水墨 — near-white paper, deep ink text, 朱砂 vermilion accent, 青瓷 celadon secondary */
:root {
  --bg:         #FDFBF7;   /* 宣纸 near-white, slight warm tint */
  --white:      #FFFFFF;
  --text:       #1F1F1F;   /* 墨黑 */
  --text-light: #6B6B6B;
  --gold:       #C8372D;   /* 朱砂 vermilion — primary accent */
  --terracotta: #9B2920;   /* 深朱 deeper vermilion for hover / dark accent */
  --green:      #7A9E8E;   /* 青瓷 celadon */
  --border:     #EAE4DA;   /* 纸边 paper edge */
  --cream:      #F8F2E8;   /* 纸色 soft paper — for callout boxes */
  --shadow:     0 2px 12px rgba(0,0,0,.05);
  --shadow-hover: 0 8px 30px rgba(0,0,0,.08);
  --radius:     12px;
  --transition: .3s ease;

  /* Fonts */
  --font-zh:    'Noto Serif SC', serif;
  --font-en:    'Lora', serif;
  --font-body:  'Inter', sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(253,251,247,0.82), rgba(253,251,247,0.82)),
    url("../images/bg-koi.jpg");
  background-repeat: no-repeat, no-repeat;
  background-position: center center, center center;
  background-size: cover, cover;
  background-attachment: fixed, fixed;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

@media (max-width: 720px) {
  body {
    background-attachment: scroll, scroll;
  }
}

img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--terracotta); }

h1, h2, h3, h4 {
  font-family: var(--font-en);
  line-height: 1.3;
}

/* Chinese headings override */
[lang="zh"] h1, [lang="zh"] h2, [lang="zh"] h3,
.zh-heading {
  font-family: var(--font-zh);
}

/* --- Utility --- */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 48px;
}

.section-title h2 {
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 8px;
}

.section-title p {
  color: var(--text-light);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto;
}

.text-center { text-align: center; }

/* --- Decorative Elements (CSS-only ink / watercolor feel) --- */
.ink-accent {
  position: relative;
}

.ink-accent::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--terracotta));
  border-radius: 2px;
  margin: 16px auto 0;
}

/* Subtle brush-stroke divider */
.brush-divider {
  height: 24px;
  background: linear-gradient(
    90deg,
    transparent 10%,
    var(--gold) 30%,
    var(--terracotta) 50%,
    var(--gold) 70%,
    transparent 90%
  );
  opacity: .12;
  border-radius: 50%;
  margin: 40px auto;
  max-width: 400px;
}

/* Watercolor blob (decorative background) */
.watercolor-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .08;
  pointer-events: none;
  z-index: 0;
}

/* =====================
   HEADER / NAVIGATION
   ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(250, 246, 240, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  text-decoration: none;
}

.logo-icon {
  font-size: 1.6rem;
}

.logo-img {
  height: 40px;
  width: auto;
  border-radius: 4px;
}

.hero-logo {
  width: 280px;
  max-width: 70vw;
  height: auto;
  animation: float 4s ease-in-out infinite;
}

.logo span {
  color: var(--gold);
}

/* Desktop Nav */
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: .92rem;
  font-weight: 500;
  color: var(--text);
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
  transition: width var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
}

/* Language Toggle */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  transition: all var(--transition);
  font-family: var(--font-body);
}

.lang-toggle:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile Nav Overlay */
.mobile-nav {
  display: none;
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(250, 246, 240, .98);
  backdrop-filter: blur(16px);
  z-index: 999;
  padding: 40px 24px;
}

.mobile-nav.open {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: fadeIn .25s ease;
}

.mobile-nav a {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
  font-family: var(--font-body);
}

.mobile-nav a:hover { color: var(--gold); }

.mobile-nav .lang-toggle {
  margin-top: 16px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =====================
   HERO SECTION
   ===================== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 120px 0 200px;
  text-align: center;
}

/* Photo layer — fades to transparent at bottom so body koi bg blends in */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("../images/banners/village.jpg") no-repeat center center / cover;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0,0,0,0) 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0,0,0,0) 100%);
  z-index: 0;
}

/* Scrim for text readability — stronger at text area, fades out at bottom */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(253,251,247,0.50) 0%,
    rgba(253,251,247,0.72) 30%,
    rgba(253,251,247,0.65) 55%,
    rgba(253,251,247,0.25) 80%,
    rgba(253,251,247,0) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* ===== Hero decorative Chinese elements ===== */
.hero-lantern {
  position: absolute;
  top: 30px;
  width: 68px;
  height: auto;
  z-index: 1;
  pointer-events: none;
  transform-origin: 50% 0;
  filter: drop-shadow(0 6px 14px rgba(155,41,32,0.25));
}

.hero-lantern-left  { left: 6%;  animation: lanternSway 6s ease-in-out infinite; }
.hero-lantern-right { right: 6%; animation: lanternSway 6s ease-in-out -3s infinite; }

@keyframes lanternSway {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(3deg);  }
}

.hero-knot {
  position: absolute;
  bottom: 32px;
  right: 4%;
  width: 54px;
  height: auto;
  opacity: 0.85;
  z-index: 1;
  pointer-events: none;
  animation: lanternSway 8s ease-in-out infinite;
  transform-origin: 50% 0;
  filter: drop-shadow(0 4px 10px rgba(155,41,32,0.18));
}

@media (max-width: 720px) {
  .hero-lantern  { width: 46px; top: 18px; }
  .hero-lantern-left  { left: 4%; }
  .hero-lantern-right { right: 4%; }
  .hero-knot { width: 40px; bottom: 24px; right: 4%; }
  .hero { padding-bottom: 120px; }
}

.hero-content {
  position: relative;
  z-index: 2;
}
.hero-lantern,
.hero-knot { z-index: 2; }

.hero-icon {
  font-size: 3.5rem;
  margin-bottom: 24px;
  display: inline-block;
  animation: float 4s ease-in-out infinite;
}

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

.hero h1 {
  font-family: var(--font-zh);
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  text-shadow: 0 1px 3px rgba(253,251,247,0.85);
}

.hero .subtitle {
  font-family: var(--font-en);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text);
  font-style: italic;
  margin-bottom: 32px;
  text-shadow: 0 1px 2px rgba(253,251,247,0.9);
}

.hero .mission-text {
  max-width: 640px;
  margin: 0 auto 40px;
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.8;
  text-shadow: 0 1px 2px rgba(253,251,247,0.95);
}

/* =====================
   CARDS (shared)
   ===================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
  display: inline-block;
}

.card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--text);
}

.card p {
  color: var(--text-light);
  font-size: .95rem;
  line-height: 1.7;
}

.card-link {
  display: inline-block;
  margin-top: 16px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--gold);
}

.card-link:hover { color: var(--terracotta); }

/* Feature card accent top border */
.card-accent {
  border-top: 3px solid var(--gold);
}

/* =====================
   BADGES
   ===================== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.badge-gold {
  background: rgba(200,55,45,.12);
  color: var(--gold);
}

.badge-terracotta {
  background: rgba(155,41,32,.10);
  color: var(--terracotta);
}

.badge-green {
  background: rgba(122,158,142,.12);
  color: var(--green);
}

.badge-coming {
  background: rgba(200,55,45,.15);
  color: var(--gold);
  font-style: italic;
}

.badge-new {
  background: rgba(155,41,32,.12);
  color: var(--terracotta);
  font-weight: 600;
}

/* =====================
   BUTTONS
   ===================== */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-family: var(--font-body);
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--terracotta);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
}

.btn-outline:hover {
  background: var(--gold);
  color: var(--white);
}

/* Filter Buttons */
.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 36px;
}

.filter-btn {
  padding: 8px 20px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  background: var(--white);
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(200,55,45,.06);
}

/* =====================
   STORY CARDS (special)
   ===================== */
.story-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.story-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* ===== Chengyu "poster" thumbnail — Chinese calligraphy style ===== */
.story-thumb {
  aspect-ratio: 16/9;
  background:
    radial-gradient(ellipse at 70% 30%, rgba(255,220,180,.15) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(200,55,45,.25) 0%, transparent 65%),
    linear-gradient(135deg, #8C2820 0%, #5C1914 50%, #2F0B09 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  cursor: pointer;
  transition: filter var(--transition);
}

/* Ink-wash texture overlay */
.story-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 85% 85%, rgba(0,0,0,.3) 0%, transparent 40%),
    radial-gradient(ellipse at 15% 15%, rgba(255,255,255,.05) 0%, transparent 40%);
  z-index: 0;
  pointer-events: none;
}

/* Chengyu characters displayed as a seal/calligraphy poster */
.thumb-chars {
  font-family: var(--font-zh);
  font-weight: 700;
  font-size: 2.6rem;
  letter-spacing: .15em;
  color: #FDFBF7;
  text-shadow:
    0 2px 8px rgba(0,0,0,.4),
    0 0 40px rgba(255,220,180,.15);
  position: relative;
  z-index: 1;
  transition: transform var(--transition), letter-spacing var(--transition);
  padding: 0 16px;
  text-align: center;
  line-height: 1.1;
}

.story-thumb:hover .thumb-chars {
  transform: scale(1.04);
  letter-spacing: .2em;
}

/* Decorative corner brackets — a nod to traditional Chinese seal frames */
.story-thumb .corner-tl,
.story-thumb .corner-br {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: rgba(250, 246, 240, .4);
  z-index: 1;
}
.story-thumb .corner-tl {
  top: 10px; left: 10px;
  border-top: 2px solid;
  border-left: 2px solid;
}
.story-thumb .corner-br {
  bottom: 10px; right: 10px;
  border-bottom: 2px solid;
  border-right: 2px solid;
}

/* Legacy emoji support — hide when using thumb-chars */
.story-thumb .thumb-emoji {
  position: relative;
  z-index: 1;
  font-size: 3.6rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.4));
  transition: transform var(--transition);
}

.story-thumb:hover .thumb-emoji {
  transform: scale(1.08);
}

/* YouTube-style red play button */
.story-thumb .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 44px;
  background: rgba(0, 0, 0, .75);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  color: transparent;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition);
  z-index: 3;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}

.story-thumb .play-icon::after {
  content: '';
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 18px solid #fff;
  margin-left: 4px;
}

.story-thumb:hover .play-icon {
  opacity: 1;
  background: #FF0000; /* YouTube red */
}

.story-thumb:hover {
  filter: brightness(1.1);
}

/* Category pill at the bottom-right — like a YouTube-style badge */
.story-thumb .thumb-label {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, .75);
  color: #fff;
  font-size: .7rem;
  font-weight: 500;
  border-radius: 3px;
  z-index: 2;
  letter-spacing: .02em;
  font-family: var(--font-body);
}

/* Alternate color themes for variety */
.story-thumb.theme-gold {
  background:
    radial-gradient(ellipse at 70% 30%, rgba(255,240,200,.12) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(200,55,45,.3) 0%, transparent 65%),
    linear-gradient(135deg, #B88A3F 0%, #7A5A26 50%, #3E2D12 100%);
}

.story-thumb.theme-green {
  background:
    radial-gradient(ellipse at 70% 30%, rgba(200,240,210,.12) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(122,158,142,.3) 0%, transparent 65%),
    linear-gradient(135deg, #5A7A6E 0%, #3A564C 50%, #1D2F28 100%);
}

.story-thumb.theme-ink {
  background:
    radial-gradient(ellipse at 70% 30%, rgba(220,230,250,.1) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(70,80,110,.3) 0%, transparent 65%),
    linear-gradient(135deg, #2C3E50 0%, #1A252F 50%, #0A1117 100%);
}

.story-thumb iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* YouTube thumbnail variant — uses the video's own preview image */
.story-thumb.yt-thumb {
  background: #000;
  padding: 0;
}
.story-thumb.yt-thumb::before {
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,.35) 100%);
}
.story-thumb.yt-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
  z-index: 0;
}
.story-thumb.yt-thumb:hover img {
  transform: scale(1.05);
}
.story-thumb.yt-thumb .play-icon {
  opacity: 1;
  background: rgba(0, 0, 0, .75);
}
.story-thumb.yt-thumb:hover .play-icon {
  background: #FF0000;
}

.story-body {
  padding: 20px;
}

.story-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.story-body h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--text);
  font-family: var(--font-zh);
}

.story-body p {
  color: var(--text-light);
  font-size: .88rem;
  line-height: 1.6;
}

/* Clickable story-body — when wrapped in an <a class="story-body-link"> */
a.story-body-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: background var(--transition);
}
a.story-body-link:hover {
  background: rgba(166, 60, 46, 0.04);
}
a.story-body-link:hover h3 {
  color: var(--terracotta);
}

/* =====================
   LANGUAGE-BASED VISIBILITY
   Switch blocks via document.documentElement.lang
   ===================== */
html[lang="zh"] .lang-en { display: none !important; }
html[lang="en"] .lang-zh { display: none !important; }

/* =====================
   CHENGYU READER PAGE
   ===================== */
.chengyu-reader {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.chengyu-reader-header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.chengyu-reader-header h1 {
  font-family: var(--font-zh);
  font-size: 2.4rem;
  color: var(--terracotta);
  margin: 0 0 8px;
  letter-spacing: .05em;
}

.chengyu-reader-header .chengyu-pinyin {
  font-size: 1.05rem;
  color: var(--text-light);
  letter-spacing: .1em;
  margin-bottom: 14px;
}

.chengyu-reader-header .chengyu-meaning {
  font-size: 1rem;
  color: var(--text);
  max-width: 560px;
  margin: 0 auto 20px;
  line-height: 1.7;
}

.chengyu-reader-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.chengyu-story {
  font-size: 1.1rem;
  line-height: 2.6;
  color: var(--text);
}

.chengyu-story p {
  margin-bottom: 1.2em;
}

/* Ruby annotation styling */
.chengyu-story ruby {
  ruby-align: center;
}
.chengyu-story rt {
  font-size: .55em;
  color: var(--text-light);
  letter-spacing: .02em;
  font-family: var(--font-en, system-ui, sans-serif);
  font-weight: normal;
  padding-bottom: 2px;
}

/* English story body on the reader page */
.chengyu-story-en {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}
.chengyu-story-en p {
  margin-bottom: 1.1em;
}

.chengyu-reader-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

@media (max-width: 640px) {
  .chengyu-reader-header h1 { font-size: 2rem; }
  .chengyu-story { font-size: 1rem; line-height: 2.4; }
}

/* =====================
   PICTURE BOOK CARDS
   ===================== */
.book-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  text-align: center;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.book-cover {
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, #F5EFE3 0%, #EBE2D0 50%, #DFD4BE 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.book-cover .book-title-overlay {
  font-family: var(--font-zh);
  font-size: 1rem;
  color: var(--terracotta);
  font-weight: 600;
}

.book-cover img.book-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.book-card a.book-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.book-card a.book-link:hover .book-cover-img {
  transform: scale(1.04);
}

.book-info {
  padding: 20px;
}

.book-info h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  font-family: var(--font-zh);
}

/* =====================
   MONTHLY GATHERING SECTION
   ===================== */
.gathering-section {
  background: linear-gradient(135deg, #F5EFE3 0%, #FDFBF7 100%);
  border-radius: var(--radius);
  padding: 48px 40px;
  margin-top: 60px;
  position: relative;
  overflow: hidden;
}

.gathering-section::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(200,55,45,.06) 0%, transparent 70%);
  border-radius: 50%;
}

.gathering-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  display: inline-block;
}

.gathering-section h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.gathering-section p {
  color: var(--text-light);
  max-width: 640px;
  line-height: 1.8;
}

/* Floating ribbon (homepage) */
.floating-ribbon {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  background: var(--gold);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 28px;
  font-size: .85rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(200,55,45,.3);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.floating-ribbon:hover {
  background: var(--terracotta);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(155,41,32,.3);
}

/* =====================
   PAGE HEADER (inner pages) — with photo background + scrim overlay
   ===================== */
.page-header {
  position: relative;
  overflow: hidden;
  padding: 120px 0 140px;
  text-align: center;
}
/* Photo layer — fades to transparent at the bottom, so body koi bg shows through smoothly */
.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--page-bg);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0,0,0,0) 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0,0,0,0) 100%);
  z-index: 0;
}
/* Scrim layer for text readability — stronger at top where text sits, fades out at bottom */
.page-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(253,251,247,0.55) 0%,
    rgba(253,251,247,0.78) 25%,
    rgba(253,251,247,0.72) 50%,
    rgba(253,251,247,0.30) 80%,
    rgba(253,251,247,0) 100%
  );
  pointer-events: none;
  z-index: 1;
}
.page-header > * {
  position: relative;
  z-index: 2;
}

@media (max-width: 720px) {
  .page-header { padding: 80px 0 60px; }
}

.page-header h1 {
  font-family: var(--font-zh);
  font-size: 2.2rem;
  margin-bottom: 8px;
  text-shadow: 0 1px 3px rgba(253,251,247,0.85);
}

.page-header .page-subtitle {
  font-family: var(--font-en);
  font-size: 1.15rem;
  color: var(--text);
  font-style: italic;
  text-shadow: 0 1px 2px rgba(253,251,247,0.9);
}

.page-header .intro {
  max-width: 680px;
  margin: 24px auto 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
  text-shadow: 0 1px 2px rgba(253,251,247,0.95);
}

/* =====================
   ABOUT PAGE
   ===================== */
.about-story {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 2;
  color: var(--text);
}

/* Two-column layout: Apple's story on the left, Xiaoyi's on the right */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  max-width: 1180px;
  margin: 0 auto;
  align-items: start;
}
.about-grid .about-story {
  max-width: none;
}
.about-grid .about-col-title {
  font-family: var(--font-zh);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

/* Bio card (below Apple's signature) */
.about-bio {
  margin-top: 28px;
  padding: 22px 24px;
  background: rgba(253, 251, 247, 0.75);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.about-bio-title {
  font-family: var(--font-zh);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 10px 0;
  color: var(--text);
}
.about-bio p {
  margin: 0 0 10px 0;
  font-size: .95rem;
  line-height: 1.75;
  color: var(--text-light);
}
.about-bio p:last-child { margin-bottom: 0; }
.about-bio-link {
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dotted var(--gold);
  transition: color var(--transition);
}
.about-bio-link:hover { color: var(--terracotta); }

.about-story p {
  margin-bottom: 24px;
}

.about-highlight {
  background: rgba(200,55,45,.06);
  border-left: 3px solid var(--gold);
  padding: 20px 24px;
  border-radius: 0 8px 8px 0;
  margin: 32px 0;
  font-style: italic;
  color: var(--text-light);
}

/* CTA Section */
.cta-section {
  text-align: center;
  padding: 60px 40px;
  background: linear-gradient(135deg, #F5EFE3, #FDFBF7);
  border-radius: var(--radius);
  margin-top: 40px;
}

.cta-section h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.cta-section p {
  color: var(--text-light);
  margin-bottom: 24px;
}

.email-form {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 480px;
  margin: 0 auto;
}

.email-form input {
  flex: 1;
  min-width: 200px;
  padding: 12px 20px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: var(--font-body);
  background: var(--white);
  transition: border-color var(--transition);
}

.email-form input:focus {
  outline: none;
  border-color: var(--gold);
}

/* =====================
   TWO-SECTION LAYOUT (college page)
   ===================== */
.two-sections {
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.sub-section h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  text-align: center;
}

.sub-section .sub-desc {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 32px;
}

.sub-section-img {
  display: block;
  max-width: 760px;
  width: 100%;
  margin: 0 auto 36px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

/* =====================
   FOOTER
   ===================== */
.site-footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-light);
  font-size: .88rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-inner .footer-brand {
  font-family: var(--font-en);
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
}

.footer-inner .footer-brand span {
  color: var(--gold);
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 900px) {
  .card-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Header */
  .nav-links { display: none; }
  .hamburger { display: flex; }

  /* Hero */
  .hero { padding: 70px 0 60px; }
  .hero h1 { font-size: 2rem; }
  .hero .subtitle { font-size: 1.1rem; }

  /* Cards */
  .card-grid,
  .card-grid-3 {
    grid-template-columns: 1fr;
  }

  .card { padding: 24px 20px; }

  /* Page header */
  .page-header h1 { font-size: 1.7rem; }

  /* Gathering */
  .gathering-section { padding: 32px 24px; }

  /* Section */
  .section { padding: 60px 0; }

  /* Floating ribbon */
  .floating-ribbon {
    bottom: 16px;
    right: 16px;
    font-size: .8rem;
    padding: 10px 16px;
  }

  /* CTA */
  .email-form { flex-direction: column; }
  .email-form input { min-width: 0; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 1.7rem; }
  .hero .subtitle { font-size: 1rem; }
  .section-title h2 { font-size: 1.5rem; }
  .card-grid { gap: 16px; }
  .filter-group { gap: 6px; }
  .filter-btn { padding: 6px 14px; font-size: .8rem; }
}

/* --- Hamburger animation --- */
.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}
