/* =========================================================
   Society of Ksitigarbha Studies — Global Stylesheet
   ========================================================= */

/* ── Google Fonts loaded in each HTML <head> ── */

:root {
  --gold:        #b8860b;
  --gold-light:  #d4a820;
  --gold-pale:   #f5e6b8;
  --gold-faint:  rgba(212, 196, 154, 0.14);
  --ink:         #1a1410;
  --ink-mid:     #2a241c;
  --ink-soft:    #3a3020;
  --parchment:   #faf6ee;
  --warm-mid:    #6b5a3e;
  --warm-light:  #9a8a6a;
  --border:      #d4c49a;
  --border-soft: #e8dfc8;
  --red:         #8b2020;
  --shadow-sm:   0 2px 10px rgba(0,0,0,0.08);
  --shadow-md:   0 6px 24px rgba(0,0,0,0.13);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.18);
  --radius:      2px;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'EB Garamond', Georgia, serif;
  background: var(--parchment);
  color: var(--ink);
  line-height: 1.75;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
img { display: block; max-width: 100%; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography helpers ── */
.zh { font-family: 'Noto Serif TC', serif; }
.italic { font-style: italic; }

/* ── Ornament divider ── */
.ornament {
  text-align: center;
  color: var(--gold);
  font-size: 1.3rem;
  letter-spacing: 0.6rem;
  margin: 2.5rem 0;
  user-select: none;
}

/* =========================================================
   NAV
   ========================================================= */
.site-nav {
  position: sticky; top: 0; z-index: 200;
  background: var(--ink);
  border-bottom: 2px solid var(--gold);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  color: var(--gold-pale);
  text-decoration: none;
  padding: 0.9rem 0;
  line-height: 1.25;
}
.nav-logo .en { font-size: 0.95rem; font-weight: 500; letter-spacing: 0.04em; }
.nav-logo .zh-sub { font-size: 0.78rem; color: var(--gold); font-family: 'Noto Serif TC', serif; }

.nav-links { display: flex; list-style: none; gap: 0; }
.nav-links a {
  display: block; padding: 1rem 1.1rem;
  color: #b0a880; font-size: 0.85rem; letter-spacing: 0.04em;
  text-decoration: none;
  border-left: 1px solid var(--ink-soft);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--gold-pale); background: var(--ink-mid);
  text-decoration: none;
}

/* hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 0.5rem;
}
.hamburger span { display: block; width: 24px; height: 2px; background: var(--gold-pale); }

.mobile-menu { display: none; background: var(--ink); border-top: 1px solid var(--ink-soft); }
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block; padding: 0.85rem 2rem;
  color: #b0a880; font-size: 0.9rem;
  border-bottom: 1px solid var(--ink-soft);
  text-decoration: none;
}
.mobile-menu a:hover { color: var(--gold-pale); background: var(--ink-mid); }

/* =========================================================
   PAGE WRAPPERS
   ========================================================= */
.page-content {
  max-width: 1000px; margin: 0 auto;
  padding: 3.5rem 2rem 5rem;
  flex: 1;
}

/* ── Page header (inner pages) ── */
.page-header {
  background: var(--ink);
  text-align: center;
  padding: 3.5rem 2rem 2.8rem;
  border-bottom: 2px solid var(--gold);
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, #2e2618 0%, var(--ink) 75%);
}
.page-header h1 {
  position: relative;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--gold-pale);
  font-weight: 400;
  letter-spacing: 0.05em;
  line-height: 1.3;
}
.page-header h1 .zh-title {
  display: block;
  font-family: 'Noto Serif TC', serif;
  font-size: 0.52em;
  color: var(--gold);
  margin-top: 0.25rem;
  letter-spacing: 0.18em;
}
.page-header .breadcrumb {
  position: relative;
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--warm-light);
  letter-spacing: 0.04em;
}
.page-header .breadcrumb a { color: var(--gold-light); text-decoration: none; }
.page-header .breadcrumb a:hover { text-decoration: underline; }

/* =========================================================
   FOOTER
   ========================================================= */
footer {
  background: var(--ink);
  color: var(--warm-light);
  border-top: 2px solid var(--gold);
  padding: 3rem 2rem 0;
  margin-top: auto;
}
.footer-grid {
  max-width: 1000px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem;
  padding-bottom: 2.5rem;
}
.footer-col h4 {
  color: var(--gold);
  font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.9rem; padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--ink-soft);
}
.footer-col address {
  font-style: normal;
  font-size: 0.85rem; line-height: 1.9;
  color: var(--warm-light);
}
.footer-col a { color: var(--gold-light); }
.footer-col a:hover { text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid var(--ink-soft);
  text-align: center;
  padding: 1.2rem 0;
  font-size: 0.78rem;
  color: #5a4e3a;
}

