/* Courses follow the public EJMC course directory. */
main[data-page="cursos"] .inner-hero {
  background: #fff;
  border-bottom: 1px solid #e5eaf2;
}

main[data-page="cursos"] .inner-hero h1 {
  color: #174291;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: -1px;
  text-transform: uppercase;
}

main[data-page="cursos"] .center-title::before {
  display: none;
}

main[data-page="cursos"] .inner-hero h1::after {
  content: "";
  display: block;
  width: 80px;
  height: 5px;
  margin: 18px auto 0;
  border-radius: 10px;
  background: #cc1b29;
}

main[data-page="cursos"] .inner-hero p {
  color: #4b6b9c;
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.8;
}

.courses-content {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
  width: min(1200px, calc(100% - 40px));
  padding-block: 35px 70px;
}

.courses-content .course-selector {
  position: sticky;
  top: calc(var(--header-height) + 16px);
  z-index: 5;
  display: grid;
  min-width: 0;
  max-height: calc(100vh - var(--header-height) - 32px);
  max-height: calc(100dvh - var(--header-height) - 32px);
  gap: 5px;
  margin: 0;
  padding: 16px 10px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #dbe4f0;
  border-radius: 15px;
  background: #fff;
}

.course-index-label {
  margin: 0 9px 9px;
  color: #5c6d84;
  font-size: .65rem;
  font-weight: 750;
  line-height: 1.5;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.courses-content .course-selector a.course-index-link {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #405371;
  background: transparent;
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.4;
  text-decoration: none;
  white-space: normal;
  transition: color 160ms ease, background-color 160ms ease;
}

.courses-content .course-selector a.course-index-link:hover { color: #174291; background: #eef3fb; }
.courses-content .course-selector a.course-index-link[aria-current="location"] { color: #174291; background: #eaf1fd; font-weight: 750; box-shadow: inset 3px 0 #cc1b29; }
.courses-content .course-selector a.course-index-link:focus-visible { outline: 3px solid #174291; outline-offset: 3px; }
.courses-content[data-reveal], .courses-content .course-selector[data-reveal] { opacity: 1; transform: none; animation: none; transition: none; }

.ejmc-courses-wrapper {
  --course-blue: #174291;
  --course-red: #cc1b29;
  --course-red-bright: #e61e2e;
  --course-border: #e5eaf2;
  width: 100%;
  min-width: 0;
  color: var(--course-blue);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.ejmc-courses-wrapper *,
.ejmc-courses-wrapper *::before,
.ejmc-courses-wrapper *::after {
  box-sizing: border-box;
}

.courses-content .course-section {
  position: relative;
  isolation: isolate;
  min-width: 0;
  margin: 0 0 120px;
  padding-top: 20px;
  scroll-margin-top: 8px;
}

.courses-content .course-section:last-child {
  margin-bottom: 0;
}

.course-watermark {
  position: absolute;
  z-index: -1;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  color: var(--course-blue);
  font-size: clamp(8rem, 25vw, 22rem);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  opacity: .03;
  pointer-events: none;
  user-select: none;
}

.course-content-wrapper {
  position: relative;
  min-width: 0;
}

.courses-content .course-title-main {
  margin: 0 auto 25px;
  color: var(--course-blue);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -1px;
  text-align: center;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.course-title-main::after {
  content: "";
  display: block;
  width: 60px;
  height: 5px;
  margin: 15px auto 0;
  border-radius: 10px;
  background: var(--course-red);
}

.course-featured-photo-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto 50px;
  overflow: hidden;
  border: 1px solid var(--course-border);
  border-radius: 20px;
  background: #f5f8fd;
  box-shadow: 0 15px 35px rgb(0 0 0 / .08);
}

.course-photo-zoom {
  width: 100%;
}

.course-featured-photo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.course-cycle-ribbon {
  position: absolute;
  z-index: 2;
  top: 25px;
  right: -10px;
  max-width: calc(100% - 15px);
  padding: 8px 25px;
  border-radius: 20px 0 0 20px;
  background: var(--course-red);
  color: #fff;
  box-shadow: 0 10px 20px rgb(204 27 41 / .4);
  font-size: .85rem;
  font-weight: 800;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 1px;
  overflow-wrap: anywhere;
}

.course-cycle-ribbon::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  border-width: 6px 10px 0 0;
  border-style: solid;
  border-color: #8b0e19 transparent transparent;
}

.courses-content .course-team-subtitle {
  margin: 0 auto 40px;
  color: var(--course-blue);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.course-staff-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 25px;
  width: 100%;
  min-width: 0;
}

.courses-content a.course-person-card {
  position: relative;
  display: block;
  flex: 1 1 280px;
  width: 100%;
  min-width: 0;
  max-width: 320px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 20px;
  background: #174291;
  color: #fff;
  box-shadow: 0 15px 30px rgb(23 66 145 / .12);
  text-decoration: none;
}

.course-person-card > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.course-cinematic-overlay {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 55%;
  padding: 40px 20px 20px;
  background: linear-gradient(to top, rgb(15 44 99 / .95), rgb(23 66 145 / .6) 70%, transparent);
}

.course-person-name {
  margin: 0;
  font-weight: inherit;
}

.course-given {
  display: block;
  color: #fff;
  font-size: clamp(1.2rem, 5vw, 1.4rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: .5px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.course-surname {
  display: block;
  margin: 4px 0 15px;
  color: #d1dcf0;
  font-size: clamp(.9rem, 3.5vw, 1rem);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 1px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.course-person-role {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 14px;
  border-radius: 12px;
  background: var(--course-red);
  color: #fff;
  box-shadow: 0 4px 10px rgb(204 27 41 / .3);
  font-size: clamp(.75rem, 3vw, .85rem);
  font-weight: 800;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.course-person-role > i {
  flex: none;
}

.course-person-role > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes course-enter {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes course-breathing {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
  }

  .courses-content .course-section {
    animation: course-enter .8s ease-out both;
  }

  .course-featured-photo {
    animation: course-breathing 12s ease-in-out infinite alternate;
  }

  .course-featured-photo-container,
  .course-photo-zoom {
    transition: transform .5s ease, box-shadow .5s ease;
  }

  .course-featured-photo-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgb(23 66 145 / .25), 0 0 40px rgb(23 66 145 / .1);
  }

  .course-featured-photo-container:hover .course-featured-photo {
    animation-play-state: paused;
  }

  .course-featured-photo-container:hover .course-photo-zoom {
    transform: scale(1.01);
  }

  .courses-content a.course-person-card {
    transition: box-shadow .4s ease, transform .4s ease;
  }

  .course-person-card > img {
    transition: transform .8s cubic-bezier(.25, .46, .45, .94);
  }

  .course-cinematic-overlay {
    transition: padding-bottom .5s cubic-bezier(.25, .46, .45, .94), background .5s;
  }

  .course-given,
  .course-surname,
  .course-person-role {
    transform: translateY(10px);
    transition: transform .4s ease;
  }

  .course-surname { transition-delay: .05s; }
  .course-person-role { transition-delay: .1s; opacity: .9; }

  .courses-content a.course-person-card:is(:hover, :focus-visible) {
    transform: translateY(-8px);
    box-shadow: 0 25px 45px rgb(204 27 41 / .25), 0 0 30px rgb(204 27 41 / .15);
  }

  .course-person-card:is(:hover, :focus-visible) > img {
    transform: scale(1.08);
  }

  .course-person-card:is(:hover, :focus-visible) .course-cinematic-overlay {
    padding-bottom: 30px;
    background: linear-gradient(to top, #0f2c63, rgb(23 66 145 / .85) 80%, transparent);
  }

  .course-person-card:is(:hover, :focus-visible) :is(.course-given, .course-surname, .course-person-role) {
    transform: translateY(0);
  }

  .course-person-card:is(:hover, :focus-visible) .course-person-role {
    opacity: 1;
    background: var(--course-red-bright);
    box-shadow: 0 6px 15px rgb(204 27 41 / .5);
  }
}

@media (max-width: 900px) {
  .courses-content { display: block; }
  .courses-content .course-selector {
    top: var(--header-height);
    z-index: 12;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    max-width: 100%;
    max-height: none;
    gap: 5px;
    margin-bottom: 24px;
    padding: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    border-radius: 12px;
    scrollbar-width: thin;
  }
  .course-index-label { display: none; }
  .courses-content .course-selector a.course-index-link { flex: none; padding: 9px 12px; font-size: .74rem; white-space: nowrap; }
  .courses-content .course-selector a.course-index-link[aria-current="location"] { box-shadow: inset 0 -3px #cc1b29; }
  .courses-content .course-section { scroll-margin-top: 64px; }
}

@media (max-width: 768px) {
  .courses-content {
    width: calc(100% - 30px);
    padding-block: 25px 45px;
  }

  .courses-content .course-section {
    margin-bottom: 80px;
    scroll-margin-top: 64px;
  }

  .courses-content .course-title-main {
    margin-bottom: 20px;
  }

  .course-featured-photo-container {
    margin-bottom: 40px;
    border-radius: 16px;
  }

  .course-cycle-ribbon {
    top: 15px;
    padding: 6px 15px;
    font-size: .7rem;
  }

  .course-staff-grid {
    width: min(100%, 348px);
    margin-inline: auto;
    gap: 12px;
  }

  .courses-content a.course-person-card {
    display: flex;
    flex: 0 1 calc((100% - 12px) / 2);
    flex-direction: column;
    width: auto;
    max-width: 168px;
    aspect-ratio: auto;
    border-radius: 14px;
    background: #10264a;
  }

  .course-person-card > img {
    height: auto;
    flex: none;
    aspect-ratio: 1;
  }

  .courses-content a.course-person-card .course-cinematic-overlay {
    position: static;
    flex: 1;
    justify-content: flex-start;
    min-height: 0;
    padding: 10px;
    background: transparent;
  }

  .course-given { font-size: .9rem; letter-spacing: 0; }
  .course-surname { margin: 3px 0 8px; font-size: .72rem; letter-spacing: .015em; }
  .course-person-role { margin-top: auto; gap: 4px; padding: 4px 6px; font-size: .68rem; letter-spacing: 0; text-transform: none; }

  .course-given,
  .course-surname,
  .course-person-role {
    transform: none;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .courses-content .course-selector a.course-index-link { transition: none; }

  .ejmc-courses-wrapper *,
  .ejmc-courses-wrapper *::before,
  .ejmc-courses-wrapper *::after {
    animation: none !important;
    transition: none !important;
  }

  .course-featured-photo-container,
  .course-photo-zoom,
  .courses-content a.course-person-card,
  .course-person-card > img,
  .course-given,
  .course-surname,
  .course-person-role {
    transform: none !important;
  }

  .course-person-role {
    opacity: 1;
  }
}

