/* ==========================================================================
   GuíasGTA — hoja de estilos principal
   Paleta "atardecer en Vice City": teal oscuro + naranja + ciruela
   ========================================================================== */

:root {
  --bg: #0e2229;
  --bg-2: #112c35;
  --bg-3: #163844;
  --header: #0c2730;
  --line: #1f4350;
  --text: #eaf1f3;
  --muted: #a9bcc2;
  --orange: #ff5a36;
  --coral: #ff7a45;
  --peach: #ff9b5e;
  --plum: #7b2950;
  --plum-dark: #4a1d3f;
  --sun: #ffd38a;
  --teal: #1e5563;
  --green: #3ccf91;
  --yellow: #ffc94d;
  --radius: 14px;
  --maxw: 1120px;
  --font-title: "Anton", "Impact", "Arial Narrow", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--peach); text-underline-offset: 3px; }
a:hover { color: var(--sun); }

h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.3px;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); margin-top: 1.6em; }
h3 { font-size: 1.45rem; margin-top: 1.4em; }
h4 { font-size: 1.05rem; margin: 1.2em 0 0.4em; }

p { margin: 0 0 1em; }

.container { width: min(var(--maxw), 100% - 40px); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--orange); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 12px; }

/* --------------------------------------------------------------------------
   Cabecera
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header);
  border-bottom: 3px solid var(--orange);
}
.header-inner {
  display: flex; align-items: center; gap: 22px;
  min-height: 62px;
}
.logo {
  font-family: var(--font-title);
  font-size: 1.7rem;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.logo span { color: var(--orange); }
.logo:hover { color: #fff; }

.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav a, .nav-more summary {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 11px;
  border-radius: 8px;
  white-space: nowrap;
  cursor: pointer;
}
.main-nav a:hover, .nav-more summary:hover { background: var(--bg-3); color: #fff; }
.main-nav a.active { background: #1c3f4a; }

.nav-more { position: relative; }
.nav-more summary { list-style: none; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary::after { content: " ▾"; font-size: 0.8em; }
.nav-more[open] summary { background: var(--bg-3); }
.nav-more summary.active { background: #1c3f4a; }
.nav-more-menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--header); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px; width: 430px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  z-index: 60;
}
.nav-more-menu a { padding: 9px 12px; }
.site-footer .footer-grid > div:first-child ul { margin-top: 10px; }

.search { position: relative; margin-left: auto; }
.search input {
  width: 220px;
  background: #1d3d47;
  border: 1px solid transparent;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font: inherit; font-size: 0.95rem;
}
.search input::placeholder { color: #93a9b0; }
.search input:focus { outline: none; border-color: var(--orange); }
.search-results {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 340px; max-height: 420px; overflow-y: auto;
  background: var(--header); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
  padding: 6px; display: none;
}
.search-results.open { display: block; }
.search-results a {
  display: block; padding: 10px 12px; border-radius: 8px;
  color: var(--text); text-decoration: none;
}
.search-results a:hover, .search-results a.focused { background: var(--bg-3); }
.search-results strong { display: block; font-size: 0.95rem; }
.search-results small { color: var(--muted); font-size: 0.82rem; }
.search-empty { padding: 10px 12px; color: var(--muted); font-size: 0.9rem; }

/* --------------------------------------------------------------------------
   Hero de portada
   -------------------------------------------------------------------------- */