/* =========================================================
   HOME — HERO
   ========================================================= */
.hero {
  background: var(--ink);
  color: var(--gold-pale);
  text-align: center;
  padding: 5rem 2rem 4rem;
  border-bottom: 2px solid var(--gold);
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 30%, #3a2e1a 0%, var(--ink) 65%);
}
.hero-inner { position: relative; max-width: 780px; margin: 0 auto; }
.hero-sanskrit {
  font-size: clamp(1rem, 2.4vw, 1.45rem);
  color: var(--gold-light);
  font-style: italic; letter-spacing: 0.03em;
  margin-bottom: 1rem;
}
.hero-subtitle {
  font-size: clamp(0.9rem, 1.8vw, 1.05rem);
  color: #b0a880; line-height: 2;
  font-family: 'Noto Serif TC', serif;
}

/* ── Bodhisattva section ── */
.bodhisattva-section {
  display: flex; gap: 3.5rem; align-items: flex-start;
  margin-bottom: 4rem;
}
.bodhisattva-img-wrap { flex: 0 0 200px; text-align: center; }
.bodhisattva-img-wrap img {
  width: 185px;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-md);
}
.bodhisattva-img-wrap .caption {
  margin-top: 0.75rem; font-size: 0.88rem;
  color: var(--warm-mid); font-family: 'Noto Serif TC', serif;
  line-height: 1.6;
}
.quotes { flex: 1; }
.quote-block {
  border-left: 3px solid var(--gold);
  padding: 0.85rem 1.3rem;
  margin-bottom: 1.5rem;
  background: var(--gold-faint);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.quote-block p {
  font-size: 1.05rem;
  color: var(--warm-mid);
  font-style: italic;
  line-height: 1.8;
}

/* ── Slideshow ── */
.slideshow-wrap {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.slideshow-track {
  display: flex;
  transition: transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}
.slideshow-track img {
  min-width: 100%; width: 100%;
  height: 420px; object-fit: cover;
}
.slide-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(26,20,16,0.55); color: var(--gold-pale);
  border: 1px solid rgba(212,196,154,0.4);
  width: 42px; height: 42px; border-radius: 50%;
  font-size: 1.3rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  z-index: 5;
}
.slide-btn:hover { background: rgba(26,20,16,0.9); }
.slide-prev { left: 1rem; }
.slide-next { right: 1rem; }
.slide-dots {
  position: absolute; bottom: 0.9rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: 0.5rem; z-index: 5;
}
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255,255,255,0.35); border: 1px solid var(--gold);
  cursor: pointer; transition: background 0.25s;
}
.dot.active { background: var(--gold); }

/* =========================================================
   MISSION PAGE
   ========================================================= */
.mission-layout {
  display: flex; gap: 3rem; align-items: flex-start; margin-top: 2rem;
}
.mission-img img {
  width: 250px;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-md);
}
.mission-intro {
  margin-bottom: 1.5rem;
  font-size: 1.05rem; color: var(--warm-mid); font-style: italic;
}
.mission-bilingual {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  margin-top: 1.5rem;
}
.mission-bilingual .col {
  padding: 1.4rem 1.6rem;
  background: var(--gold-faint);
  border: 1px solid var(--border-soft);
  font-size: 1rem; line-height: 2.1;
}
.mission-bilingual .col-zh { font-family: 'Noto Serif TC', serif; }

/* =========================================================
   PUBLICATIONS PAGE
   ========================================================= */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 2rem; margin-top: 0.5rem;
}
.book-card {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}
.book-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}
.book-card-cover {
  width: 100%; height: 220px;
  object-fit: cover; object-position: center top;
}
.book-card-body { padding: 1rem 1.1rem 1.2rem; }
.book-card-body h3 {
  font-size: 0.88rem; line-height: 1.55;
  color: var(--ink); font-weight: 500;
  margin-bottom: 0.35rem;
}
.book-card-body .book-type {
  font-size: 0.75rem; color: var(--warm-mid);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.books-note {
  margin-top: 2.5rem; padding: 1.2rem 1.6rem;
  border-left: 3px solid var(--gold);
  background: var(--gold-faint);
  font-size: 0.95rem; color: var(--warm-mid);
  line-height: 1.8;
}

/* =========================================================
   BOOK DETAIL PAGE
   ========================================================= */
.book-detail {
  display: flex; gap: 3.5rem; align-items: flex-start;
  margin-top: 0.5rem;
}
.book-cover-wrap { flex: 0 0 240px; }
.book-cover-wrap img {
  width: 240px;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-md);
}
.book-info { flex: 1; }
.book-info h1 {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  color: var(--ink); font-weight: 500;
  line-height: 1.4; margin-bottom: 1.2rem;
}
.book-description {
  font-size: 1rem; color: var(--warm-mid);
  line-height: 1.9; margin-bottom: 2rem;
  white-space: pre-line;
}
.book-meta {
  border-top: 1px solid var(--border-soft);
  padding-top: 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.book-meta-row { display: flex; gap: 0; }
.book-meta-label {
  flex: 0 0 160px;
  font-size: 0.82rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gold);
  font-weight: 500; padding-top: 0.1rem;
}
.book-meta-value {
  font-size: 0.93rem; color: var(--ink); line-height: 1.7;
}
.book-meta-value a { color: var(--red); }
.book-meta-value a:hover { text-decoration: underline; }
.buy-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.8rem; }
.buy-link {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 0.82rem; letter-spacing: 0.06em;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  border-radius: var(--radius);
}
.buy-link:hover { background: var(--gold); color: var(--ink); text-decoration: none; }
.podcast-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.6rem; }
.podcast-link {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  color: var(--warm-mid);
  font-size: 0.8rem;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
  border-radius: var(--radius);
}
.podcast-link:hover { border-color: var(--gold); color: var(--gold); }

