/* ============================================================
   Páginas de contenido (sectores y blog). Se carga DESPUÉS de styles.css:
   reutiliza sus variables de tema (--ink, --fg, --accent…), .glass y .vr-pill.
   No depende de Tailwind, para que tw.css siga purgado solo contra index.html.
   ============================================================ */

:root {
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --page-max: 76rem;
  --text-max: 44rem;
  --gutter: clamp(1rem, 4vw, 1.5rem);
  --radius-lg: 28px;
  --radius-md: 18px;
  --line: rgb(var(--fg) / 0.09);
}

.c-body {
  margin: 0;
  font-family: var(--font-sans);
  color: rgb(var(--body));
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.c-body *, .c-body *::before, .c-body *::after { box-sizing: border-box; }
:where(.c-body a) { color: inherit; } /* :where = especificidad 0, así los botones mandan */
.c-body img { max-width: 100%; height: auto; display: block; }
.c-wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }

.c-skip { position: absolute; left: -9999px; }
.c-skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--cyan); color: #0B0F17; padding: 8px 14px; border-radius: 8px; }

/* ---------- Cabecera ---------- */
.c-header { position: sticky; top: 0; z-index: 40; padding: 12px 12px 0; }
.c-nav {
  max-width: var(--page-max); margin: 0 auto; height: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 8px 0 18px; border-radius: 999px;
}
.c-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; }
.c-brand b { font-family: var(--font-display); font-weight: 700; color: rgb(var(--fg)); letter-spacing: -0.01em; }
.c-brand b span { color: rgb(var(--accent)); }
.c-links { display: none; gap: 4px; font-size: 13px; }
.c-links a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: rgb(var(--body)); transition: color 200ms ease, background-color 200ms ease; }
.c-links a:hover, .c-links a[aria-current="page"] { color: rgb(var(--fg)); background: rgb(var(--fg) / 0.06); }
.c-actions { display: flex; align-items: center; gap: 6px; }
.c-icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid rgb(var(--fg) / 0.1); background: transparent; color: rgb(var(--sub)); cursor: pointer;
}
.c-icon-btn:hover { color: rgb(var(--fg)); }
.c-icon-btn svg { width: 16px; height: 16px; }
@media (min-width: 1024px) { .c-links { display: flex; } }

/* Menú de sectores en móvil: fila desplazable bajo la cápsula */
.c-subnav { max-width: var(--page-max); margin: 8px auto 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0 4px; }
.c-subnav::-webkit-scrollbar { display: none; }
.c-subnav a { flex-shrink: 0; font-size: 12px; padding: 6px 12px; border-radius: 999px; text-decoration: none; color: rgb(var(--sub)); border: 1px solid var(--line); background: rgb(var(--ink) / 0.7); }
.c-subnav a[aria-current="page"] { color: rgb(var(--fg)); border-color: rgb(var(--accent) / 0.5); }
@media (min-width: 1024px) { .c-subnav { display: none; } }

