/*
Theme Name: Mando Crítico
Theme URI: https://mandocritico.com
Author: Mando Crítico
Description: Tema a medida para Mando Crítico, web de análisis y avances de videojuegos. Incluye los tipos de contenido "Análisis" y "Avances", portada, listados, ficha de artículo y formulario de contacto.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: mando-critico
*/

:root {
  --bg: #0A0A0D;
  --surface: #131318;
  --text: #F2F1EE;
  --body: #D8D6CE;
  --muted: #9B99A2;
  --soft: #B7B5AC;
  --line: rgba(255, 255, 255, 0.08);
  --pink: #FF3D8A;
  --cyan: #4BD8E0;
  --pad: 64px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Work Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 150ms ease; }
a:hover { color: var(--pink); }
body.pt-avance a:hover { color: var(--cyan); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 3px;
}
.disp { font-family: 'Unbounded', system-ui, sans-serif; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  clip: auto; width: auto; height: auto; margin: 0; padding: 12px 18px;
  background: var(--pink); color: var(--bg); z-index: 100; top: 8px; left: 8px;
}

/* ---------- Estructura ---------- */
.site {
  position: relative;
  z-index: 0;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
}
.site-top { position: relative; }
.watermark {
  position: absolute; top: -40px; left: 0; right: 0; z-index: -1;
  text-align: center; white-space: nowrap; pointer-events: none;
  font-family: 'Unbounded', sans-serif; font-weight: 900;
  font-size: clamp(90px, 15.3vw, 220px); line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.09);
}
.type-h { animation: typeH 1.1s steps(5, end) 1 both; }
@keyframes typeH { from { clip-path: inset(-6px 100% -6px -6px); } to { clip-path: inset(-6px -6px -6px -6px); } }

/* Bombillas */
.marquee-wrap { display: flex; justify-content: flex-start; padding: 10px var(--pad); margin-top: 15px; }
.marquee { display: flex; gap: 10px; }
.bulb { width: 6px; height: 6px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 6px var(--pink); opacity: 0; animation: bulbIn 280ms ease-out forwards; }
.bulb.dim { background: #2A2635; box-shadow: none; }
.bulb:nth-child(1) { animation-delay: 0ms; }
.bulb:nth-child(2) { animation-delay: 70ms; }
.bulb:nth-child(3) { animation-delay: 140ms; }
.bulb:nth-child(4) { animation-delay: 210ms; }
.bulb:nth-child(5) { animation-delay: 280ms; }
.bulb:nth-child(6) { animation-delay: 350ms; }
.bulb:nth-child(7) { animation-delay: 420ms; }
.bulb:nth-child(8) { animation-delay: 490ms; }
.bulb:nth-child(9) { animation-delay: 560ms; }
.bulb:nth-child(10) { animation-delay: 630ms; }
@keyframes bulbIn { from { opacity: 0; } to { opacity: 1; } }

/* Navegación */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding: 20px var(--pad); }
.nav--bordered { border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.tabs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.tab {
  display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; padding: 10px 20px; color: var(--text);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  transition: transform 140ms var(--ease-out), color 150ms ease;
}
.tab:active { transform: scale(0.97); }
.tab.is-current { background: var(--pink); color: var(--bg); }
.tab.is-current.is-avance { background: var(--cyan); }
.tab.is-current:hover { color: var(--bg); }

/* Etiqueta tipo pegatina */
.tag {
  position: absolute; z-index: 2; padding: 6px 18px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--bg);
  background: var(--type, var(--pink));
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  transform: rotate(-5deg); box-shadow: 0 4px 10px rgba(0, 0, 0, .35);
}
.is-analisis { --type: var(--pink); }
.is-avance { --type: var(--cyan); }

