/*
Theme Name: Toche
Theme URI: https://usetoche.com/blog/
Author: Toche
Description: Tema del blog de Toche. Misma identidad que la landing y la app: amarillo de marca, violeta de acento, Plus Jakarta Sans, tarjetas redondeadas y modo oscuro.
Version: 1.2.2
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: toche
*/

/* Fuentes propias (las mismas de la landing). Variable: pesos 200–800 en un solo archivo. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fuentes/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fuentes/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Colores: los mismos tokens de la app (src/styles/tokens.css), claro y oscuro. */
:root {
  --bg: oklch(0.975 0.008 95);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.955 0.012 95);
  --text: oklch(0.23 0.03 285);
  --text-2: oklch(0.47 0.03 285);
  --border: oklch(0.91 0.012 95);
  --border-suave: oklch(0.88 0.03 285);
  --accent: oklch(0.47 0.21 288);
  --accent-soft: oklch(0.95 0.03 288);
  --marca: oklch(0.86 0.17 92);
  --on-marca: oklch(0.23 0.03 285);
  --marca-soft: oklch(0.96 0.05 95);
  --tinta: oklch(0.2 0.02 285);
  --sombra: 0 2px 0 oklch(0.2 0.03 285 / 0.08), 0 16px 32px -20px oklch(0.2 0.03 285 / 0.35);
  --fuente: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.18 0.02 285);
    --surface: oklch(0.225 0.025 285);
    --surface-2: oklch(0.27 0.03 285);
    --text: oklch(0.96 0.008 95);
    --text-2: oklch(0.76 0.02 285);
    --border: oklch(0.33 0.03 285);
    --border-suave: oklch(0.36 0.04 285);
    --accent: oklch(0.74 0.14 288);
    --accent-soft: oklch(0.32 0.07 288);
    --marca: oklch(0.84 0.16 92);
    --on-marca: oklch(0.2 0.02 285);
    --marca-soft: oklch(0.32 0.06 92);
    --tinta: oklch(0.96 0.008 95);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--fuente);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img,
video,
iframe {
  max-width: 100%;
  height: auto;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.sr-only,
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.salto {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 30;
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 10px;
}
.salto:focus {
  top: 12px;
}
.ancho {
  width: min(100% - 32px, 1120px);
  margin-inline: auto;
}

/* Barra */
.barra {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in oklch, var(--marca) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--on-marca);
}
.admin-bar .barra {
  top: 32px;
}
@media (max-width: 782px) {
  .admin-bar .barra {
    top: 46px;
  }
}
.barra__interior {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}
.marca {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.marca img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.barra nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.enlace-barra {
  font-weight: 650;
  text-decoration: none;
  padding: 10px 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.enlace-barra:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Botones */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 14px;
  background: oklch(0.2 0.02 285);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px -14px oklch(0.2 0.03 285 / 0.6);
  transition: transform 0.15s ease-out;
}
.boton:hover {
  transform: translateY(-1px);
}
.boton--claro {
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--border-suave);
}

/* Portada del blog y archivos */
.hero-blog {
  background: var(--marca);
  color: var(--on-marca);
  padding: 40px 0 64px;
  border-radius: 0 0 40px 40px;
}
.hero-blog h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 7vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
  text-wrap: balance;
}
.hero-blog p {
  margin: 0;
  max-width: 52ch;
  font-size: 1.125rem;
  font-weight: 500;
}
.principal {
  padding: 40px 0 72px;
}
.tarjetas {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 720px) {
  .tarjetas {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1040px) {
  .tarjetas {
    grid-template-columns: repeat(3, 1fr);
  }
}
.tarjeta {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--sombra);
  transition: transform 0.15s ease-out;
}
.tarjeta:hover {
  transform: translateY(-2px);
}
.tarjeta__foto {
  aspect-ratio: 16 / 9;
  background: var(--marca-soft);
  display: block;
}
.tarjeta__foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tarjeta__cuerpo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 24px;
  flex: 1;
}
.tarjeta h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 750;
}
.tarjeta h2 a {
  text-decoration: none;
}
/* toda la tarjeta es clicable desde el título */
.tarjeta h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.tarjeta p {
  margin: 0;
  color: var(--text-2);
}
.meta {
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 600;
}
.pildora {
  align-self: flex-start;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  text-decoration: none;
}
.vacio {
  background: var(--surface);
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--sombra);
  text-align: center;
}

/* Paginación */
.paginacion {
  margin-top: 40px;
}
.paginacion .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.paginacion .page-numbers {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--surface);
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 0 0 1.5px var(--border-suave);
}
.paginacion .current {
  background: var(--accent);
  color: var(--bg);
  box-shadow: none;
}

