*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --gutter-ratio: 0.08;
  --gutter: calc(var(--gutter-ratio) * 100%);
  --brand: #0d47a1;
  --bg: #f0f2f5;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: var(--bg);
}

body > main {
  flex: 1 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  padding: 0.85rem var(--gutter);
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.site-header ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
}

.site-header a {
  color: var(--brand);
  text-decoration: none;
}

.site-header a:hover {
  text-decoration: underline;
}

.lang-switch a[aria-current="true"] {
  font-weight: 700;
  color: #1a1a1a;
}

.content {
  max-width: none;
  margin: 0 var(--gutter);
  padding: 2rem clamp(1.25rem, 3vw, 3rem) 3rem;
  background: #fff;
}

body > main.content {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.content h1 {
  font-size: clamp(1.75rem, 2.4vw, 2.5rem);
  line-height: 1.25;
  margin-top: 0;
}

.content h2 {
  font-size: 1.35rem;
  margin-top: 2rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.35rem;
}

.content h3 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0;
}

.content th,
.content td {
  border: 1px solid #ddd;
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.content th {
  background: #f5f5f5;
}

.content ul,
.content ol {
  padding-left: 1.25rem;
}

.content .table-scroll {
  overflow-x: auto;
  margin: 1rem 0;
}

.ad {
  margin: 1.5rem 0;
  text-align: center;
  min-height: 100px;
  overflow: hidden;
}

.ad--in-article {
  min-height: 280px;
}

.ad--desktop-only {
  min-height: 90px;
}

@media (max-width: 767px) {
  .ad--desktop-only {
    display: none;
  }
}

.site-footer {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding: 1.75rem var(--gutter);
  background: #0f1b2d;
  color: #b8c2d0;
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer__logo {
  font-weight: 700;
  font-size: 1.125rem;
}

.faq dt {
  font-weight: 600;
  margin-top: 1rem;
}

.faq dd {
  margin: 0.35rem 0 0;
}

.sources ol {
  word-break: break-word;
}

/* Cluster principal (home) */
.home-main {
  background: var(--bg);
  padding: 0 var(--gutter) 2rem;
}

.home-main .content {
  margin: 0;
  padding-left: 0;
  padding-right: 0;
  background: transparent;
}

/* Porcentajes relativos al ancho de .home-main sin su padding (100% - 2 × gutter) */
.home-main .home-hero {
  --bleed: calc(var(--gutter) / (1 - 2 * var(--gutter-ratio)));
  margin: 0 calc(-1 * var(--bleed)) 1rem;
  padding: 3.5rem var(--bleed) 2.5rem;
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 55%, #1e88e5 100%);
  color: #fff;
}

.home-hero h1 {
  font-size: clamp(2rem, 3.5vw, 3.25rem);
  margin-bottom: 0.75rem;
}

.home-hero .home-eyebrow,
.home-hero .home-lead {
  color: rgba(255, 255, 255, 0.9);
}

.home-hero .home-lead {
  max-width: 60rem;
}

.home-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #555;
}

.home-eyebrow a {
  color: inherit;
}

.home-lead {
  font-size: 1.125rem;
  color: #333;
  max-width: 42rem;
}

.section-intro {
  margin-top: -0.5rem;
  color: #555;
}

.pillar-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}

.pillar-card {
  margin: 0;
}

.pillar-card__link {
  display: block;
  height: 100%;
  padding: 1.25rem 1.35rem;
  background: #fff;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pillar-card__link:hover {
  border-color: #0d47a1;
  box-shadow: 0 4px 16px rgba(13, 71, 161, 0.08);
}

.pillar-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: #0d47a1;
}

.pillar-card__summary {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  color: #444;
}

.pillar-card__cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0d47a1;
}

.home-blocks {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .home-blocks {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .home-blocks {
    grid-template-columns: repeat(3, 1fr);
  }
}

.home-block {
  margin: 0;
  padding: 1.25rem 1.4rem;
  background: #fff;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.home-block:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(13, 71, 161, 0.08);
}

.home-block__pillar {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #777;
}

.home-block__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  line-height: 1.35;
}

.home-block__title a {
  color: #0d47a1;
  text-decoration: none;
}

.home-block__title a:hover {
  text-decoration: underline;
}

.home-block__excerpt {
  margin: 0;
  font-size: 0.9rem;
  color: #444;
}

.home-about {
  margin-bottom: 2rem;
}

.site-header .logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: #1a1a1a;
}

.lang-switch {
  margin-left: auto;
}

.lang-switch ul {
  flex-wrap: wrap;
  row-gap: 0.35rem;
}