.hero {
  background: linear-gradient(180deg, #ff9b5e 0%, #ff7443 38%, #e2533f 62%, #a63a4c 82%, #7b2950 100%);
  overflow: hidden;
}
.hero-inner {
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: end; gap: 24px;
  padding-top: 44px;
}
.hero-text { padding-bottom: 40px; }
.hero-meta { font-size: 0.9rem; font-weight: 500; opacity: 0.95; margin-bottom: 14px; }
.hero h1 { color: #fff; font-size: clamp(2.5rem, 5.4vw, 3.9rem); margin-bottom: 18px; }
.hero p.lead { font-size: 1.12rem; max-width: 34em; color: #fff; }
.hero-art svg { width: 100%; height: auto; display: block; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 9px;
  font-weight: 700;
  text-decoration: none;
  font-size: 1rem;
  transition: transform .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-dark { background: var(--header); color: #fff; }
.btn-dark:hover { color: #fff; }
.btn-light { background: #fff; color: var(--header); }
.btn-light:hover { color: var(--header); }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { color: #fff; }

/* --------------------------------------------------------------------------
   Cabecera de páginas interiores
   -------------------------------------------------------------------------- */
.page-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #ff9b5e 0%, #e2533f 45%, #7b2950 100%);
  border-bottom: 1px solid var(--line);
}
/* Imagen de fondo opcional: <img class="page-hero-img">. Si no existe, queda el degradado. */
.page-hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.page-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(12,39,48,.92) 0%, rgba(12,39,48,.72) 45%, rgba(12,39,48,.2) 100%);
}
.page-hero .container { position: relative; z-index: 1; padding: 54px 0 46px; }
.page-hero h1 { max-width: 15em; }
.page-hero p.lead { max-width: 36em; font-size: 1.1rem; color: #f3f6f7; }
.breadcrumb { font-size: 0.88rem; color: #d6e1e4; margin-bottom: 12px; }
.breadcrumb a { color: #fff; }
.updated { font-size: 0.88rem; color: #d6e1e4; margin-top: 14px; }

/* --------------------------------------------------------------------------
   Publicidad (huecos para AdSense)
   -------------------------------------------------------------------------- */
/* Los huecos vacíos solo se ven en la vista previa local (clase .ads-preview que pone main.js).
   En la web publicada están ocultos hasta que dentro haya un anuncio real de AdSense. */
.ad-slot {
  border: 1px dashed #2e5866;
  background: var(--bg-2);
  border-radius: var(--radius);
  min-height: 110px;
  display: none; place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 30px auto;
}
.ads-preview .ad-slot { display: grid; }
.ad-slot:has(ins.adsbygoogle) {
  display: block; border: 0; background: none; color: transparent; font-size: 0; min-height: 0;
}
.ad-slot.ad-inline { margin: 34px 0; }
.ad-slot.ad-top { margin: 24px auto 0; min-height: 90px; }
.sidebar > .ad-slot.ad-side { min-height: 600px; margin: 0 0 18px; }

/* --------------------------------------------------------------------------
   Tarjetas
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  margin: 10px 0 30px;
}
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); border-color: #2f5e6c; }
.card-head {
  padding: 26px 18px 14px;
  min-height: 92px;
  display: flex; align-items: flex-end;
  background-size: cover; background-position: center;
}
.card-head h3 { margin: 0; font-size: 1.6rem; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.25); }
.card-head h3 a { color: inherit; text-decoration: none; }
.card-head.c-orange { background-color: var(--orange); }
.card-head.c-teal { background-color: #12313b; border-bottom: 1px solid var(--line); }
.card-head.c-plum { background-color: var(--plum); }
.card-head.c-peach { background-color: #e86a3e; }
.card-head.c-sea { background-color: var(--teal); }
.card-head.c-dark { background-color: var(--plum-dark); }
.card-body { padding: 16px 18px 20px; color: #d3dfe2; font-size: 0.97rem; flex: 1; }
.card-body ul { margin: 10px 0 0; padding-left: 20px; }
.card-body li { margin: 3px 0; }
.card-body li a { color: #fff; font-weight: 600; text-decoration: none; }
.card-body li a:hover { color: var(--peach); }

/* Tarjetas de personaje con foto opcional (si la foto no existe, se elimina la figura) */
.card figure { margin: 0; position: relative; }
.card figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card figure figcaption {
  position: absolute; right: 8px; bottom: 6px;
  font-size: 0.7rem; color: #fff; background: rgba(0,0,0,.55);
  padding: 1px 6px; border-radius: 4px;
}
.card-body h3 { margin: 0 0 6px; font-size: 1.45rem; }
.card-body .role { color: var(--peach); font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; }

/* Tarjetas de dato rápido */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px; margin: 18px 0 26px;
}
.stat {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px;
}
.stat b { display: block; font-family: var(--font-title); font-weight: 400; font-size: 1.7rem; color: var(--peach); line-height: 1.1; }
.stat span { color: var(--muted); font-size: 0.9rem; }

/* --------------------------------------------------------------------------
   Contenido de artículo
   -------------------------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 40px;
  padding: 34px 0 60px;
}
.article > h2:first-child { margin-top: 0.2em; }
.article ul, .article ol { padding-left: 24px; margin: 0 0 1.1em; }
.article li { margin: 6px 0; }
.article li::marker { color: var(--orange); }

.sidebar { position: relative; }
.sidebar-sticky { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 18px; }
.toc {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
}
.toc h2 { font-size: 1.3rem; margin: 0 0 8px; }
.toc ol { margin: 0; padding-left: 20px; font-size: 0.93rem; }
.toc li { margin: 5px 0; }
.toc a { color: #dbe6e9; text-decoration: none; }
.toc a:hover { color: var(--peach); }
.sidebar .ad-slot { min-height: 250px; margin: 0; }

/* Tablas */
.table-wrap { overflow-x: auto; margin: 16px 0 24px; border-radius: 12px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th {
  background: #12313b;
  font-weight: 700; color: #fff; white-space: nowrap;
}
tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
tbody tr:last-child td { border-bottom: 0; }
td code, .code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.86rem;
  background: #0b1d23; border: 1px solid var(--line);
  padding: 2px 6px; border-radius: 6px; white-space: nowrap;
}

/* Avisos */
.callout {
  border-left: 4px solid var(--orange);
  background: var(--bg-2);
  border-radius: 0 12px 12px 0;
  padding: 14px 18px;
  margin: 18px 0 22px;
}
.callout p:last-child { margin-bottom: 0; }
.callout strong:first-child { color: var(--peach); }
.callout.tip { border-color: var(--green); }
.callout.tip strong:first-child { color: var(--green); }
.callout.warn { border-color: var(--yellow); }
.callout.warn strong:first-child { color: var(--yellow); }

/* Pasos numerados */
.steps { counter-reset: step; list-style: none; padding-left: 0 !important; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 14px 16px 14px 62px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 10px 0 !important;
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 16px; top: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--orange); color: #fff;
  font-family: var(--font-title); font-size: 1.1rem;
  display: grid; place-items: center;
}

/* Desplegables (spoilers, FAQ) */
details.fold {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  margin: 10px 0; overflow: hidden;
}
details.fold summary {
  cursor: pointer; padding: 14px 18px; font-weight: 700;
  list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after { content: "+"; color: var(--orange); font-size: 1.3rem; line-height: 1; }
details.fold[open] summary::after { content: "–"; }
details.fold .fold-body { padding: 0 18px 16px; color: #d3dfe2; }

.tag {
  display: inline-block; font-size: 0.75rem; font-weight: 700;
  padding: 2px 8px; border-radius: 99px; vertical-align: middle;
  background: var(--bg-3); color: var(--peach); margin-left: 6px;
}
.tag.spoiler { background: var(--plum); color: #fff; }

/* Bloque de vídeo (para enlazar con YouTube más adelante) */
.video-box {
  background: linear-gradient(135deg, #12313b, #1b4552);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; gap: 18px; align-items: center; margin: 26px 0;
}
.video-box .play {
  flex: none; width: 56px; height: 56px; border-radius: 50%;
  background: var(--orange); display: grid; place-items: center;
}
.video-box .play::after {
  content: ""; border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 5px;
}
.video-box p { margin: 0; }

/* Siguiente página */
.next-page {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   Pie de página
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--header);
  border-top: 3px solid var(--orange);
  padding: 40px 0 26px;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
.site-footer h4 { color: #fff; margin-top: 0; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 6px 0; }
.site-footer a { color: #dbe6e9; text-decoration: none; }
.site-footer a:hover { color: var(--peach); }
.disclaimer { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; font-size: 0.82rem; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1020px) {
  .header-inner { flex-wrap: wrap; gap: 10px; padding: 10px 0; }
  .main-nav { order: 3; flex: 1 1 100%; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .search input { width: 180px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero-inner { grid-template-columns: 1fr; padding-top: 30px; }
  .hero-text { padding-bottom: 10px; }
  .footer-grid { grid-template-columns: 1fr; }
  .search-results { width: min(340px, 90vw); }
  .page-hero .container { padding: 40px 0 34px; }
}
/* En móvil, el menú "Más" se despliega en línea */
@media (max-width: 1020px) {
  .nav-more-menu { position: fixed; top: auto; left: 20px; right: 20px; width: auto; }
}
