/* ============================================================
   Diani Loves Music — global stylesheet
   Design tokens, reset, base typography, header / nav / footer.
   Loaded by every page; page-specific rules live in their own file.
   ============================================================ */

/* ── Design tokens (palette carried over from the original site) ── */
:root {
  --cream:  #fbf1ec;   /* header / footer background */
  --accent: #ad9586;   /* taupe — dividers, buttons, logo */
  --ink:    #4f4e4a;   /* primary body text */
  --muted:  #817f73;   /* secondary text */
  --heading:#333333;   /* section headings */
  --brown:  #8b4513;   /* emphasis / highlighted headings */
  --link:   #8b0000;   /* in-text links */

  --font-display: 'Jura', sans-serif;        /* logo + display headings */
  --font-body:    'Open Sans', sans-serif;   /* body copy */
  --font-accent:  'Play', sans-serif;        /* secondary headings */

  --maxw: 1000px;            /* readable content width */
  --header-h: 96px;          /* nominal header height for scroll offsets */
}

/* ── Reset / base ──────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--link); }

main { flex: 1 0 auto; }

/* ── Header / nav ──────────────────────────────────────────── */
.site-header {
  position: sticky;          /* modern replacement for the old JS DOM-move hack */
  top: 0;
  z-index: 1000;
  width: 100%;
  background: var(--cream);
  padding: 15px 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hidden state toggled by site.js when scrolling down */
.site-header.is-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.header-logo {
  line-height: 0.95;
  text-decoration: none;
  display: inline-block;
}

.header-logo .logo-zh {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  color: var(--accent);
}

.header-logo .logo-en {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
}

.main-nav .nav-menu {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  text-decoration: none;
  color: var(--ink);
  font-size: 16px;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover { background: rgba(173, 149, 134, 0.18); }

.nav-link.active {
  font-weight: 700;
  color: var(--accent);
}

/* Hamburger (hidden on desktop) */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}

.menu-toggle span {
  width: 26px;
  height: 3px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  flex-shrink: 0;
  background: var(--cream);
  padding: 30px 20px;
  margin-top: 40px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-text {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

/* ── Shared content helpers ────────────────────────────────── */
.content {
  width: var(--maxw);
  max-width: 100%;
  margin: 0 auto;
  padding: 40px 60px;
}

/* ── Responsive: tablet / mobile ───────────────────────────── */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--cream);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.12);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .main-nav.open { max-height: 320px; }

  .main-nav .nav-menu {
    flex-direction: column;
    gap: 6px;
    padding: 16px 20px;
  }

  /* Animate hamburger into an X when open */
  .menu-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .menu-toggle.open span:nth-child(2) { opacity: 0; }
  .menu-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .header-logo .logo-zh { font-size: 30px; }
  .header-logo .logo-en { font-size: 22px; }

  .content { padding: 30px 24px; }

  .site-footer { padding: 22px 16px; }
  .footer-text { font-size: 14px; }
}

@media (max-width: 480px) {
  .header-logo .logo-zh { font-size: 26px; }
  .header-logo .logo-en { font-size: 18px; }
  .content { padding: 24px 18px; }
  .footer-text { font-size: 12px; }
}