/* ---------- Botones ---------- */
.c-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 15px; text-decoration: none;
  transition: background-color 200ms ease, transform 300ms var(--ease-out), border-color 200ms ease;
}
.c-btn:hover { transform: translateY(-1px); }
.c-btn--primary { background: var(--cyan); color: #0B0F17; }
.c-btn--primary:hover { background: #67E8F9; }
.c-btn--ghost { border: 1px solid rgb(var(--fg) / 0.16); color: rgb(var(--fg)); }
.c-btn--ghost:hover { border-color: var(--cyan); }
.c-btn--sm { padding: 8px 16px; font-size: 13px; }
.c-btn svg { width: 18px; height: 18px; }
.c-nav .c-btn--sm { display: none; }
@media (min-width: 768px) { .c-nav .c-btn--sm { display: inline-flex; } }

/* ---------- Migas ---------- */
.c-crumbs { font-size: 13px; color: rgb(var(--muted)); margin: 32px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.c-crumbs li + li::before { content: '/'; margin-right: 6px; opacity: 0.5; }
.c-crumbs a { text-decoration: none; }
.c-crumbs a:hover { color: rgb(var(--accent)); }

/* ---------- Héroe de sector / artículo ---------- */
.c-hero { position: relative; padding: 24px 0 56px; }
.c-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: rgb(var(--accent)); margin: 0; }
.c-h1 {
  font-family: var(--font-display); font-weight: 700; color: rgb(var(--fg));
  font-size: clamp(2.1rem, 1.3rem + 3.6vw, 4.2rem); line-height: 1.04; letter-spacing: -0.03em;
  margin: 16px 0 0; max-width: 18ch;
}
.c-hero--article .c-h1 { max-width: 24ch; font-size: clamp(1.9rem, 1.2rem + 2.8vw, 3.4rem); }
.c-lead { font-size: clamp(1.05rem, 1rem + 0.3vw, 1.25rem); color: rgb(var(--body)); max-width: var(--text-max); margin: 20px 0 0; }
.c-hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.c-hero__grid { display: grid; gap: 32px; align-items: end; }
.c-hero__media { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 5; }
.c-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.c-hero__media .vr-pill { position: absolute; left: 14px; top: 14px; }
@media (min-width: 900px) {
  .c-hero__grid { grid-template-columns: 1.35fr 1fr; }
  .c-hero__media { max-height: 560px; }
}

/* Respuesta directa: el bloque que un buscador o un LLM puede citar solo */
.c-answer {
  margin: 28px 0 0; max-width: var(--text-max); padding: 18px 20px; border-radius: var(--radius-md);
  border-left: 3px solid var(--cyan); background: rgb(var(--accent) / 0.07); color: rgb(var(--fg));
}
.c-answer p { margin: 0; }

.c-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: rgb(var(--muted)); margin-top: 20px; }
.c-meta strong { color: rgb(var(--body)); font-weight: 600; }

/* ---------- Secciones ---------- */
.c-section { padding: 56px 0; border-top: 1px solid var(--line); }
.c-h2 {
  font-family: var(--font-display); font-weight: 700; color: rgb(var(--fg));
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.6rem); line-height: 1.1; letter-spacing: -0.02em; margin: 0; max-width: 22ch;
}
.c-sub { max-width: var(--text-max); color: rgb(var(--sub)); margin: 14px 0 0; }

/* Retos del sector: lista numerada con peso editorial */
.c-points { counter-reset: punto; list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 14px; }
.c-points li { counter-increment: punto; position: relative; padding: 20px 20px 20px 64px; border-radius: var(--radius-md); }
.c-points li::before {
  content: counter(punto, decimal-leading-zero); position: absolute; left: 20px; top: 20px;
  font-family: var(--font-display); font-weight: 700; color: rgb(var(--accent)); font-size: 14px;
}
.c-points b { display: block; color: rgb(var(--fg)); font-family: var(--font-display); font-size: 1.1rem; }
.c-points span { display: block; margin-top: 4px; color: rgb(var(--sub)); }
@media (min-width: 900px) { .c-points { grid-template-columns: repeat(2, 1fr); } }

