/*
 * Main body redesign, laid out like the reference course page:
 * hero with a rule under it, a plain-text intro with an offer block,
 * stacked "What you'll learn" cards, an agenda timeline and a trainer card.
 *
 * Loaded after all of the original site CSS. Every rule is scoped under #main,
 * so the header, navigation and footer stay exactly as on extension.aua.am.
 * Fonts are the site's own: Lato for headings (as in the blue title bar) and
 * Fedra Sans Arm for text, which the theme forces on div/li/a with !important.
 */

/* flow-root keeps the breadcrumb's 30px top margin inside #main; otherwise it
   collapses through and leaves a strip of the grey page background under the
   blue title bar. */
#main {
  display: flow-root;
  background: #fff;
}

#main .course {
  --ink: #1d1d1f;
  --text: #3d3d3f;
  --muted: #6e6e73;
  --line: #e5e5e7;
  --heading-font: Lato, Arial, Helvetica, Verdana, sans-serif;
  padding-bottom: 40px;
  color: var(--text);
}

/* The theme forces bullets and margins on every list inside .so-panel with
   !important (site/inline/style-custom.css), so undo that here and space list
   items with gap/padding rather than margins. */
#main .course ul,
#main .course ol,
#main .course li {
  margin: 0 !important;
  padding: 0;
  list-style: none !important;
}

#main .course p {
  margin: 0 0 14px;
  line-height: 26px;
}

#main .course p:last-child {
  margin-bottom: 0;
}

#main .course strong {
  color: var(--ink);
}

#main .course a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

#main .course a:hover {
  color: #295282;
}

/* ---------------------------------------------------------------- sections */

#main .course-section {
  max-width: 820px;
  padding-top: 56px;
}

/* !important: the theme sets h1, h2 { margin-bottom: 0 !important }. */
#main .course-h {
  margin: 0 0 18px !important;
  font-family: var(--heading-font);
  font-size: 30px;
  font-weight: 700;
  line-height: 38px;
  color: var(--ink);
}

/* ---------------------------------------------------------------- hero */

#main .course-hero {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  border-bottom: 3px solid var(--ink);
}

/* Headline at the top, right under the breadcrumb; name at the bottom, on the
   rule. The photo sets the hero's height. */
#main .course-hero__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 8px 0 28px;
}

#main .course-hero__title {
  max-width: 720px;
  margin: 0 0 22px !important;
  font-family: var(--heading-font);
  font-size: 46px;
  font-weight: 700;
  line-height: 54px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}

#main .course .course-hero__trainer {
  margin: 0;
  line-height: 28px;
}

#main .course-hero__name {
  font-family: var(--heading-font);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

#main .course-hero__role {
  margin-left: 8px;
  font-size: 14px;
  color: var(--muted);
}

/* Stands on the rule, like the cut-out portrait in the reference.
   flex-end rather than stretch, so it keeps its proportions. */
#main .course-hero__photo {
  display: block;
  flex: none;
  align-self: flex-end;
  width: 250px;
  height: auto;
}

/* ---------------------------------------------------------------- layout: main column + registration box */

/* The box comes first in the markup so it follows the hero on phones;
   on wider screens it moves to a right-hand column and stays in view. */
#main .course-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  column-gap: 56px;
}

#main .course-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

#main .course-enroll {
  position: sticky;
  top: 24px;
  grid-column: 2;
  grid-row: 1;
  margin-top: 40px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

#main .course .course-enroll__price {
  margin-bottom: 22px;
  font-size: 18px;
  line-height: 30px;
  color: var(--ink);
}

#main .course-enroll__price strong {
  font-size: 26px;
}

#main .course .course-enroll__label {
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

#main .course-enroll__label label {
  margin: 0;
  font: inherit;
  color: inherit;
}

#main .course .course-enroll__dates {
  margin-bottom: 20px;
  font-size: 17px;
  line-height: 26px;
}

#main .course a.course-enroll__button {
  display: block;
  margin-bottom: 30px;
  padding: 14px 16px;
  font-size: 17px;
  line-height: 24px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
}

#main .course a.course-enroll__button:hover,
#main .course a.course-enroll__button:focus-visible {
  color: #fff;
  background: #3a3a3c;
}

#main .course-enroll__form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 5px 5px 5px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

#main .course-enroll__form:focus-within {
  border-color: var(--ink);
}

#main .course-enroll__form input[type="email"] {
  flex: 1;
  min-width: 0;
  height: 40px;
  margin: 0;
  padding: 0;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: 0;
  box-shadow: none;
  outline: none;
}

/* !important on the background: the theme paints every <button> navy with
   !important (site/inline/style-custom.css). */
#main .course-enroll__form button {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 40px;
  margin: 0;
  padding: 0;
  color: #fff;
  background: var(--ink) !important;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

#main .course-enroll__form button:hover,
#main .course-enroll__form button:focus-visible {
  background: #3a3a3c !important;
}

#main .course-enroll__form svg {
  width: 18px;
  height: 18px;
}

/* Mailchimp's bot trap (copied from the footer form): off-screen, never filled. */
#main .course-enroll__trap {
  position: absolute;
  left: -5000px;
}

