/* ===========================
   共學與你 — Global Stylesheet
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@300;400;500;600;700&family=DM+Sans:wght@300;400;500&display=swap');

/* ── Design Tokens ── */
:root {
  --cream:    #FAF7F2;
  --ivory:    #F2EDE4;
  --gold:     #C8956C;
  --gold-dk:  #A67050;
  --rust:     #8B4A2F;
  --bark:     #3D2314;
  --sage:     #7A9E87;
  --charcoal: #2E2620;
  --warm-mid: #6B5744;
  --border:   rgba(61,35,20,.12);

  --fs-xs:  0.82rem;
  --fs-sm:  0.95rem;
  --fs-md:  1rem;
  --fs-lg:  1.15rem;
  --fs-xl:  1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;
  --fs-4xl: 3rem;

  --radius: 4px;
  --shadow-sm: 0 2px 12px rgba(61,35,20,.08);
  --shadow-md: 0 8px 32px rgba(61,35,20,.12);
  --shadow-lg: 0 20px 60px rgba(61,35,20,.16);

  --transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --nav-h: 72px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 17px; }
body {
  font-family: 'Noto Serif TC', serif;
  background: var(--cream);
  color: var(--charcoal);
  line-height: 1.85;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ── Typography Helpers ── */
.sans { font-family: 'DM Sans', sans-serif; }
.label {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--gold);
}
.section-heading {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--bark);
  line-height: 1.3;
  margin-bottom: .5rem;
  font-weight: 600;
}
.section-sub {
  font-size: var(--fs-lg);
  color: var(--warm-mid);
  max-width: 540px;
  line-height: 1.85;
}
.text-center { text-align: center; }
.text-center .section-sub { margin-inline: auto; }

/* ── Layout Utilities ── */
.container {
  width: min(1180px, 92vw);
  margin-inline: auto;
}
.section {
  padding-block: clamp(56px, 9vw, 110px);
}
.section-header {
  margin-bottom: clamp(36px, 5vw, 60px);
}
.divider {
  width: 48px; height: 3px;
  background: var(--gold);
  margin-block: 16px;
}
.text-center .divider { margin-inline: auto; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: var(--radius);
  font-family: 'Noto Serif TC', serif;
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  min-height: 48px;
}
.btn-primary {
  background: var(--gold);
  color: white;
}
.btn-primary:hover {
  background: var(--gold-dk);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-outline {
  background: transparent;
  color: var(--bark);
  border: 1.5px solid var(--gold);
}
.btn-outline:hover {
  background: var(--gold);
  color: white;
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--gold-dk);
  padding-left: 0;
  padding-right: 0;
  min-height: unset;
}
.btn-ghost::after {
  content: '→';
  transition: transform .25s;
}
.btn-ghost:hover::after { transform: translateX(5px); }

/* ── Navigation ── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 900;
  background: rgba(250,247,242,0);
  transition: background .4s, box-shadow .4s;
}
#navbar.scrolled {
  background: rgba(250,247,242,.97);
  box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
  backdrop-filter: blur(12px);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.nav-logo {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.nav-logo .logo-cn {
  font-family: 'Noto Serif TC', serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--bark);
  letter-spacing: .08em;
}
/* 隱藏英文副標 */
.nav-logo .logo-en {
  display: none;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  font-family: 'Noto Serif TC', serif;
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--charcoal);
  transition: color .25s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1.5px;
  background: var(--gold);
  transition: width .3s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--gold-dk); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-cta {
  padding: 10px 22px;
  background: var(--gold);
  color: white !important;
  border-radius: var(--radius);
}
.nav-cta::after { display: none !important; }
.nav-cta:hover { background: var(--gold-dk) !important; }

/* hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 26px; height: 2px;
  background: var(--charcoal);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: var(--ivory);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 899;
  padding: 24px;
  flex-direction: column;
  gap: 0;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.1rem;
  color: var(--charcoal);
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  transition: color .2s;
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--gold-dk); }

/* ── Footer ── */
.site-footer {
  background: var(--bark);
  color: rgba(255,255,255,.75);
  padding-block: 56px 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.4fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-brand .logo-cn {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: white;
  letter-spacing: .1em;
  display: block;
  margin-bottom: 16px;
}
/* footer 不顯示英文 */
.footer-brand .logo-en {
  display: none;
}
.footer-brand p {
  font-size: var(--fs-sm);
  line-height: 1.9;
  max-width: 280px;
}
.footer-col h4 {
  font-family: 'Noto Serif TC', serif;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  font-size: var(--fs-sm);
  color: rgba(255,255,255,.65);
  margin-bottom: 10px;
  transition: color .2s;
}
.footer-col a:hover { color: white; }
.footer-contact p {
  font-size: var(--fs-sm);
  margin-bottom: 10px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.7;
}
.footer-contact p span:first-child { color: var(--gold); flex-shrink: 0; }
.footer-bottom {
  padding-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom p {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--fs-xs);
  color: rgba(255,255,255,.4);
}
.social-links {
  display: flex;
  gap: 14px;
}
.social-links a {
  width: 40px; height: 40px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  color: rgba(255,255,255,.6);
  transition: var(--transition);
}
.social-links a:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-3px);
}

/* ── Page Hero (inner pages) ── */
.page-hero {
  padding-top: calc(var(--nav-h) + 64px);
  padding-bottom: 64px;
  background: var(--ivory);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -80px;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(200,149,108,.12) 0%, transparent 70%);
  pointer-events: none;
}
.page-hero .label { margin-bottom: 14px; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: var(--fs-xs);
  color: var(--warm-mid);
  margin-top: 20px;
}
.breadcrumb a { color: var(--gold); }
.breadcrumb span { color: var(--warm-mid); }

/* ── Cards ── */
.card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .3s, box-shadow .3s;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}
.card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--ivory);
}
.card-body { padding: 24px; }
.card-tag {
  font-family: 'Noto Serif TC', serif;
  font-size: .78rem;
  font-weight: 500;
  color: var(--sage);
  margin-bottom: 8px;
}
.card-title {
  font-family: 'Noto Serif TC', serif;
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--bark);
  line-height: 1.4;
  margin-bottom: 10px;
}
.card-text {
  font-size: var(--fs-sm);
  color: var(--warm-mid);
  line-height: 1.85;
}

/* ── Scroll Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }
.reveal-delay-4 { transition-delay: .4s; }

/* ── Tag Badges ── */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-family: 'Noto Serif TC', serif;
  font-size: var(--fs-xs);
  font-weight: 500;
}
.badge-gold { background: rgba(200,149,108,.15); color: var(--gold-dk); }
.badge-sage { background: rgba(122,158,135,.15); color: var(--sage); }
.badge-rust { background: rgba(139,74,47,.12); color: var(--rust); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  html { font-size: 16px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
