:root {
  --blue: #005da1;
  --blue-dark: #005a99;
  --text: #4f4f4f;
  --text-soft: #686868;
  --yellow: #ffc738;
  --page: #f8f8f6;
  --white: #ffffff;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --content-width: 1200px;
  --gutter: 24px;
  --font: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

.content-block {
  width: min(100% - calc(var(--gutter) * 2), var(--content-width));
  margin: 0 auto;
}

@media (min-width: 600px) {
  :root { --gutter: 32px; }
}

@media (min-width: 960px) {
  :root { --gutter: 48px; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: clamp(180px, 18vw, 280px);
  background-color: #003a6b;
  background-image: image-set(
    url("img/header.webp") type("image/webp"),
    url("img/header.png") type("image/png")
  );
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 16px;
}

.hero-content {
  width: min(100% - calc(var(--gutter) * 2), var(--content-width));
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.hero-logos {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.hero-logo {
  display: block;
  height: auto;
}

.hero-logo-uchile {
  width: clamp(80px, 12vw, 160px);
}

.hero-logo-vti {
  width: clamp(120px, 18vw, 240px);
}

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--white);
  max-width: 700px;
}

/* ============================================================
   INTRO
   ============================================================ */
.intro {
  padding: 40px 0 24px;
}

.intro p {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
}

.intro span {
  color: var(--blue);
  font-weight: 700;
}

/* ============================================================
   COURSES
   ============================================================ */
.courses {
  padding: 16px 0 48px;
}

.courses h2,
.benefits h2 {
  margin: 0 0 20px;
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--blue);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.course-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow);
}

.course-card-picture {
  display: block;
  width: 100%;
  aspect-ratio: 423 / 231;
  overflow: hidden;
}

.course-card-picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.course-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 20px 20px;
  border-left: 4px solid var(--yellow);
}

.course-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--blue);
}

.course-card p {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-soft);
}

.course-card strong {
  color: var(--blue);
  font-weight: 700;
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
}

.course-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.course-meta span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--yellow);
}

.course-card a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 8px 14px;
  background: var(--yellow);
  color: var(--blue);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: background-color 160ms ease, transform 160ms ease;
}

.course-card a:hover,
.course-card a:focus-visible {
  background: #ffd76b;
  transform: translateY(-1px);
}

.course-card a:focus-visible {
  outline: 3px solid rgba(0, 93, 161, 0.25);
  outline-offset: 3px;
}

.course-card a span {
  font-size: 18px;
  line-height: 0.8;
}

.course-card--upcoming img {
  cursor: pointer;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  padding: 32px;
  cursor: pointer;
}

.modal-overlay.open {
  display: flex;
}

.modal-overlay img {
  max-width: min(90vw, 800px);
  max-height: 90vh;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.upcoming {
  padding: 0 0 64px;
}

.upcoming h2 {
  margin: 0 0 20px;
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--blue);
}

/* ============================================================
   BENEFITS
   ============================================================ */
.benefits {
  padding: 0 0 64px;
}

.benefits ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0 0 0 24px;
}

.benefits li {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
}

.benefits strong {
  color: var(--blue);
  font-weight: 700;
}

.benefits li::marker {
  color: var(--blue);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--blue-dark);
  color: var(--white);
  padding: 40px 0 48px;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  align-items: stretch;
}

@media (min-width: 600px) {
  .footer-group {
    padding-left: 24px;
    border-left: 1px solid rgba(255,255,255,0.2);
  }

  .footer-group:first-child {
    padding-left: 0;
    border-left: none;
  }
}

@media (min-width: 961px) {
  .footer-inner {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .footer-collaborators {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-collaborators .footer-logos {
    flex-wrap: nowrap;
    gap: 20px;
    justify-content: center;
    width: 100%;
  }

  .footer-collaborators h2 {
    text-align: center;
  }

  .footer-collaborators .footer-logos img:nth-child(1) {
    max-width: 40px;
  }

  .footer-collaborators .footer-logos img:nth-child(2) {
    max-width: 85px;
    transform: translateY(-10px);
  }

  .footer-collaborators .footer-logos img:nth-child(3) {
    max-width: 280px;
  }

  .footer-organizer img {
    transform: translateY(20px);
  }
}

.footer-group h2 {
  margin: 0 0 16px;
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.footer-logos {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

  .footer-collaborators .footer-logos img:nth-child(1) {
    order: 1;
    max-width: 60px;
  }

  .footer-collaborators .footer-logos img:nth-child(2) {
    order: 2;
    max-width: 110px;
    transform: translateY(2px);
  }

  .footer-collaborators .footer-logos img:nth-child(3) {
    order: 3;
    max-width: 275px;
  }

.footer-organizer img {
  max-width: 200px;
}

.footer-platform img {
  max-width: 120px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .course-grid {
    grid-template-columns: 1fr;
  }

  .hero-logo-uchile {
    width: clamp(100px, 24vw, 140px);
  }

  .hero-logo-vti {
    width: clamp(160px, 40vw, 200px);
  }

  .hero h1 {
    max-width: none;
  }

  .footer-group {
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.2);
    border-left: none;
    padding-left: 0;
  }

  .footer-group:first-child {
    border-top: none;
    padding-top: 0;
  }

  .footer-collaborators .footer-logos {
    justify-content: center;
    gap: 32px;
  }

  .footer-collaborators .footer-logos img:nth-child(1) {
    transform: translateY(10px);
  }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