/* Módulos del sector */
.c-modules { display: grid; gap: 14px; margin-top: 32px; }
.c-module { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; padding: 22px; border-radius: var(--radius-md); }
.c-module h3 { margin: 0; font-family: var(--font-display); font-size: 1.15rem; color: rgb(var(--fg)); }
.c-module p { margin: 6px 0 0; color: rgb(var(--sub)); font-size: 15px; }
.c-module a { font-size: 14px; color: rgb(var(--accent)); text-decoration: none; font-weight: 600; }
.c-module a:hover { text-decoration: underline; }
.c-tag { align-self: flex-start; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.c-tag--demo { color: rgb(var(--safetyfg)); border: 1px solid rgb(var(--safetyfg) / 0.4); }
.c-tag--config { color: rgb(var(--sub)); border: 1px solid var(--line); }
@media (min-width: 700px) { .c-modules { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .c-modules { grid-template-columns: repeat(3, 1fr); } }

/* Norma: tarjeta con fuente enlazada */
.c-norms { display: grid; gap: 14px; margin-top: 32px; }
.c-norm { padding: 22px; border-radius: var(--radius-md); }
.c-norm h3 { margin: 0; font-family: var(--font-display); font-size: 1.05rem; color: rgb(var(--fg)); }
.c-norm p { margin: 8px 0 0; color: rgb(var(--sub)); font-size: 15px; }
.c-norm a { display: inline-block; margin-top: 12px; font-size: 13px; color: rgb(var(--accent)); text-decoration: none; }
.c-norm a:hover { text-decoration: underline; }
@media (min-width: 900px) { .c-norms { grid-template-columns: repeat(2, 1fr); } }

.c-note { margin-top: 20px; font-size: 14px; color: rgb(var(--muted)); max-width: var(--text-max); }

/* Caso */
.c-case { display: grid; gap: 24px; padding: 28px; border-radius: var(--radius-lg); margin-top: 32px; }
.c-case dl { display: grid; gap: 10px; margin: 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.c-case dt { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: rgb(var(--muted)); }
.c-case dd { margin: 6px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: rgb(var(--fg)); }
.c-case p { margin: 0; }
.c-case a { color: rgb(var(--accent)); }

/* Artículos del clúster */
.c-posts { display: grid; gap: 14px; margin-top: 32px; list-style: none; padding: 0; }
.c-post a { display: block; height: 100%; padding: 22px; border-radius: var(--radius-md); text-decoration: none; transition: transform 300ms var(--ease-out), border-color 200ms ease; }
.c-post a:hover { transform: translateY(-2px); border-color: rgb(var(--accent) / 0.5); }
.c-post small { color: rgb(var(--accent)); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.c-post b { display: block; margin-top: 8px; font-family: var(--font-display); font-size: 1.15rem; color: rgb(var(--fg)); line-height: 1.25; }
.c-post span { display: block; margin-top: 8px; color: rgb(var(--sub)); font-size: 15px; }
.c-empty { margin-top: 24px; color: rgb(var(--sub)); max-width: var(--text-max); }
@media (min-width: 900px) { .c-posts { grid-template-columns: repeat(3, 1fr); } }

/* Sectores (enlaces cruzados entre nichos) */
.c-sectors { display: grid; gap: 10px; margin-top: 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.c-sectors a { padding: 16px 18px; border-radius: var(--radius-md); text-decoration: none; color: rgb(var(--fg)); font-family: var(--font-display); font-weight: 600; border: 1px solid var(--line); }
.c-sectors a:hover { border-color: var(--cyan); }
.c-sectors small { display: block; font-family: var(--font-sans); font-weight: 400; font-size: 13px; color: rgb(var(--sub)); margin-top: 4px; }

/* CTA final */
.c-cta { margin: 56px 0; padding: clamp(28px, 5vw, 56px); border-radius: var(--radius-lg); position: relative; overflow: hidden; }
.c-cta .hazard { position: absolute; top: 0; left: 0; right: 0; height: 6px; opacity: 0.8; }
.c-cta .c-h2 { max-width: 20ch; }
.c-cta p { max-width: var(--text-max); margin: 14px 0 0; }

/* Preguntas frecuentes: reutiliza .faq-list / .faq-item de styles.css */
.c-faq { max-width: var(--text-max); margin-top: 28px; }

/* ---------- Cuerpo de artículo (Markdown) ---------- */
.c-prose { max-width: var(--text-max); font-size: 1.06rem; }
.c-prose h2 { font-family: var(--font-display); color: rgb(var(--fg)); font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.9rem); line-height: 1.2; letter-spacing: -0.015em; margin: 48px 0 0; }
.c-prose h3 { font-family: var(--font-display); color: rgb(var(--fg)); font-size: 1.2rem; margin: 32px 0 0; }
.c-prose p, .c-prose ul, .c-prose ol, .c-prose table, .c-prose blockquote { margin: 16px 0 0; }
.c-prose li + li { margin-top: 6px; }
.c-prose strong { color: rgb(var(--fg)); }
.c-prose a { color: rgb(var(--accent)); text-underline-offset: 3px; }
.c-prose blockquote { border-left: 3px solid rgb(var(--safetyfg)); padding: 4px 0 4px 16px; color: rgb(var(--sub)); }
.c-prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.c-prose th, .c-prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.c-prose th { color: rgb(var(--fg)); font-weight: 600; }
.c-prose img { border-radius: var(--radius-md); border: 1px solid var(--line); }

.c-article-grid { display: grid; gap: 40px; }
.c-aside { display: grid; gap: 14px; align-content: start; }
.c-aside .glass { padding: 20px; border-radius: var(--radius-md); }
.c-aside h2 { font-family: var(--font-display); font-size: 1rem; color: rgb(var(--fg)); margin: 0; }
.c-aside p { margin: 8px 0 0; font-size: 14px; color: rgb(var(--sub)); }
.c-aside .c-btn { margin-top: 14px; width: 100%; }
@media (min-width: 1024px) {
  .c-article-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .c-aside { position: sticky; top: 96px; }
}

/* Autor y revisor (E-E-A-T) */
.c-people { display: grid; gap: 14px; margin-top: 40px; max-width: var(--text-max); }
.c-person { padding: 18px 20px; border-radius: var(--radius-md); }
.c-person small { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: rgb(var(--muted)); }
.c-person b { display: block; margin-top: 4px; color: rgb(var(--fg)); font-family: var(--font-display); }
.c-person span { display: block; margin-top: 4px; font-size: 14px; color: rgb(var(--sub)); }
@media (min-width: 700px) { .c-people { grid-template-columns: 1fr 1fr; } }

.c-sources { max-width: var(--text-max); margin-top: 32px; font-size: 14px; color: rgb(var(--sub)); }
.c-sources h2 { font-family: var(--font-display); font-size: 1rem; color: rgb(var(--fg)); margin: 0; }
.c-sources ol { margin: 10px 0 0; padding-left: 20px; }
.c-sources a { color: rgb(var(--accent)); word-break: break-word; }

/* ---------- Pie ---------- */
.c-footer { border-top: 1px solid var(--line); padding: 40px 0 32px; margin-top: 24px; font-size: 14px; color: rgb(var(--sub)); }
.c-footer__grid { display: grid; gap: 28px; }
.c-footer h2 { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(var(--muted)); margin: 0 0 10px; font-weight: 600; }
.c-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.c-footer a { text-decoration: none; }
.c-footer a:hover { color: rgb(var(--accent)); }
.c-footer__legal { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; color: rgb(var(--muted)); }
@media (min-width: 900px) { .c-footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .c-btn, .c-post a { transition: none; }
  .c-btn:hover, .c-post a:hover { transform: none; }
}

/* ---------- Artículo con foto principal y galería (2026-10-21) ---------- */
.c-hero--foto { display: grid; gap: 24px; }
.c-hero--foto .c-answer { margin-top: 0; }
.c-fig { margin: 36px 0 0; }
.c-fig img {
  display: block; width: 100%; height: auto; border-radius: var(--radius-lg);
  border: 1px solid var(--line); background: rgb(var(--fg) / 0.04);
}
.c-fig figcaption { margin-top: 10px; font-size: 0.88rem; color: rgb(var(--sub)); line-height: 1.45; }
.c-fig--hero { margin: 0; position: relative; }
.c-fig--hero img {
  aspect-ratio: 3 / 2; object-fit: cover;
  box-shadow: 0 30px 80px -30px rgb(34 211 238 / 0.45), 0 0 0 1px rgb(34 211 238 / 0.25);
}
.c-gallery { display: grid; gap: 16px; margin-top: 36px; }
.c-gallery .c-fig { margin: 0; }
@media (min-width: 700px) { .c-gallery { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) {
  .c-hero--foto { grid-template-columns: 5fr 6fr; align-items: center; column-gap: 48px; }
  .c-hero--foto .c-hero__texto { grid-column: 1; grid-row: 1; }
  .c-hero--foto .c-fig--hero { grid-column: 2; grid-row: 1 / span 2; }
  .c-hero--foto .c-answer { grid-column: 1; grid-row: 2; align-self: start; }
}
.c-post__img { display: block; width: calc(100% + 2px); height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 14px; margin-bottom: 14px; }
/* Un hijo de grid no se encoge por debajo de su contenido más ancho (tablas, URLs largas): se fuerza */
.c-article-grid > * { min-width: 0; }
.c-prose { overflow-wrap: anywhere; }

/* ---------- Páginas legales y Libro de Reclamaciones (2026-10-21) ---------- */
.c-hero--legal { padding-bottom: 24px; }
.c-legal { padding-bottom: 72px; }
.c-legal table { font-size: 0.95rem; }
.c-footer__links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.9rem; }
.c-footer__links a { color: rgb(var(--sub)); text-decoration: none; }
.c-footer__links a:hover { color: rgb(var(--accent)); }
.c-libro-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: rgb(var(--fg)) !important; }
.c-libro { display: grid; gap: 20px; max-width: 860px; padding-bottom: 72px; }
.c-libro__prov { padding: 18px 22px; border-radius: var(--radius-lg); }
.c-libro__prov p { margin: 0; } .c-libro__prov p + p { margin-top: 4px; }
.c-libro__nota { font-size: 0.86rem; color: rgb(var(--sub)); margin-top: 10px !important; }
.c-libro__def { max-width: none; }
.c-libro__form, .c-libro__listo { padding: 24px; border-radius: var(--radius-lg); display: grid; gap: 18px; }
.c-libro__form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; }
.c-libro__form legend { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: rgb(var(--fg)); margin-bottom: 12px; padding: 0; }
@media (min-width: 700px) { .c-libro__form fieldset { grid-template-columns: 1fr 1fr; } .c-campo--ancho { grid-column: 1 / -1; } }
.c-campo { display: grid; gap: 6px; font-size: 0.9rem; color: rgb(var(--sub)); }
.c-campo input, .c-campo select, .c-campo textarea {
  font: 400 1rem Inter, system-ui, sans-serif; color: rgb(var(--fg)); background: rgb(var(--fg) / 0.04);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; width: 100%;
}
.c-campo textarea { resize: vertical; }
.c-campo input:focus, .c-campo select:focus, .c-campo textarea:focus { outline: 2px solid rgb(var(--accent)); outline-offset: 1px; }
[aria-invalid="true"] { border-color: #ef4444 !important; }
.c-campo__error { color: #ef4444; font-size: 0.82rem; }
.c-check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; color: rgb(var(--body)); }
.c-check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.c-opciones { display: flex; gap: 22px; font-size: 0.95rem; color: rgb(var(--body)); }
.c-opciones label { display: inline-flex; gap: 8px; align-items: center; }
.c-trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.c-libro__error { color: #ef4444; margin: 0; font-weight: 600; }
.c-libro__form .c-btn { justify-self: start; }
.c-libro__tabla { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.c-libro__tabla th, .c-libro__tabla td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.c-libro__tabla th { width: 32%; color: rgb(var(--sub)); font-weight: 600; }
.c-libro__tabla td { white-space: pre-wrap; overflow-wrap: anywhere; }
@media print {
  .c-header, .c-footer, .c-crumbs, .c-libro__prov, .c-libro__def, .c-subnav { display: none !important; }
  .c-libro__listo { box-shadow: none; border: 0; }
}
/* display:grid de arriba le gana al atributo hidden: se restablece */
.c-libro [hidden] { display: none !important; }