#main .course .course-enroll__note {
  font-size: 14px;
  line-height: 22px;
  text-align: center;
}

/* ---------------------------------------------------------------- intro */

#main .course .course-label {
  margin: 26px 0 8px;
  font-weight: 700;
  color: var(--ink);
}

/* .course in the selector: it has to outrank the list reset above. */
#main .course .course-bullets {
  display: grid;
  gap: 6px;
  padding: 0 0 14px 18px;
}

#main .course-bullets li {
  position: relative;
  line-height: 25px;
}

#main .course-bullets li::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 10px;
  width: 5px;
  height: 5px;
  background: var(--ink);
  border-radius: 50%;
}

/* ---------------------------------------------------------------- what you'll learn (native <details>, no JS) */

#main .course-modules {
  display: grid;
  gap: 16px;
  padding-top: 10px;
}

#main .course-module {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

#main .course-module summary {
  position: relative;
  padding: 16px 20px 12px 44px;
  font-weight: 700;
  line-height: 24px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

#main .course-module summary::-webkit-details-marker {
  display: none;
}

/* Chevron: points down when open, right when closed. */
#main .course-module summary::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 21px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}

#main .course-module[open] summary::before {
  top: 19px;
  transform: rotate(45deg);
}

#main .course-module summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
  border-radius: 8px;
}

#main .course-module ul {
  display: grid;
  gap: 8px;
  padding: 0 20px 18px 44px;
}

#main .course-module li {
  position: relative;
  font-size: 14px;
  line-height: 22px;
}

/* Hollow bullet, lined up under the chevron. */
#main .course-module li::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 7px;
  box-sizing: border-box;
  width: 7px;
  height: 7px;
  border: 1px solid #b0b0b5;
  border-radius: 50%;
}

/* ---------------------------------------------------------------- agenda timeline */

#main .course .course-timeline {
  padding: 10px 0 0 6px;
}

#main .course-timeline li {
  position: relative;
  padding: 0 0 22px 24px;
  border-left: 1px solid #c7c7cc;
}

#main .course-timeline li:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

/* Small hollow circle centred on the line. */
#main .course-timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 6px;
  box-sizing: border-box;
  width: 9px;
  height: 9px;
  background: #fff;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

#main .course .course-timeline__title {
  margin-bottom: 4px;
  font-weight: 700;
  line-height: 22px;
  color: var(--ink);
}

#main .course-timeline li p {
  font-size: 15px;
}

/* ---------------------------------------------------------------- trainer */

#main .course-trainer {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  padding-top: 10px;
}

#main .course-trainer__side {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 160px;
}

#main .course-trainer__photo {
  display: block;
  width: 160px;
  height: 160px;
  margin-bottom: 8px;
  border-radius: 16px;
  object-fit: cover;
}

#main .course a.course-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 104px;
  height: 36px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#main .course a.course-btn:hover,
#main .course a.course-btn:focus-visible {
  border-color: var(--ink);
}

#main .course a.course-btn--square {
  min-width: 36px;
  width: 36px;
  padding: 0;
}

#main .course-btn svg {
  width: 14px;
  height: 14px;
}

/* The site sets every <i> to 17px !important; this icon sits in a 36px button. */
#main .course-btn i {
  font-size: 15px !important;
  line-height: 1;
}

#main .course-trainer__body {
  flex: 1;
  min-width: 0;
  max-width: 640px;
}

#main .course-trainer__name {
  margin: 0 0 4px;
  font-family: var(--heading-font);
  font-size: 26px;
  font-weight: 700;
  line-height: 34px;
  color: var(--ink);
}

#main .course .course-trainer__role {
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--muted);
}

#main .course-trainer__body p {
  font-size: 15px;
}

#main .course .course-trainer__label {
  margin: 24px 0 10px;
  font-weight: 700;
  color: var(--ink);
}

/* Names in place of logos: grey, bold, spaced like a logo row. */
#main .course-names {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 28px;
}

#main .course-names li {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #8e8e93;
}

/* ---------------------------------------------------------------- responsive */

/* One column: the box sits under the hero and scrolls with the page. */
@media (max-width: 960px) {
  #main .course-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  #main .course-main,
  #main .course-enroll {
    grid-column: 1;
    grid-row: auto;
  }

  #main .course-enroll {
    position: static;
    max-width: 440px;
    margin-top: 32px;
  }
}

@media (max-width: 780px) {
  /* The trainer card shows the photo further down. */
  #main .course-hero__photo {
    display: none;
  }

  #main .course-hero__text {
    padding: 8px 0 24px;
  }

  #main .course-hero__title {
    font-size: 36px;
    line-height: 42px;
  }

  #main .course-hero__role {
    display: block;
    margin: 2px 0 0;
  }

  #main .course-section {
    padding-top: 44px;
  }

  #main .course-h {
    font-size: 26px;
    line-height: 32px;
  }

  #main .course-trainer {
    flex-direction: column;
    gap: 20px;
  }

  /* Photo with the two buttons beside it. */
  #main .course-trainer__side {
    flex-direction: row;
    align-items: flex-end;
    width: auto;
  }

  #main .course-trainer__photo {
    width: 120px;
    height: 120px;
    margin: 0 4px 0 0;
  }
}
