:root {
  /* PALETA LINKECONTRATA */
  --lc-primary: #0A66C2;
  --lc-primary-dark: #004182;
  --lc-accent: #70B5F9;
  --lc-bg: #F3F2EF;
  --lc-surface: #FFFFFF;
  --lc-text: #1D2226;
  --lc-text-muted: #6f7782;
  --lc-border: rgba(0, 0, 0, 0.06);
  --lc-shadow: rgba(10, 102, 194, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-size: 1em;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--lc-bg);
  color: var(--lc-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ————— HEADER / NAVBAR ————— */
header {
  background: var(--lc-bg);
  padding: 15px 5%;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow .3s ease, padding .3s ease, background .3s ease;
}

header.scrolled {
  padding: 8px 5%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .08);
  background: var(--lc-surface);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  column-gap: 16px;
}

/* LOGO */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  display: block;
  width: auto;
  height: clamp(70px, 12vw, 140px);
  object-fit: contain;
}

/* MENÚ */
nav {
  position: relative;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(.8rem, 2vw, 1.5rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

nav ul li a {
  color: var(--lc-text-muted);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 6px;
  transition: color .2s, background .2s;
}

nav ul li a:hover {
  color: var(--lc-text);
  background: rgba(10, 102, 194, .1);
}

.dropdown-arrow {
  font-size: .7rem;
  transition: transform .2s;
}

/* SUBMENÚ (desktop) */
nav ul li .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--lc-primary-dark);
  list-style: none;
  min-width: 200px;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .25);
  overflow: hidden;
  z-index: 1000;
}

nav ul li .submenu li a {
  display: block;
  padding: .65rem 1rem;
  color: #eaf3ff;
  font-weight: 500;
}

nav ul li .submenu li a:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

@media (min-width: 769px) {
  nav ul li:hover>.submenu {
    display: block;
  }

  nav ul li:hover>a .dropdown-arrow {
    transform: rotate(180deg);
  }
}

/* Botón hamburguesa */
.menu-toggle {
  display: none;
  /* visible en móvil */
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 28px;
  color: var(--lc-text-muted);
}

.menu-toggle i {
  display: inline-block;
  transition: transform .25s ease, opacity .2s ease;
}

.menu-toggle.is-open i {
  transform: rotate(90deg);
}

/* ————— RESPONSIVE ————— */
@media (max-width: 900px) {
  header {
    padding: 14px 5%;
  }

  .navbar {
    align-items: center;
  }

  /* Logo cómodo en móvil */
  .logo img {
    height: 96px;
  }

  @media (max-width: 480px) {
    .logo img {
      height: 104px;
    }
  }

  .menu-toggle {
    display: block;
  }

  /* Menú móvil con slide */
  #nav-menu {
    width: 100%;
  }

  #nav-menu ul {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: var(--lc-surface);
    border-top: 1px solid var(--lc-border);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .08);

    display: block;
    /* necesario para animar altura */
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    transition: max-height .35s ease, opacity .25s ease, transform .25s ease;
  }

  #nav-menu ul.show {
    max-height: 420px;
    opacity: 1;
    transform: translateY(0);
  }

  #nav-menu ul li a {
    width: 100%;
    padding: 12px 20px;
    font-size: .95rem;
    color: var(--lc-text);
  }

  /* Submenú tipo acordeón en móvil */
  nav ul li .submenu {
    position: relative;
    background: none;
    box-shadow: none;
    top: 0;
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    padding-left: 1.5rem;
  }

  nav ul li.show-sub>.submenu {
    max-height: 500px;
  }
}

/* ————— HERO ————— */
.hero {
  text-align: center;
  padding: 40px 20px;
}

.hero .portada {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px var(--lc-shadow);
}

.hero-text h1 {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--lc-primary-dark);
}

.hero-text p {
  font-size: 1rem;
  color: var(--lc-text-muted);
}

/* ————— CARDS ————— */
.cta-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  padding: 40px 20px;
}

.card {
  background: var(--lc-surface);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  color: var(--lc-text);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .08);
  transition: transform .2s, box-shadow .2s;
  width: 280px;
  border: 1px solid var(--lc-border);
}

.card i {
  font-size: 2rem;
  color: var(--lc-primary);
  margin-bottom: 10px;
}

.card h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--lc-primary-dark);
}

.card p {
  font-size: .95rem;
  color: var(--lc-text-muted);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(10, 102, 194, .18);
}

/* ————— FOOTER ————— */
footer {
  background: var(--lc-primary-dark);
  color: var(--lc-surface);
  text-align: center;
  padding: 1em;
  margin-top: auto;
  font-size: .9rem;
}

/* ————— LAYOUT & ADS ————— */
.layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 10px;
  gap: 10px;
}