.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; color: var(--warm-mid);
  margin-bottom: 2rem; text-decoration: none;
  letter-spacing: 0.03em;
}
.back-link:hover { color: var(--gold); }
.back-link::before { content: '←'; font-size: 1em; }

/* =========================================================
   CONTACT PAGE
   ========================================================= */
.contact-intro {
  text-align: center; padding: 1rem 0 2.5rem;
  font-size: 1.05rem; color: var(--warm-mid); font-style: italic;
}
.contact-intro .zh-line {
  display: block; font-style: normal;
  font-family: 'Noto Serif TC', serif;
  font-size: 0.92rem; margin-top: 0.3rem;
}
.contact-locations {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.8rem;
  margin-bottom: 3.5rem;
}
.contact-card {
  padding: 1.5rem 1.6rem;
  border: 1px solid var(--border);
  background: var(--gold-faint);
}
.contact-card h3 {
  color: var(--gold); font-size: 0.78rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 0.9rem; font-weight: 500;
  padding-bottom: 0.4rem; border-bottom: 1px solid var(--border-soft);
}
.contact-card p { font-size: 0.88rem; line-height: 1.9; }
.contact-card a { color: var(--red); }
.contact-card a:hover { text-decoration: underline; }

.contact-form-wrap h3 {
  font-size: 1.1rem; color: var(--warm-mid);
  font-style: italic; margin-bottom: 1.6rem;
}
.contact-form-wrap h3 .zh-label {
  font-style: normal; font-family: 'Noto Serif TC', serif;
  font-size: 0.85em; color: var(--gold); margin-left: 0.4rem;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block; font-size: 0.8rem; letter-spacing: 0.05em;
  color: var(--warm-mid); margin-bottom: 0.4rem;
}
.form-group input,
.form-group textarea {
  width: 100%; padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  background: #fff; color: var(--ink);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.95rem; border-radius: var(--radius);
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--gold); }
.form-group input.error,
.form-group textarea.error { outline: none; border-color: var(--red); }
.form-group textarea { height: 140px; resize: vertical; }
.submit-btn {
  background: var(--ink); color: var(--gold-pale);
  border: 2px solid var(--gold);
  padding: 0.72rem 2.6rem;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.95rem; letter-spacing: 0.1em;
  cursor: pointer; border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
}
.form-group .captcha-box{
  position: relative;
}
.form-group .captcha-box img{
  position: absolute;
  top: 1px;
  right: 1px;
  z-index: 10;
  height: 40px;
  cursor: pointer;
}
.form-group .captcha-box input{
  padding-right: calc(0.9rem + 120px);
}
.form-group div.error{
  font-size: 0.8rem;
  line-height: 1.2;
  color: var(--red);
}
.submit-btn:hover { background: var(--gold); color: var(--ink); }
.form-success {
  display: none; margin-top: 1rem;
  padding: 0.85rem 1.3rem;
  background: var(--gold-faint); border-left: 3px solid var(--gold);
  font-size: 0.9rem; color: var(--warm-mid);
}

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

  .bodhisattva-section { flex-direction: column; align-items: center; }
  .bodhisattva-img-wrap { flex: none; }
  .quotes { width: 100%; }

  .mission-layout { flex-direction: column; }
  .mission-bilingual { grid-template-columns: 1fr; }

  .contact-locations { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .form-grid { grid-template-columns: 1fr; }

  .book-detail { flex-direction: column; }
  .book-cover-wrap img { width: 200px; }
  .book-meta-label { flex: 0 0 130px; }

  .slideshow-track img { height: 240px; }
  .books-grid { grid-template-columns: repeat(2, 1fr); }
}
