/* Mis Hallazgos — hoja de estilo única */

:root {
  --ink: #0a0b10;
  --ink-2: #0e1017;
  --surface: #14161f;
  --surface-2: #1b1e29;
  --line: #262a38;
  --line-soft: #1f2330;
  --text: #f0f2f8;
  --muted: #8d94a8;
  --muted-2: #656c80;
  --gold: #f2b441;
  --gold-soft: #ffd98a;
  --copper: #c4713c;
  --good: #4ec9a5;
  --plate: #f6f6f9;
  --radius: 14px;
  --shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.85);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; }

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

button, input, select, textarea { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 20px; }

.display {
  font-family: 'Bricolage Grotesque', 'Instrument Sans', sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted-2);
  font-weight: 600;
}

.tnum { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- cabecera */

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-block: 14px;
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; margin-right: auto; }

.mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--gold) 0%, var(--copper) 100%);
  color: #17120a;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 17px;
  flex: none;
}

.brand-name { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }

.search {
  position: relative;
  flex: 1 1 220px;
  max-width: 320px;
}

.search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px 9px 36px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.search input:focus { border-color: var(--gold); background: var(--surface-2); }

.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }

/* ---------------------------------------------------------------- hero */

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line-soft); }

.hero::before {
  content: '';
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 420px;
  background:
    radial-gradient(520px 260px at 22% 40%, rgba(242, 180, 65, 0.16), transparent 70%),
    radial-gradient(460px 240px at 78% 20%, rgba(196, 113, 60, 0.14), transparent 70%);
  pointer-events: none;
}

.hero-inner { position: relative; padding-block: 56px 44px; display: grid; gap: 22px; }

.hero h1 { font-size: clamp(34px, 6.5vw, 58px); line-height: 1.02; margin: 0; max-width: 16ch; }

.hero h1 em { font-style: normal; color: var(--gold); }

.hero p { margin: 0; color: var(--muted); max-width: 54ch; font-size: 16px; }

.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
  min-width: 108px;
}

.stat b { display: block; font-family: 'Bricolage Grotesque', sans-serif; font-size: 22px; line-height: 1.1; }

.stat span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted-2); }

/* ----------------------------------------------------------- secciones */

section { padding-block: 40px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.section-head h2 { font-size: 22px; margin: 0; font-family: 'Bricolage Grotesque', sans-serif; letter-spacing: -0.02em; }

.rule { flex: 1; height: 1px; background: var(--line-soft); }

/* ---------------------------------------------------------- destacados */

.featured-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.feat {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 18px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color 0.18s, transform 0.18s;
}

.feat:hover { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); transform: translateY(-2px); }

.feat .plate { aspect-ratio: 1; }

.feat-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.feat h3 { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 600; }

/* --------------------------------------------------------------- chips */

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }

.chips[hidden] { display: none; }

.chip {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover { color: var(--text); border-color: var(--muted-2); }

.chip[aria-pressed='true'] {
  background: var(--gold);
  border-color: var(--gold);
  color: #17120a;
  font-weight: 600;
}

/* -------------------------------------------------------------- grilla */

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.18s, transform 0.18s;
}

.card:hover { border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); transform: translateY(-3px); }

.plate {
  background: var(--plate);
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.plate img { width: 100%; height: 100%; object-fit: contain; }

.plate .fallback {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #6c7183;
  text-align: center;
  padding: 10px;
  line-height: 1.3;
}

.tag {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(10, 11, 16, 0.86);
  color: var(--gold-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .note { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }

.card-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; }

.price { font-family: 'Bricolage Grotesque', sans-serif; font-size: 17px; color: var(--gold); font-variant-numeric: tabular-nums; }

.cta {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* --------------------------------------------------------------- vacío */

.empty {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--ink-2);
}

.empty h3 { font-family: 'Bricolage Grotesque', sans-serif; color: var(--text); margin: 0 0 8px; }

/* --------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--line-soft);
  margin-top: 40px;
  padding-block: 30px 40px;
  color: var(--muted-2);
  font-size: 13px;
}

.fineprint {
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.6;
  max-width: 62ch;
  margin: 18px 0 0;
}

.footer-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }

/* ------------------------------------------------------------ admin ui */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}

.field { display: grid; gap: 6px; margin-bottom: 14px; }

.field label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }

.field input, .field select, .field textarea {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  outline: none;
  width: 100%;
}

.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); }

.btn {
  background: var(--gold);
  color: #17120a;
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 11px 18px;
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
  transition: filter 0.15s;
}

.btn:hover { filter: brightness(1.08); }

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }

.btn.ghost:hover { border-color: var(--muted-2); }

.btn.danger { background: transparent; color: #ff8d7a; border-color: #4a2a28; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line-soft); margin-bottom: 24px; }

.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.tab[aria-selected='true'] { color: var(--text); border-bottom-color: var(--gold); }

.msg { border-radius: 10px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 14px; }
.msg.err { background: #2a1512; border: 1px solid #4a2a28; color: #ffb3a4; }
.msg.ok { background: #10241d; border: 1px solid #1f4638; color: #8ee3c4; }
.msg.warn { background: #2a2211; border: 1px solid #4a3f1e; color: #ffd98a; }

.list { display: grid; gap: 10px; }

.item {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 10px 12px;
}

.item .plate { aspect-ratio: 1; border-radius: 8px; padding: 6px; }

.item h4 { margin: 0 0 3px; font-size: 14px; font-weight: 600; }

.item small { color: var(--muted-2); font-size: 12px; }

/* --------------------------------------------------------------- mapa */

.map-wrap {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  overflow: hidden;
}

.map-wrap svg { width: 100%; height: auto; display: block; }

.land { fill: #1d2231; stroke: #2b3143; stroke-width: 0.7; }

.dot { fill: var(--gold); }
.dot-halo { fill: var(--gold); opacity: 0.18; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }

.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }

.kpi b { display: block; font-family: 'Bricolage Grotesque', sans-serif; font-size: 28px; line-height: 1.05; font-variant-numeric: tabular-nums; }

.kpi span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted-2); }

.bars { display: grid; gap: 9px; }

.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }

.bar-track { position: relative; background: var(--line-soft); border-radius: 6px; height: 26px; overflow: hidden; }

.bar-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--copper), var(--gold)); opacity: 0.55; }

.bar-label { position: relative; padding: 4px 10px; display: flex; align-items: center; height: 100%; }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 60px; }
.spark i { flex: 1; background: var(--line); border-radius: 3px 3px 0 0; min-height: 2px; }
.spark i.on { background: linear-gradient(180deg, var(--gold), var(--copper)); }

@media (max-width: 560px) {
  .feat { grid-template-columns: 110px 1fr; }
  .hero-inner { padding-block: 40px 32px; }
  .item { grid-template-columns: 50px 1fr; }
  .item .actions { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  #editorGrid { grid-template-columns: 1fr !important; }
  #editorGrid > div:first-child { max-width: 220px; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; }
}
