/* ============================================================
   JB Heritage Trail – Global Stylesheet
   Colour palette: warm paper (#f5ede0), deep red (#8b1a1a),
   gold (#c9a227), ink (#2c1a0e), muted (#7a6652)
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@300;400;500&family=Playfair+Display:ital,wght@0,700;1,400&display=swap');

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

:root {
  --paper:   #f5ede0;
  --paper2:  #ede1cf;
  --red:     #8b1a1a;
  --red-lt:  #b33030;
  --gold:    #c9a227;
  --gold-lt: #e0b840;
  --ink:     #2c1a0e;
  --muted:   #7a6652;
  --white:   #fff;
  --nav-h:   64px;
  --radius:  8px;
  --shadow:  0 4px 20px rgba(44,26,14,.18);
}

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

img { display: block; max-width: 100%; }
a   { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-lt); text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: 'Noto Serif SC', 'STSong', serif;
  font-weight: 700;
  line-height: 1.3;
}

/* ── Top Navigation ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--ink);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

.site-nav .nav-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--gold);
  font-family: 'Noto Serif SC', serif;
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
}

.site-nav .nav-logo img {
  height: 42px;
  width: auto;
  border-radius: 4px;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin-left: auto;
}

.nav-links a {
  color: var(--paper2);
  font-size: .92rem;
  padding: .3rem .5rem;
  border-radius: 4px;
  transition: background .2s, color .2s;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--red);
  color: var(--white);
  text-decoration: none;
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--paper);
  transition: transform .3s;
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(.45) sepia(.25);
  transition: transform 8s ease;
}

.hero:hover .hero-bg { transform: scale(1.04); }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(44,26,14,.3) 0%, rgba(44,26,14,.65) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  max-width: 800px;
}

.hero-logo {
  height: 90px;
  width: auto;
  margin: 0 auto 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}

.hero-content h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--gold);
  text-shadow: 0 2px 10px rgba(0,0,0,.6);
  margin-bottom: .5rem;
}

.hero-content .subtitle {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--paper);
  margin-bottom: 2rem;
  opacity: .9;
}

.btn {
  display: inline-block;
  padding: .75rem 2rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .15s;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
  border: none;
}
.btn-primary:hover { background: var(--red-lt); transform: translateY(-2px); text-decoration: none; color: var(--white); }

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 2px solid var(--gold);
}
.btn-outline:hover { background: var(--gold); color: var(--ink); text-decoration: none; transform: translateY(-2px); }

/* ── Section header ── */
.section-header {
  text-align: center;
  padding: 4rem 1rem 2rem;
}

.section-header .eyebrow {
  font-size: .8rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .5rem;
}

.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--red);
  margin-bottom: .75rem;
}

.section-header p {
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
}

.divider {
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin: 1rem auto 0;
  border-radius: 2px;
}

/* ── Cards grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 1rem 2rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .25s, box-shadow .25s;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(44,26,14,.28);
}

.card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center;
}

.card-body {
  padding: 1.25rem 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body .tag {
  font-size: .75rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .4rem;
}

.card-body h3 {
  font-size: 1.2rem;
  color: var(--red);
  margin-bottom: .5rem;
}

.card-body p {
  font-size: .9rem;
  color: var(--muted);
  flex: 1;
}

.card-body .card-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--red);
}
.card-body .card-link:hover { color: var(--red-lt); }

/* ── Section splash (used on inner pages) ── */
.section-hero {
  height: 55vh;
  min-height: 300px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 2.5rem 2rem;
}

.section-hero .hero-bg {
  filter: brightness(.4) sepia(.3);
}

.section-hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.section-hero-content .eyebrow {
  color: var(--gold);
  font-size: .85rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: .4rem;
}

.section-hero-content h1 {
  color: var(--white);
  font-size: clamp(1.8rem, 4vw, 3rem);
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}

.section-hero-content p {
  color: var(--paper2);
  font-size: 1rem;
  max-width: 560px;
  margin-top: .5rem;
}

/* ── Content block ── */
.content-block {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.content-block h2 {
  font-size: 1.7rem;
  color: var(--red);
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--gold);
}

.content-block h3 {
  font-size: 1.2rem;
  color: var(--ink);
  margin: 1.5rem 0 .5rem;
}

