/* =========================================================
   IGC - International Global Certification
   Estilos globales (compartidos por todas las páginas)
   ========================================================= */

/* La fuente Inter se declara en css/fuentes.css (generado por build.py con la
   fuente incrustada), que se carga antes que este archivo. */

:root {
  --color-primary: #00609c;   /* azul del logo */
  --color-primary-dark: #004a7a;
  --color-primary-darker: #00355f;
  --color-accent: #2f9fe0;
  --color-text: #1b2533;
  --color-muted: #5b6676;
  --color-border: #e3e8ef;
  --color-bg: #ffffff;
  --color-bg-soft: #f4f7fb;
  --color-star: #f5a623;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 33, 56, .06), 0 2px 6px rgba(16, 33, 56, .05);
  --shadow: 0 10px 30px rgba(16, 33, 56, .10);
  --shadow-lg: 0 20px 50px rgba(16, 33, 56, .16);

  --container: 1180px;
  --header-h: 72px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  /* el pie queda abajo aunque la página sea corta */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

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

a { color: var(--color-primary); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

.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;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .85em 1.6em;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, box-shadow .2s, filter .2s;
}
.btn:hover { box-shadow: var(--shadow); filter: brightness(.92); }

.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-light { background: #fff; color: var(--color-primary); }
.btn-light:hover { background: #eef5fb; }

.btn-sm { padding: .6em 1.2em; font-size: .9rem; }
.btn-lg { padding: 1em 2em; font-size: 1.15rem; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-color: var(--color-border); box-shadow: var(--shadow-sm); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 24px;
  max-width: none;   /* la cabecera ocupa todo el ancho de la ventana */
  padding-inline: clamp(16px, 3vw, 40px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: -.01em;
  white-space: nowrap;
  color: var(--color-text);
  text-decoration: none;
}
.brand img { width: 40px; height: 40px; flex-shrink: 0; }

.main-nav { display: flex; align-items: center; gap: 20px; }
.nav-list { display: flex; align-items: center; gap: 4px; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-size: .95rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  transition: color .2s, background-color .2s;
}
.nav-link:hover, .nav-link[aria-current="page"], .nav-link[aria-current="true"], .dropdown-toggle[data-current] { color: var(--color-primary); }
.nav-link:hover { background: var(--color-bg-soft); }

.chevron { width: 16px; height: 16px; transition: transform .2s; }
.dropdown-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

/* Desplegables */
.has-dropdown { position: relative; }

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  min-width: 360px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
/* Puente invisible para que el hover no se pierda entre botón y menú */
.dropdown::before { content: ""; position: absolute; inset: -12px 0 auto; height: 12px; }
.dropdown--wide { min-width: 600px; }

.has-dropdown.is-open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.dropdown a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  text-decoration: none;
  transition: background-color .15s;
}
.dropdown a:hover, .dropdown a[aria-current="page"] { background: var(--color-bg-soft); }
.dropdown a[aria-current="page"] strong { color: var(--color-primary); }
.dropdown a:hover strong { color: var(--color-primary); }
.dropdown strong { display: block; font-size: .95rem; font-weight: 600; transition: color .15s; }
.dropdown a span span,
.dropdown-grid span { display: block; font-size: .82rem; color: var(--color-muted); line-height: 1.35; }

.dropdown-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.dropdown-grid a { display: block; }

.dropdown-list img {
  width: 64px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Botón hamburguesa */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  background: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: #fff;
  background:
    linear-gradient(100deg, rgba(4, 22, 44, .92) 0%, rgba(4, 22, 44, .72) 50%, rgba(0, 53, 95, .45) 100%),
    url("../img/hero-ciudad.jpg") center / cover no-repeat;
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 40px;
  min-height: min(calc(100vh - var(--header-h)), 720px);
  padding-block: 80px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.9rem);
  font-weight: 800;
  margin-bottom: .45em;
}
.hero .accent { color: var(--color-accent); }
.hero .lead {
  max-width: 34em;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: rgba(255, 255, 255, .85);
  margin-bottom: 2em;
}
.hero-seal { display: flex; justify-content: center; }
.hero-seal img {
  width: min(100%, 380px);
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .35));
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ---------- Secciones genéricas ---------- */
.section { padding-block: clamp(64px, 9vw, 110px); }

.section-title {
  text-align: center;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 1.2em;
}
.section-sub { text-align: center; color: var(--color-muted); font-size: 1.1rem; }

/* ---------- Clientes ---------- */
.clients { background: var(--color-bg-soft); }
.clients-title {
  text-align: center;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 800;
  margin-bottom: .3em;
}
.counter { color: var(--color-primary); font-variant-numeric: tabular-nums; }

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px 56px;
  margin-top: 48px;
}
.logo-row img {
  height: 64px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: .65;
  transition: filter .3s, opacity .3s, transform .3s;
}
.logo-row img:hover { filter: none; opacity: 1; transform: scale(1.05); }

