/* =====================================================================
   El Gamer Crónico — hoja de estilos
   Inspirada en el template "Philosophy" del sitio original, reescrita
   sin dependencias (sin jQuery, sin frameworks).
   ===================================================================== */

/* ---------- Fuentes (las mismas del sitio original) ---------- */
@font-face { font-family: "Metropolis"; src: url("../fonts/metropolis-regular-webfont.ea531a4039bd.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("../fonts/metropolis-medium-webfont.eb3f91f51db9.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("../fonts/metropolis-semibold-webfont.954b06b72e08.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("../fonts/metropolis-bold-webfont.ac3f6f0c7bbc.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("../fonts/librebaskerville-regular-webfont.520ff79ac50e.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("../fonts/librebaskerville-italic-webfont.4ba92be4076c.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("../fonts/librebaskerville-bold-webfont.1c87f16b386b.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ---------- Variables ---------- */
:root {
  --c-header: #151515;
  --c-footer: #19191b;
  --c-page: #f2f2f2;
  --c-card: #ffffff;
  --c-text: #555555;
  --c-muted: #858585;
  --c-heading: #000000;
  --c-link: #0054a5;
  --c-blue: #01aef0;
  --c-green: #679a23;
  --c-line: #e5e5e5;
  --f-sans: "Metropolis", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Libre Baskerville", Georgia, serif;
  --wrap: 1240px;
  --gutter: 16px;
  --radius: 0;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--c-footer);
  color: var(--c-text);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.75;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-link); text-decoration: none; transition: color .2s ease; }
a:hover, a:focus-visible { color: #000; }
:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 2px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--f-serif); font-weight: 700; color: var(--c-heading); line-height: 1.3; margin: 0 0 .6em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: 860px; }

/* ---------- Cabecera ---------- */
.pageheader {
  background: var(--c-header);
  color: #fff;
  padding: 28px 0 24px;
}
.pageheader--home { padding-bottom: 56px; }

.header {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
}
.header__logo img { width: 260px; height: 60px; image-rendering: pixelated; }

.nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; }
.nav__list > li { position: relative; }
.nav__list > li > a,
.nav__sub-toggle {
  display: block;
  padding: 6px 14px;
  color: rgba(255,255,255,.65);
  font: 600 13px/1.6 var(--f-sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav__list > li > a:hover, .nav__sub-toggle:hover,
.nav__list > li > a[aria-current="page"], .has-sub.is-open > .nav__sub-toggle { color: #fff; }
.nav__sub-toggle::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.nav__sub {
  display: none;
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 210px;
  list-style: none;
  margin: 6px 0 0;
  padding: 8px 0;
  background: #000;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.nav__sub a { display: block; padding: 6px 20px; color: rgba(255,255,255,.75); font-size: 15px; }
.nav__sub a:hover { color: #fff; background: rgba(255,255,255,.06); }
.has-sub.is-open > .nav__sub { display: block; }
@media (hover: hover) and (min-width: 801px) {
  .has-sub:hover > .nav__sub { display: block; }
}

.nav-toggle { display: none; }

@media (max-width: 800px) {
  .header { flex-direction: row; justify-content: space-between; flex-wrap: wrap; }
  .header__logo img { width: 195px; height: 45px; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 10px;
    background: none; border: 1px solid rgba(255,255,255,.2); color: #fff;
    padding: 8px 12px; font: 600 12px var(--f-sans); letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
  }
  .nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
    display: block; width: 18px; height: 2px; background: currentColor; position: relative;
  }
  .nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle__bars::before { top: -6px; }
  .nav-toggle__bars::after { top: 6px; }
  .nav { display: none; width: 100%; }
  .nav.is-open { display: block; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; border-top: 1px solid rgba(255,255,255,.1); margin-top: 8px; }
  .nav__list > li { border-bottom: 1px solid rgba(255,255,255,.08); }
  .nav__list > li > a, .nav__sub-toggle { width: 100%; text-align: left; padding: 12px 4px; }
  .nav__sub { position: static; transform: none; box-shadow: none; margin: 0 0 8px; background: rgba(255,255,255,.04); }
}

/* ---------- Destacados de la portada ---------- */
.featured {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0;
  margin-top: 40px;
}
.featured__column { display: grid; grid-template-rows: 1fr 1fr; }
.featured__item {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 282px;
  background: #222 center / cover no-repeat;
  color: #fff;
  overflow: hidden;
}
.featured__item--big { min-height: 564px; }
.featured__item::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,10,10,.92) 0%, rgba(10,10,10,.45) 55%, rgba(10,10,10,.25) 100%);
  transition: background-color .3s ease;
}
.featured__item:hover::before { background-color: rgba(10,10,10,.35); }
.featured__content { position: relative; padding: 32px 40px; width: 100%; }
.featured__item--big .featured__content { padding: 48px 20% 48px 56px; }
.featured__title { color: #fff; font-size: 22px; line-height: 1.35; margin: 14px 0 12px; }
.featured__item--big .featured__title { font-size: 36px; }
.featured__item:hover .featured__title { text-decoration: underline; text-decoration-color: rgba(255,255,255,.3); text-underline-offset: 6px; }
.featured__info { display: flex; align-items: center; gap: 14px; color: rgba(255,255,255,.6); font-weight: 600; font-size: 15px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }

.badge {
  display: inline-block;
  padding: 0 14px;
  color: #fff;
  font: 700 11px/24px var(--f-sans);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.badge--blue { background: var(--c-blue); }
.badge--green { background: var(--c-green); }

@media (max-width: 900px) {
  .featured { grid-template-columns: 1fr; margin-top: 24px; }
  .featured__item--big { min-height: 420px; }
  .featured__item--big .featured__content { padding: 32px 24px; }
  .featured__item--big .featured__title { font-size: 28px; }
  .featured__content { padding: 24px; }
}
@media (max-width: 480px) {
  .featured__item--big { min-height: 340px; }
  .featured__item--big .featured__title { font-size: 23px; }
  .featured__item { min-height: 220px; }
  .featured__title { font-size: 19px; }
}

/* ---------- Contenido ---------- */
.s-content { background: var(--c-page); padding: 64px 0 56px; }
.s-content--narrow { padding-top: 0; }

.page-heading { text-align: center; margin-bottom: 40px; }
.page-heading h1 { font-size: clamp(30px, 5vw, 44px); margin-bottom: 8px; }

.meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; color: var(--c-muted); font-weight: 500; font-size: 15px; }
.meta li + li::before { content: "•"; margin: 0 10px; color: #bbb; }

/* Grilla de tarjetas (se lee de izquierda a derecha, de la más nueva a la más vieja) */
.masonry { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 32px; align-items: start; }
.masonry--4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); margin-bottom: 32px; }
.masonry > .empty { grid-column: 1 / -1; text-align: center; }

.card { background: var(--c-card); display: block; }
.card__thumb { display: block; overflow: hidden; background: #ddd; aspect-ratio: 1 / 1; }
.card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card__thumb img { transform: scale(1.05); }
.card__text { padding: 26px 28px 30px; }
.card__date { color: var(--c-muted); font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.card__title { font-size: 21px; line-height: 1.4; margin-bottom: 14px; }
.card__title a { color: var(--c-heading); }
.card__title a:hover { color: var(--c-link); }
.card__excerpt { margin: 0 0 18px; font-size: 15px; line-height: 1.75; }
.card__meta { padding-top: 14px; border-top: 1px solid var(--c-line); font: 600 13px var(--f-sans); letter-spacing: .08em; text-transform: uppercase; }
.card--promo[style*="--promo-border"] { outline: 3px solid var(--promo-border); outline-offset: -3px; }

/* Paginación */
.pgn { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: 16px; font-weight: 600; }
.pgn a, .pgn span { padding: 8px 4px; }
.pgn .is-disabled { color: #bbb; }
.pgn__num { color: var(--c-muted); font-weight: 500; }

/* Paneles (calendario, 404) */
.panel { background: var(--c-card); padding: 48px clamp(20px, 5vw, 64px); margin-top: 8px; }
.panel--center { text-align: center; }
.panel__heading { font-size: clamp(28px, 5vw, 40px); text-align: center; }
.panel__title { font-size: 24px; margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--c-heading); }
.panel__title:first-child { margin-top: 0; }
.btn { display: inline-block; margin-top: 32px; padding: 14px 28px; background: #000; color: #fff; font: 700 13px var(--f-sans); letter-spacing: .15em; text-transform: uppercase; }
.btn:hover { background: var(--c-link); color: #fff; }
.empty { color: var(--c-muted); }

.releases { list-style: none; margin: 0; padding: 0; }
.releases li { display: grid; grid-template-columns: 80px 1fr auto; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--c-line); }
.releases time { color: var(--c-muted); font-weight: 600; font-size: 14px; text-transform: uppercase; }
.releases a { color: var(--c-heading); }
.releases a:hover { color: var(--c-link); }
.releases__genre { color: var(--c-muted); font-size: 14px; }
.releases .is-highlighted a { font-weight: 700; }
.releases .is-highlighted::after { content: none; }
@media (max-width: 560px) {
  .releases li { grid-template-columns: 64px 1fr; }
  .releases__genre { grid-column: 2; margin-top: -8px; }
}

/* ---------- Artículo ---------- */
.post { max-width: 1000px; margin: 0 auto; background: var(--c-card); }
.post__header { text-align: center; padding: 64px clamp(20px, 6vw, 80px) 32px; }
.post__title { font-size: clamp(28px, 4.5vw, 44px); line-height: 1.22; }
.post__media img { width: 100%; }
.post__main { max-width: 800px; margin: 0 auto; padding: 40px clamp(20px, 5vw, 40px) 64px; }
.lead { font-size: 20px; line-height: 1.7; color: #222; font-family: var(--f-sans); font-weight: 500; margin: 0 0 32px; }

.post__body { font-size: 17px; line-height: 1.85; color: #3a3a3a; overflow-wrap: break-word; }
.post__body p { margin: 0 0 1.4em; }
.post__body h2 { font-size: 26px; margin-top: 1.6em; }
.post__body h3 { font-size: 21px; margin-top: 1.5em; }
.post__body h4 { font-size: 18px; margin-top: 1.4em; }
.post__body a { text-decoration: underline; text-decoration-color: rgba(0,84,165,.35); text-underline-offset: 3px; }
.post__body img { margin: 1.6em auto; }
.post__body ul, .post__body ol { padding-left: 1.4em; margin: 0 0 1.4em; }
.post__body li { margin-bottom: .4em; }
.post__body blockquote { margin: 1.8em 0; padding: 4px 0 4px 24px; border-left: 4px solid #000; font-family: var(--f-serif); font-style: italic; font-size: 19px; color: #222; }
.post__body table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 15px; display: block; overflow-x: auto; }
.post__body th, .post__body td { border: 1px solid var(--c-line); padding: 8px 12px; text-align: left; }
.post__body iframe { display: block; width: 100%; max-width: 100%; border: 0; margin: 1.6em 0; }
.post__body iframe[src*="youtube"] { aspect-ratio: 16 / 9; height: auto; }
.post__body iframe[src*="steampowered"] { height: 190px; }

.video { position: relative; aspect-ratio: 16 / 9; background: #000; margin: 1.6em 0; }
.post__media .video { margin: 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.author { display: flex; gap: 24px; align-items: flex-start; margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--c-line); }
.author__avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author__name { font-size: 20px; margin-bottom: 6px; }
.author p { margin: 0 0 10px; font-size: 15px; }
.author__social { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
@media (max-width: 560px) {
  .author { flex-direction: column; align-items: center; text-align: center; }
  .author__social { justify-content: center; }
}

/* ---------- Pie ---------- */
.s-extra { background: #fff; padding: 64px 0 72px; }
.s-extra__title { font-size: 22px; margin-bottom: 20px; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tagcloud a { padding: 4px 16px; background: #f2f2f2; color: #111; font-weight: 600; font-size: 14px; }
.tagcloud a:hover { background: #000; color: #fff; }

.s-footer { background: var(--c-footer); color: rgba(255,255,255,.55); font-size: 14px; padding: 36px 0; }
.s-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; }
.s-footer a { color: rgba(255,255,255,.75); }
.s-footer a:hover { color: #fff; }
.go-top { width: 44px; height: 44px; display: grid; place-items: center; background: #000; font-size: 20px; }

@media (max-width: 600px) {
  .s-content { padding: 40px 0; }
  .s-content--narrow { padding-top: 0; }
  .masonry { gap: 20px; }
  .card__text { padding: 20px 20px 24px; }
  .post__header { padding-top: 40px; }
  .post__body { font-size: 16.5px; }
}
