/* =========================================================
   Đình Làng Rùa — Website di tích
   Phong cách: Ấm áp làng quê
   Palette: xanh lá lúa — vàng nắng — nâu tre — be giấy dó
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,700;1,500&family=Be+Vietnam+Pro:wght@300;400;500;600;700&display=swap');

:root {
  --bg-warm:      #F7F1E1;
  --bg-cream:     #FDF9EF;
  --bg-deep:      #EDE3CB;
  --line:         #D9C9A3;

  --text:         #2E241B;
  --text-soft:    #5C4A38;
  --text-mute:    #8A755A;

  --brown:        #7A5A2E;
  --brown-deep:   #573F1C;
  --green:        #5B7C3A;
  --green-deep:   #3E5B23;
  --red:          #A93826;
  --gold:         #C99A38;

  --font-serif:   'Playfair Display', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans:    'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --measure:      42rem;
  --wide:         64rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg-warm);
  background-image:
    radial-gradient(1200px 400px at 50% -200px, rgba(201, 154, 56, 0.10), transparent),
    radial-gradient(800px 400px at 100% 800px, rgba(91, 124, 58, 0.06), transparent);
  min-height: 100vh;
}

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

a { color: var(--brown-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }

/* ---------- Header + Nav ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg-cream);
  position: sticky; top: 0; z-index: 30;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.site-header__inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  display: flex; flex-direction: column; line-height: 1.1;
  text-decoration: none;
}
.brand__name {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brown-deep);
  letter-spacing: 0.01em;
}
.brand__sub {
  font-size: 0.8rem;
  color: var(--text-mute);
  margin-top: 0.15rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.nav a {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--bg-deep); color: var(--brown-deep); }
.nav a.is-active { background: var(--brown); color: #FDF9EF; }
.nav a.is-active:hover { background: var(--brown-deep); color: #FDF9EF; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero__media {
  position: relative;
  width: 100%;
  height: min(78vh, 56.25vw);
  overflow: hidden;
  background: #2E241B;
}
.hero__media img, .hero__media video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero__media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(46,36,27,0) 30%,
    rgba(46,36,27,0.55) 78%,
    rgba(46,36,27,0.82) 100%);
}
.hero__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2rem 1.25rem 2.25rem;
  color: #FDF9EF;
  z-index: 2;
  text-align: center;
}
.hero__eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #E9D6A6;
  margin-bottom: 0.75rem;
  font-weight: 500;
}
.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5.5vw, 3.6rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.hero__sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: #F5E6C2;
  margin: 0 auto;
  max-width: 40rem;
}

/* ---------- Main content ---------- */
main { padding: 3rem 1.25rem 5rem; }
.container { max-width: var(--wide); margin: 0 auto; }
.prose { max-width: var(--measure); margin: 0 auto; }
.prose > * + * { margin-top: 1rem; }

.prose h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--brown-deep);
  margin: 3rem 0 0.5rem;
  line-height: 1.25;
  font-weight: 700;
  position: relative;
  padding-top: 1.2rem;
}
.prose h2::before {
  content: "";
  display: block;
  width: 48px; height: 2px;
  background: var(--gold);
  margin-bottom: 0.9rem;
}
.prose h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--green-deep);
  margin: 2rem 0 0.25rem;
  font-weight: 600;
}
.prose p {
  color: var(--text);
  text-align: justify;
  hyphens: auto;
}
.prose p.lead {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--text-soft);
  text-align: center;
  padding: 0 1rem;
  margin-bottom: 2rem;
}
.prose .drop::first-letter {
  font-family: var(--font-serif);
  font-size: 3.6rem;
  float: left;
  line-height: 1;
  padding: 0.35rem 0.6rem 0 0;
  color: var(--red);
  font-weight: 700;
}
.prose blockquote {
  border-left: 3px solid var(--gold);
  padding: 0.25rem 1.1rem;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-soft);
  margin: 1.5rem 0;
  background: rgba(201, 154, 56, 0.06);
}

/* ---------- Figure ---------- */
figure { margin: 2.5rem 0; }
figure img, figure video {
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(46,36,27,0.15);
}
figcaption {
  font-size: 0.9rem;
  color: var(--text-mute);
  text-align: center;
  margin-top: 0.6rem;
  font-style: italic;
}

/* ---------- Info card ---------- */
.info-card {
  background: var(--bg-cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  margin: 2.5rem auto;
  max-width: var(--measure);
}
.info-card h3 {
  font-family: var(--font-serif);
  color: var(--brown-deep);
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.info-card dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.25rem;
  margin: 0;
  font-size: 0.95rem;
}
.info-card dt { color: var(--text-mute); font-weight: 500; }
.info-card dd { margin: 0; color: var(--text); }

/* ---------- Media grid ---------- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0;
}
.media-grid figure { margin: 0; }
.media-grid figure video { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }

/* ---------- CTA ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  background: var(--brown);
  color: #FDF9EF;
  text-decoration: none;
  font-weight: 500;
  border-radius: 4px;
  transition: background 0.15s, transform 0.15s;
  font-size: 1rem;
}
.btn:hover { background: var(--brown-deep); color: #FDF9EF; transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--brown-deep);
  border: 1px solid var(--brown);
}
.btn--ghost:hover { background: var(--brown); color: #FDF9EF; }
.cta-row { text-align: center; margin: 2.5rem 0; display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Tour 360 ---------- */
.tour-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 8px;
  background: #1a1410;
  box-shadow: 0 8px 32px rgba(46,36,27,0.2);
  margin: 2rem 0;
}
.tour-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: linear-gradient(135deg, #3E5B23, #7A5A2E);
  color: #FDF9EF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.75rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-style: italic;
  text-align: center;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 8px 32px rgba(46,36,27,0.2);
}
.tour-placeholder small {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-style: normal;
  color: #E9D6A6;
  letter-spacing: 0.05em;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-cream);
  padding: 2rem 1.25rem;
  color: var(--text-mute);
  font-size: 0.9rem;
  text-align: center;
}
.site-footer strong { color: var(--brown-deep); }
.site-footer p { margin: 0.35rem 0; }

/* ---------- Ornament ---------- */
.ornament {
  text-align: center;
  margin: 3rem 0 2rem;
  color: var(--gold);
  font-size: 1.5rem;
  letter-spacing: 0.5em;
}
.ornament::before { content: "❦"; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  main { padding: 2rem 1rem 3rem; }
  .site-header__inner { padding: 0.75rem 1rem; }
  .nav a { padding: 0.4rem 0.7rem; font-size: 0.9rem; }
  .brand__name { font-size: 1.25rem; }
  .brand__sub { font-size: 0.7rem; }
  .hero__caption { padding: 1.5rem 1rem 1.75rem; }
  .info-card dl { grid-template-columns: 1fr; gap: 0.15rem 0; }
  .info-card dt { margin-top: 0.6rem; }
}

@media print {
  .site-header, .site-footer, .nav, .cta-row { display: none; }
  body { background: white; color: black; }
  .hero__media { display: none; }
}

/* ===== Song ngữ vi/en ===== */
html[data-lang="en"] .vi{display:none!important}
html:not([data-lang="en"]) .en{display:none!important}
.lang-btn{cursor:pointer;border:1px solid currentColor;background:transparent;color:inherit;
  border-radius:16px;padding:4px 12px;font-weight:700;font-size:.85rem;margin-left:10px}
