/* =========================================================
   FEBOBI · Base
   Variables de diseño, modos de lectura, reset, tipografía
   y piezas mínimas reutilizables (botones, campos, chips…).
   ========================================================= */
:root {
  /* Paño y madera */
  --felt-950: #041c14; --felt-900: #082f22; --felt-800: #0b3d2c; --felt-700: #0f5039; --felt-600: #15654a; --felt-400: #3d9a73;
  /* Superficies y tinta */
  --ivory: #f6f1e6; --paper: #fffdf8; --card: #fff;
  --ink: #17201b; --ink-2: #47514b; --ink-3: #6b746e;
  --line: #e3dccb; --line-2: #d3c9b2;
  /* Acentos */
  --gold: #c19237; --gold-2: #e6c472; --gold-ink: #7a5714; --on-gold: #1d1606;
  --on-felt: #f5f1e6; --on-felt-2: #c4d6cc;
  --focus: #e6a700;
  /* Categorías */
  --c-m: #7a5714;  --c-m-bg: #f7ecd2;
  --c-n: #8e1b16;  --c-n-bg: #f8dedb;
  --c-p1: #b3261e; --c-p1-bg: #fbe7e4;
  --c-p2: #1d4f91; --c-p2-bg: #e2ecf8;
  --c-p3: #146046; --c-p3-bg: #dff1e8;
  --c-pr: #9a4a00; --c-pr-bg: #fdebd8;
  --c-sc: #555d58; --c-sc-bg: #eceeea;
  /* Forma y movimiento */
  --r: 18px; --r-lg: 28px; --pill: 999px;
  --shadow-sm: 0 1px 2px rgba(10,30,20,.06), 0 2px 8px rgba(10,30,20,.05);
  --shadow: 0 2px 4px rgba(10,30,20,.05), 0 12px 32px -8px rgba(10,30,20,.16);
  --shadow-lg: 0 30px 80px -20px rgba(4,28,20,.45);
  --ease: cubic-bezier(.2,.7,.2,1);
  --header-h: 84px;
  --font: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
}

