/**
 * CPD-DMQ Design System — Producto 2 (WordPress + Elementor)
 * Tokens derivados del logo institucional y del plugin CPD Accesibilidad.
 * Orientado a WCAG 2.2 AA y maquetación tipo Elementor Theme Builder.
 */

@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Sans:wght@500;600;700&display=swap");

:root {
  /* Marca CPD-DMQ (logo) */
  --cpd-navy: #103070;
  --cpd-blue: #1050a0;
  --cpd-blue-deep: #1a3a5c;
  --cpd-sky: #60b0e0;
  --cpd-sky-soft: #e8f4fb;
  --cpd-red: #d42030;
  --cpd-yellow: #f0d010;
  --cpd-focus: #c79b00;
  --cpd-teal: #0d6e6e;

  /* Neutros */
  --cpd-ink: #1a1f2e;
  --cpd-text: #243041;
  --cpd-muted: #4a5568;
  --cpd-border: #c5d0dc;
  --cpd-surface: #ffffff;
  --cpd-bg: #f4f7fb;
  --cpd-success: #1b7a4a;
  --cpd-warning: #9a6700;

  /* Tipografía */
  --font-sans: "Source Sans 3", "Segoe UI", sans-serif;
  --font-display: "IBM Plex Sans", "Source Sans 3", sans-serif;
  --text-base: 1.0625rem;
  --leading: 1.6;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(16, 48, 112, 0.1);
  --header-h: 4.5rem;
  --max: 72rem;
  --space: clamp(1rem, 2.5vw, 2rem);

  /* Escalado a11y */
  --font-scale: 1;
  --link-underline: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: calc(100% * var(--font-scale));
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--cpd-text);
  background: var(--cpd-bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--cpd-blue);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  text-decoration: var(--link-underline, underline);
}

a:hover {
  color: var(--cpd-navy);
}

/* Enlaces sobre fondos oscuros: el hover navy global sería ilegible */
.site-topbar a:hover,
.global-products a:hover,
.prototype-bar a:hover,
.prototype-nav a:hover,
.doc-banner a:hover,
.site-footer a:not(.btn):hover,
.footer-bottom a:hover,
.e-section--navy a:not(.btn):hover {
  color: var(--cpd-yellow);
}

:focus-visible {
  outline: 3px solid var(--cpd-focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -100px;
  z-index: 100000;
  background: var(--cpd-navy);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(100% - 2 * var(--space), var(--max));
  margin-inline: auto;
}

/* —— Prototipo: barra de revisión —— */
.prototype-bar {
  background: #0b1f3d;
  color: #fff;
  font-size: 0.875rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.prototype-bar .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.55rem;
}

.prototype-bar a {
  color: #fff;
  text-decoration: underline;
}

.prototype-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.prototype-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
  font-size: 0.8rem;
}

.prototype-nav a[aria-current="page"] {
  background: var(--cpd-yellow);
  color: #1a1f2e;
  font-weight: 700;
}

/* —— Elementor-like chrome —— */
.site-topbar {
  background: var(--cpd-navy);
  color: #fff;
  font-size: 0.875rem;
}

.site-topbar .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.5rem;
  justify-content: space-between;
  padding-block: 0.45rem;
}

.site-topbar .container > span {
  min-width: min(100%, 16rem);
  white-space: normal;
}

.site-topbar a,
.elementor-location-header .elementor-widget-text-editor a[href^="mailto:"],
.elementor .elementor-widget-text-editor a[href^="mailto:"] {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  white-space: normal;
}

.site-topbar a:hover,
.elementor-location-header .elementor-widget-text-editor a[href^="mailto:"]:hover,
.elementor .elementor-widget-text-editor a[href^="mailto:"]:hover {
  color: var(--cpd-yellow);
}

.global-products {
  background: #0c2758;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.global-products .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-block: 0.4rem;
}

