:root {
  --primary: #1a3a5c;
  --primary-light: #2c5282;
  --accent: #c9a227;
  --accent-hover: #b08d1e;
  --bg: #f8fafc;
  --bg-alt: #eef2f7;
  --text: #1e293b;
  --text-light: #64748b;
  --white: #ffffff;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(26,58,92,0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  box-shadow: var(--shadow);
}
.navbar .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}
.navbar .logo img {
  height: 40px;
  width: auto;
}
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--primary) 0%, #0f2847 100%);
  color: var(--white);
  padding: 6rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(201,162,39,0.08) 0%, transparent 70%);
  animation: pulse 8s infinite;
}
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.8; }
}
.hero-content { position: relative; z-index: 1; max-width: 800px; }
.hero img.hero-logo {
  width: 160px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}
.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}
.hero h1 span { color: var(--accent); }
.hero p.tagline {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  opacity: 0.9;
  margin-bottom: 2rem;
  font-weight: 300;
}
.hero .motto {
  font-style: italic;
  opacity: 0.85;
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
  text-align: left;
}
.btn {
  display: inline-block;
  padding: 0.9rem 2.2rem;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}
.btn-primary {
  background: var(--accent);
  color: var(--primary);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201,162,39,0.35);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
  margin-left: 1rem;
}
.btn-outline:hover {
  background: var(--white);
  color: var(--primary);
}

/* Section styling */
section {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-header h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.section-header p {
  color: var(--text-light);
  font-size: 1.1rem;
}

/* About / Mission / Vision */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.2rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  border-top: 4px solid var(--accent);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}
.card h3 {
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.card p { color: var(--text-light); font-size: 0.95rem; }
.icon { font-size: 1.4rem; }

/* Programs */
.programs {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 3rem;
}
.program-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.program-item {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: transform 0.2s;
}
.program-item:hover { transform: translateY(-4px); }
.program-item h4 { color: var(--primary); font-size: 1.05rem; }
.program-item .meta { font-size: 0.85rem; color: var(--text-light); }
.program-item .badge {
  display: inline-block;
  background: var(--accent);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  width: fit-content;
}

/* Values */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.value-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.8rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.value-card h4 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}
.value-card p { font-size: 0.9rem; color: var(--text-light); }

/* Contact / Footer */
.contact {
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius);
  padding: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.contact h2 { font-size: 2rem; margin-bottom: 1rem; }
.contact p { opacity: 0.9; margin-bottom: 0.5rem; }
.contact a { color: var(--accent); text-decoration: none; }
.map-responsive {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.map-responsive iframe {
  width: 100%;
  height: 280px;
  border: none;
}

footer {
  background: #0f2847;
  color: var(--white);
  text-align: center;
  padding: 2rem;
  font-size: 0.9rem;
  opacity: 0.85;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero { padding-top: 5rem; }
  .contact { grid-template-columns: 1fr; }
  .btn-outline { margin-left: 0; margin-top: 1rem; }
  .programs { padding: 1.5rem; }
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s forwards;
}
@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────────────────────────────
   Migrated Markdown content (the body of inner pages)
   ─────────────────────────────────────────────────────────────────────
   The original site used very specific class names (info-card,
   module-list, benefits-list, etc.) for the styled content blocks.
   After migrating to Markdown, the rendered HTML is plain <h2>/<h3>/
   <h4>/<p>/<ul> with no class names. This block restores the visual
   structure by targeting the Markdown's natural headings/lists inside
   the .content wrapper that each page renders its <Content /> into.
   ───────────────────────────────────────────────────────────────────── */

article.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem;
  /* Always lay out the Markdown body as a grid so consecutive h4+p
     pairs (info cards) lay out side by side. Headings and full-width
     paragraphs span all columns via grid-column below. */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

article.content > h2 {
  text-align: center;
  font-size: 2rem;
  color: var(--primary);
  margin: 3rem 0 1rem;
}
article.content > h2::before {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--accent);
  margin: 0 auto 1rem;
  border-radius: 2px;
}

article.content > h3 {
  text-align: center;
  color: var(--primary);
  font-size: 1.4rem;
  margin: 2.5rem 0 1.5rem;
}

article.content > h4 {
  color: var(--primary);
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

article.content > p {
  color: var(--text-light);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
  max-width: 800px;
}

article.content > p:has(+ h4),
article.content > p:has(+ ul) {
  margin-bottom: 0.5rem;
}

/* Info cards: groups of <h4> + <p> become a responsive grid.
   The migrated markdown lays out info cards as repeated h4/p blocks
   (Fecha/Horario/Inversión/Ubicación). Put the article into a CSS
   grid whenever it has a sequence of h4+p pairs, and have each
   h4+p pair occupy one cell. */
article.content > h2,
article.content > h3,
article.content > ul,
article.content > ol,
article.content > hr {
  grid-column: 1 / -1;
}
article.content > h4:has(+ p) {
  background: var(--white);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.6rem 1.4rem;
  box-shadow: var(--shadow);
  display: block;
  text-align: center;
  margin: 0;
  transition: transform 0.2s;
}
article.content > h4:has(+ p):hover {
  transform: translateY(-4px);
}
article.content > h4:has(+ p) + p {
  background: var(--white);
  border-radius: 0 0 var(--radius) var(--radius);
  margin: 0;
  padding: 0 1.4rem 1.4rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.95rem;
  box-shadow: var(--shadow);
  max-width: none;
}

/* Benefits lists: when an <h3> is followed by a <ul>, the ul becomes
   a styled benefits box. */
article.content > h3 + ul {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.8rem 2rem;
  margin: 1rem 0 2rem;
  list-style: none;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.5rem;
}
article.content > h3 + ul li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  color: var(--text-light);
  border-bottom: 1px solid var(--bg-alt);
  font-size: 0.95rem;
}
article.content > h3 + ul li:last-child { border-bottom: none; }
article.content > h3 + ul li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
}

/* Generic content lists: <ul> that isn't part of a benefits box
   (no preceding h3) gets normal styling. */
article.content > ul {
  margin: 1rem 0 2rem 1.5rem;
  color: var(--text-light);
}
article.content > ul li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* Two-column layout: when consecutive <h3>+<ul> blocks appear, lay
   them out side by side on wide screens. */
@media (min-width: 768px) {
  /* Info-card grid: 2-4 columns depending on count */
  article.content {
    /* Use display:contents on h4 to participate in grid auto-flow */
  }
}

/* Three-card row for ¿Quiénes somos?: an h3 followed by 3 h4+p pairs
   that share the same style. Use a flex/grid via adjacent-sibling. */
article.content {
  position: relative;
}

/* Section breaks: a horizontal rule between major sections */
article.content > h2 + p {
  text-align: center;
  color: var(--text-light);
  font-size: 1.05rem;
  margin: 0 auto 1rem;
  max-width: 700px;
}

/* Lema / motto quote: paragraphs starting with "“" get quote styling */
article.content > p:has(em) {
  font-style: italic;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 1.2rem;
  margin: 1.5rem 0;
  background: rgba(201, 162, 39, 0.05);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.2rem;
  max-width: 800px;
}

/* Strong text inside paragraphs: subtle highlight */
article.content strong { color: var(--primary); }

/* Responsive: on small screens, info cards stack */
@media (max-width: 768px) {
  article.content { padding: 2rem 1rem; }
  article.content > h2 { font-size: 1.5rem; }
}