.content-block p {
  margin-bottom: 1rem;
  color: #3e2c1a;
}

/* ── Site entry (two-column layout) ── */
.site-entry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--paper2);
}

.site-entry:last-child { border-bottom: none; }

.site-entry.reverse { direction: rtl; }
.site-entry.reverse > * { direction: ltr; }

.site-entry-img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.site-entry-text h2 {
  font-size: 1.5rem;
  border-bottom: 2px solid var(--gold);
  padding-bottom: .4rem;
  margin-bottom: 1rem;
}

.site-entry-text .meta {
  font-size: .8rem;
  letter-spacing: .1em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: .75rem;
}

/* ── Photo gallery ── */
.gallery-section {
  background: var(--paper2);
  padding: 3rem 2rem;
}

.gallery-section h2 {
  font-family: 'Noto Serif SC', serif;
  text-align: center;
  font-size: 1.5rem;
  color: var(--red);
  margin-bottom: .5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
  max-width: 1200px;
  margin: 1.5rem auto 0;
}

.gallery-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
}

.gallery-grid img:hover {
  opacity: .85;
  transform: scale(1.02);
}

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.92);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox.open { display: flex; }

.lightbox-img {
  max-height: 90vh;
  max-width: 90vw;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 2rem;
  color: var(--paper);
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  color: var(--paper);
  background: rgba(44,26,14,.5);
  border: none;
  cursor: pointer;
  padding: .5rem .9rem;
  border-radius: 4px;
  transition: background .2s;
}
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-prev:hover, .lightbox-next:hover { background: var(--red); }

/* ── Map section ── */
.map-section {
  padding: 3rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.map-section h2 {
  font-size: 1.5rem;
  color: var(--red);
  margin-bottom: 1rem;
}

.map-section img {
  width: 100%;
  max-height: 600px;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 auto;
}

/* ── Info cards (for five-deity, etc.) ── */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.info-card {
  background: var(--white);
  border-left: 4px solid var(--gold);
  padding: 1rem 1.2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: 0 2px 8px rgba(44,26,14,.1);
}

.info-card .deity-group {
  font-size: .75rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.info-card h4 {
  font-size: 1rem;
  color: var(--red);
  margin: .25rem 0 .25rem;
}

.info-card p {
  font-size: .85rem;
  color: var(--muted);
}

/* ── Quote block ── */
.quote-block {
  border-left: 4px solid var(--gold);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: rgba(201,162,39,.08);
  font-style: italic;
  color: var(--ink);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.quote-block cite {
  display: block;
  margin-top: .5rem;
  font-size: .85rem;
  color: var(--muted);
  font-style: normal;
}

/* ── Footer ── */
.site-footer {
  background: var(--ink);
  color: var(--paper2);
  text-align: center;
  padding: 2.5rem 2rem;
  font-size: .85rem;
}

.site-footer a { color: var(--gold); }

/* ── Breadcrumb ── */
.breadcrumb {
  padding: .75rem 2rem;
  font-size: .82rem;
  color: var(--muted);
  max-width: 1200px;
  margin: 0 auto;
}

.breadcrumb a { color: var(--red); }
.breadcrumb span { margin: 0 .4rem; }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: .5rem;
  padding: 0 2rem;
  max-width: 1200px;
  margin: 2rem auto 0;
  border-bottom: 2px solid var(--paper2);
  flex-wrap: wrap;
}

.tab-btn {
  padding: .6rem 1.4rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: .95rem;
  font-family: 'Noto Sans SC', sans-serif;
  color: var(--muted);
  margin-bottom: -2px;
  transition: color .2s, border-color .2s;
}

.tab-btn.active {
  color: var(--red);
  border-bottom-color: var(--red);
  font-weight: 600;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; gap: .5rem; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--ink);
    padding: 1rem 2rem;
    border-top: 1px solid rgba(255,255,255,.1);
  }
  .nav-toggle { display: flex; }

  .site-entry { grid-template-columns: 1fr; }
  .site-entry.reverse { direction: ltr; }
  .site-entry-img { height: 240px; }

  .cards-grid { padding: 1rem; gap: 1rem; }
  .hero { min-height: 75vh; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .section-hero { height: 45vh; padding: 1.5rem 1rem; }
}
