/*
Theme Name: Wiki Atraso Menstrual
Theme URI: https://atrasomenstrualperu.wiki
Description: Theme de Wiki Atraso Menstrual Perú (La Biblia del Atraso Menstrual). Requiere el plugin Atraso Geo SEO.
Author: Wiki Atraso Menstrual Perú
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
Text Domain: wiki-atraso
*/
/* Sistema Modernist: tokens y componentes */

:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201e1d;
  --color-accent: #ec3013;
  --color-accent-2: #e15b47;
  --color-divider: color-mix(in srgb, #201e1d 40%, transparent);

  /* Tonal ramps — generated in OKLCH on one shared lightness scale, so the
     same step of any role matches the others in visual value. */
  --color-neutral-100: #f8f4f4;
  --color-neutral-200: #eae7e7;
  --color-neutral-300: #d7d3d3;
  --color-neutral-400: #bab6b6;
  --color-neutral-500: #9b9797;
  --color-neutral-600: #7d7979;
  --color-neutral-700: #605d5d;
  --color-neutral-800: #444141;
  --color-neutral-900: #2d2b2b;

  --color-accent-100: #fff2ef;
  --color-accent-200: #ffe0d9;
  --color-accent-300: #ffc4b8;
  --color-accent-400: #ff9783;
  --color-accent-500: #ff563c;
  --color-accent-600: #dd2b0f;
  --color-accent-700: #ae1800;
  --color-accent-800: #7c1405;
  --color-accent-900: #4d170e;

  --color-accent-2-100: #fff2ef;
  --color-accent-2-200: #ffe0da;
  --color-accent-2-300: #ffc4b9;
  --color-accent-2-400: #ff9784;
  --color-accent-2-500: #ef6853;
  --color-accent-2-600: #c94b39;
  --color-accent-2-700: #9e3526;
  --color-accent-2-800: #71261b;
  --color-accent-2-900: #471d16;

  --font-heading: "Archivo", system-ui, sans-serif;
  --font-heading-weight: 800;
  --font-body: "Archivo", system-ui, sans-serif;

  --space-1: 4.0px;
  --space-2: 8.0px;
  --space-3: 12.0px;
  --space-4: 16.0px;
  --space-6: 24.0px;
  --space-8: 32.0px;

  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;

  /* Elevation — derived from the ground: soft ink-tinted shadows on a
     light theme, a hairline edge + ambient darkness on a dark one. */
  --shadow-sm: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--font-heading-weight); }

.grayscale{filter:grayscale(1) contrast(1.08)}

/* ══════════════════════════════════════════════════════════════════════════
   Components — built with the tokens above. Plain CSS
   on plain HTML: no JavaScript, no build step. Each class is documented in
   readme.md and demonstrated in foundations/ and components/.
   ══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.55; font-weight: 400; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 var(--space-2);
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; }
h6 { letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption {
  font-size: 11px; margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* — rules — */
.hr {
  height: 2px; border: 0; margin: var(--space-4) 0;
  background: var(--color-divider);
}

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text); /* matches the .input's 14px —
     the pair sits side by side in sign-up rows */
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); justify-content: flex-start; text-align: left; }

/* — forms — */
.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.radio .dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--color-divider);
}
.radio:hover .dot { border-color: var(--color-accent); }
.radio input:checked + .dot {
  border-color: var(--color-accent); background: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
}
.radio input:focus-visible + .dot { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.seg {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt:has(input:checked) { background: var(--color-accent); color: var(--color-bg); }
.seg-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* — cards — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface);
}
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 17px; line-height: 1.2;
}
.card-body { margin: 0; font-size: 13px; opacity: 0.8; flex: 1; }
.card-meta {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* — tags — */
.tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px;
  border-radius: calc(var(--radius-md) * 0.75);
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-accent-2 { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }

/* — navigation — */
.nav {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: 2px solid var(--color-divider);
}
.nav-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; margin-right: auto;
}
.nav a { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--color-accent); }

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2); border-bottom: 2px solid var(--color-divider);
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }

/* — dialog — */
.dialog-backdrop {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent);
}
.dialog {
  width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-lg);
}
.dialog-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 20px;
}
.dialog-body { font-size: 14px; opacity: 0.85; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }


/* ── Base del sitio ── */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { font-size: 16px; line-height: 1.6; text-rendering: optimizeLegibility; }
a { color: var(--color-accent-700); }
a:hover { color: var(--color-accent); }
p, li { text-wrap: pretty; }
h1, h2 { text-wrap: balance; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--color-text); color: var(--color-bg); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.btn { min-height: 44px; justify-content: flex-start; }
.btn-lg { min-height: 48px; min-width: 220px; font-size: 15px; }
.kicker { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--color-accent-700); margin: 0 0 12px; }
.lede { font-size: 18px; max-width: 720px; }
.muted { color: var(--color-neutral-800); font-size: 13px; }
.rule { border-top: 2px solid var(--color-divider); padding: 20px 0; }
.rule-ink { border-top: 2px solid var(--color-text); }
.h1-xl { font-size: clamp(32px, 5vw, 54px); line-height: 1.04; margin: 0 0 14px; }
.sec-title { font-size: 24px; margin: 0 0 12px; }

/* header */
.site-header .nav { flex-wrap: wrap; row-gap: 8px; padding: 14px 20px; max-width: 1200px; margin: 0 auto; border-bottom: 0; }
.site-header { border-bottom: 2px solid var(--color-divider); }
.brand { display: flex; gap: 10px; align-items: center; color: var(--color-text) !important; text-decoration: none; margin-right: auto; }
.brand-name { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name b { font-size: 17px; font-weight: 800; }
.brand-name small { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--color-accent-700); }
.menu { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; }
.menu a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; }
.menu .current-menu-item > a, .menu .current_page_item > a, .menu a[aria-current="page"] { color: var(--color-accent); }

/* breadcrumbs */
.crumbs { font-size: 13px; padding: 14px 0 0; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--color-neutral-600); }

/* layout: contenido + lateral (el lateral va después en móvil) */
.layout { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; padding: 24px 0 40px; }
.layout-main { flex: 1 1 540px; min-width: 0; max-width: 780px; }
.layout-aside { flex: 0 1 260px; display: grid; gap: 20px; }
@media (min-width: 900px) { .layout-aside { position: sticky; top: 16px; } }
@media (max-width: 899px) { .layout-aside .toc { display: none; } }
.toc { border-top: 2px solid var(--color-text); padding-top: 10px; }
.toc ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }

/* byline */
.byline { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--color-text) !important; border-top: 1px solid var(--color-divider); border-bottom: 1px solid var(--color-divider); padding: 10px 0; margin: 0 0 24px; }
.byline:hover { background: var(--color-surface); }
.byline img { width: 48px; height: 48px; object-fit: cover; }
.byline span { font-size: 13px; line-height: 1.4; }

/* respuesta rápida */
.snippet { border-top: 2px solid var(--color-text); background: var(--color-surface); padding: 16px; margin: 0 0 20px; }
.snippet p { margin: 0; font-size: 17px; }

/* contenido de artículo */
.prose h2 { font-size: 22px; margin: 0 0 8px; padding-top: 18px; border-top: 2px solid var(--color-divider); }
.prose p { margin: 0 0 18px; }
.prose ul { padding-left: 20px; }

/* FAQ nativo (sin JS) */
.faq details { border-bottom: 1px solid var(--color-divider); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; min-height: 44px; font-weight: 600; font-size: 17px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--color-accent); font-weight: 800; }
.faq details[open] summary::after { content: "–"; }
.faq .faq-a { padding: 0 0 14px; font-size: 15px; }

