/* National Library of Bolivia — Reference Guide
   Scholarly / archival theme: parchment, oxblood, gold. Custom CSS, no framework.
   Content is visible with CSS alone; nothing is gated on JavaScript. */

:root {
  --parchment: #f6f1e7;
  --parchment-2: #efe7d4;
  --surface: #fffdf8;
  --ink: #2b2621;
  --ink-soft: #5f574c;
  --oxblood: #6b1f2a;
  --oxblood-dark: #501420;
  --oxblood-deep: #331216;
  --gold: #a9772e;
  --gold-soft: #d9b25b;
  --line: #e2d8c4;
  --line-strong: #cdbfa2;
  --shadow: 0 8px 28px rgba(53, 23, 26, 0.12);
  --shadow-sm: 0 3px 12px rgba(53, 23, 26, 0.08);
  --maxw: 1120px;
  --prose: 760px;
}

/* Safeguard: never leave content hidden waiting on JS (defensive; no AOS used). */
[data-aos] { opacity: 1 !important; transform: none !important; }

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Lora", Georgia, "Times New Roman", serif;
  font-size: 1.075rem;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--parchment);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(169, 119, 46, 0.05), transparent 40%),
    radial-gradient(circle at 88% 92%, rgba(107, 31, 42, 0.05), transparent 42%);
  min-height: 100vh;
}

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

a { color: var(--oxblood); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; transition: color .15s ease; }
a:hover { color: var(--gold); }

h1, h2, h3, h4 { font-family: "Playfair Display", Georgia, serif; line-height: 1.2; color: var(--oxblood-dark); font-weight: 600; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.4rem; }

/* ---------- Disclaimer topbar ---------- */
.topbar {
  background: var(--oxblood-deep);
  color: #f3e4c9;
  font-family: "Lora", serif;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  text-align: center;
  padding: 0.5rem 1rem;
  border-bottom: 2px solid var(--gold);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 1.4rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; }
.brand:hover { color: inherit; }
.brand-mark {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(150deg, var(--oxblood), var(--oxblood-dark));
  border: 1.5px solid var(--gold-soft);
  padding: 0.5rem 0.55rem;
  border-radius: 7px;
  line-height: 1;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: "Playfair Display", serif; font-size: 1.12rem; color: var(--oxblood-dark); font-weight: 700; }
.brand-text em { font-style: normal; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }

/* ---------- Navigation (details/summary, no-JS friendly) ---------- */
.site-nav { position: relative; }
.nav-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-family: "Lora", serif;
  font-weight: 600;
  color: var(--oxblood-dark);
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}
.nav-menu summary::-webkit-details-marker { display: none; }
.burger { width: 18px; height: 2px; background: var(--oxblood); position: relative; display: inline-block; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: var(--oxblood); }
.burger::before { top: -6px; }
.burger::after { top: 6px; }
.nav-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0.5rem;
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.nav-list li { margin: 0; }
.nav-list a {
  display: block;
  padding: 0.55rem 0.7rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  border-radius: 5px;
}
.nav-list a:hover { background: var(--parchment-2); color: var(--oxblood); }
.nav-list a.active { color: var(--oxblood); font-weight: 700; background: rgba(169,119,46,0.10); }

@media (min-width: 940px) {
  .nav-menu summary { display: none; }
  .nav-menu .nav-list {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-end;
    position: static;
    margin: 0;
    padding: 0;
    min-width: 0;
    background: none;
    border: none;
    box-shadow: none;
    gap: 0.1rem;
  }
  .nav-list a { padding: 0.4rem 0.62rem; font-size: 0.92rem; border-radius: 5px; }
  .nav-list a.active { background: none; border-bottom: 2px solid var(--gold); border-radius: 0; }
}