/* Imagen de relleno cuando no hay portada */
.ph {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(255, 61, 138, .22), transparent 60%),
    radial-gradient(100% 80% at 100% 100%, rgba(75, 216, 224, .16), transparent 60%),
    #15151B;
}
.media { position: relative; overflow: hidden; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Portada ---------- */
.hero { position: relative; z-index: 1; height: 640px; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; overflow: hidden; animation: heroPan 22s ease-in-out infinite alternate; }
.hero__bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@keyframes heroPan { from { transform: scale(1); } to { transform: scale(1.06); } }
.hero__shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,10,13,1) 0px, rgba(10,10,13,1) 172px, rgba(10,10,13,.98) 217px, rgba(10,10,13,.93) 261px, rgba(10,10,13,.86) 305px, rgba(10,10,13,.76) 350px, rgba(10,10,13,.65) 394px, rgba(10,10,13,.51) 438px, rgba(10,10,13,.35) 482px, rgba(10,10,13,.17) 527px, rgba(10,10,13,0) 566px);
}
/* Banda del color del fondo en el borde inferior: en pantallas con escalado (125 %, 150 %) el borde
   del hero cae en medio píxel y la imagen ampliada por la animación se colaba como una línea clara. */
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--bg); z-index: 3; }
.hero .tag { top: 32px; left: 56px; }
.hero__text { position: absolute; left: var(--pad); right: var(--pad); bottom: 52px; max-width: 900px; }
.hero__title { font-size: 60px; font-weight: 800; line-height: 1.02; margin: 0 0 16px; }
.hero__title a:hover { color: inherit; }
.hero__lede { font-size: 16px; color: #C9C7C2; max-width: 640px; line-height: 1.55; margin: 0 0 20px; }
.hero__bar { height: 12px; width: 72px; background: var(--pink); border-radius: 2px; }
.is-avance .hero__bar { background: var(--cyan); }

/* ---------- Secciones y tarjetas ---------- */
.section { padding: 40px var(--pad) 56px; position: relative; z-index: 1; }
.section-title { font-size: 26px; font-weight: 800; margin: 0 0 22px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { display: block; transition: transform 200ms var(--ease-out); }
.card:hover { color: inherit; }
.card:hover .ctitle { text-decoration: underline; text-underline-offset: 4px; }
.card__media { height: var(--h, 210px); }
.card--lg .card__media { height: var(--hl, 300px); }
.card__body { padding-top: 14px; }
.card--lg .card__body { padding-top: 16px; }
.card__meta { font-size: 10px; color: var(--muted); margin-bottom: 7px; text-transform: uppercase; }
.card--lg .card__meta { font-size: 11px; margin-bottom: 8px; }
.ctitle { font-size: 18px; font-weight: 800; margin: 0 0 7px; color: #fff; line-height: 1.2; }
.card--lg .ctitle { font-size: 25px; margin-bottom: 8px; }
.card__excerpt { font-size: 13px; color: var(--soft); line-height: 1.5; margin: 0; }
.card--lg .card__excerpt { font-size: 14px; }
.home .ctitle { color: var(--type); }
.home .card__media { --h: 200px; }
.home .card--lg .card__media { --hl: 280px; }
.home .card--lg .ctitle { font-size: 23px; }

/* Lista tipo marcador */
.board { padding: 8px var(--pad) 56px; border-top: 1px solid var(--line); position: relative; z-index: 1; }
.board .section-title { margin: 34px 0 18px; }
.row { display: flex; align-items: center; gap: 20px; padding: 19px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row:hover { color: inherit; }
.row__n { font-size: 18px; font-weight: 800; color: var(--muted); width: 36px; }
.row__thumb {
  width: 104px; height: 66px; flex-shrink: 0; position: relative; overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.row__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.row__kind { width: 90px; font-size: 13px; font-weight: 700; color: var(--type); text-align: center; text-transform: uppercase; }
.row__title { flex: 1; font-size: 18px; font-weight: 600; transition: color 150ms ease; }
.row:hover .row__title { color: var(--pink); }
.row.is-avance:hover .row__title { color: var(--cyan); }

/* ---------- Listados ---------- */
.page-head { padding: 56px var(--pad) 32px; }
.page-head h1 { font-size: 52px; font-weight: 800; color: #fff; margin: 0; }
.listing { padding: 16px var(--pad) 64px; }
.listing .grid-2 { margin-bottom: 28px; }
.listing .grid-3 { margin-bottom: 28px; }
.pager { display: flex; justify-content: center; gap: 12px; padding-top: 44px; flex-wrap: wrap; }
.chip {
  display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600;
  padding: 12px 28px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, .14); color: var(--soft);
  background: transparent; cursor: pointer; transition: filter 150ms ease, transform 140ms var(--ease-out);
}
.chip:active { transform: scale(0.97); }
.empty { color: var(--soft); font-size: 16px; line-height: 1.6; max-width: 60ch; }

/* ---------- Artículo ---------- */
.cover {
  position: relative; height: 520px; overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 56px));
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .tag { top: 28px; left: 28px; }
.cover__text { position: absolute; left: var(--pad); right: var(--pad); bottom: 80px; max-width: 820px; }
.cover__title { font-size: 58px; font-weight: 800; line-height: 1.02; margin: 0 0 14px; text-shadow: 0 2px 16px rgba(0, 0, 0, .85), 0 1px 3px rgba(0, 0, 0, .9); }
.byline { display: flex; align-items: center; gap: 14px; font-size: 12px; text-transform: uppercase; text-shadow: 0 1px 6px rgba(0, 0, 0, .9); }
.article-body { padding: 48px var(--pad) 80px; display: flex; justify-content: center; }
.entry-content { flex: 1; max-width: 700px; min-width: 0; }
.entry-content > p { font-size: 17px; line-height: 1.75; color: var(--body); margin: 0 0 22px; }
.entry-content > p:last-child { margin-bottom: 0; }
.entry-content h2, .entry-content h3 { font-family: 'Unbounded', sans-serif; font-weight: 800; color: #fff; line-height: 1.15; margin: 44px 0 18px; }
.entry-content h2 { font-size: 28px; }
.entry-content h3 { font-size: 21px; }
.entry-content a { color: var(--type, var(--pink)); text-decoration: underline; text-underline-offset: 3px; }
.entry-content ul, .entry-content ol { color: var(--body); font-size: 17px; line-height: 1.75; margin: 0 0 22px; padding-left: 24px; }
.entry-content blockquote { margin: 28px 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--type, var(--pink)); color: #fff; font-size: 19px; line-height: 1.6; }
.entry-content strong { color: #fff; }
.entry-content figure, .entry-content .wp-block-image { margin: 8px 0 32px; }
.entry-content figure img, .entry-content .wp-block-image img {
  display: block; width: 100%; height: auto;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 24px 100%, 0 calc(100% - 24px));
}
.entry-content figure:nth-of-type(even) img, .entry-content .wp-block-image:nth-of-type(even) img {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%);
}
.entry-content figcaption { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); margin-top: 10px; }
.entry-content .alignwide, .entry-content .alignfull { max-width: 100%; }
.entry-content .alignleft { float: left; margin: 4px 24px 12px 0; }
.entry-content .alignright { float: right; margin: 4px 0 12px 24px; }
.entry-content::after { content: ""; display: table; clear: both; }
.entry-content iframe { max-width: 100%; }
.entry-content .wp-block-embed { margin: 8px 0 32px; }

/* Páginas genéricas */
.page-body { padding: 16px var(--pad) 88px; }

/* ---------- Contacto ---------- */
.contact { padding: 64px var(--pad) 88px; }
.contact__inner { max-width: 620px; }
.contact h1 { font-size: 48px; font-weight: 800; line-height: 1.05; margin: 0 0 18px; }
.contact__intro { font-size: 15px; color: var(--soft); line-height: 1.6; margin: 0 0 36px; max-width: 520px; }
.form { display: flex; flex-direction: column; gap: 18px; margin-bottom: 20px; }
.field label { font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #8A8890; display: block; margin-bottom: 8px; }
.field input[type=text], .field input[type=email], .field textarea {
  width: 100%; background: var(--surface); border: 1px solid rgba(255, 255, 255, .14); color: var(--text);
  font-family: 'Work Sans', sans-serif; font-size: 14px; padding: 12px 14px; border-radius: 0; transition: border-color 150ms ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--pink); }
.field textarea { resize: vertical; min-height: 140px; }
.consent { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--soft); line-height: 1.5; }
.consent input { margin-top: 3px; accent-color: var(--pink); }
.consent a { text-decoration: underline; text-underline-offset: 3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn {
  display: inline-block; border: 0; cursor: pointer; background: var(--pink); color: var(--bg);
  font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 12px 26px; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); transition: transform 140ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.notice { padding: 14px 18px; margin-bottom: 26px; font-size: 14px; line-height: 1.5; border-left: 3px solid var(--cyan); background: var(--surface); }
.notice--error { border-left-color: var(--pink); }
.chan { display: flex; align-items: center; gap: 14px; padding: 16px 0; margin-top: 40px; }
.chan .k { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); width: 120px; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Pie ---------- */
.footer { padding: 34px var(--pad); border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; position: relative; z-index: 1; }
.footer__brand { font-size: 18px; font-weight: 800; }
.footer__brand:hover { color: var(--text); }
.footer__tag { font-size: 11px; color: var(--muted); }
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; font-size: 11px; text-transform: uppercase; }
.footer__links a { color: var(--muted); }
.footer__links a:hover { color: var(--pink); }

/* ---------- Interacción solo con puntero ---------- */
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-4px); }
  .chip:hover { filter: brightness(1.18); }
}