/* ---------- Por qué nos eligen ---------- */
.feature {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
}
.feature + .feature { margin-top: clamp(48px, 7vw, 96px); }
.feature--reverse .feature-media { order: 2; }

.feature-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 3 / 2;
}
.feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.feature:hover .feature-media img { transform: scale(1.04); }

.feature-body h3 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 700;
  color: var(--color-primary);
}
.feature-body p { color: var(--color-muted); font-size: 1.05rem; }
.feature-body .note { font-size: .85rem; border-left: 3px solid var(--color-border); padding-left: 12px; }

.stats { display: grid; gap: 14px; margin-top: 8px; }
.stats li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 18px;
  background: var(--color-bg-soft);
  border-radius: var(--radius);
}
.stats strong {
  min-width: 3.4em;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--color-primary);
}
.stats li > span { color: var(--color-muted); }

/* ---------- Banda "Trabaja con nosotros" ---------- */
.banner {
  color: #fff;
  text-align: center;
  background:
    linear-gradient(rgba(0, 53, 95, .82), rgba(0, 53, 95, .82)),
    url("../img/trabaja-con-nosotros.jpg") center / cover no-repeat;
  padding-block: clamp(72px, 10vw, 120px);
}
.banner-inner { max-width: 760px; }
.banner h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); font-weight: 800; }
.banner p { font-size: 1.15rem; color: rgba(255, 255, 255, .88); margin-bottom: 1.8em; }

/* ---------- Testimonios ---------- */
.testimonials { background: var(--color-bg-soft); }
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.card {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 32px 28px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s;
}
.card:hover { box-shadow: var(--shadow); }
.card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: .5em; }
.card blockquote {
  flex: 1;
  margin: 0 0 1.4em;
  color: var(--color-muted);
  font-style: italic;
}
.card figcaption { border-top: 1px solid var(--color-border); padding-top: 16px; }
.card figcaption strong { display: block; }
.card figcaption span { font-size: .9rem; color: var(--color-muted); }
.stars { color: var(--color-star); font-size: 1.15rem; letter-spacing: 3px; margin-bottom: 12px; }

