/* ==========================================================================
   Medics Online Academy — Home page (v2 design, "MOA_Website_HomePage_Option_02")
   Used only by lms/templates/index.html. Every rule is scoped to `.moa-home`
   so the chatbot widget and any shared CSS are not affected.
   Header/footer: shared header.html / footer.html (site_header.css, site_footer.css).
   ========================================================================== */

.moa-home {
  --moa-red: #ee343b;
  --moa-red-dark: #c92830;
  --moa-red-soft: #fff0f1;
  --moa-ink: #171717;
  --moa-muted: #555;
  --moa-line: #ededed;
  --moa-container: min(1640px, 85.4167%);
  margin: 0;
  font-family: Montserrat, "Segoe UI", Arial, sans-serif;
  color: var(--moa-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
.moa-home *, .moa-home *::before, .moa-home *::after { box-sizing: border-box; }
html:has(body.moa-home) { scroll-behavior: smooth; }
:where(.moa-home) a { color: inherit; text-decoration: none; }
:where(.moa-home) :is(button, input) { font: inherit; }
:where(.moa-home) button { cursor: pointer; }
:where(.moa-home) img { max-width: 100%; }
.moa-home :focus-visible { outline: 3px solid var(--moa-red); outline-offset: 3px; }
.moa-home .moa-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.moa-container { width: var(--moa-container); margin: 0 auto; }

/* ---------- Buttons ---------- */
.moa-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 28px; border-radius: 5px; border: 1px solid transparent;
  font-size: 13px; font-weight: 650; line-height: 1.2; white-space: nowrap;
  transition: transform .28s ease, box-shadow .28s ease, background-color .25s ease, color .25s ease, border-color .25s ease;
}
.moa-btn--red { background: var(--moa-red); color: #fff !important; }
.moa-btn--outline { background: #fff; color: var(--moa-red) !important; border-color: var(--moa-red); }
.moa-btn--white { background: #fff; color: #111 !important; border-color: var(--moa-red); }
@media (hover: hover) and (pointer: fine) {
  .moa-btn:hover { transform: translateY(-3px); box-shadow: 0 7px 17px rgba(238, 52, 59, .17); }
  .moa-btn--red:hover { background: #d9202b; }
  .moa-btn--outline:hover, .moa-btn--white:hover { background: var(--moa-red); color: #fff !important; }
}
.moa-btn--white:focus-visible, .moa-btn--outline:focus-visible { background: var(--moa-red); color: #fff !important; }

/* ==========================================================================
   Hero carousel
   Three slides: brand slide (photo + live tagline + Watch Video CTA) and
   course promo posters (artwork + live Enroll Now CTA). Overlay positions are
   percentages of the slide so they track the artwork at every width.
   ========================================================================== */
.moa-hero-carousel { position: relative; width: 100%; overflow: hidden; background: #f7f8f8; }
.moa-hero-carousel__track { display: grid; width: 100%; aspect-ratio: 1920 / 717; }
.moa-hero-carousel__slide {
  position: relative; grid-area: 1 / 1; min-width: 0;
  opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility 0s linear .6s;
}
.moa-hero-carousel__slide.is-active { opacity: 1; visibility: visible; z-index: 1; transition: opacity .6s ease, visibility 0s; }
.moa-hero-carousel__image { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Brand slide overlays, aligned with the header logo */
.moa-hero-carousel__brand-art {
  position: absolute; left: 7.29165%; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 33.6%; height: auto; max-height: 64%; object-fit: contain;
}
.moa-hero-carousel__tagline {
  position: absolute; left: 7.29165%; top: 64%; z-index: 3; margin: 0;
  white-space: nowrap; font-size: clamp(8px, 1vw, 15px); line-height: 1.4;
  font-weight: 800; letter-spacing: -.015em; color: #101010;
}
.moa-hero-carousel__tagline strong { font-weight: 800; color: var(--moa-red); }

/* Slide CTAs */
.moa-hero-carousel__cta {
  position: absolute; z-index: 4; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px; background: var(--moa-red); color: #fff !important; font-weight: 700; line-height: 1.2;
  text-decoration: none !important; transition: background-color .2s ease, transform .2s ease;
}
.moa-hero-carousel__cta--watch {
  left: 7.29165%; top: 83%; gap: 8px; padding: 10.4px 20px;
  font-size: clamp(9.6px, .92vw, 13.6px); box-shadow: 0 5px 15px rgba(238, 52, 59, .18);
}
.moa-hero-carousel__cta--enroll {
  left: 7.3%; top: 82%; gap: 8px; padding: clamp(5px, .55vw, 10px) clamp(11px, 1.2vw, 22px);
  font-size: clamp(10px, .9vw, 16px); box-shadow: 0 3px 12px rgba(0, 0, 0, .13);
}
.moa-hero-carousel__slide:nth-child(2) .moa-hero-carousel__cta--enroll { top: 83%; }
.moa-hero-carousel__cta:focus-visible { transform: translateY(-3px); }
.moa-hero-carousel__cta--watch:focus-visible { background: #c8222a; transform: translateY(-2px); }
@media (hover: hover) {
  .moa-hero-carousel__cta--enroll:hover { transform: translateY(-3px); }
  .moa-hero-carousel__cta--watch:hover { background: #c8222a; transform: translateY(-2px); }
}

/* Arrows */
.moa-hero-carousel__arrow {
  position: absolute; top: 50%; z-index: 8; transform: translateY(-50%);
  width: 43px; height: 52px; padding: 0; border: 0; border-radius: 4px;
  background: rgba(255, 255, 255, .82); color: var(--moa-red); font-size: 27px; line-height: 1;
  cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .13); transition: background-color .2s ease, color .2s ease;
}
.moa-hero-carousel__arrow--prev { left: 12px; }
.moa-hero-carousel__arrow--next { right: 12px; }
.moa-hero-carousel__arrow:focus-visible { background: var(--moa-red); color: #fff; }
@media (hover: hover) { .moa-hero-carousel__arrow:hover { background: var(--moa-red); color: #fff; } }

/* Dots: 10px visual, larger invisible tap target */
.moa-hero-carousel__dots {
  position: absolute; bottom: 12px; left: 50%; z-index: 8; transform: translateX(-50%);
  display: flex; gap: 9px;
}
.moa-hero-carousel__dots button {
  position: relative; width: 10px; height: 10px; padding: 0; border: 1px solid var(--moa-red);
  border-radius: 50%; background: #fff; cursor: pointer;
}
.moa-hero-carousel__dots button::before { content: ""; position: absolute; inset: -8px -4px; }
.moa-hero-carousel__dots button.is-active { background: var(--moa-red); }

@media (max-width: 760px) {
  .moa-hero-carousel__brand-art,
  .moa-hero-carousel__tagline,
  .moa-hero-carousel__cta--watch { left: 4%; }
}
@media (max-width: 650px) {
  .moa-hero-carousel__brand-art { width: 36%; max-height: 68%; }
  .moa-hero-carousel__tagline { top: 63%; font-size: clamp(5px, 1.15vw, 8px); }
  .moa-hero-carousel__cta { border-radius: 3px; }
  .moa-hero-carousel__cta--watch { top: 85%; gap: 4px; padding: 5.6px 8px; font-size: clamp(7.2px, 1.6vw, 9.6px); }
  .moa-hero-carousel__cta--enroll { left: 7%; top: 79%; gap: 3px; padding: 4px 7px; font-size: 8px; }
  .moa-hero-carousel__slide:nth-child(2) .moa-hero-carousel__cta--enroll { top: 80%; }
  /* Arrows would cover the slide copy on phones; swipe and dots are used instead. */
  .moa-hero-carousel__arrow { display: none; }
  .moa-hero-carousel__dots { bottom: 5px; }
  .moa-hero-carousel__dots button { width: 7px; height: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .moa-hero-carousel__slide, .moa-hero-carousel__slide.is-active { transition: none; }
}

/* ==========================================================================
   Shared section scaffolding
   ========================================================================== */
.moa-section { padding: 36px 0; text-align: center; }
.moa-heading {
  margin: 0 0 7px; font-size: clamp(23px, 2.2vw, 32px); line-height: 1.25;
  font-weight: 800; letter-spacing: .5px; color: var(--moa-red);
}
.moa-intro { margin: 0 0 25px; font-size: clamp(14px, 1.05vw, 16px); line-height: 1.55; }
.moa-after-grid { margin: 20px 0 14px; }

/* ---------- Explore courses your way (specialties) ---------- */
.moa-pathway {
  margin-top: 0; padding: 34px 6%; border-radius: 14px;
  background: #eee; color: #111; text-align: center;
}
.moa-pathway__eyebrow { display: block; font-size: 20px; font-weight: 600; }
.moa-pathway h2 { margin: 4px 0; font-size: clamp(23px, 2.2vw, 32px); line-height: 1.25; font-weight: 800; }
.moa-pathway > p { margin: 0 0 25px; font-size: clamp(14px, 1.05vw, 16px); line-height: 1.55; }
.moa-specialty-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-bottom: 20px; }
.moa-specialty-grid a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  min-height: 205px; padding: 25px 10px; border-radius: 9px; background: #fff;
  color: #161616; font-weight: 650;
  transition: transform 480ms cubic-bezier(.22, 1, .36, 1), box-shadow 480ms cubic-bezier(.22, 1, .36, 1);
}
.moa-specialty-grid img { display: block; width: 72px; height: 72px; object-fit: contain; }
@media (hover: hover) {
  .moa-specialty-grid a:hover { transform: translate3d(0, -7px, 0) scale(1.025); box-shadow: 0 18px 32px rgba(60, 20, 20, .18); }
}

/* ---------- Course levels ---------- */
.moa-levels { padding: 37px 0 26px; text-align: center; }
.moa-levels h2 { margin: 0; font-size: clamp(23px, 2.2vw, 32px); line-height: 1.25; font-weight: 800; }
.moa-levels > p { margin: 5px 0 22px; font-size: clamp(14px, 1.05vw, 16px); }
.moa-level-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.moa-level-links a {
  flex: 1 1 0; min-width: 160px; padding: 10px 6px; border: 1px solid var(--moa-red); border-radius: 4px;
  color: #333; transition: background-color .25s ease, color .25s ease, transform .28s ease;
}
.moa-level-links a:hover, .moa-level-links a:focus-visible { background: var(--moa-red); color: #fff; transform: translateY(-2px); }

/* ---------- Image cards (courses, cases, surgery) ---------- */
.moa-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.moa-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  aspect-ratio: 399 / 465; overflow: hidden; isolation: isolate;
  border-radius: 15px; background: #27343d; color: #fff; text-align: left;
  transition: transform .28s ease, box-shadow .28s ease;
}
.moa-card > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
@media (hover: hover) {
  .moa-card:hover { transform: translateY(-5px); box-shadow: 0 12px 25px rgba(0, 0, 0, .19); }
}

/* Course cards: live text over the course image */
.moa-course-card { border: 1px solid #b4202a; }
.moa-course-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, .28), transparent 32%, rgba(0, 0, 0, .15) 52%, rgba(0, 0, 0, .82) 100%);
}
.moa-course-card::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 52%; z-index: -1;
  background: linear-gradient(to top, rgba(135, 8, 23, .97) 0%, rgba(169, 15, 32, .9) 60%, rgba(200, 29, 42, 0) 100%);
  opacity: 0; transform: translateY(18%); transition: opacity .28s ease, transform .28s ease;
}
.moa-course-card:hover::before, .moa-course-card:focus-within::before { opacity: 1; transform: translateY(0); }
.moa-card-label {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 12px;
  border-radius: 15px; background: #ed3b40; color: #fff; font-size: 12px; font-weight: 700;
  transform-origin: left center; transition: transform .25s ease, box-shadow .25s ease;
}
.moa-card:hover .moa-card-label { transform: scale(1.075); box-shadow: 0 3px 12px rgba(238, 52, 59, .42); }
.moa-card-body { padding: 0 16px 14px; text-align: center; }
.moa-card-body h3 {
  margin: 0 0 4px; font-size: clamp(14px, 1.2vw, 19px); line-height: 1.25; font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.moa-card-body h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card clickable */
.moa-card-body h3 a:focus-visible { outline: none; }
.moa-card:has(h3 a:focus-visible) { outline: 3px solid var(--moa-red); outline-offset: 3px; }
.moa-card-cpd { margin: 0; font-size: clamp(12px, .95vw, 15px); opacity: .95; }
.moa-card-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 22px; font-size: clamp(11px, .85vw, 14px); font-weight: 500;
}
.moa-card-explore { display: inline-flex; align-items: center; gap: 4px; }
.moa-card-rating { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.moa-card-rating svg { width: 15px; height: 15px; color: #fbbf24; }

/* Case discussion / surgery cards: curated artwork already includes titles */
.moa-media-card::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 48%; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(135, 8, 23, 1) 0%, rgba(169, 15, 32, .98) 62%, rgba(200, 29, 42, 0) 100%);
  mix-blend-mode: color; opacity: 0; transform: translateY(18%); transition: opacity .28s ease, transform .28s ease;
}
.moa-media-card:hover::before, .moa-media-card:focus-visible::before { opacity: 1; transform: translateY(0); }
.moa-media-card > img { object-fit: fill; }

/* ---------- Why learn with us ---------- */
.moa-feature-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 30px auto; }
.moa-feature-grid article {
  flex: 0 0 calc((100% - 32px) / 3); min-height: 230px; padding: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid var(--moa-red); border-radius: 9px; text-align: center;
  transition: transform .28s ease, box-shadow .28s ease;
}
.moa-feature-grid img { display: block; width: 82px; height: 82px; object-fit: contain; }
.moa-feature-grid h3 { margin: 12px 0 7px; font-size: 17px; }
.moa-feature-grid p { margin: 0; font-size: 14px; line-height: 1.5; }
@media (hover: hover) {
  .moa-feature-grid article:hover { transform: translateY(-5px); box-shadow: 0 12px 24px rgba(0, 0, 0, .12); }
}

/* ---------- Medical experts ---------- */
.moa-expert-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 26px auto; }
.moa-expert-grid article[hidden] { display: none; }
.moa-expert-grid article {
  position: relative; display: flex; flex-direction: column; min-width: 0; padding: 16px;
  border: 1px solid var(--moa-line); border-radius: 22px; overflow: hidden; text-align: center;
  background: #fff; box-shadow: 0 3px 12px rgba(0, 0, 0, .04);
  transition: border-color .22s ease, box-shadow .22s ease, transform .28s ease;
}
.moa-expert-grid article:nth-child(4n+1) { background: linear-gradient(155deg, #e8f4ff 0%, #f3f9ff 58%, #fff 100%); }
.moa-expert-grid article:nth-child(4n+2) { background: linear-gradient(155deg, #fff0f3 0%, #fff8fa 58%, #fff 100%); }
.moa-expert-grid article:nth-child(4n+3) { background: linear-gradient(155deg, #eaf8f6 0%, #f5fbfa 58%, #fff 100%); }
.moa-expert-grid article:nth-child(4n+4) { background: linear-gradient(155deg, #f3efff 0%, #faf8ff 58%, #fff 100%); }
.moa-expert-grid article:hover, .moa-expert-grid article:focus-within {
  border-color: var(--moa-red); box-shadow: 0 4px 15px rgba(238, 52, 59, .12); transform: translateY(-5px);
}
.moa-expert-grid img {
  display: block; width: 100%; height: 240px; object-fit: contain; object-position: center bottom;
  border-radius: 12px; mix-blend-mode: multiply;
}
.moa-expert-grid h3 { margin: 14px 0 5px; font-size: 16px; line-height: 1.25; color: #161616; }
.moa-expert-grid p {
  flex: 1; margin: 0; font-size: 12px; line-height: 1.4; color: #333;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.moa-expert-grid article a { display: block; margin-top: 12px; font-size: 11px; font-weight: 600; text-align: right; color: #333; }
.moa-expert-grid article a::after { content: ""; position: absolute; inset: 0; }
.moa-expert-grid article:hover a { color: var(--moa-red); }

/* ---------- FAQ ---------- */
.moa-faq details {
  margin: 14px 0; border: 1px solid #bbb; border-radius: 5px; background: #fff; text-align: left;
  transition: background-color .2s ease, border-color .2s ease;
}
.moa-faq details[open], .moa-faq details:focus-within { border-color: var(--moa-red); }
.moa-faq summary { padding: 18px; font-weight: 650; list-style: none; cursor: pointer; }
.moa-faq summary::-webkit-details-marker { display: none; }
.moa-faq summary::before { content: "\25B6"; margin-right: 14px; color: var(--moa-red); }
.moa-faq details[open] summary::before { content: "\25BC"; }
.moa-faq details p { margin: 0; padding: 0 18px 18px 45px; line-height: 1.6; color: var(--moa-muted); }
.moa-faq details p a { color: var(--moa-red); font-weight: 600; }
@media (hover: hover) { .moa-faq details:hover { background: #fff0f0; border-color: var(--moa-red); } }

/* ---------- Floating quick-access icons ---------- */
.moa-floating {
  position: fixed; right: 26px; bottom: 10%; z-index: 90; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.moa-floating__icon {
  display: flex; align-items: center; justify-content: center;
  width: 84px; height: 84px; padding: 4px; border: 2px solid transparent; border-radius: 50%; background: #fff;
  transition: border-color .22s ease, box-shadow .22s ease, transform .25s ease;
}
.moa-floating__icon img { display: block; width: 72px; height: 72px; object-fit: contain; border-radius: 50%; transition: transform .28s ease; }
button.moa-floating__icon { border-color: transparent; }
.moa-floating__icon--green:hover, .moa-floating__icon--green:focus-visible { border-color: #16bb52; box-shadow: 0 0 0 3px rgba(22, 187, 82, .12); transform: translateY(-3px); }
.moa-floating__icon--red:hover, .moa-floating__icon--red:focus-visible { border-color: var(--moa-red); box-shadow: 0 0 0 3px rgba(238, 52, 59, .12); transform: translateY(-3px); }
.moa-floating__icon:hover img { transform: scale(1.06) rotate(3deg); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1050px) {
  .moa-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .moa-feature-grid article { flex-basis: calc((100% - 16px) / 2); }
  .moa-expert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .moa-container { width: 92%; }
  .moa-section { padding: 28px 0; }
  .moa-levels { padding: 30px 0 22px; }
  .moa-pathway { padding: 26px 18px; }
  .moa-pathway__eyebrow { font-size: 16px; }
  .moa-specialty-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .moa-specialty-grid a { min-height: 140px; padding: 15px 5px; font-size: 13px; }
  .moa-level-links a { flex-basis: calc(50% - 6px); min-width: 0; }
  .moa-card-grid { gap: 12px; }
  .moa-card-body { padding: 0 9px 10px; }
  .moa-card-meta { margin-top: 12px; }
  .moa-feature-grid article { flex-basis: 100%; min-height: 210px; }
  .moa-floating { right: 8px; gap: 8px; }
  .moa-floating__icon { width: 60px; height: 60px; padding: 3px; }
  .moa-floating__icon img { width: 50px; height: 50px; }
}
@media (max-width: 550px) {
  .moa-expert-grid { grid-template-columns: 1fr; max-width: 370px; }
}
@media (max-width: 450px) {
  .moa-card-grid { gap: 10px; }
  .moa-card { border-radius: 13px; }
  .moa-card-label { top: 7px; left: 7px; height: 22px; padding: 0 8px; font-size: 10px; }
  .moa-card-body { padding: 0 6px 8px; }
  .moa-card-body h3 { font-size: 12px; }
  .moa-card-cpd { font-size: 10px; }
  .moa-card-meta { margin-top: 8px; font-size: 9px; }
  .moa-card-rating svg { width: 11px; height: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  html:has(body.moa-home) { scroll-behavior: auto; }
  .moa-home *, .moa-home *::before, .moa-home *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
