/* Styles for the article reading page (/articulos/<slug>/).
 *
 * WHY THIS FILE EXISTS, AND WHY IT DUPLICATES VALUES
 * --------------------------------------------------
 * Every other page on this site is built by Next and styled with Tailwind.
 * This one is assembled by netlify/functions/articulo.js at request time, so
 * that an article published in /admin is live immediately rather than waiting
 * for someone to run a deploy. A function cannot use Tailwind classes — they
 * are generated when the site is compiled — so the reading page carries its
 * own stylesheet.
 *
 * The colours below are copied from tailwind.config.ts and app/globals.css.
 * IF YOU CHANGE A BRAND COLOUR THERE, CHANGE IT HERE TOO. There is no build
 * step that will catch the drift for you.
 *
 * Same story for the fonts: app/layout.tsx loads them through next/font/local,
 * which publishes them at hashed paths that change on every build, so this
 * page points at the stable copies in public/fuentes/ instead.
 */

@font-face {
  font-family: "Space Grotesk";
  src: url("/fuentes/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/fuentes/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Archivo Black";
  src: url("/fuentes/archivo-black.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --base: #0a0a0b;
  --surface: #16161a;
  --border: rgba(255, 255, 255, 0.08);
  --lime: #d7ff3d;
  --lime-hover: #c2f01f;
  --ink: #ffffff;
  --ink-80: rgba(255, 255, 255, 0.82);
  --ink-55: rgba(255, 255, 255, 0.55);
  --ink-40: rgba(255, 255, 255, 0.4);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--base);
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--lime);
  text-decoration: none;
}

::selection {
  background: var(--lime);
  color: var(--base);
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ---------- top bar ---------- */

.barra {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(12px);
}

.lockup {
  font-family: "Archivo Black", "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: -0.3px;
  line-height: 1;
  color: var(--ink);
}

.lockup span {
  color: var(--lime);
}

.volver {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-55);
}

.volver:hover {
  color: var(--lime);
}

.wa {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  background: var(--lime);
  color: var(--base);
  font-size: 14px;
  font-weight: 800;
  padding: 11px 20px;
  border-radius: 999px;
  transition: background 0.18s;
}

.wa:hover {
  background: var(--lime-hover);
}

/* ---------- article ---------- */

.lectura {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.migas {
  font-size: 12px;
  color: var(--ink-40);
  padding: 26px 0 0;
}

.migas a {
  color: var(--ink-55);
}

.categoria {
  display: inline-block;
  margin: 24px 0 14px;
  border: 1px solid rgba(215, 255, 61, 0.3);
  background: rgba(215, 255, 61, 0.1);
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 6px 12px;
  border-radius: 999px;
}

h1 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -1px;
  margin: 0 0 16px;
  text-wrap: balance;
}

.bajada {
  font-size: 18.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.62);
  margin: 0 0 22px;
  max-width: 60ch;
}

.firma {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0 26px;
  border-bottom: 1px solid var(--border);
}

.avatar {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: rgba(215, 255, 61, 0.12);
  border: 1px solid rgba(215, 255, 61, 0.3);
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--lime);
}

.firma .autor {
  font-size: 13.5px;
  font-weight: 700;
}

.firma .cuando {
  font-size: 12px;
  color: var(--ink-40);
}

.portada {
  margin: 0 0 34px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.portada img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.cuerpo p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-80);
  margin: 0 0 22px;
  max-width: 65ch;
}

.cuerpo h2 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.4px;
  margin: 38px 0 14px;
  text-wrap: balance;
}

.cuerpo ul {
  margin: 0 0 22px;
  padding-left: 20px;
  max-width: 65ch;
}

.cuerpo li {
  font-size: 16.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 9px;
}

.cuerpo li::marker {
  color: var(--lime);
}

.cuerpo figure {
  margin: 32px 0;
}

.cuerpo figure img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.cuerpo figcaption {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink-40);
  line-height: 1.5;
}

.cuerpo blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--lime);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 21px;
  line-height: 1.45;
  color: var(--ink);
  max-width: 48ch;
}

/* ---------- closing ---------- */

.cta {
  margin: 44px 0 0;
  border: 1px solid rgba(215, 255, 61, 0.25);
  background: rgba(215, 255, 61, 0.07);
  border-radius: 16px;
  padding: 26px;
}

.cta h3 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.cta p {
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-55);
  max-width: 60ch;
}

.servicio-rel {
  margin: 22px 0 0;
  font-size: 14.5px;
  color: var(--ink-55);
}

.relacionados {
  margin: 52px 0 70px;
  border-top: 1px solid var(--border);
  padding-top: 26px;
}

.relacionados h4 {
  margin: 0 0 16px;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--ink-40);
}

.tarjetas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tarjeta {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.22s var(--ease), border-color 0.22s, box-shadow 0.22s;
}

.tarjeta-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #000;
}

.tarjeta-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.tarjeta-cuerpo {
  padding: 14px 14px 16px;
}

.tarjeta-titulo {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  margin: 0;
}

.tarjeta-fecha {
  margin-top: 10px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.38);
  font-variant-numeric: tabular-nums;
}

@media (hover: hover) and (pointer: fine) {
  .tarjeta:hover {
    transform: translateY(-6px);
    border-color: rgba(215, 255, 61, 0.4);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.55);
  }

  .tarjeta:hover .tarjeta-media img {
    transform: scale(1.05);
  }
}

/* ---------- 404 / error ---------- */

.aviso {
  max-width: 560px;
  margin: 0 auto;
  padding: 90px 20px;
  text-align: center;
}

.aviso h1 {
  font-size: 28px;
  margin-bottom: 12px;
}

.aviso p {
  color: var(--ink-55);
  font-size: 15.5px;
  line-height: 1.6;
  margin: 0 0 22px;
}

@media (max-width: 680px) {
  h1 {
    font-size: 30px;
  }

  .bajada {
    font-size: 16.5px;
  }

  .cuerpo blockquote {
    font-size: 18px;
  }

  .tarjetas {
    grid-template-columns: 1fr;
  }

  .barra {
    gap: 12px;
    padding: 14px 16px;
  }

  .volver {
    display: none;
  }
}