/* ---------- Cursos ---------- */
.course-box {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  overflow: hidden;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-lg);
}
.course-media { height: 100%; }
.course-media img { width: 100%; height: 100%; object-fit: cover; min-height: 280px; }
.course-body { padding: clamp(32px, 5vw, 64px); }
.course-body h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; }
.course-body p { color: rgba(255, 255, 255, .85); font-size: 1.1rem; margin-bottom: 1.8em; }
.course-body .btn-primary { background: #fff; color: var(--color-primary); box-shadow: none; }
.course-body .btn-primary:hover { background: #eef5fb; }

/* ---------- Redes sociales ---------- */
.social-grid {
  display: grid;
  grid-template-columns: minmax(0, 500px) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.social-col h3 { font-size: 1.25rem; font-weight: 700; color: var(--color-primary); }
.fb-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}
.fb-wrap iframe { display: block; width: 100%; max-width: 500px; }

/* ---------- Pie de página ---------- */
.site-footer {
  background: #0b1a2c;
  color: rgba(255, 255, 255, .75);
  padding-top: 64px;
  font-size: .95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
}
.footer-brand img { width: 64px; height: 64px; margin-bottom: 14px; }
.footer-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.2em;
}
.footer-links { display: grid; gap: 10px; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  transition: color .2s;
  word-break: break-word;
}
.footer-links a:hover { color: #fff; }
.footer-links svg { width: 18px; height: 18px; flex-shrink: 0; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-block: 22px;
  font-size: .85rem;
}
.footer-bottom p { margin: 0; }

/* ---------- Banner de cookies ---------- */
.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 20px;
  width: calc(100% - 32px);
  max-width: 920px;
  padding: 18px 22px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: .88rem;
  color: var(--color-muted);
  transform: translateX(-50%);
  animation: slide-up .4s ease;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; }
.cookie-banner .btn { flex-shrink: 0; }
@keyframes slide-up {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* =========================================================
   Páginas internas
   ========================================================= */

/* ---------- Cabecera de página ---------- */
.page-hero {
  position: relative;
  color: #fff;
  background: var(--color-primary);
  padding-block: clamp(28px, 4vw, 48px);
}
.page-hero h1 {
  font-size: clamp(1.8rem, 3.8vw, 2.6rem);
  font-weight: 800;
  max-width: 22em;
  margin-bottom: .3em;
}
.page-hero-sub { font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: rgba(255, 255, 255, .85); margin: 0; max-width: 40em; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .88rem;
  color: rgba(255, 255, 255, .7);
  margin-bottom: 18px;
}
.breadcrumb a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.breadcrumb a:hover { color: #fff; text-decoration: underline; }

.page-hero-note { margin: 1em 0 0; font-size: .95rem; color: rgba(255, 255, 255, .75); }

/* Cabecera con sello de la norma a la derecha */
.page-hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 40px;
}
.page-hero-seal { width: 120px; height: auto; }
@media (max-width: 640px) {
  .page-hero-inner { gap: 16px; }
  .page-hero-seal { width: 72px; }
}

.section--soft { background: var(--color-bg-soft); }
.section--tight { padding-block: clamp(40px, 6vw, 72px); }

/* ---------- Texto largo ---------- */
.prose { max-width: 760px; font-size: 1.05rem; color: #334155; overflow-wrap: anywhere; }
.prose--center { margin-inline: auto; }
.prose h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  font-weight: 800;
  color: var(--color-text);
  margin: 1.8em 0 .6em;
}
.prose h3 { font-size: 1.25rem; font-weight: 700; color: var(--color-primary); margin: 1.6em 0 .5em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul li { position: relative; padding-left: 1.6em; margin-bottom: .6em; }
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
}
.prose ol li { margin-bottom: .6em; padding-left: .3em; }
.prose a { text-underline-offset: 3px; }
.prose strong { color: var(--color-text); }
.data-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 24px;
  margin: 0 0 1.2em;
  padding: 20px 24px;
  background: var(--color-bg-soft);
  border-radius: var(--radius);
}
.data-list dt { font-weight: 600; color: var(--color-text); }
.data-list dd { margin: 0; }
@media (max-width: 520px) {
  .data-list { grid-template-columns: 1fr; gap: 2px; }
  .data-list dd { margin-bottom: 10px; }
}
.prose .note {font-size: .92rem; color: var(--color-muted); border-left: 3px solid var(--color-border); padding-left: 14px; }

/* ---------- Preguntas frecuentes ---------- */
.faq h3 {
  margin-top: 2.2em;
  padding-bottom: .4em;
  font-size: 1.4rem;
  color: var(--color-text);
  border-bottom: 2px solid var(--color-primary);
}
.faq h4 {
  margin: 1.6em 0 .5em;
  padding-top: 1.2em;
  font-size: 1.1rem;
  line-height: 1.35;
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
}
.faq h3 + h4 { border-top: 0; padding-top: 0; }
.faq-index {
  margin-bottom: 1em;
  padding: 20px 24px;
  background: var(--color-bg-soft);
  border-radius: var(--radius);
  font-size: .98rem;
}
.faq-index p { margin: 0 0 .4em; }
.faq-index ul { margin-bottom: 1em; }
.faq-index ul:last-child { margin-bottom: 0; }
.faq-index li { margin-bottom: .3em; }

/* ---------- Página de norma ---------- */
.norma-intro {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.norma-media { margin: 0; position: sticky; top: calc(var(--header-h) + 24px); }
.norma-media img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.norma-media figcaption { margin-top: 10px; font-size: .9rem; color: var(--color-muted); text-align: center; }

.benefits {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.benefit {
  padding: 30px 28px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s;
}
.benefit:hover { box-shadow: var(--shadow); }
.benefit-num {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(0, 96, 157, .1);
  color: var(--color-primary);
  font-weight: 800;
}
.benefit h3 { font-size: 1.2rem; font-weight: 700; }
.benefit p { margin: 0; color: var(--color-muted); }

/* ---------- Caja de llamada a la acción ---------- */
.cta-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  flex-wrap: wrap;
  padding: clamp(32px, 5vw, 56px);
  color: #fff;
  background: var(--color-primary);
  border-radius: var(--radius-lg);
}
.cta-box h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; margin-bottom: .3em; }
.cta-box p { margin: 0; color: rgba(255, 255, 255, .85); }

/* ---------- Lista de documentos (PDF) ---------- */
.doc-list { display: grid; gap: 20px; max-width: 860px; }
.doc-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 24px 26px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, border-color .25s;
}
.doc-card:hover { box-shadow: var(--shadow); border-color: rgba(0, 96, 157, .35); }
.doc-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(0, 96, 157, .1);
  color: var(--color-primary);
}
.doc-icon svg { width: 28px; height: 28px; }
.doc-card h2, .doc-card h3 { font-size: 1.15rem; font-weight: 700; margin: 0 0 .25em; }
.doc-card p { margin: 0; color: var(--color-muted); font-size: .95rem; }