/* Artículo */
.articulo {
  padding: 40px 0 24px;
}
.articulo__cabeza {
  width: min(100% - 32px, 700px);
  margin: 0 auto 28px;
}
.articulo__cabeza h1 {
  margin: 14px 0 12px;
  font-size: clamp(2rem, 6.5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
  text-wrap: balance;
}
.articulo__foto {
  width: min(100% - 32px, 960px);
  margin: 0 auto 32px;
}
.articulo__foto img {
  width: 100%;
  display: block;
  border-radius: 28px;
  box-shadow: var(--sombra);
}
.contenido {
  width: min(100% - 32px, 700px);
  margin: 0 auto;
  font-size: 1.125rem;
  line-height: 1.75;
}
.contenido > * + * {
  margin-top: 1.25em;
}
.contenido h2 {
  margin-top: 2em;
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 800;
  text-wrap: balance;
}
.contenido h3 {
  margin-top: 1.75em;
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 750;
}
.contenido a {
  color: var(--accent);
  text-underline-offset: 3px;
  font-weight: 600;
}
.contenido ul,
.contenido ol {
  padding-left: 1.4em;
}
.contenido li + li {
  margin-top: 0.4em;
}
.contenido blockquote {
  margin-inline: 0;
  padding: 16px 22px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 20px 20px 0;
  font-weight: 600;
}
.contenido blockquote p {
  margin: 0;
}
.contenido img {
  border-radius: 20px;
}
.contenido figcaption,
.wp-caption-text {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 0.875rem;
  text-align: center;
}
.contenido hr {
  border: 0;
  border-top: 1.5px solid var(--border);
  margin: 2.5em 0;
}
.contenido code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 6px;
}
.contenido pre {
  overflow-x: auto;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: inset 0 0 0 1.5px var(--border);
  font-size: 0.9375rem;
}
.contenido pre code {
  background: none;
  padding: 0;
}
.contenido table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  display: block;
  overflow-x: auto;
}
.contenido th,
.contenido td {
  padding: 10px 14px;
  border-bottom: 1.5px solid var(--border);
  text-align: left;
}
.contenido th {
  font-weight: 750;
  background: var(--surface-2);
}
.alignleft {
  float: left;
  margin: 0.4em 1.25em 0.8em 0;
}
.alignright {
  float: right;
  margin: 0.4em 0 0.8em 1.25em;
}
.aligncenter {
  display: block;
  margin-inline: auto;
}
.wp-block-image figure,
.wp-block-image {
  margin-inline: 0;
}

/* Cierre de cada artículo: invitación a Toche */
.invitacion {
  width: min(100% - 32px, 700px);
  margin: 56px auto 0;
  padding: 28px 26px;
  background: var(--marca);
  color: var(--on-marca);
  border-radius: 28px;
  box-shadow: var(--sombra);
}
.invitacion h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.invitacion p {
  margin: 0 0 18px;
  font-weight: 500;
}
.invitacion__botones {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.seguir {
  padding: 56px 0 72px;
}
.seguir h2 {
  margin: 0 0 24px;
  font-size: clamp(1.5rem, 5vw, 2rem);
  letter-spacing: -0.025em;
  font-weight: 800;
}

/* Pie */
.pie {
  background: var(--marca);
  color: var(--on-marca);
  padding: 32px 0;
  font-size: 0.875rem;
}
.pie__interior {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: center;
}
.pie nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.pie a {
  font-weight: 650;
  padding: 10px 0;
  display: inline-block;
}

/* Búsqueda y 404 */
.buscador {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  max-width: 480px;
}
.buscador input[type="search"] {
  flex: 1;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid var(--border-suave);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

/* Selector de idioma */
.idiomas {
  position: relative;
}
.idiomas summary {
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 12px;
  font-weight: 750;
  font-size: 0.875rem;
  box-shadow: inset 0 0 0 1.5px color-mix(in oklch, var(--on-marca) 35%, transparent);
}
.idiomas summary::-webkit-details-marker {
  display: none;
}
.idiomas ul {
  list-style: none;
  margin: 0;
  padding: 6px;
}
details.idiomas[open] ul {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 150px;
  background: var(--surface);
  color: var(--text);
  border-radius: 16px;
  box-shadow: var(--sombra);
}
details.idiomas:not([open]) ul {
  display: none;
}
.idiomas li a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 650;
}
.idiomas li a[aria-current] {
  background: var(--accent-soft);
  color: var(--accent);
}
.idiomas li a:hover {
  background: var(--surface-2);
}
.idiomas--pie ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 0;
}
.idiomas--pie li a {
  min-height: 44px;
  padding: 0;
  font-weight: 650;
  text-decoration: underline;
  background: none;
}
.idiomas--pie li a[aria-current] {
  background: none;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}
@media (max-width: 480px) {
  .barra nav .enlace-barra {
    padding: 10px 4px;
  }
  .barra nav .boton {
    padding: 10px 14px;
  }
}