/* ---------- Adaptación a móvil y tableta ---------- */
@media (max-width: 1100px) {
  :root { --pad: 40px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero__title { font-size: 48px; }
  .cover__title { font-size: 46px; }
}
@media (max-width: 720px) {
  :root { --pad: 20px; }
  .brand { font-size: 18px; }
  .tab { padding: 9px 14px; font-size: 12px; }
  .hero { height: 520px; }
  .hero .tag { left: 16px; top: 20px; }
  .hero__text { bottom: 36px; }
  .hero__title { font-size: 32px; }
  .hero__lede { font-size: 15px; }
  .section { padding: 32px var(--pad) 40px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 28px; }
  .grid-2 { margin-bottom: 28px; }
  .card__media, .card--lg .card__media, .home .card__media, .home .card--lg .card__media { height: 220px; }
  .card--lg .ctitle, .home .card--lg .ctitle { font-size: 21px; }
  .page-head { padding: 36px var(--pad) 16px; }
  .page-head h1 { font-size: 34px; }
  .row { gap: 12px; }
  .row__n { display: none; }
  .row__thumb { width: 72px; height: 52px; }
  .row__kind { display: none; }
  .row__title { font-size: 16px; }
  .cover { height: 440px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 32px)); }
  .cover__text { bottom: 56px; }
  .cover__title { font-size: 30px; }
  .article-body { padding: 32px var(--pad) 56px; }
  .entry-content > p, .entry-content ul, .entry-content ol { font-size: 16px; }
  .contact { padding: 40px var(--pad) 56px; }
  .contact h1 { font-size: 32px; }
  .chan { flex-direction: column; align-items: flex-start; gap: 4px; }
  .footer { padding: 28px var(--pad); }
}

@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
  .bulb { animation: none; opacity: 1; }
  .hero__bg { animation: none; }
  .type-h { animation: none; clip-path: none; }
  a, .card, .tab, .chip, .btn { transition-duration: 0.01ms !important; }
}