.global-products a {
  color: #d7e7f8;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

.global-products a[aria-current="true"],
.global-products a.is-active {
  background: var(--cpd-sky);
  color: var(--cpd-navy);
}

/* Header mockup CPD: logo arriba · menú + buscar debajo (no sticky) */
.site-header {
  background: var(--cpd-surface);
  border-bottom: 1px solid var(--cpd-border);
  position: static;
  top: auto;
  z-index: auto;
}

.site-header .container,
.site-header .elementor-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.2rem;
  min-height: 0;
  padding-block: 0.65rem 0.55rem;
  position: relative;
}

/* Logo: fila completa */
.site-header .brand,
.site-header .elementor-widget-theme-site-logo {
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--cpd-navy);
  max-width: 280px;
}

.brand img {
  width: 100%;
  max-width: 260px;
  height: auto;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--cpd-blue);
  background: #fff;
  color: var(--cpd-navy);
  border-radius: 4px;
  padding: 0.4rem 0.65rem;
  font-weight: 700;
  font-size: 0.875rem;
}

.site-header .nav-toggle {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

/* Menú: segunda fila, alineado a la izquierda (bajo el logo) */
.site-header .primary-nav,
.site-header .elementor-nav-menu--main {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  display: flex;
  justify-content: flex-start;
}

.primary-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.primary-nav a {
  display: block;
  padding: 0.45rem 0.5rem;
  color: #3a3a3a;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8125rem;
  line-height: 1.2;
  border-radius: 0;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.primary-nav a:hover {
  background: transparent;
  color: var(--cpd-navy);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

.primary-nav a[aria-current="page"],
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a,
.primary-nav .current-menu-ancestor > a {
  background: transparent;
  color: var(--cpd-navy);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Buscar: segunda fila, derecha */
.site-header .header-search,
.site-header .elementor-search-form {
  grid-column: 2;
  grid-row: 2;
  min-width: 2.75rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}

.ast-search-icon,
.elementor-search-form__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cpd-navy);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ast-search-icon:hover,
.elementor-search-form__toggle:hover {
  background: var(--cpd-sky-soft);
  color: var(--cpd-navy);
}

.ast-search-icon svg,
.elementor-search-form__toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-search-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: min(22rem, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--cpd-border);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(16, 48, 112, 0.12);
  padding: 0.75rem;
  z-index: 950;
}

.header-search-panel[hidden] {
  display: none !important;
}

.search-form {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--cpd-border);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  width: 100%;
}

.search-form input {
  border: 0;
  padding: 0.55rem 0.75rem;
  min-width: 0;
  flex: 1;
  font: inherit;
  font-size: 0.9375rem;
}

.search-form input:focus {
  outline: none;
}

.search-form button[type="submit"] {
  border: 0;
  background: var(--cpd-navy);
  color: #fff;
  padding: 0.55rem 0.85rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}

.search-form button[type="submit"]:hover {
  background: var(--cpd-blue);
  color: #fff;
}

/* —— Breadcrumbs —— */
.breadcrumbs {
  background: #fff;
  border-bottom: 1px solid var(--cpd-border);
  font-size: 0.9rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0.7rem 0;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: var(--cpd-muted);
}

.breadcrumbs a {
  text-decoration: none;
}

/* —— Sections / Elementor containers —— */
.e-section {
  padding: clamp(2rem, 5vw, 3.5rem) 0;
}

.e-section-- Tight {
  padding-block: 1.25rem;
}

.e-section--alt {
  background: #fff;
}

.e-section--navy {
  background: linear-gradient(135deg, #0c2758 0%, #1050a0 55%, #1f6fba 100%);
  color: #fff;
}

.e-section--navy a {
  color: #fff;
}

.e-section--navy .btn-ghost:hover,
.e-section--navy a.btn-ghost:hover {
  color: #fff;
  border-color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.e-section--navy .btn-outline:hover,
.e-section--navy a.btn-outline:hover {
  background: #fff;
  color: var(--cpd-navy);
  border-color: #fff;
}

.section-kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cpd-blue);
  margin-bottom: 0.4rem;
}

.e-section--navy .section-kicker {
  color: var(--cpd-yellow);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.25;
  margin: 0 0 0.6rem;
  color: var(--cpd-navy);
}

.e-section--navy .section-title {
  color: #fff;
}

.section-lead {
  margin: 0 0 1.25rem;
  max-width: 42rem;
  color: var(--cpd-muted);
}

.e-section--navy .section-lead {
  color: #dceaf8;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 700px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border-radius: 8px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
}

.btn-primary {
  background: var(--cpd-red);
  color: #fff;
}

.btn-primary:hover {
  background: #b51827;
  color: #fff;
}

.btn-secondary {
  background: var(--cpd-blue);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--cpd-navy);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}

