/* Pictogramas.es — hoja de estilos principal */

/* Fuentes alojadas en la propia web (sin conexiones a Google). Licencia SIL Open Font License. */
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-hyperlegible-400.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/atkinson-hyperlegible-700.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 800 900; font-display: swap; src: url("../fonts/nunito-800-900.woff2") format("woff2"); }

:root {
  --navy: #12355b;
  --navy-2: #1d4e80;
  --ink: #1b2430;
  --muted: #5b6676;
  --line: #e3e8ef;
  --bg: #f7f9fc;
  --card: #ffffff;
  --red: #e2412f;
  --yellow: #f5b70a;
  --green: #2f9e57;
  --blue: #2d8bd6;
  --focus: #f5b70a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(18, 53, 91, .06), 0 8px 24px rgba(18, 53, 91, .08);
  --shadow-lg: 0 2px 6px rgba(18, 53, 91, .08), 0 24px 60px rgba(18, 53, 91, .16);
  --wrap: 1200px;
  --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-title: "Nunito", var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-2); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
h1, h2, h3 { font-family: var(--font-title); color: var(--navy); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 900; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 800; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 100; }
.skip:focus { top: 12px; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-family: var(--font-title); font-weight: 900; font-size: 1.35rem; }
.brand:hover { color: var(--navy); }
.brand-mark { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 34px; height: 34px; }
.brand-mark span { border-radius: 4px; }
.brand-mark span:nth-child(1) { background: var(--green); }
.brand-mark span:nth-child(2) { background: var(--yellow); }
.brand-mark span:nth-child(3) { background: var(--blue); }
.brand-mark span:nth-child(4) { background: var(--red); }
.brand small { color: var(--muted); font-weight: 700; }

.nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px;
  text-decoration: none; color: var(--ink); font-weight: 700;
}
.nav a:hover { background: #eef3f9; color: var(--navy); }
.nav a[aria-current="page"] { background: var(--navy); color: #fff; }

/* Submenú «Temas» */
.has-sub { position: relative; }
.nav-sub-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px; border: 0; background: none;
  font: inherit; font-weight: 700; color: var(--ink); cursor: pointer;
}
.nav-sub-toggle:hover, .has-sub.is-open .nav-sub-toggle { background: #eef3f9; color: var(--navy); }
.has-sub.is-current .nav-sub-toggle { background: var(--navy); color: #fff; }
.nav-sub-toggle .caret { width: 1em; height: 1em; transition: transform .15s; }
.has-sub.is-open .caret { transform: rotate(180deg); }
.nav .nav-sub {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  flex-direction: column; gap: 2px; min-width: 250px; padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.has-sub.is-open .nav-sub { display: flex; }
.nav .nav-sub a { width: 100%; border-radius: 10px; padding: 10px 14px; white-space: nowrap; }
.nav .nav-sub a[aria-current="page"] { background: #eef3f9; color: var(--navy); }
.nav-toggle {
  display: none; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--navy);
  padding: 9px 14px; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer;
}

@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; max-height: calc(100vh - 68px); overflow-y: auto; }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; padding: 10px 16px 16px; }
  .nav a, .nav-sub-toggle { width: 100%; border-radius: 12px; padding: 12px 14px; }
  .nav-sub-toggle .caret { margin-left: auto; }
  .nav .nav-sub { position: static; min-width: 0; padding: 0 0 0 30px; border: 0; box-shadow: none; }
}

/* ---------- Hero ---------- */
.hero { padding: 20px 0 0; }
.hero-media {
  border-radius: 28px; overflow: hidden; background: #e9eef4;
  aspect-ratio: 2000 / 750; box-shadow: var(--shadow);
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-card {
  position: relative; z-index: 2;
  max-width: 880px; margin: -70px auto 0;
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow-lg);
  padding: 32px 36px 28px; text-align: center;
}
.hero-card .lead { color: var(--muted); font-size: 1.15rem; max-width: 640px; margin: 0 auto 22px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: #f2f5f9; border: 2px solid transparent; border-radius: 999px;
  padding: 6px 6px 6px 20px; transition: border-color .15s, background .15s;
}
.search:focus-within { border-color: var(--navy-2); background: #fff; }
.search .icon { color: var(--muted); width: 22px; height: 22px; }
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font: inherit; font-size: 1.1rem; color: var(--ink); padding: 10px 4px;
}
.search input::placeholder { color: #7a8595; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; margin: 18px 0 0; padding: 0; list-style: none; color: var(--muted); font-weight: 700; font-size: .98rem; }
.stats li { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

@media (max-width: 640px) {
  .hero { padding-top: 12px; }
  .hero .wrap { padding: 0 12px; }
  .hero-media { border-radius: 18px; aspect-ratio: 4 / 3; }
  .hero-media img { object-position: 46% 50%; }
  .hero-card { margin-top: -36px; padding: 24px 18px 20px; border-radius: 20px; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 22px;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  background: var(--navy); color: #fff; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--navy-2); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-light { background: #eef3f9; color: var(--navy); }
.btn-light:hover { background: #e1e9f3; color: var(--navy); }
.btn-yellow { background: var(--yellow); color: #2a1f00; }
.btn-yellow:hover { background: #e6aa00; color: #2a1f00; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Secciones ---------- */
.section { padding: 64px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.section-head p { color: var(--muted); margin: 0; }
.eyebrow { display: inline-block; font-weight: 800; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--green); margin-bottom: 6px; }

/* ---------- Explorador ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.crumb { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crumb h2 { margin: 0; }
.count { color: var(--muted); font-weight: 700; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 22px; padding: 0; list-style: none; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 700; cursor: pointer;
}
.chip:hover { border-color: var(--navy-2); color: var(--navy); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.cat-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 18px 14px 16px; text-decoration: none; color: var(--ink);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent, var(--navy-2)); color: var(--ink); }
.cat-card img { width: 100%; max-width: 130px; aspect-ratio: 1; object-fit: contain; }
.cat-card strong { font-family: var(--font-title); font-size: 1.1rem; color: var(--navy); }
.cat-card span { color: var(--muted); font-size: .92rem; margin-top: -8px; }

.picto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.picto {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.picto:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--navy-2); }
.picto-open {
  display: flex; flex-direction: column; align-items: stretch; gap: 0; width: 100%;
  border: 0; background: none; padding: 12px 12px 0; cursor: pointer; font: inherit; color: inherit; text-align: center;
}
.picto-open img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; }
.picto-name {
  display: block; padding: 8px 4px 12px; font-weight: 700; font-size: 1rem;
  line-height: 1.25; overflow-wrap: break-word; hyphens: auto;
}
.picto-name::first-letter { text-transform: uppercase; }
.picto-play {
  position: absolute; right: 8px; top: 8px;
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(238, 243, 249, .92); color: var(--navy);
  box-shadow: 0 1px 3px rgba(18, 53, 91, .12);
}
.picto-play:hover { background: var(--navy); color: #fff; }
.picto-play .icon { width: 18px; height: 18px; }
.picto.is-playing { border-color: var(--yellow); box-shadow: 0 0 0 4px rgba(245, 183, 10, .25); }
.picto.is-playing .picto-play { background: var(--yellow); color: #2a1f00; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); background: #fff; border: 2px dashed var(--line); border-radius: var(--radius); }
.empty strong { display: block; color: var(--navy); font-size: 1.2rem; margin-bottom: 6px; }

@media (max-width: 520px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .picto-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .picto-open { padding: 8px 8px 0; }
}

/* ---------- Visor (modal) ---------- */
.viewer {
  width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 24px);
  border: 0; border-radius: 24px; padding: 0; box-shadow: var(--shadow-lg); color: var(--ink);
}
.viewer::backdrop { background: rgba(14, 30, 50, .6); backdrop-filter: blur(3px); }
.viewer-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.viewer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.viewer-top .tag { font-weight: 700; color: var(--muted); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: #eef3f9; color: var(--navy);
}
.icon-btn:hover { background: var(--navy); color: #fff; }
.viewer-stage { position: relative; display: flex; align-items: center; gap: 8px; }
.viewer-stage figure { flex: 1; margin: 0; }
.viewer-stage img { width: 100%; max-height: 52vh; aspect-ratio: 1; object-fit: contain; }
.viewer h2 { text-align: center; margin: 0; font-size: clamp(1.6rem, 5vw, 2.4rem); }
.viewer h2::first-letter { text-transform: uppercase; }
.viewer-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
@media (max-width: 520px) {
  .viewer-body { padding: 16px; }
  .viewer-stage .icon-btn { width: 38px; height: 38px; }
  .viewer-actions .btn { flex: 1 1 40%; padding: 12px 14px; }
}

/* ---------- Bloques informativos ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { background: #fff; border-radius: var(--radius); padding: 26px; border: 1px solid var(--line); }
.step-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px; color: #fff; }
.step-icon .icon { width: 26px; height: 26px; }
.step p { color: var(--muted); margin: 0; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.split-media { background: #fff; border-radius: 24px; padding: 24px; box-shadow: var(--shadow); }
.split-media img { margin: 0 auto; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 28px; } }

.promo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.promo {
  display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  border-top: 6px solid var(--accent); transition: transform .15s, box-shadow .15s;
}
.promo:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.promo h3 { margin: 0; }
.promo p { color: var(--muted); margin: 0; flex: 1; }
.promo .more { font-weight: 800; color: var(--navy-2); display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 820px) { .promo-grid { grid-template-columns: 1fr; } }

.band { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- Páginas interiores ---------- */
.page-head { padding: 48px 0 28px; }
.page-banner { margin-top: 20px; border-radius: 28px; overflow: hidden; background: #f6efe6; aspect-ratio: 2000 / 667; box-shadow: var(--shadow); }
.page-banner img { width: 100%; height: 100%; object-fit: cover; }
.page-banner + .page-head { padding-top: 32px; }
@media (max-width: 640px) {
  .page-banner { margin-top: 12px; border-radius: 18px; aspect-ratio: 4 / 3; }
  .page-banner img { object-position: 78% 50%; }
  .page-banner.is-centro img { object-position: 54.5% 50%; }
  .page-banner.is-izq img { object-position: 12% 50%; }
}
.page-head p { color: var(--muted); font-size: 1.15rem; max-width: 720px; }
.prose { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: clamp(22px, 4vw, 44px); }
.prose h2 { font-size: 1.35rem; margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.25em; }
.prose li { margin-bottom: .35em; }
.legal { max-width: 860px; }
.faq { display: grid; gap: 12px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.faq details[open] { border-color: var(--navy-2); box-shadow: var(--shadow); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; font-family: var(--font-title); font-weight: 800; font-size: 1.12rem; color: var(--navy);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: #eef3f9; color: var(--navy); font-size: 1.3rem; line-height: 1;
}
.faq details[open] summary::after { content: "−"; background: var(--navy); color: #fff; }
.faq details > div { padding: 0 22px 6px; color: #36414f; }

.sitemap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: start; }
.sitemap ul { list-style: none; padding-left: 0; }
.sitemap li { margin-bottom: .5em; }
.sitemap > section > ul > li > a { font-weight: 700; }
.sitemap-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 16px; margin-top: 10px; padding-left: 14px !important; border-left: 3px solid var(--line); }
@media (max-width: 760px) { .sitemap { grid-template-columns: 1fr; } }

.list-check { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.list-check li { background: #f2f5f9; border-radius: 10px; padding: 8px 12px; font-weight: 700; }

.store-badge { display: inline-flex; align-items: center; gap: 12px; background: #111; color: #fff; padding: 12px 22px; border-radius: 14px; text-decoration: none; }
.store-badge:hover { background: #000; color: #fff; }
.store-badge small { display: block; font-size: .75rem; opacity: .8; line-height: 1.1; }
.store-badge strong { display: block; font-size: 1.15rem; line-height: 1.2; }
.note { display: inline-block; margin-top: 12px; color: var(--muted); font-size: .95rem; }

.poster-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 18px; box-shadow: var(--shadow); }
.poster-card img { border-radius: 12px; margin: 0 auto; }
.poster-card .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 32px; align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-aside { background: var(--navy); color: #dfe9f5; border-radius: 24px; padding: 32px; }
.contact-aside h2 { color: #fff; }
.contact-aside a.mail { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.15rem; text-decoration: none; background: rgba(255,255,255,.1); padding: 12px 18px; border-radius: 14px; margin-top: 8px; overflow-wrap: anywhere; }
.contact-aside a.mail:hover { background: rgba(255,255,255,.18); }
.form { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: clamp(22px, 4vw, 36px); display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fbfcfe;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--navy-2); background: #fff; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .97rem; color: var(--muted); }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--navy); flex: none; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.alert { border-radius: 12px; padding: 14px 16px; font-weight: 700; }
.alert[hidden] { display: none; }
.alert.ok { background: #e7f6ec; color: #1d6b3a; }
.alert.err { background: #fdecea; color: #a12a1c; }

/* ---------- Pie ---------- */
.site-footer { background: var(--navy); color: #c9d6e6; margin-top: 64px; padding: 48px 0 28px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer .brand { color: #fff; }
.site-footer h3 { color: #fff; font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer ul a { text-decoration: none; }
.site-footer ul a:hover { text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 32px; padding-top: 20px; font-size: .92rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.footer-bottom a { color: #c9d6e6; }
.site-footer .colab { color: rgba(201, 214, 230, .45); }
.site-footer .colab a { color: inherit; text-decoration: none; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- Impresión ---------- */
@media print {
  .site-header, .site-footer, .hero, .no-print { display: none !important; }
  body { background: #fff; }
}

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