/*
Theme Name: Modo Hiperfoco
Theme URI: https://modohiperfoco.com
Author: CLINK
Author URI: https://clink.es
Description: Custom classic WordPress theme for modohiperfoco.com — a Spanish educational site about ADHD. Lightweight, accessible, mobile-first, with zero third-party runtime requests (fonts served locally). No CSS frameworks, no jQuery, no external CDNs.
Version: 0.2.0
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: modohiperfoco
Tags: blog, education, accessibility-ready, custom-menu, featured-images, translation-ready
*/

/* ==========================================================================
   Local fonts — self-hosted woff2, latin subset. No external requests (RGPD).
   Bricolage Grotesque is a variable font: one file, weight range 400–800.
   ========================================================================== */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/bricolage-grotesque-variable.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/atkinson-hyperlegible-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/atkinson-hyperlegible-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/atkinson-hyperlegible-400-italic.woff2") format("woff2");
}

/* ==========================================================================
   Design tokens — source of truth: referencias/identidad-modo-hiperfoco.html
   Closed decisions. Do not change palette or type without explicit instruction.
   ========================================================================== */
:root {
  --tinta: #1F2B3E;
  --papel: #FAF8F3;
  --ambar: #EFA32F;
  --salvia: #3E8E7E;
  --coral: #D95D39;
  --bruma: #E6E1D6;
  --tinta-suave: #51607A;
  --tinta-clara: #C8CEDA;   /* light text on dark backgrounds */

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, sans-serif;

  --wrap: 1000px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;      /* 17px */
  line-height: 1.65;
  color: var(--tinta);
  background: var(--papel);
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; }
a { color: inherit; }
img { max-width: 100%; height: auto; }

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

/* Accessibility utilities */
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
label:focus-visible { outline: 3px solid var(--ambar); outline-offset: 3px; }

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute; word-wrap: normal !important;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--tinta); color: var(--papel);
  padding: 10px 16px; border-radius: 8px; text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.brand-symbol { flex: 0 0 auto; display: block; }

/* ==========================================================================
   Header / navigation
   ========================================================================== */
.site-header {
  background: var(--papel);
  border-bottom: 1px solid var(--bruma);
  position: sticky; top: 0; z-index: 20;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; padding-top: 14px; padding-bottom: 14px;
}
.site-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  color: var(--tinta); text-decoration: none;
}
/* Darker amber (brand-sanctioned, from "Idea clave") for AA contrast on light bg. */
.site-brand .accent { color: #A96F14; }

.nav-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.menu-btn {
  background: none; border: 1px solid var(--bruma); border-radius: 8px;
  padding: 8px 12px; font-family: var(--font-body); font-size: 14px;
  color: var(--tinta); cursor: pointer;
}
.nav-links {
  list-style: none; margin: 0; padding: 0;
  display: none; flex-basis: 100%; flex-direction: column; gap: 2px;
}
.nav-toggle:checked ~ .nav-links { display: flex; }
.nav-links a {
  display: block; padding: 10px 4px; font-weight: 700; font-size: 15px;
  color: var(--tinta-suave); text-decoration: none;
}
.nav-links a:hover { color: var(--tinta); }

@media (min-width: 760px) {
  .menu-btn { display: none; }
  .nav-links {
    display: flex; flex-direction: row; flex-basis: auto;
    gap: 22px; align-items: center;
  }
  .nav-links a { padding: 0; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  background: var(--tinta); color: var(--papel);
  padding: 64px 0 56px; position: relative; overflow: hidden;
}
.hero .wrap { position: relative; z-index: 2; }
.hero-rings {
  position: absolute; right: -90px; top: 50%; transform: translateY(-50%);
  opacity: .14; pointer-events: none; z-index: 1;
}
.hero h1 {
  font-size: clamp(30px, 5.5vw, 46px); font-weight: 800;
  max-width: 20ch; margin-bottom: 16px;
}
.hero h1 em { font-style: normal; color: var(--ambar); }
.hero p { font-size: 19px; color: var(--tinta-clara); max-width: 52ch; }

/* ==========================================================================
   Doors (sections by life moment)
   ========================================================================== */
.doors { padding: 0 0 56px; margin-top: -28px; position: relative; z-index: 5; }
.doors-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .doors-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 920px) { .doors-grid { grid-template-columns: repeat(4, 1fr); } }
.door {
  background: #fff; border: 1px solid var(--bruma); border-radius: 16px;
  padding: 22px; text-decoration: none; color: var(--tinta); display: block;
  transition: transform .15s ease, box-shadow .15s ease;
}
.door:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(31, 43, 62, .10); }
.door .q { display: block; font-family: var(--font-display); font-weight: 800; font-size: 19px; margin-bottom: 6px; }
.door .d { display: block; font-size: 15px; color: var(--tinta-suave); }
.door .go { display: inline-block; margin-top: 12px; font-weight: 700; font-size: 15px; border-bottom: 2px solid var(--ambar); }

