/* ALFA · ajuste final posterior a LearnDash. Sólo presentación. */

/* Biblioteca de cursos: el grid legacy de LearnDash trae anchos Bootstrap. */
body.alfa-courses-screen .ld-course-list-content {
  width: 100% !important;
  max-width: none !important;
  margin: 22px 0 0 !important;
}

body.alfa-courses-screen .ld-course-list-items.row {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 22px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.alfa-courses-screen .ld-course-list-items.row::before,
body.alfa-courses-screen .ld-course-list-items.row::after {
  display: none !important;
  content: none !important;
}

body.alfa-courses-screen .ld-course-list-items .ld_course_grid {
  float: none !important;
  display: block !important;
  flex: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.alfa-courses-screen .ld-course-list-items .ld_course_grid article {
  display: flex !important;
  min-height: 100% !important;
  flex-direction: column !important;
  overflow: hidden !important;
  background: #fff !important;
  border: 1px solid var(--alfa-border) !important;
  box-shadow: 0 8px 22px rgba(13, 31, 49, .11) !important;
}

body.alfa-courses-screen .ld_course_grid .thumbnail,
body.alfa-courses-screen .ld_course_grid .thumbnail > a {
  width: 100% !important;
}

body.alfa-courses-screen .ld_course_grid .thumbnail > a {
  display: block !important;
  aspect-ratio: 16 / 9 !important;
  height: auto !important;
  overflow: hidden !important;
}

body.alfa-courses-screen .ld_course_grid .thumbnail img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

body.alfa-courses-screen .ld_course_grid .caption {
  display: flex !important;
  min-height: 160px !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  padding: 18px !important;
}

body.alfa-courses-screen .ld_course_grid .entry-title {
  margin: 0 !important;
  color: var(--alfa-ink) !important;
  font-size: clamp(.95rem, 1.4vw, 1.15rem) !important;
  font-weight: 900 !important;
  letter-spacing: -.035em !important;
  line-height: 1.12 !important;
}

body.alfa-courses-screen .ld_course_grid .ld_course_grid_button {
  width: 100% !important;
  margin-top: auto !important;
  padding-top: 17px !important;
}

body.alfa-courses-screen .ld_course_grid .btn {
  display: flex !important;
  width: 100% !important;
  min-height: 42px !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 9px 12px !important;
  overflow: hidden !important;
  color: #fff !important;
  font-size: .64rem !important;
  font-weight: 900 !important;
  letter-spacing: .075em !important;
  line-height: 1.1 !important;
  text-align: center !important;
  text-overflow: ellipsis !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  background: var(--alfa-navy) !important;
  border: 0 !important;
  border-radius: 0 !important;
}

body.alfa-courses-screen .ld_course_grid .ribbon {
  padding: 7px 11px !important;
  font-size: .58rem !important;
  letter-spacing: .09em !important;
}

/* Curso individual: compacidad y jerarquía editorial, sin tocar el contenido. */
body.alfa-course-screen .wp-block-post-content,
body.alfa-course-screen .learndash-wrapper {
  max-width: 760px !important;
}

body.alfa-course-screen .wp-block-post-content img {
  display: block !important;
  width: 100% !important;
  max-height: 420px !important;
  margin: 0 0 22px !important;
  object-fit: cover !important;
  object-position: center !important;
  border-bottom: 4px solid var(--alfa-orange) !important;
  box-shadow: 0 12px 28px rgba(13, 31, 49, .15) !important;
}

body.alfa-course-screen .wp-block-post-content h1:not(.wp-block-post-title),
body.alfa-course-screen .learndash-wrapper h1 {
  margin: 0 0 13px !important;
  color: var(--alfa-ink) !important;
  font-size: clamp(1.35rem, 3vw, 2rem) !important;
  font-weight: 900 !important;
  letter-spacing: -.05em !important;
  line-height: 1.04 !important;
}

body.alfa-course-screen .wp-block-post-content p,
body.alfa-course-screen .learndash-wrapper p {
  font-size: .88rem !important;
  line-height: 1.62 !important;
}

body.alfa-course-screen .learndash-wrapper .ld-course-status {
  margin-bottom: 16px !important;
  padding: 14px 16px !important;
}

body.alfa-course-screen .learndash-wrapper .ld-item-list-item > a {
  min-height: 48px !important;
  padding: 13px 15px !important;
}

body.alfa-course-screen .learndash-wrapper .ld-item-name {
  font-size: .8rem !important;
  line-height: 1.25 !important;
}

/* Temario: la tabla nativa pasa a ser una secuencia de entrenamiento. */
body.alfa-course-screen .learndash-wrapper .ld-item-list,
body.alfa-course-screen .learndash-wrapper .ld-table-list {
  overflow: hidden !important;
  margin: 22px 0 0 !important;
  background: #fff !important;
  border: 1px solid var(--alfa-border) !important;
  border-top: 4px solid var(--alfa-cyan) !important;
  border-radius: 0 !important;
  box-shadow: 0 12px 28px rgba(13, 31, 49, .1) !important;
}

body.alfa-course-screen .learndash-wrapper .ld-item-list .ld-section-heading,
body.alfa-course-screen .learndash-wrapper .ld-table-list .ld-table-list-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  min-height: 64px !important;
  margin: 0 !important;
  padding: 16px 18px !important;
  color: #fff !important;
  background: linear-gradient(110deg, var(--alfa-navy), var(--alfa-ink)) !important;
  border: 0 !important;
}

body.alfa-course-screen .learndash-wrapper .ld-item-list .ld-section-heading h2,
body.alfa-course-screen .learndash-wrapper .ld-item-list .ld-section-heading h3,
body.alfa-course-screen .learndash-wrapper .ld-table-list .ld-table-list-header {
  margin: 0 !important;
  color: #fff !important;
  font-size: .72rem !important;
  font-weight: 900 !important;
  letter-spacing: .1em !important;
  line-height: 1.2 !important;
  text-transform: uppercase !important;
}

body.alfa-course-screen .learndash-wrapper .ld-item-list-items,
body.alfa-course-screen .learndash-wrapper .ld-table-list .ld-table-list-items {
  padding: 0 !important;
}

body.alfa-course-screen .learndash-wrapper .ld-item-list-item,
body.alfa-course-screen .learndash-wrapper .ld-table-list-item {
  position: relative !important;
  margin: 0 !important;
  background: #fff !important;
  border: 0 !important;
  border-bottom: 1px solid #e5ebf0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: background .18s ease, transform .18s ease !important;
}

body.alfa-course-screen .learndash-wrapper .ld-item-list-item::before,
body.alfa-course-screen .learndash-wrapper .ld-table-list-item::before {
  position: absolute !important;
  top: 50% !important;
  left: 16px !important;
  display: grid !important;
  width: 25px !important;
  height: 25px !important;
  place-items: center !important;
  color: var(--alfa-navy) !important;
  font-size: .58rem !important;
  font-weight: 900 !important;
  content: counter(alfa-course-step, decimal-leading-zero) !important;
  counter-increment: alfa-course-step !important;
  background: #eaf3f5 !important;
  border: 1px solid rgba(18, 180, 200, .32) !important;
  border-radius: 50% !important;
  transform: translateY(-50%) !important;
}

body.alfa-course-screen .learndash-wrapper .ld-item-list-items,
body.alfa-course-screen .learndash-wrapper .ld-table-list-items {
  counter-reset: alfa-course-step !important;
}

body.alfa-course-screen .learndash-wrapper .ld-item-list-item > a,
body.alfa-course-screen .learndash-wrapper .ld-table-list-item > a {
  display: flex !important;
  min-height: 60px !important;
  align-items: center !important;
  padding: 13px 48px 13px 54px !important;
  color: var(--alfa-ink) !important;
  text-decoration: none !important;
}

body.alfa-course-screen .learndash-wrapper .ld-item-list-item > a::after,
body.alfa-course-screen .learndash-wrapper .ld-table-list-item > a::after {
  position: absolute !important;
  right: 16px !important;
  color: var(--alfa-orange) !important;
  font-size: 1.1rem !important;
  font-weight: 800 !important;
  content: '→' !important;
}

body.alfa-course-screen .learndash-wrapper .ld-item-list-item .ld-item-name,
body.alfa-course-screen .learndash-wrapper .ld-table-list-item .ld-item-name {
  color: var(--alfa-ink) !important;
  font-size: .82rem !important;
  font-weight: 800 !important;
  letter-spacing: -.012em !important;
}

body.alfa-course-screen .learndash-wrapper .ld-item-list-item.ld-is-current-lesson,
body.alfa-course-screen .learndash-wrapper .ld-table-list-item.ld-is-current-lesson {
  background: #eef9f5 !important;
}

body.alfa-course-screen .learndash-wrapper .ld-item-list-item.ld-is-current-lesson::before,
body.alfa-course-screen .learndash-wrapper .ld-table-list-item.ld-is-current-lesson::before {
  color: #fff !important;
  background: var(--alfa-green) !important;
  border-color: var(--alfa-green) !important;
}

body.alfa-course-screen .learndash-wrapper .ld-expand-button {
  min-height: 32px !important;
  padding: 0 10px !important;
  color: #fff !important;
  font-size: .59rem !important;
  font-weight: 900 !important;
  letter-spacing: .07em !important;
  text-transform: uppercase !important;
  background: rgba(255, 255, 255, .14) !important;
  border: 1px solid rgba(255, 255, 255, .3) !important;
  border-radius: 0 !important;
}

@media (hover: hover) {
  body.alfa-course-screen .learndash-wrapper .ld-item-list-item:hover,
  body.alfa-course-screen .learndash-wrapper .ld-table-list-item:hover {
    background: #f5fafb !important;
    transform: translateX(3px) !important;
  }
}

body.alfa-course-screen .alfa-course-back {
  position: fixed;
  z-index: 950;
  top: 78px;
  left: 16px;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 13px;
  color: var(--alfa-navy);
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-decoration: none;
  text-transform: uppercase;
  background: #fff;
  border: 1px solid var(--alfa-border);
  box-shadow: 0 5px 14px rgba(13, 31, 49, .08);
}

body.alfa-course-screen .alfa-course-back span {
  color: var(--alfa-orange);
  font-size: 1.1rem;
  line-height: 1;
}

body.alfa-course-screen .alfa-course-back:hover {
  color: #fff;
  background: var(--alfa-navy);
  border-color: var(--alfa-navy);
}

/* LearnDash no siempre propaga body_class: selectores por estructura real. */
.learndash-wrapper .ld-item-list.ld-lesson-list {
  overflow: hidden !important;
  margin: 22px 0 !important;
  background: #fff !important;
  border: 1px solid var(--alfa-border) !important;
  border-top: 4px solid var(--alfa-cyan) !important;
  border-radius: 0 !important;
  box-shadow: 0 12px 28px rgba(13, 31, 49, .1) !important;
}

.learndash-wrapper .ld-item-list.ld-lesson-list .ld-section-heading {
  display: flex !important;
  min-height: 64px !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 16px 18px !important;
  color: #fff !important;
  background: linear-gradient(110deg, var(--alfa-navy), var(--alfa-ink)) !important;
  border: 0 !important;
}

.learndash-wrapper .ld-item-list.ld-lesson-list .ld-section-heading h2 {
  margin: 0 !important;
  color: #fff !important;
  font-size: .72rem !important;
  font-weight: 900 !important;
  letter-spacing: .1em !important;
  text-transform: uppercase !important;
}

.learndash-wrapper .ld-item-list.ld-lesson-list .ld-item-list-items {
  padding: 0 !important;
  counter-reset: alfa-lesson !important;
}

.learndash-wrapper .ld-item-list.ld-lesson-list .ld-item-list-item {
  position: relative !important;
  margin: 0 !important;
  background: #fff !important;
  border: 0 !important;
  border-bottom: 1px solid #e5ebf0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.learndash-wrapper .ld-item-list.ld-lesson-list .ld-item-list-item::before {
  position: absolute !important;
  top: 50% !important;
  left: 16px !important;
  z-index: 1 !important;
  display: grid !important;
  width: 25px !important;
  height: 25px !important;
  place-items: center !important;
  color: var(--alfa-navy) !important;
  font-size: .58rem !important;
  font-weight: 900 !important;
  content: counter(alfa-lesson, decimal-leading-zero) !important;
  counter-increment: alfa-lesson !important;
  background: #eaf3f5 !important;
  border: 1px solid rgba(18, 180, 200, .32) !important;
  border-radius: 50% !important;
  transform: translateY(-50%) !important;
}

.learndash-wrapper .ld-item-list.ld-lesson-list .ld-item-list-item > a {
  display: flex !important;
  min-height: 60px !important;
  align-items: center !important;
  padding: 13px 48px 13px 54px !important;
  color: var(--alfa-ink) !important;
  text-decoration: none !important;
}

.learndash-wrapper .ld-item-list.ld-lesson-list .ld-item-list-item > a::after {
  position: absolute !important;
  right: 16px !important;
  color: var(--alfa-orange) !important;
  font-size: 1.1rem !important;
  font-weight: 800 !important;
  content: '→' !important;
}

.learndash-wrapper .ld-item-list.ld-lesson-list .ld-item-name {
  color: var(--alfa-ink) !important;
  font-size: .82rem !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
}

.learndash-wrapper .ld-item-list.ld-lesson-list .ld-expand-button {
  min-height: 32px !important;
  padding: 0 10px !important;
  color: #fff !important;
  font-size: .59rem !important;
  font-weight: 900 !important;
  letter-spacing: .07em !important;
  text-transform: uppercase !important;
  background: rgba(255, 255, 255, .14) !important;
  border: 1px solid rgba(255, 255, 255, .3) !important;
  border-radius: 0 !important;
}

.alfa-course-back {
  position: fixed !important;
  z-index: 950 !important;
  top: 78px !important;
  left: 16px !important;
  display: inline-flex !important;
  min-height: 32px !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 0 9px !important;
  color: var(--alfa-navy) !important;
  font-size: .58rem !important;
  font-weight: 900 !important;
  letter-spacing: .07em !important;
  text-decoration: none !important;
  text-transform: uppercase !important;
  background: #fff !important;
  border: 1px solid var(--alfa-border) !important;
  box-shadow: 0 5px 14px rgba(13, 31, 49, .12) !important;
}

.alfa-course-back span { color: var(--alfa-orange) !important; font-size: 1.1rem !important; }

/* Aplicado por el pequeño detector del tema: independiente del markup LD. */
.alfa-syllabus {
  overflow: hidden !important;
  margin: 24px 0 !important;
  background: #fff !important;
  border: 1px solid var(--alfa-border) !important;
  border-top: 4px solid var(--alfa-cyan) !important;
  box-shadow: 0 12px 28px rgba(13, 31, 49, .11) !important;
}

.alfa-syllabus-title,
.alfa-syllabus .alfa-syllabus-title {
  display: flex !important;
  min-height: 64px !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 16px 18px !important;
  color: #fff !important;
  font-size: .72rem !important;
  font-weight: 900 !important;
  letter-spacing: .1em !important;
  text-transform: uppercase !important;
  background: linear-gradient(110deg, var(--alfa-navy), var(--alfa-ink)) !important;
}

.alfa-syllabus .alfa-syllabus-link {
  position: relative !important;
  display: flex !important;
  min-height: 60px !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 13px 48px 13px 54px !important;
  color: var(--alfa-ink) !important;
  font-size: .82rem !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  text-decoration: none !important;
  background: #fff !important;
  border-bottom: 1px solid #e5ebf0 !important;
}

.alfa-syllabus .alfa-syllabus-link::before {
  position: absolute !important;
  top: 50% !important;
  left: 16px !important;
  display: grid !important;
  width: 25px !important;
  height: 25px !important;
  place-items: center !important;
  color: var(--alfa-navy) !important;
  font-size: .58rem !important;
  font-weight: 900 !important;
  content: '•' !important;
  background: #eaf3f5 !important;
  border: 1px solid rgba(18, 180, 200, .32) !important;
  border-radius: 50% !important;
  transform: translateY(-50%) !important;
}

.alfa-syllabus .alfa-syllabus-link::after {
  position: absolute !important;
  right: 16px !important;
  color: var(--alfa-orange) !important;
  font-size: 1.1rem !important;
  font-weight: 900 !important;
  content: '→' !important;
}

.alfa-syllabus .alfa-syllabus-link:hover { background: #f4fafb !important; }

@media (min-width: 1200px) {
  body.alfa-courses-screen .ltv-app-main {
    max-width: 1180px !important;
  }
}

@media (max-width: 980px) {
  body.alfa-courses-screen .ld-course-list-items.row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  body.alfa-courses-screen .ld-course-list-items.row {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }

  body.alfa-courses-screen .ld_course_grid .caption {
    min-height: 138px !important;
    padding: 16px !important;
  }

  body.alfa-course-screen .wp-block-post-content h1:not(.wp-block-post-title),
  body.alfa-course-screen .learndash-wrapper h1 {
    font-size: 1.38rem !important;
  }

  body.alfa-course-screen .wp-block-post-content img {
    max-height: 260px !important;
    margin-bottom: 18px !important;
  }

  body.alfa-course-screen .alfa-course-back {
    top: 72px;
    left: 10px;
    min-height: 34px;
    padding: 0 10px;
    font-size: .58rem;
  }

  body.alfa-course-screen .learndash-wrapper .ld-item-list .ld-section-heading,
  body.alfa-course-screen .learndash-wrapper .ld-table-list .ld-table-list-header {
    min-height: 58px !important;
    padding: 13px 14px !important;
  }

  body.alfa-course-screen .learndash-wrapper .ld-item-list-item::before,
  body.alfa-course-screen .learndash-wrapper .ld-table-list-item::before {
    left: 12px !important;
    width: 23px !important;
    height: 23px !important;
  }

  body.alfa-course-screen .learndash-wrapper .ld-item-list-item > a,
  body.alfa-course-screen .learndash-wrapper .ld-table-list-item > a {
    min-height: 56px !important;
    padding: 12px 39px 12px 45px !important;
  }

  body.alfa-course-screen .learndash-wrapper .ld-item-list-item > a::after,
  body.alfa-course-screen .learndash-wrapper .ld-table-list-item > a::after {
    right: 12px !important;
  }

  .learndash-wrapper .ld-item-list.ld-lesson-list .ld-section-heading {
    min-height: 58px !important;
    padding: 13px 14px !important;
  }

  .learndash-wrapper .ld-item-list.ld-lesson-list .ld-item-list-item::before {
    left: 12px !important;
    width: 23px !important;
    height: 23px !important;
  }

  .learndash-wrapper .ld-item-list.ld-lesson-list .ld-item-list-item > a {
    min-height: 56px !important;
    padding: 12px 39px 12px 45px !important;
  }

  .learndash-wrapper .ld-item-list.ld-lesson-list .ld-item-list-item > a::after {
    right: 12px !important;
  }

  .alfa-course-back {
    top: 72px !important;
    left: 10px !important;
    min-height: 34px !important;
    padding: 0 10px !important;
    font-size: .58rem !important;
  }

  .alfa-syllabus-title,
  .alfa-syllabus .alfa-syllabus-title {
    min-height: 58px !important;
    padding: 13px 14px !important;
  }

  .alfa-syllabus .alfa-syllabus-link {
    min-height: 56px !important;
    padding: 12px 39px 12px 45px !important;
  }

  .alfa-syllabus .alfa-syllabus-link::before { left: 12px !important; width: 23px !important; height: 23px !important; }
  .alfa-syllabus .alfa-syllabus-link::after { right: 12px !important; }
}