.home-main .home-about {
  padding: 1.5rem 2rem;
  background: #fff;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
}

/* Pilar: hub con fichas de guías */
.pillar-main {
  padding: 0 var(--gutter) 3rem;
}

.pillar-main .pillar-hero {
  --bleed: calc(var(--gutter) / (1 - 2 * var(--gutter-ratio)));
  position: relative;
  margin: 0 calc(-1 * var(--bleed)) 2.5rem;
  padding: 3.5rem var(--bleed) 6rem;
  color: #fff;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath fill='%23f0f2f5' d='M0 120V78l120-30 110 38 150-70 130 52 90-24 160 60 140-86 150 64 110-28 130 40 150-52v106z'/%3E%3C/svg%3E") bottom / 100% 90px no-repeat,
    linear-gradient(135deg, #0b3d2e 0%, #14532d 45%, #1f6f4a 100%);
}

.pillar-hero__crumbs {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.pillar-hero__crumbs a {
  color: #fff;
  text-decoration: none;
}

.pillar-hero__crumbs a:hover {
  text-decoration: underline;
}

.pillar-hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.25rem, 4vw, 3.75rem);
  line-height: 1.1;
}

.pillar-hero__lead {
  max-width: 60rem;
  margin: 0 0 1.5rem;
  font-size: clamp(1.05rem, 1.4vw, 1.3rem);
  color: rgba(255, 255, 255, 0.9);
}

.pillar-hero__facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.pillar-hero__facts li {
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
}

.pillar-hero__facts strong {
  font-size: 1rem;
}

.pillar-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-bottom: 1.25rem;
}

.pillar-section__head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 1.85rem);
}

.pillar-section__head p {
  margin: 0;
  color: #555;
}

.guide-cards {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
}

.guide-card {
  margin: 0;
}

.guide-card__link {
  display: block;
  height: 100%;
  padding: 1.5rem 1.6rem;
  background: #fff;
  border: 1px solid #e0e4ea;
  border-left: 4px solid #15803d;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.guide-card__link:hover,
.guide-card__link:focus-visible {
  border-color: #15803d;
  box-shadow: 0 8px 24px rgba(15, 27, 45, 0.1);
}

.guide-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  line-height: 1.3;
  color: #0f1b2d;
}

.guide-card__link:hover .guide-card__title {
  color: #15803d;
}

.guide-card__excerpt {
  margin: 0;
  font-size: 0.95rem;
  color: #4a5565;
}

/* Pilar: artículos */
.pillar main.content article > h1 {
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 4px solid #15803d;
}

.pillar main.content article > h2 {
  position: relative;
  margin-top: 2.75rem;
  padding: 0 0 0 1rem;
  border-bottom: none;
}

.pillar main.content article > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 5px;
  border-radius: 3px;
  background: #15803d;
}

.pillar .content .table-scroll {
  border: 1px solid #e0e4ea;
  border-radius: 10px;
}

.pillar .content .table-scroll table {
  margin: 0;
}

.pillar .content th,
.pillar .content td {
  border: none;
  border-bottom: 1px solid #edf0f3;
  padding: 0.75rem 1rem;
}

.pillar .content thead th {
  background: #0f1b2d;
  color: #fff;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.pillar .content tbody th {
  background: #f6f7f9;
}

.pillar .content tbody tr:nth-child(even) td {
  background: #fafbfc;
}

.pillar .content tbody tr:hover td {
  background: #eef6f1;
}

.pillar .content tbody tr:last-child > * {
  border-bottom: none;
}

.pillar article ol:not(.sources) {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.pillar article ol:not(.sources) > li {
  counter-increment: step;
  position: relative;
  margin-bottom: 0.75rem;
  padding-left: 2.75rem;
  min-height: 2rem;
}

.pillar article ol:not(.sources) > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #15803d;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.pillar .faq dt {
  margin: 0;
  padding: 1rem 1.25rem 0;
  background: #f6f7f9;
  border-left: 4px solid #15803d;
  border-radius: 10px 10px 0 0;
}

.pillar .faq dd {
  margin: 0 0 0.75rem;
  padding: 0.35rem 1.25rem 1rem;
  border-left: 4px solid #15803d;
  background: #f6f7f9;
  border-radius: 0 0 10px 10px;
  color: #374151;
}

.pillar .sources {
  font-size: 0.85rem;
  color: #555;
}

@media (max-width: 640px) {
  :root {
    --gutter-ratio: 0.04;
  }

  .lang-switch {
    margin-left: 0;
    width: 100%;
  }
}