/* ==========================================================================
   Shared button
   ========================================================================== */
.btn {
  display: inline-block; background: var(--ambar); color: var(--tinta);
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  padding: 13px 26px; border-radius: 999px; text-decoration: none;
  border: none; cursor: pointer;
}

/* ==========================================================================
   Screening test block
   ========================================================================== */
.test {
  background: #fff; border-top: 1px solid var(--bruma); border-bottom: 1px solid var(--bruma);
  padding: 48px 0;
}
.test .wrap { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.test-icon { flex: 0 0 auto; }
.test h2 { font-size: clamp(22px, 4vw, 28px); font-weight: 800; margin-bottom: 8px; }
.test p { color: var(--tinta-suave); max-width: 52ch; }
.test .note { font-size: 14px; margin-top: 8px; }
.test .btn { margin-top: 16px; }

/* ==========================================================================
   Featured articles
   ========================================================================== */
.articles { padding: 56px 0; }
.eyebrow {
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--tinta-suave); margin-bottom: 12px; font-weight: 700;
}
.articles h2 { font-size: clamp(24px, 4.5vw, 32px); font-weight: 800; margin-bottom: 24px; }
.art-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .art-grid { grid-template-columns: 1fr 1fr 1fr; } }
.card {
  background: #fff; border: 1px solid var(--bruma); border-radius: 16px;
  padding: 22px; text-decoration: none; color: var(--tinta); display: block;
}
.card:hover .t { text-decoration: underline; text-decoration-color: var(--ambar); text-decoration-thickness: 2px; }
.card .cat {
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 10px; color: var(--tinta-suave);
}
.card .cat::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ambar); }
.card .cat.salvia::before { background: var(--salvia); }
.card .cat.coral::before { background: var(--coral); }
.card .t { display: block; font-family: var(--font-display); font-weight: 800; font-size: 19px; line-height: 1.25; margin-bottom: 8px; }
.card .x { display: block; font-size: 15px; color: var(--tinta-suave); }
.card .rev { display: block; font-size: 13px; color: var(--tinta-suave); margin-top: 12px; }

/* ==========================================================================
   Newsletter
   ========================================================================== */