/* ---------- Comunicados ---------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}
.news-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s;
}
.news-card:hover { box-shadow: var(--shadow); }
.news-media {
  height: 240px;
  padding: 24px;
  background: var(--color-bg-soft);
}
.news-media img { width: 100%; height: 100%; object-fit: contain; }
.news-body { display: flex; flex-direction: column; flex: 1; padding: 24px 26px 28px; }
.news-body .news-meta { flex: 0 0 auto; margin-bottom: 8px; font-size: .85rem; font-weight: 600; color: var(--color-primary); }
.news-body h2, .news-body h3 { font-size: 1.2rem; font-weight: 700; }
.news-body h2 a, .news-body h3 a { color: var(--color-text); text-decoration: none; }
.news-body h2 a:hover, .news-body h3 a:hover { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
.news-body p { color: var(--color-muted); flex: 1; }
.news-card[hidden] { display: none; }

/* Filtros y búsqueda del listado (solo con JavaScript) */
.filtros { display: none; }
.js .filtros {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px 20px;
  align-items: end;
  margin-bottom: 32px;
}
.campo label { display: block; margin-bottom: 6px; font-size: .9rem; font-weight: 600; color: var(--color-text); }
.campo input,
.campo select {
  width: 100%;
  min-height: 46px;
  padding: .6em .9em;
  font: inherit;
  color: var(--color-text);
  background-color: #fff;
  border: 1px solid #cfd7e2;
  border-radius: 8px;
}
.campo input:hover, .campo select:hover { border-color: #aab6c6; }
.campo input:focus-visible, .campo select:focus-visible { border-color: var(--color-primary); }
.filtros-total { grid-column: 1 / -1; margin: 0; font-size: .92rem; color: var(--color-muted); }
.filtros-vacio { padding: 40px 0; text-align: center; color: var(--color-muted); }
.filtros-vacio[hidden] { display: none; }

/* Pie de una entrada: normas relacionadas y vuelta al listado */
.entrada-pie { margin-top: 2.5em; padding-top: 1.2em; border-top: 1px solid var(--color-border); font-size: 1rem; }
.entrada-pie p { margin-bottom: .6em; }
.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.contact-grid--aside { grid-template-columns: 1fr 2fr; align-items: start; }
.contact-card {
  padding: 30px 28px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.contact-card .eyebrow {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 6px;
}
.contact-card h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: .2em; }
.contact-card .company { color: var(--color-muted); margin-bottom: 1.2em; }
.contact-lines { display: grid; gap: 12px; }
.contact-lines li { display: flex; gap: 12px; align-items: flex-start; }
.contact-lines svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 3px; color: var(--color-primary); }
.contact-lines a { color: var(--color-text); text-decoration-color: rgba(0, 96, 157, .4); text-underline-offset: 3px; }
.contact-lines a:hover { color: var(--color-primary); }