.btn-outline {
  background: #fff;
  border-color: var(--cpd-blue);
  color: var(--cpd-blue);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

/* —— Cards (solo donde hay interacción/contenido listado) —— */
.task-list,
.card-list {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 700px) {
  .task-list {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-list.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-list.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.task-link,
.content-card {
  background: #fff;
  border: 1px solid var(--cpd-border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: inherit;
  box-shadow: none;
  transition: border-color 0.15s, transform 0.15s;
}

.task-link:hover,
.content-card:hover {
  border-color: var(--cpd-sky);
  transform: translateY(-2px);
}

.task-link strong,
.content-card h3 {
  display: block;
  color: var(--cpd-navy);
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.meta {
  color: var(--cpd-muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--cpd-sky-soft);
  color: var(--cpd-blue);
}

.badge--ok {
  background: #e6f6ec;
  color: var(--cpd-success);
}

.badge--warn {
  background: #fff5d6;
  color: var(--cpd-warning);
}

.badge--hot {
  background: #fde8ea;
  color: var(--cpd-red);
}

/* —— Hero institucional —— */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 20%, rgba(240, 208, 16, 0.28), transparent 28%),
    linear-gradient(120deg, #0a1f4a 0%, #1050a0 48%, #2a7fc0 100%);
  color: #fff;
  padding: clamp(2.5rem, 7vw, 5rem) 0;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -35% 40%;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(96, 176, 224, 0.35), transparent 65%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .hero .container {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: end;
  }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.85rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
  max-width: 16ch;
}

.hero p {
  margin: 0 0 1.25rem;
  max-width: 38rem;
  color: #e4eef8;
  font-size: 1.125rem;
}

.hero-panel {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 1rem;
  backdrop-filter: blur(6px);
}

.hero-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-panel ol {
  margin: 0;
  padding-left: 1.1rem;
}

.hero-panel li + li {
  margin-top: 0.45rem;
}

.alert-banner {
  background: #fff8db;
  border-bottom: 2px solid var(--cpd-yellow);
  color: #5c4700;
}

.alert-banner .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.75rem;
}

/* —— Forms / filters —— */
.filters {
  display: grid;
  gap: 0.75rem;
  background: #fff;
  border: 1px solid var(--cpd-border);
  border-radius: var(--radius);
  padding: 1rem;
}

@media (min-width: 800px) {
  .filters {
    grid-template-columns: repeat(4, 1fr) auto;
    align-items: end;
  }
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--cpd-ink);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--cpd-border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  background: #fff;
  color: var(--cpd-text);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--cpd-blue);
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--cpd-border);
  border-radius: var(--radius);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

table.data th,
table.data td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--cpd-border);
  text-align: left;
  vertical-align: top;
}

table.data th {
  background: var(--cpd-sky-soft);
  color: var(--cpd-navy);
  font-weight: 700;
}

table.data tr:hover td {
  background: #fafcfe;
}

/* —— Metadata panels —— */
.meta-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 700px) {
  .meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.meta-item {
  background: #fff;
  border: 1px solid var(--cpd-border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}

.meta-item dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--cpd-muted);
  margin: 0 0 0.2rem;
}