.news { background: var(--tinta); color: var(--papel); padding: 52px 0; }
.news h2 { font-size: clamp(22px, 4vw, 28px); font-weight: 800; margin-bottom: 8px; }
.news p { color: var(--tinta-clara); max-width: 52ch; }
/* Newsletter is a beehiiv embed (iframe); it styles its own fields. Keep only spacing. */
.news-form { margin-top: 18px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { padding: 36px 0 56px; font-size: 14px; color: var(--tinta-suave); }
.site-disclaimer {
  background: color-mix(in srgb, var(--coral) 7%, #fff);
  border: 1px solid color-mix(in srgb, var(--coral) 38%, #fff);
  border-radius: 12px; padding: 14px 18px; margin: 0 0 22px; max-width: 72ch;
}
.site-copyright { margin: 0 0 6px; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { text-decoration: underline; text-decoration-color: var(--bruma); text-underline-offset: 3px; }

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */
.breadcrumbs { margin: 28px 0 8px; font-size: 14px; color: var(--tinta-suave); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--bruma); }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; text-decoration-color: var(--ambar); }
.breadcrumbs [aria-current="page"] { color: var(--tinta); }

/* ==========================================================================
   Article (single) and static pages
   ========================================================================== */
.entry { max-width: 720px; margin: 0 auto; padding-bottom: 24px; }
.entry-header { margin: 8px 0 20px; }
.entry-title { font-size: clamp(28px, 5vw, 40px); font-weight: 800; margin-bottom: 12px; }
.entry-byline { font-size: 15px; font-weight: 600; color: var(--tinta-suave); margin: 0 0 8px; }
.entry-dates { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--tinta-suave); }
.entry-dates .revised { font-weight: 700; color: var(--salvia); }

.entry-content { font-size: 1.125rem; line-height: 1.7; }
.entry-content > * { max-width: 65ch; }
.entry-content h2 { font-size: clamp(22px, 3.5vw, 28px); font-weight: 700; margin: 1.8em 0 .5em; scroll-margin-top: 80px; }
.entry-content h3 { font-size: 1.25rem; font-weight: 600; margin: 1.4em 0 .4em; }
.entry-content p { margin: 0 0 1.2em; }
.entry-content ul, .entry-content ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.entry-content li { margin-bottom: .4em; }
.entry-content a { color: var(--tinta); text-decoration: underline; text-decoration-color: var(--ambar); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.entry-content img { border-radius: 12px; }
.entry-content blockquote { margin: 1.5em 0; padding-left: 18px; border-left: 4px solid var(--bruma); color: var(--tinta-suave); font-style: italic; }

/* ==========================================================================
   Table of contents
   ========================================================================== */
.toc { max-width: 65ch; margin: 0 auto 28px; background: #fff; border: 1px solid var(--bruma); border-radius: 12px; padding: 6px 18px; }
.toc summary { font-family: var(--font-display); font-weight: 600; font-size: 15px; padding: 10px 0; cursor: pointer; }
.toc ol { margin: 0 0 12px; padding-left: 1.2em; }
.toc li { margin-bottom: 6px; font-size: 15px; }
.toc a { color: var(--tinta-suave); text-decoration: none; }
.toc a:hover { color: var(--tinta); text-decoration: underline; text-decoration-color: var(--ambar); }

/* ==========================================================================
   Editorial boxes — source of truth: identidad-modo-hiperfoco.html (04)
   ========================================================================== */
.box { max-width: 65ch; border-radius: 12px; padding: 18px 20px; margin: 24px auto; border: 1px solid var(--bruma); background: #fff; }
.box .tag { font-family: var(--font-display); font-weight: 600; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.box .tag::before { content: ""; width: 10px; height: 10px; border-radius: 50%; }
.box .box-body > *:last-child { margin-bottom: 0; }
.box.corto { background: var(--tinta); color: var(--papel); border: none; }
.box.corto .tag, .box.corto .tag::before { color: var(--ambar); }
.box.corto .tag::before { background: var(--ambar); }
/* Tinted surface instead of a coloured left bar: the semantic colour washes
   the whole box (background + hairline border) rather than striping one edge. */
.box.clave { background: color-mix(in srgb, var(--ambar) 9%, #fff); border-color: color-mix(in srgb, var(--ambar) 38%, #fff); }
.box.clave .tag { color: #A96F14; }
.box.clave .tag::before { background: var(--ambar); }
.box.ojo { background: color-mix(in srgb, var(--coral) 7%, #fff); border-color: color-mix(in srgb, var(--coral) 38%, #fff); }
.box.ojo .tag { color: var(--coral); }
.box.ojo .tag::before { background: var(--coral); }
.box.practica { background: color-mix(in srgb, var(--salvia) 8%, #fff); border-color: color-mix(in srgb, var(--salvia) 38%, #fff); }
.box.practica .tag { color: var(--salvia); }
.box.practica .tag::before { background: var(--salvia); }

/* ==========================================================================
   Related articles + section landing + pagination + 404
   ========================================================================== */
.related { max-width: var(--wrap); margin: 40px auto 0; }
.related h2 { font-size: 22px; font-weight: 800; margin-bottom: 18px; }

.section-intro { margin: 8px 0 28px; max-width: 65ch; }
.section-intro h1 { font-size: clamp(28px, 5vw, 40px); font-weight: 800; margin-bottom: 12px; }
.section-lead { color: var(--tinta-suave); font-size: 1.0625rem; }
.section-list { margin-bottom: 32px; }

.pagination { margin: 8px 0 40px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers { display: inline-block; padding: 8px 14px; border: 1px solid var(--bruma); border-radius: 8px; text-decoration: none; color: var(--tinta); }
.pagination .page-numbers.current { background: var(--ambar); border-color: var(--ambar); }

.error-404 { padding: 40px 0; }
.error-404 h1 { font-size: clamp(26px, 5vw, 36px); font-weight: 800; margin-bottom: 10px; }
.error-404 p { color: var(--tinta-suave); margin-bottom: 24px; }
.error-404 .doors-grid { grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .error-404 .doors-grid { grid-template-columns: repeat(4, 1fr); } }

/* ==========================================================================
   Tool page — distraction-free (e.g. the future screening test)
   ========================================================================== */
.tool-page .nav-links,
.tool-page .menu-btn,
.tool-page .nav-toggle,
.tool-page .foot-links { display: none !important; }
.tool-page .site-header { position: static; }
.tool-page .nav-inner { justify-content: center; }

.tool-main { max-width: 680px; margin: 0 auto; padding: 40px 22px 8px; }
.tool-header { text-align: center; margin-bottom: 28px; }
.tool-header .entry-title { font-size: clamp(26px, 5vw, 38px); font-weight: 800; margin-bottom: 14px; }
.tool-privacy {
  display: inline-block; background: var(--salvia); color: var(--papel);
  font-weight: 700; font-size: 14px; padding: 8px 16px; border-radius: 999px;
}
.tool-content { font-size: 1.0625rem; line-height: 1.7; }
.tool-content > * { max-width: none; }

/* ==========================================================================
   ASRS screening test — one question at a time
   ========================================================================== */
.asrs { margin-top: 24px; }
.asrs-noscript { background: color-mix(in srgb, var(--coral) 7%, #fff); border: 1px solid color-mix(in srgb, var(--coral) 38%, #fff); border-radius: 12px; padding: 14px 18px; }

/* Progress */
.asrs-progress { margin-bottom: 24px; }
.asrs-progress-text { font-size: 14px; font-weight: 700; color: var(--tinta-suave); margin-bottom: 8px; }
.asrs-progress-bar { height: 8px; background: var(--bruma); border-radius: 999px; overflow: hidden; }
.asrs-progress-fill { height: 100%; width: 0; background: var(--ambar); border-radius: 999px; transition: width .25s ease; }

/* Question step */
.asrs-step { border: 0; padding: 0; margin: 0; min-height: 280px; }
.asrs-question { font-family: var(--font-display); font-weight: 800; font-size: clamp(20px, 4vw, 26px); line-height: 1.25; padding: 0; margin-bottom: 22px; }

/* Scale options as large tappable cards */
.asrs-scale { display: grid; gap: 10px; }
.asrs-opt { display: block; cursor: pointer; }
.asrs-radio { position: absolute; opacity: 0; width: 1px; height: 1px; }
.asrs-opt-box {
  display: block; padding: 15px 18px; border: 2px solid var(--bruma); border-radius: 12px;
  background: #fff; font-size: 1.0625rem; transition: border-color .15s ease, background .15s ease;
}
.asrs-opt:hover .asrs-opt-box { border-color: var(--tinta-suave); }
.asrs-radio:checked + .asrs-opt-box { border-color: var(--ambar); background: #FDF3E1; font-weight: 700; }
.asrs-radio:focus-visible + .asrs-opt-box { outline: 3px solid var(--ambar); outline-offset: 3px; }

/* Navigation */
.asrs-nav { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.asrs-nav .btn { margin-left: auto; }
.asrs-nav .btn:disabled { opacity: .45; cursor: not-allowed; }

/* Result */
.asrs-result { background: color-mix(in srgb, var(--salvia) 8%, #fff); border: 1px solid color-mix(in srgb, var(--salvia) 38%, #fff); border-radius: 14px; padding: 28px 24px; text-align: center; }
.asrs-result:focus-visible { outline: 3px solid var(--ambar); outline-offset: 3px; }
.asrs-result-icon { color: var(--salvia); width: 72px; margin: 0 auto 12px; }
.asrs-result-icon.is-positive { color: var(--ambar); }
.asrs-result-icon svg { width: 72px; height: 72px; display: block; }
.asrs-result h2 { font-size: clamp(20px, 4vw, 26px); font-weight: 800; margin-bottom: 12px; }
.asrs-result p { margin-bottom: 14px; }
.asrs-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; margin: 20px 0; }
.asrs-privacy-note { color: var(--salvia); font-weight: 700; font-size: 15px; }
.asrs-source-note { color: var(--tinta-suave); font-size: 14px; }
.asrs-link { background: none; border: none; padding: 0; font: inherit; color: var(--tinta); cursor: pointer; text-decoration: underline; text-decoration-color: var(--ambar); text-decoration-thickness: 2px; text-underline-offset: 3px; }