/* grillas y listas */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card-link { text-decoration: none; color: var(--color-text) !important; min-height: 110px; padding: 16px; }
.card-link:hover { background: var(--color-neutral-300); }
.list-cols { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 20px; }
.list-cols li { border-top: 1px solid var(--color-divider); padding: 8px 0; font-size: 15px; }
.list-cols small { font-size: 12px; color: var(--color-neutral-800); }
.num-list { list-style: none; margin: 0; padding: 0; }
.num-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; border-top: 1px solid var(--color-divider); padding: 14px 0; }
.num-list b.n { color: var(--color-accent); font-size: 18px; }

/* mapa esquemático */
.pe-map { display: grid; grid-template-columns: repeat(6, minmax(0, 52px)); grid-auto-rows: 52px; gap: 4px; }
.pe-map a { display: flex; align-items: flex-end; padding: 5px; background: var(--color-accent); color: var(--color-bg) !important; font-size: 12px; font-weight: 800; text-decoration: none; }
.pe-map a:hover { background: var(--color-accent-700); }

/* búsqueda */
.search { max-width: 760px; position: relative; }
.search-row { display: flex; gap: 8px; }
.search input { min-height: 48px; font-size: 16px; flex: 1; min-width: 0; }
.search-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--color-divider); border-top: 0; background: var(--color-surface); }
.search-list a { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 12px; min-height: 44px; text-decoration: none; color: var(--color-text); }
.search-list a:hover, .search-list a[aria-selected="true"] { background: var(--color-accent-100); }
.search-list small { display: block; font-size: 12px; color: var(--color-neutral-700); }

/* atención y asesoría */
.care { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 1px solid var(--color-divider); }
.care li { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--color-divider); }
.care span { font-size: 14px; display: block; }
.doc-card { background: var(--color-surface); border-top: 2px solid var(--color-text); padding: 16px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.doc-card img { width: 72px; height: 72px; object-fit: cover; }
.doc-card .txt { flex: 1 1 240px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* franja CTA y botón flotante */
.cta-band { background: var(--color-accent); color: var(--color-bg); }
.cta-band .wrap { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.cta-band h2 { color: var(--color-bg); font-size: clamp(24px, 3vw, 32px); margin: 0 0 6px; }
.cta-band p { margin: 0; max-width: 620px; }
.cta-band .btn { background: var(--color-bg); color: var(--color-text); }
.cta-band .btn:hover { background: var(--color-neutral-200); }
.wa-float { position: fixed; right: 16px; bottom: 16px; z-index: 20; display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 0 14px; background: var(--color-accent); color: var(--color-bg) !important; font-weight: 700; font-size: 14px; text-decoration: none; box-shadow: var(--shadow-lg); }
.wa-float:hover { background: var(--color-accent-600); }
@media (max-width: 480px) { .wa-float span { display: none; } .wa-float { padding: 0 13px; } }

/* footer */
.site-footer { border-top: 2px solid var(--color-divider); }
.site-footer .wrap { padding-top: 28px; padding-bottom: 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; font-size: 14px; }
.site-footer h2 { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 400; margin: 0 0 8px; font-family: var(--font-body); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

/* calculadora */
.calc { display: grid; gap: 16px; max-width: 520px; }
.calc input[type=range] { width: 100%; accent-color: var(--color-accent); }
.calc-out { border-top: 2px solid var(--color-accent); background: var(--color-surface); padding: 16px 20px; }
.calc-out[hidden] { display: none; }

/* autora */
.author-head { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; border-top: 2px solid var(--color-divider); padding-top: 20px; }
.author-head img { width: 200px; height: 200px; object-fit: cover; }

/* legales: menú lateral después del contenido en móvil */
.legal-nav { order: 2; flex: 0 1 220px; border-top: 2px solid var(--color-text); padding-top: 10px; }
.legal-nav ul { list-style: none; margin: 0; padding: 0; }
.legal-nav a { display: block; padding: 8px 0; border-bottom: 1px solid var(--color-divider); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print { .site-header .menu, .cta-band, .wa-float, .site-footer { display: none; } }
.site-footer .foot-copy { display: block; padding-top: 0; padding-bottom: 88px; margin: 0; }
