/* Museo de la Guampa — sistema de diseño (Rediseño v2) */

/* ---------- Fuentes ---------- */
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/cormorant-garamond-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2010-2019, U+201C-201D, U+2026; }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/assets/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2010-2019, U+201C-201D, U+2026; }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/assets/fonts/cormorant-garamond-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2010-2019, U+201C-201D, U+2026; }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/cormorant-garamond-latin-400-italic.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2010-2019, U+201C-201D, U+2026; }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/cormorant-garamond-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/assets/fonts/cormorant-garamond-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/assets/fonts/cormorant-garamond-cyrillic-700-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/cormorant-garamond-cyrillic-400-italic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/inter-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2010-2019, U+201C-201D, U+2026; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/assets/fonts/inter-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2010-2019, U+201C-201D, U+2026; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/assets/fonts/inter-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2010-2019, U+201C-201D, U+2026; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/inter-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/assets/fonts/inter-cyrillic-500-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/assets/fonts/inter-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

/* ---------- Tokens ---------- */
:root {
  --paper: #f4efe6;
  --paper-soft: #efe8db;
  --card: #fbf8f2;
  --ink: #2b2115;
  --ink-soft: #5b4c39;
  --ink-faint: #8a7a64;
  --accent: #a4671e;
  --accent-dark: #7d4e14;
  --dark: #2b2115;
  --dark-text: #efe6d7;
  --rule: #d9cfbd;
  --serif: 'Cormorant Garamond', 'Georgia', serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Utilidades tipográficas ---------- */
.label {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--accent);
}
.serif { font-family: var(--serif); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0; }

/* ---------- Header ---------- */
.site-header {
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: relative; z-index: 20;
}
.site-header .wrap { display: flex; align-items: center; gap: 18px; padding-top: 16px; padding-bottom: 16px; }
.brand { text-decoration: none; display: flex; align-items: center; gap: 13px; }
.brand .brand-mark { width: 38px; height: auto; }
.brand .brand-name { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: .01em; }
.brand .brand-sub { font-size: 9.5px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-faint); margin-top: 2px; }
.main-nav { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.main-nav a { font-size: 13px; font-weight: 500; text-decoration: none; color: var(--ink-soft); padding-bottom: 3px; }
.main-nav a:hover { color: var(--ink); }
.main-nav a.active { color: var(--ink); border-bottom: 2px solid var(--accent); }
.lang-switch { display: flex; border: 1px solid var(--rule); border-radius: 3px; overflow: hidden; margin-left: 6px; }
.lang-switch a {
  font-size: 11px; font-weight: 600; letter-spacing: .06em; padding: 6px 10px;
  text-decoration: none; color: var(--ink-faint); border-bottom: none;
}
.lang-switch a.active { background: var(--ink); color: var(--paper); }
.nav-toggle { display: none; background: none; border: 1px solid var(--rule); border-radius: 3px; padding: 7px 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); margin: 3px 0; }