/* ---------- Equipo ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.team-card {
  padding: 32px 24px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.team-card img {
  width: 132px;
  height: 132px;
  margin: 0 auto 18px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 5px #fff, 0 0 0 7px rgba(0, 96, 157, .2);
}
.team-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .2em; }
.team-card p { margin: 0; color: var(--color-muted); font-size: .95rem; }

/* ---------- Pasos (preparar certificación) ---------- */
.steps { display: grid; gap: 28px; counter-reset: paso; }
.step {
  display: grid;
  grid-template-columns: 280px 1fr;
  align-items: center;
  gap: 32px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.step img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.step-num {
  display: inline-block;
  margin-bottom: 4px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--color-primary);
}
.step h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: .4em; }
.step p { margin: 0; color: var(--color-muted); }

/* ---------- Comunicado / carta ---------- */
.letter {
  max-width: 820px;
  margin-inline: auto;
  padding: clamp(28px, 5vw, 56px);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.letter .signature { margin-top: 2em; }
.letter .signature p { margin: 0; }

/* ---------- Formulario embebido ---------- */
.form-embed {
  max-width: 900px;
  margin-inline: auto;
  padding: clamp(12px, 3vw, 28px);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ---------- Animaciones al hacer scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

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

/* =========================================================
   Responsive
   ========================================================= */
/* Anchos intermedios: enlaces más juntos para que quepan nombre y menú */
@media (max-width: 1340px) {
  .main-nav { gap: 12px; }
  .nav-link { padding-inline: 8px; }
}

@media (max-width: 1200px) {
  /* backdrop-filter crea un contenedor para position:fixed y rompería el menú móvil */
  .site-header { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav-toggle { display: flex; }

  .main-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 16px 20px 32px;
    background: #fff;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .main-nav.is-open { opacity: 1; visibility: visible; transform: none; }

  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list > li { border-bottom: 1px solid var(--color-border); }
  .nav-link { width: 100%; justify-content: space-between; padding: 14px 4px; font-size: 1.05rem; }
  .nav-link:hover { background: none; }
  .nav-cta { justify-content: center; padding: .9em; font-size: 1rem; }

  .dropdown,
  .dropdown--wide {
    position: static;
    min-width: 0;
    padding: 0 0 12px;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }
  .dropdown::before { display: none; }
  .has-dropdown.is-open .dropdown { display: block; transform: none; }
  .dropdown-grid { grid-template-columns: 1fr; }

  body.nav-open { overflow: hidden; }
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; padding-block: 56px 72px; min-height: 0; }
  .hero .lead { margin-inline: auto; }
  .hero-seal { order: -1; }
  .hero-seal img { width: 180px; }

  .feature,
  .feature--reverse { grid-template-columns: 1fr; }
  .feature--reverse .feature-media { order: 0; }

  .cards { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }

  .course-box { grid-template-columns: 1fr; }
  .course-media img { min-height: 0; aspect-ratio: 16 / 9; }

  .social-grid { grid-template-columns: 1fr; }
  .fb-wrap { max-width: 500px; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }

  .cookie-banner { flex-direction: column; align-items: stretch; bottom: 12px; }

  .norma-intro { grid-template-columns: 1fr; }
  .norma-media { position: static; order: -1; }
  .benefits { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .step { grid-template-columns: 1fr; gap: 18px; }
  .cta-box { flex-direction: column; align-items: flex-start; }
  .js .filtros { grid-template-columns: 1fr 1fr; }
  .campo--buscar { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .doc-card { grid-template-columns: auto 1fr; }
  .doc-card .btn { grid-column: 1 / -1; justify-content: center; }
}

@media (max-width: 520px) {
  .container { padding-inline: 16px; }
  /* el nombre completo pasa a dos líneas para dejar sitio al botón del menú */
  .brand { font-size: .95rem; white-space: normal; max-width: 13em; }
  .logo-row { gap: 20px 32px; }
  .logo-row img { height: 48px; max-width: 130px; }
  .footer-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .js .filtros { grid-template-columns: 1fr; }
}