.main-content {
  max-width: 1200px;
  width: 100%;
  padding: 0 20px;
}

.ads {
  width: 160px;
  min-height: 100vh;
  position: sticky;
  top: 10px;
  background: var(--lc-surface);
  color: var(--lc-text);
  padding: 10px;
  border-radius: 10px;
  font-size: .9rem;
  text-align: center;
  box-shadow: 0 0 8px rgba(0, 0, 0, .05);
  border: 1px solid var(--lc-border);
}

.ad-slot {
  border: 2px dashed #b9c6d8;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
}

.left-ad {
  margin-right: 10px;
}

.right-ad {
  margin-left: 10px;
}

@media (max-width: 1024px) {
  .ads {
    display: none;
  }

  .layout {
    flex-direction: column;
    padding: 0;
  }

  .main-content {
    padding: 0 10px;
  }
}

/* ADS EN FEED */
.ads-in-feed {
  background: var(--lc-primary-dark);
  color: #eaf3ff;
  text-align: center;
  padding: 20px;
  border-radius: 10px;
  margin: 10px 0;
  font-size: 14px;
  min-width: 250px;
  grid-column: 1 / -1;
}


/* ===============================
   HOMEPAGE UX REFINEMENTS (drop-in)
   =============================== */

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

/* 1) Evita empujes y scroll lateral en layout */
.layout, .layout > *, .main-content { min-width: 0; }
html, body { overflow-x: hidden; }

/* 2) Menú móvil: ancho y capa segura */
#nav-menu ul {
  right: 0; left: 0; /* asegura 100% ancho */
  z-index: 1100;     /* sobre el resto */
}

/* 3) Hero: respiración y ratio consistente */
.hero { padding: clamp(22px, 5vw, 40px) clamp(14px, 4vw, 20px); }
.hero .portada {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 8px 20px var(--lc-shadow);
}
.hero-text h1 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
.hero-text p  { font-size: clamp(.95rem, 2.5vw, 1rem); }

/* 4) Cards: usa GRID responsive en lugar de ancho fijo */
.cta-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(12px, 2.5vw, 20px);
  padding: clamp(18px, 4vw, 40px) clamp(14px, 4vw, 20px);
}
.card {
  width: auto; /* quita los 280px fijos */
  height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  border: 1px solid var(--lc-border);
  background: var(--lc-surface);
  border-radius: 12px;
  padding: clamp(14px, 3vw, 20px);
  text-align: center;
  box-shadow: 0 6px 14px rgba(0,0,0,.08);
  transition: transform .2s, box-shadow .2s;
}
.card h2 { font-size: clamp(1.05rem, 2.5vw, 1.2rem); }
.card p  { font-size: .95rem; color: var(--lc-text-muted); }
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-6px); box-shadow: 0 12px 24px rgba(10,102,194,.18); }
}

/* 5) CTA botón reutilizable (lo usan en el home) */
.btn-go {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--lc-primary);
  color: #fff !important;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 6px 12px rgba(10,102,194,.2);
  transition: transform .1s, background .2s, box-shadow .2s;
}
.btn-go:hover { background: #0b5db0; transform: translateY(-2px); box-shadow: 0 10px 18px rgba(10,102,194,.28); }
.btn-go:active { transform: translateY(0); }
.btn-go:focus-visible { outline: 3px solid var(--lc-accent); outline-offset: 2px; }

/* 6) Side ads: sticky y colapso en pantallas medianas */
.ads { top: 84px; }
@media (max-width: 1200px) {
  .ads { display: none; }
  .layout { flex-direction: column; gap: 0; padding: 0; }
  .main-content { padding: 0 10px; }
}

/* 7) Ads in-feed: reserva sin CLS y estilo discreto */
.ads-in-feed {
  background: linear-gradient(180deg, #fafbfd, #f7f9fc);
  color: #3b4a5a;
  text-align: center;
  border: 1px solid var(--lc-border);
  border-radius: 12px;
  padding: 14px 10px;
  margin: 10px 0;
  min-height: 260px;      /* 300x250 */
  display: grid; place-items: center;
}
@media (max-width: 480px) { .ads-in-feed { min-height: 120px; } }

/* 8) Cabecera: logo y paddings más contenidos en móvil */
@media (max-width: 900px) {
  header { padding: 12px 5%; }
  .logo img { height: 72px; }         /* baja un toque para no “empujar” */
}
@media (max-width: 480px) {
  .logo img { height: 64px; }
}

/* 9) Accesibilidad & motion */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--lc-accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 10) Dark: micro ajustes si ya cambias variables en :root */
@media (prefers-color-scheme: dark) {
  .ads-in-feed { box-shadow: 0 5px 14px rgba(0,0,0,.35); }
}