/* ---------- Hero ---------- */
.page-hero {
  background: linear-gradient(140deg, var(--oxblood), var(--oxblood-dark) 70%, var(--oxblood-deep));
  color: #f6ecd6;
  padding: 3rem 1.4rem;
  border-bottom: 3px solid var(--gold);
  position: relative;
}
.page-hero .hero-inner { max-width: var(--maxw); margin: 0 auto; }
.page-hero .kicker {
  font-family: "Lora", serif;
  font-style: italic;
  color: var(--gold-soft);
  letter-spacing: 0.04em;
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
}
.page-hero h1 { color: #fdf6e6; font-size: clamp(1.9rem, 4.6vw, 3.1rem); margin: 0; max-width: 22ch; }
.home-hero {
  padding: 5rem 1.4rem 4.4rem;
  background-size: cover;
  background-position: center;
}
.home-hero .hero-inner { max-width: 860px; }
.home-hero h1 { max-width: 18ch; }
.hero-sub { margin: 1.1rem 0 0; font-size: 1.18rem; max-width: 60ch; color: #f0e3ca; }
.hero-badge {
  display: inline-block;
  margin-top: 1.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fbeecb;
  border: 1px solid var(--gold-soft);
  border-radius: 30px;
  padding: 0.35rem 0.95rem;
  background: rgba(51, 18, 22, 0.35);
}

/* ---------- Main / Prose ---------- */
.main-content { padding: 2.6rem 1.4rem 1rem; }
.prose { max-width: var(--prose); margin: 0 auto; }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15rem; }
.prose .lede {
  font-size: 1.28rem;
  line-height: 1.6;
  color: #43392f;
  border-left: 3px solid var(--gold);
  padding-left: 1.1rem;
  margin-bottom: 1.7rem;
}
.prose h2 {
  font-size: 1.72rem;
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.prose h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 62px; height: 3px;
  background: var(--gold);
}
.prose h3 { font-size: 1.28rem; margin: 1.8rem 0 0.6rem; color: var(--oxblood); }
.prose ul, .prose ol { margin: 0 0 1.3rem; padding-left: 0; }
.prose ul { list-style: none; }
.prose ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.55rem;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0.15rem; top: 0.65em;
  width: 7px; height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
}
.prose ol { padding-left: 1.4rem; }
.prose ol li { margin-bottom: 0.55rem; }
.prose strong { color: var(--oxblood-dark); }
.prose em { color: var(--ink-soft); }

/* ---------- Figures ---------- */
figure { margin: 1.8rem 0; }
.inline-figure img {
  width: 100%;
  border-radius: 10px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
figcaption {
  font-size: 0.86rem;
  color: var(--ink-soft);
  font-style: italic;
  margin-top: 0.5rem;
  text-align: center;
}

/* ---------- Callouts ---------- */
.callout {
  border-radius: 9px;
  padding: 1.1rem 1.25rem;
  margin: 1.6rem 0;
  font-size: 0.99rem;
}
.callout p { margin: 0 0 0.6rem; }
.callout p:last-child { margin-bottom: 0; }
.callout h2 { margin: 0 0 0.5rem; font-size: 1.25rem; border: none; padding: 0; }
.callout h2::after { display: none; }
.callout-note {
  background: linear-gradient(180deg, #fbf4e2, #f7edd6);
  border: 1px solid #e6d3a4;
  border-left: 4px solid var(--gold);
}
.callout-warning {
  background: #f9edec;
  border: 1px solid #e4c3c2;
  border-left: 4px solid var(--oxblood);
}
.callout-warning h2 { color: var(--oxblood); }

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  margin: 1.8rem 0 2rem;
}
.gallery-cell { margin: 0; }
.gallery-cell img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3.5rem;
  background: var(--oxblood-deep);
  color: #e9dcc4;
  border-top: 3px solid var(--gold);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
  padding: 2.8rem 1.4rem 1.6rem;
}
.site-footer h2 {
  font-size: 1.05rem;
  color: var(--gold-soft);
  margin: 0 0 0.9rem;
  letter-spacing: 0.02em;
}
.site-footer p { font-size: 0.92rem; line-height: 1.65; color: #ddceb4; margin: 0 0 0.7rem; }
.footer-official { font-size: 0.88rem !important; }
.site-footer a { color: #f0dcae; }
.site-footer a:hover { color: #fff; }
.footer-nav, .footer-sources { list-style: none; margin: 0; padding: 0; }
.footer-nav li, .footer-sources li { margin-bottom: 0.45rem; font-size: 0.92rem; }
.footer-nav a, .footer-sources a { text-decoration: none; }
.footer-nav a:hover, .footer-sources a:hover { text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(217, 178, 91, 0.25);
  padding: 1.1rem 1.4rem 1.6rem;
}
.footer-bottom p { font-size: 0.82rem; color: #c8b795; margin: 0; }

/* ---------- Entrance (CSS-only, ends visible; runs on load, not JS/scroll gated) ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .page-hero .hero-inner { animation: fadeUp .6s ease both; }
  .main-content .prose > * { animation: fadeUp .5s ease both; }
}

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  body { font-size: 1.02rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .prose .lede { font-size: 1.15rem; }
  .home-hero { padding: 3.4rem 1.4rem 3rem; }
  .brand-text strong { font-size: 1rem; }
}