/* ---------- Hero (home) ---------- */
.hero { padding: 64px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5.2vw, 58px); font-weight: 600; margin: 14px 0 18px; }
.hero p { color: var(--ink-soft); max-width: 46ch; margin: 0 0 26px; }
.hero-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.btn {
  display: inline-block; background: var(--dark); color: var(--dark-text);
  font-size: 13px; font-weight: 600; letter-spacing: .04em;
  padding: 13px 26px; text-decoration: none; border: none; cursor: pointer;
}
.btn:hover { background: #191307; }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--ink-soft); }
.btn-outline:hover { background: var(--paper-soft); }
.link-underline { font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.hero-figure { position: relative; }
.hero-figure img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.img-chip {
  position: absolute; left: 14px; bottom: 14px; background: rgba(28,21,12,.85); color: var(--dark-text);
  font-size: 11px; letter-spacing: .05em; padding: 6px 11px;
}
.img-chip a { color: inherit; text-decoration: none; }

/* ---------- Stats ---------- */
.stats { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stats .wrap { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat { padding: 26px 20px; text-align: left; }
.stat + .stat { border-left: 1px solid var(--rule); }
.stat .stat-num { font-family: var(--serif); font-size: 34px; font-weight: 600; }
.stat .stat-label { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }

/* ---------- Secciones ---------- */
.section { padding: 62px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); }

/* ---------- Cards de colección ---------- */
.world-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.world-card { background: var(--card); border: 1px solid var(--rule); text-decoration: none; display: flex; flex-direction: column; }
.world-card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.world-card .world-body { padding: 18px 20px 20px; }
.world-card h3 { font-size: 22px; margin-bottom: 6px; }
.world-card p { font-size: 13px; color: var(--ink-soft); margin: 0 0 12px; }
.world-card .world-count { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.world-card:hover { border-color: var(--accent); }

/* ---------- Banda oscura ---------- */
.dark-band { background: var(--dark); color: var(--dark-text); }
.dark-band .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 0; align-items: stretch; }
.dark-band .band-text { padding: 56px 48px 56px 0; }
.dark-band blockquote { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2.6vw, 27px); line-height: 1.4; margin: 14px 0 22px; color: #e9dfcd; }
.dark-band .band-figure img { width: 100%; height: 100%; object-fit: cover; }
.dark-band .label { color: #c89a55; }
.dark-band .link-underline { color: var(--dark-text); }

/* ---------- Página colección ---------- */
.page-head { padding: 46px 0 8px; }
.page-head h1 { font-size: clamp(30px, 4vw, 44px); margin: 6px 0 0; }
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 22px 0 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 12px; font-weight: 600; padding: 7px 14px; cursor: pointer;
  background: transparent; border: 1px solid var(--rule); color: var(--ink-soft);
  border-radius: 2px; text-decoration: none;
}
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip:hover:not(.active) { border-color: var(--ink-soft); }
.search-box {
  font-family: var(--sans); font-size: 13px; padding: 9px 14px; min-width: 240px;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink); border-radius: 2px;
}
.search-box:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.count-line { font-size: 12px; color: var(--ink-faint); margin: 10px 0 22px; }

.piece-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding-bottom: 70px; }
.piece-card { background: var(--card); border: 1px solid var(--rule); text-decoration: none; display: flex; flex-direction: column; }
.piece-card:hover { border-color: var(--accent); }
.piece-card .ph { aspect-ratio: 1/1; overflow: hidden; background: #fff; }
.piece-card img { width: 100%; height: 100%; object-fit: cover; }
.piece-card .piece-body { padding: 12px 14px 14px; border-top: 1px solid var(--rule); }
.piece-card .piece-code { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; color: var(--accent); }
.piece-card .piece-name { font-family: var(--serif); font-size: 17px; font-weight: 600; line-height: 1.2; margin: 3px 0 4px; }
.piece-card .piece-col { font-size: 11px; color: var(--ink-faint); }

/* ---------- Ficha de pieza ---------- */
.breadcrumb { font-size: 12px; color: var(--ink-faint); padding: 18px 0 0; }
.breadcrumb a { color: var(--ink-faint); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb strong { color: var(--ink-soft); font-weight: 600; }

.item-layout { display: grid; grid-template-columns: 1.05fr .95fr; gap: 46px; padding: 26px 0 40px; }
.gallery-frame { background: var(--card); border: 1px solid var(--rule); padding: 14px; }
.viewer {
  width: 100%; aspect-ratio: 4/3; background: #fff; position: relative;
}
.viewer .osd { position: absolute; inset: 0; }
.zoom-hint { font-size: 11.5px; color: var(--ink-faint); margin-top: 10px; display: flex; align-items: center; gap: 6px; }
.thumb-strip { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.thumb-strip button {
  width: 64px; height: 64px; padding: 0; cursor: pointer; overflow: hidden;
  border: 2px solid var(--rule); background: #fff;
}
.thumb-strip button.active { border-color: var(--accent); }
.thumb-strip img { width: 100%; height: 100%; object-fit: cover; }

.item-info .label { margin-bottom: 8px; display: block; }
.item-info h1 { font-size: clamp(28px, 3.6vw, 40px); margin: 4px 0 6px; }
.inv-code { font-size: 12.5px; color: var(--ink-faint); margin-bottom: 20px; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); margin-top: 18px; }
.spec { padding: 13px 4px; border-bottom: 1px solid var(--rule); }
.spec .spec-label { font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); }
.spec .spec-value { font-size: 14px; font-weight: 500; margin-top: 3px; }
.item-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.item-nav { display: flex; justify-content: space-between; font-size: 13px; padding: 8px 0 8px; border-top: 1px solid var(--rule); margin-top: 10px; }
.item-nav a { text-decoration: none; color: var(--ink-soft); font-weight: 500; }
.item-nav a:hover { color: var(--accent); }

.related { padding: 30px 0 70px; }
.related h2 { font-size: 24px; margin-bottom: 20px; }

/* ---------- Página editorial ---------- */
.article-hero { position: relative; background: var(--dark); }
.article-hero img { width: 100%; height: 320px; object-fit: cover; opacity: .55; }
.article-hero .article-hero-text { position: absolute; left: 0; right: 0; bottom: 34px; }
.article-hero h1 { color: #f3ead9; font-size: clamp(30px, 4.4vw, 48px); margin-top: 6px; }
.article-layout { display: grid; grid-template-columns: 1.6fr .9fr; gap: 54px; padding: 54px 0 70px; }
.article-body { border-left: 1px solid var(--rule); padding-left: 34px; }
.article-body p { color: var(--ink-soft); margin: 0 0 18px; max-width: 62ch; }
.article-body h2 { font-size: 24px; margin: 30px 0 12px; }
.article-body blockquote { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--accent-dark); border: none; margin: 26px 0; }
.video-block { margin: 8px 0 30px; }
.video-block video { width: 100%; height: auto; display: block; background: #171208; border: 1px solid var(--rule); }
.video-block figcaption { font-size: 12px; color: var(--ink-faint); margin-top: 8px; }
.timeline h3 { font-size: 19px; margin: 0 0 2px; }
.timeline .tl-item { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.timeline .tl-item p { font-size: 12.5px; color: var(--ink-soft); margin: 3px 0 0; }
.cta-band { background: var(--dark); color: var(--dark-text); }
.cta-band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 34px; padding-bottom: 34px; flex-wrap: wrap; }
.cta-band .cta-text { font-family: var(--serif); font-size: 24px; }
.cta-band .btn { background: #c89a55; color: #241a0d; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); margin-top: 0; }
.site-footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 26px; padding-bottom: 30px; flex-wrap: wrap; }
.site-footer, .site-footer a { font-size: 12px; color: var(--ink-faint); }
.site-footer a { text-decoration: none; margin-left: 18px; }
.site-footer a:hover { color: var(--ink); }

/* ---------- OpenSeadragon: controles propios ---------- */
.openseadragon-container { background: #fff !important; }
.osd-controls { display: flex; flex-direction: column; gap: 6px; margin: 10px; }
.osd-btn {
  width: 36px; height: 36px; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(43, 33, 21, .85); color: #efe6d7;
  border: 1px solid rgba(244, 239, 230, .28); border-radius: 3px;
  transition: background .15s;
}
.osd-btn:hover { background: var(--accent-dark); }
.osd-btn svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.openseadragon-container:fullscreen { background: #171208 !important; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .item-layout, .article-layout, .dark-band .wrap { grid-template-columns: 1fr; }
  .dark-band .band-text { padding: 42px 0; }
  .world-grid { grid-template-columns: 1fr; }
  .piece-grid { grid-template-columns: repeat(2, 1fr); }
  .stats .wrap { grid-template-columns: 1fr; }
  .stat + .stat { border-left: none; border-top: 1px solid var(--rule); }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--rule); flex-direction: column; align-items: flex-start; padding: 18px 24px 20px; gap: 14px; margin-left: 0; }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; margin-left: auto; }
  .main-nav .lang-switch { margin: 10px 0 0; width: 100%; background: var(--card); }
  .main-nav .lang-switch a { flex: 1; text-align: center; padding: 10px 0; }
  .brand .brand-mark { width: 32px; }
  .brand .brand-name { font-size: 19px; }
  .brand .brand-sub { letter-spacing: .18em; font-size: 8.5px; }
  .site-footer .wrap { display: block; }
  .site-footer .wrap > div { display: inline; }
  .site-footer a { margin-left: 10px; }
  .article-body { border-left: none; padding-left: 0; }
}
@media (max-width: 540px) {
  .piece-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .search-box { width: 100%; }
}