.meta-item dd {
  margin: 0;
  font-weight: 600;
  color: var(--cpd-ink);
}

.split {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1.6fr 1fr;
  }
  .split--aside-left {
    grid-template-columns: 280px 1fr;
  }
}

.aside-panel {
  background: #fff;
  border: 1px solid var(--cpd-border);
  border-radius: var(--radius);
  padding: 1rem;
}

.aside-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--cpd-navy);
}

.chart-placeholder {
  background: linear-gradient(180deg, #eef6fc, #fff);
  border: 1px dashed var(--cpd-sky);
  border-radius: 12px;
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--cpd-muted);
  text-align: center;
  padding: 1rem;
}

.stat-row {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 700px) {
  .stat-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat {
  background: #fff;
  border-top: 4px solid var(--cpd-blue);
  border-radius: var(--radius);
  padding: 1rem;
}

.stat strong {
  display: block;
  font-size: 1.6rem;
  color: var(--cpd-navy);
  font-family: var(--font-display);
}

/* —— Article —— */
.article-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  color: var(--cpd-navy);
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.article-body {
  background: #fff;
  border: 1px solid var(--cpd-border);
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 2rem);
}

.article-body > * + * {
  margin-top: 1rem;
}

.article-body h2 {
  color: var(--cpd-navy);
  font-family: var(--font-display);
  margin-top: 1.75rem;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  color: var(--cpd-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-list a {
  text-decoration: none;
  background: var(--cpd-sky-soft);
  color: var(--cpd-blue);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* —— Login / Intranet —— */
.auth-shell {
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: 2rem var(--space);
  background:
    radial-gradient(circle at 20% 20%, rgba(96, 176, 224, 0.25), transparent 40%),
    linear-gradient(160deg, #f4f7fb, #dfeaf5);
}

.auth-card {
  width: min(100%, 420px);
  background: #fff;
  border: 1px solid var(--cpd-border);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  color: var(--cpd-navy);
  font-family: var(--font-display);
}

.auth-note {
  background: #eef6fc;
  border-left: 4px solid var(--cpd-blue);
  padding: 0.75rem;
  margin: 1rem 0;
  font-size: 0.92rem;
}

.intranet-dash .widget {
  background: #fff;
  border: 1px solid var(--cpd-border);
  border-radius: var(--radius);
  padding: 1rem;
}

.intranet-dash .widget h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--cpd-navy);
}

/* —— Footer —— */
.site-footer {
  background: var(--cpd-navy);
  color: #e8eef8;
  margin-top: 2rem;
}

.site-footer a {
  color: #fff;
}

.site-footer .container {
  display: grid;
  gap: 1.5rem;
  padding-block: 2rem;
}

@media (min-width: 800px) {
  .site-footer .container {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--cpd-yellow);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li + li {
  margin-top: 0.4rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.875rem;
  padding-block: 0.85rem;
}

/* —— Barra flotante de accesibilidad —— */
.a11y-fab,
.chat-fab {
  position: fixed;
  z-index: 99990;
  right: 1rem;
  border: 0;
  border-radius: 999px;
  width: 3.1rem;
  height: 3.1rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.a11y-fab .fab-icon,
.chat-fab .fab-icon {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
}

.a11y-fab {
  bottom: 5.2rem;
  background: var(--cpd-blue-deep);
  color: #fff;
}

.chat-fab {
  bottom: 1.4rem;
  background: var(--cpd-teal);
  color: #fff;
}

.a11y-panel {
  position: fixed;
  right: 1rem;
  bottom: 9rem;
  width: min(20rem, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--cpd-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1rem;
  z-index: 99991;
  display: none;
}

.a11y-panel.is-open {
  display: block;
}

.a11y-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--cpd-navy);
}

.a11y-actions {
  display: grid;
  gap: 0.5rem;
}

.a11y-actions button {
  border: 1px solid var(--cpd-border);
  background: #f5f8fb;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.a11y-actions button[aria-pressed="true"] {
  background: var(--cpd-blue);
  border-color: var(--cpd-blue);
  color: #fff;
}

/* Modos a11y */
html.a11y-contrast body {
  background: #000;
  color: #fff;
}

html.a11y-contrast .site-header,
html.a11y-contrast .content-card,
html.a11y-contrast .task-link,
html.a11y-contrast .article-body,
html.a11y-contrast .aside-panel,
html.a11y-contrast .filters,
html.a11y-contrast .meta-item,
html.a11y-contrast .table-wrap,
html.a11y-contrast .auth-card,
html.a11y-contrast .intranet-dash .widget {
  background: #000;
  color: #fff;
  border-color: #fff;
}

html.a11y-contrast a {
  color: #ffff00;
}

html.a11y-links {
  --link-underline: underline;
}

html.a11y-links a {
  text-decoration: underline !important;
  text-decoration-thickness: 0.12em !important;
}

html.a11y-dyslexia body {
  letter-spacing: 0.04em;
  word-spacing: 0.12em;
  line-height: 1.8;
}

/* Elementor annotation chips (solo en prototipo) */
.e-note {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--cpd-muted);
  border-left: 3px solid var(--cpd-sky);
  padding-left: 0.5rem;
}

/* SEO inspector panel (prototipo) */
.seo-chip {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.seo-chip span {
  font-size: 0.72rem;
  background: #eef2f7;
  color: #334155;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-family: ui-monospace, monospace;
}

@media (max-width: 1100px) {
  .primary-nav a {
    font-size: 0.75rem;
    padding: 0.4rem 0.35rem;
  }
}

@media (max-width: 960px) {
  .site-header .container,
  .site-header .elementor-container {
    grid-template-columns: 1fr auto auto;
    grid-template-rows: auto auto;
  }

  .site-header .brand {
    grid-column: 1;
    grid-row: 1;
    max-width: none;
  }

  .nav-toggle {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .site-header .header-search {
    grid-column: 3;
    grid-row: 1;
  }

  .site-header .primary-nav {
    display: none;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    justify-content: flex-start;
  }

  .primary-nav.is-open {
    display: block;
  }

  .primary-nav ul {
    flex-direction: column;
    flex-wrap: wrap;
    align-items: stretch;
    padding-bottom: 0.75rem;
  }

  .primary-nav a {
    font-size: 0.9375rem;
    padding: 0.65rem 0.5rem;
    white-space: normal;
  }
}


/* —— Accesibilidad §7.6 (monocromo, guía, voz) —— */
html.a11y-mono {
  filter: grayscale(1);
}
.a11y-reading-guide {
  position: fixed;
  left: 0;
  width: 100%;
  height: 2.75rem;
  pointer-events: none;
  z-index: 99980;
  background: rgba(255, 214, 70, 0.28);
  border-top: 2px solid #c79b00;
  border-bottom: 2px solid #c79b00;
}
.a11y-reading-guide[hidden] {
  display: none !important;
}

/* —— Footer redes —— */
.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}
.footer-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.footer-social__link:hover,
.footer-social__link:focus-visible {
  background: rgba(255, 255, 255, 0.22);
}

/* —— Compartir (noticias / PDF) —— */
.share-bar {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cpd-border, #c5d0dc);
}
.share-bar__label {
  margin: 0 0 0.55rem;
  font-weight: 700;
  color: var(--cpd-navy, #103070);
  font-size: 0.95rem;
}
.share-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--cpd-border, #c5d0dc);
  background: #f5f8fb;
  color: var(--cpd-navy, #103070) !important;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  line-height: 0;
}
.share-btn svg {
  display: block;
  flex-shrink: 0;
}
.share-btn:hover,
.share-btn:focus-visible {
  background: #e8eef6;
  color: var(--cpd-navy, #103070) !important;
}
.share-btn.is-copied {
  background: var(--cpd-navy, #103070);
  color: #fff !important;
  border-color: var(--cpd-navy, #103070);
}