/* Modo alto contraste: solo cambia variables; los componentes se adaptan solos */
:root[data-contrast="high"] {
  --felt-950: #000; --felt-900: #000; --felt-800: #000; --felt-700: #111; --felt-600: #000; --felt-400: #fff;
  --ivory: #fff; --paper: #fff; --card: #fff;
  --ink: #000; --ink-2: #000; --ink-3: #111; --line: #000; --line-2: #000;
  --gold: #ffd24a; --gold-2: #ffd24a; --gold-ink: #000;
  --on-felt: #fff; --on-felt-2: #fff;
  --shadow-sm: none; --shadow: none; --shadow-lg: none;
  --c-m: #000; --c-n: #000; --c-p1: #000; --c-p2: #000; --c-p3: #000; --c-pr: #000; --c-sc: #000;
  --c-m-bg: #fff; --c-n-bg: #fff; --c-p1-bg: #fff; --c-p2-bg: #fff; --c-p3-bg: #fff; --c-pr-bg: #fff; --c-sc-bg: #fff;
}
/* Con --line en negro, todos los bordes quedan marcados; solo se refuerzan las etiquetas */
:root[data-contrast="high"] .badge { box-shadow: inset 0 0 0 2px #000; }
:root[data-contrast="high"] mark { background: #ffd24a; }

/* Tamaño de letra (todo el sitio usa rem) */
html { font-size: 112.5%; }
html[data-size="2"] { font-size: 128%; }
html[data-size="3"] { font-size: 145%; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.6; color: var(--ink); background: var(--ivory);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.15; overflow-wrap: break-word; }
p, dl, dd { margin: 0; }
mark { background: #ffe9a8; color: inherit; border-radius: 4px; padding: 0 2px; }
kbd { font-family: var(--font); font-size: .72em; font-weight: 700; padding: .1em .45em; border-radius: 6px; border: 1px solid currentColor; opacity: .75; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.container { width: min(1320px, 100% - 32px); margin-inline: auto; }
@media (min-width: 720px) { .container { width: min(1320px, 100% - 64px); } }
/* Pantallas bajas (celular acostado): encabezado más chico */
@media (max-height: 500px) and (orientation: landscape) { :root { --header-h: 64px; } }
.skip { position: absolute; left: 16px; top: -100px; z-index: 200; background: var(--gold); color: #000; padding: 12px 18px; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 12px; }

/* ---------- Tipografía de sección ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: .8rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-ink); }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; border-radius: 2px; }
.eyebrow--light { color: var(--gold-2); }
.display { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em; min-height: 56px; padding: 0 1.5em;
  border-radius: var(--pill); border: 2px solid transparent; background: none; font-weight: 700; font-size: 1rem; text-decoration: none; white-space: nowrap;
  transition: transform .25s var(--ease), background-color .25s, box-shadow .25s, color .25s, border-color .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: none; }
.btn--gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--on-gold); box-shadow: 0 8px 24px -8px rgba(193,146,55,.65), inset 0 1px 0 rgba(255,255,255,.5); }
.btn--felt { background: var(--felt-700); color: #fff; }
.btn--felt:hover { background: var(--felt-600); }
.btn--outline { border-color: var(--felt-700); color: var(--felt-700); }
.btn--outline:hover { background: var(--felt-700); color: #fff; }
.btn--ghost { color: var(--felt-700); }
.btn--ghost:hover { background: rgba(15,80,57,.08); }
.btn--ghost-light { border-color: rgba(245,241,230,.35); color: var(--on-felt); }
.btn--ghost-light:hover { background: rgba(245,241,230,.1); border-color: var(--on-felt); }
.btn--sm { min-height: 48px; padding: 0 1.2em; font-size: .9rem; }
.btn--lg { min-height: 64px; padding: 0 2em; font-size: 1.08rem; }
.btn--block { width: 100%; }
.btn .ic:last-child:not(:first-child) { transition: transform .3s var(--ease); }
.btn:hover .ic:last-child:not(:first-child) { transform: translateX(3px); }
@media (max-width: 560px) { .btn { white-space: normal; text-align: center; line-height: 1.25; padding-block: 10px; } }

.icon-btn { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--card); color: var(--ink); transition: background-color .2s, border-color .2s; }
.icon-btn:hover { border-color: var(--felt-700); background: var(--ivory); }
.icon-btn--sm { width: 44px; height: 44px; }
.link-btn { display: inline-flex; align-items: center; gap: .4em; min-height: 44px; padding: 8px 0; background: none; border: 0; color: var(--felt-700); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Campos ---------- */
.field { display: grid; gap: 8px; min-width: 0; }
.field label { font-weight: 700; font-size: .95rem; }
.field--compact { width: min(360px, 100%); }
input[type="search"], select {
  width: 100%; min-height: 60px; padding: 0 18px; border-radius: 16px; border: 2px solid var(--line-2); background: var(--card);
  font-size: 1.05rem; transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none;
}
select { padding-right: 48px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%2317201b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center; }
input[type="search"]:focus, select:focus { outline: none; border-color: var(--felt-600); box-shadow: 0 0 0 4px rgba(21,101,74,.18); }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.input-ic { position: relative; }
.input-ic > .ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.input-ic input[type="search"] { padding-left: 54px; }

/* ---------- Chips (filtros y sugerencias) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--pill);
  border: 2px solid var(--line-2); background: var(--card); font-weight: 700; transition: background-color .2s, border-color .2s, color .2s;
}
.chip small { font-size: .8rem; font-weight: 700; color: var(--ink-3); background: var(--ivory); padding: 2px 8px; border-radius: var(--pill); }
.chip:hover { border-color: var(--felt-600); }
.chip[aria-pressed="true"] { background: var(--felt-700); border-color: var(--felt-700); color: #fff; }
.chip[aria-pressed="true"] small { background: rgba(255,255,255,.18); color: #fff; }
/* En pantallas chicas los filtros van en una sola fila deslizable */
@media (max-width: 720px) {
  .chips--scroll { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 6px; scroll-padding-inline: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .chips--scroll::-webkit-scrollbar { display: none; }
  .chips--scroll .chip { flex: none; }
}

/* ---------- Etiquetas y categorías ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag, .badge { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: var(--pill); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.tag { background: var(--ivory); color: var(--ink-2); border: 1px solid var(--line); }
.tag--demo { background: #fff4d6; color: #7a5714; border-color: #f0d48d; }
.cat-m { color: var(--c-m); background: var(--c-m-bg); }   .bg-m { background: var(--c-m); }
.cat-n { color: var(--c-n); background: var(--c-n-bg); }   .bg-n { background: var(--c-n); }
.cat-p1 { color: var(--c-p1); background: var(--c-p1-bg); } .bg-p1 { background: var(--c-p1); }
.cat-p2 { color: var(--c-p2); background: var(--c-p2-bg); } .bg-p2 { background: var(--c-p2); }
.cat-p3 { color: var(--c-p3); background: var(--c-p3-bg); } .bg-p3 { background: var(--c-p3); }
.cat-pr { color: var(--c-pr); background: var(--c-pr-bg); } .bg-pr { background: var(--c-pr); }
.cat-sc { color: var(--c-sc); background: var(--c-sc-bg); } .bg-sc { background: #a5aba7; }
.avatar { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; font-weight: 700; font-size: .95rem; }

/* ---------- Estado vacío ---------- */
.empty { grid-column: 1 / -1; padding: 40px 20px; text-align: center; color: var(--ink-2); background: var(--card); border: 2px dashed var(--line-2); border-radius: var(--r); }
.empty strong { display: block; margin-bottom: 6px; font-size: 1.2rem; color: var(--ink); }
.empty .btn { margin-top: 16px; }

/* ---------- Animación de entrada ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
.is-paused, .is-paused * { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
