/*
 * Academy frame looks (deriv.com/academy and /{fr,ru,ar,pt,es}/academy only).
 *
 * Linked by components/frontend/RegionStylesheets.tsx on Academy addresses
 * only (ACADEMY_STYLESHEETS in lib/shared/site/academy-section.ts). ROW, EU,
 * UAE and the UAE Academy (/ae/academy) never load this file.
 *
 * Covers the band above the footer (components/frontend/AcademyFooterBand.tsx)
 * and the Academy navbar's differences from the ROW navbar. Numbers are
 * live traders-academy.deriv.com computed styles at 1440, 1024, 768 and 390
 * (2026-11-12, `.slider-2` and the navbar), not guesses.
 * Images: the Academy's Frontify copies (D23), sized here as WebP 1200 wide
 * (scripts/academy/frontify-code.ts; a stylesheet cannot size when drawn).
 */

/* ---------- Band above the footer (live `section.section` > `.slider-2`) ---------- */

.academy-band {
  padding-bottom: 3.25rem;
}

/* On the home only, live wraps the band in a section with its own top
   padding (`section_new-footer-breaker padding-top-md`, read 2026-11-13):
   104px from 992px up, 80px down to 768px, 48px below. Every other Academy
   page has no wrapper: the space there comes from the page's last section. */
html:has([data-raven-path="/academy"]) .academy-band {
  padding-top: 104px;
}

@media screen and (max-width: 991px) {
  html:has([data-raven-path="/academy"]) .academy-band {
    padding-top: 80px;
  }
}

@media screen and (max-width: 767px) {
  html:has([data-raven-path="/academy"]) .academy-band {
    padding-top: 48px;
  }
}

.academy-band__container {
  width: 100%;
  max-width: 83rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.academy-band__slider {
  position: relative;
  height: 550px;
  min-height: 550px;
  /* Every language, Arabic included (live sets it on `.slider-2:lang(ar)`):
     the track always moves right to left. The slides set their own text
     direction below. */
  direction: ltr;
}

.academy-band__mask {
  position: relative;
  height: 100%;
  overflow: hidden;
}

.academy-band__track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.academy-band__slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
  text-align: left;
}

.academy-band__card {
  border-radius: 30px;
  overflow: hidden;
}

.academy-band__panel {
  position: relative;
  min-height: 516px;
  max-height: 516px;
  padding: 135px 0 135px 5vw;
}

.academy-band__panel--dark {
  background-color: #181c25;
}

.academy-band__panel--coral {
  background-color: #ff444f;
}

.academy-band__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 0.9fr 1fr;
  gap: 28px;
  align-items: center;
}

.academy-band__content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1rem;
}

.academy-band__top {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1.5rem;
}

.academy-band__title {
  width: 508px;
  max-width: 508px;
  margin: 0;
  color: #fff;
  font-family: Inter, Arial, sans-serif;
  font-size: 3rem;
  font-weight: 800;
  line-height: 3.5rem;
  letter-spacing: -0.025rem;
  /* A long word (Russian "Присоединяйтесь…") wraps instead of being cut off at 320px (R824-14). */
  overflow-wrap: anywhere;
}

.academy-band__title strong {
  font-weight: 800;
}

.academy-band__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 16px 24px;
  border-radius: 96px;
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 16px;
  letter-spacing: 0.56px;
  text-decoration: none;
  white-space: nowrap;
}

.academy-band__button--white {
  background-color: #fff;
  color: #181c25;
}

.academy-band__button--black {
  background-color: #181c25;
  color: #fff;
}

/* A keyboard ring that shows on both panels (R824-5): dark, white, dark. */
.academy-band__button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 7px #181c25;
}

.academy-band__image {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 0;
  height: 100%;
  background-position: 50%;
  background-repeat: no-repeat;
  background-size: cover;
}

.academy-band__image--tradersview {
  width: 46%;
  background-image: url("https://media.ffycdn.net/eu/deriv/3VdwQV9F8DPGNk4C5Zr5.webp?width=1200&format=webp");
  transform: translate(-5%);
}

.academy-band__image--join {
  width: 50%;
  background-image: url("https://media.ffycdn.net/eu/deriv/bt6wXm3aTzojMm189na2.webp?width=1200&format=webp");
  background-position: 50% 0;
}

.academy-band__dots {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  height: 1.75rem;
  margin: auto;
  /* Live's dots sit 13px below the top of this row: 5px here + 8px inside the button. */
  padding-top: 5px;
}

/* Live's look (owner rule 20): 8px dots, centres 14px apart. Each button is an
   invisible 14 x 24 hit area around its dot (live's dot alone is 8 x 8), so the
   two areas touch but never overlap (R824-2, AF-13). */
.academy-band__dot {
  position: relative;
  width: 14px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.academy-band__dot::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-radius: 100%;
  /* Live's inactive colour, kept by owner rule 20 (AF-13). */
  background-color: #ced0d6;
  transition: background-color 0.1s;
}

.academy-band__dot--active::before {
  background-color: #20242f;
}

.academy-band__dot:focus-visible {
  outline: 2px solid #20242f;
  outline-offset: 0;
}

/* Arabic (live `:lang(ar)` rules): text on the right, panel padding swapped. */
.academy-band:lang(ar) .academy-band__slide {
  text-align: right;
}

.academy-band:lang(ar) .academy-band__panel--dark {
  padding-left: 0;
  padding-right: 24px;
}

.academy-band:lang(ar) .academy-band__panel--coral {
  padding-left: 24px;
  padding-right: 0;
}

.academy-band:lang(ar) .academy-band__top {
  align-items: flex-end;
}

.academy-band:lang(ar) .academy-band__title {
  text-align: right;
}

@media screen and (min-width: 1280px) {
  .academy-band__image--tradersview {
    width: 40%;
    transform: translate(-10%);
  }
}

@media screen and (min-width: 1440px) {
  .academy-band__image--tradersview {
    width: 39%;
  }
}

@media screen and (min-width: 1920px) {
  .academy-band__image--tradersview {
    width: 38%;
  }
}

@media screen and (max-width: 991px) {
  .academy-band__slider {
    height: 850px;
    min-height: 850px;
  }

  .academy-band__panel {
    min-height: 800px;
    max-height: 800px;
    padding: 60px 0 0;
  }

  .academy-band:lang(ar) .academy-band__panel--dark,
  .academy-band:lang(ar) .academy-band__panel--coral {
    padding-left: 0;
    padding-right: 0;
  }

  .academy-band__grid {
    grid-template-columns: 0.7fr;
  }

  .academy-band__top {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .academy-band__title {
    width: 100%;
    max-width: 103%;
    font-size: 2.5rem;
    line-height: 3rem;
  }

  .academy-band__image {
    position: static;
    width: 100%;
    height: 100%;
    min-height: 600px;
    margin-top: 60px;
  }

  .academy-band__image--tradersview {
    width: 100%;
    transform: translateY(-60px);
  }

  .academy-band__image--join {
    width: 100%;
    aspect-ratio: 1;
    background-size: contain;
  }
}

@media screen and (max-width: 767px) {
  .academy-band__grid {
    grid-template-columns: 1fr;
  }

  .academy-band__title {
    font-size: 2rem;
    line-height: 2.5rem;
  }

  .academy-band__content {
    align-items: flex-start;
  }
}

@media screen and (max-width: 479px) {
  .academy-band__container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .academy-band__slider {
    height: 650px;
    min-height: 650px;
  }

  .academy-band__panel {
    min-height: 612px;
    max-height: 612px;
  }

  .academy-band__image {
    min-height: 320px;
  }

  .academy-band__image--tradersview {
    transform: translate(-1%, -24px);
  }

  .academy-band__image--join {
    aspect-ratio: 1;
  }
}

/* ---------- Navbar: where the live Academy navbar differs from the ROW one ---------- */
/* Live `.navbar_main-wrapper`: 20px from the top (ROW 16px), a deeper shadow,
   88% white when scrolled (ROW 96%), a 14px globe and 0.56px button lettering. */

.navbar__pill {
  box-shadow: 0 8px 16px 2px rgba(65, 70, 82, 0.08);
}

.navbar .navbar__lang-globe {
  width: 14px;
  height: 20px;
}

.navbar .button,
.raven-mobile-sticky-oa .button {
  letter-spacing: 0.56px;
}

/* The pill's logo (shown only once scrolled: the design system keeps it at
   max-width 0 before). The design system gives the image 4px bottom padding
   inside a border-box, so a 28px box draws the logo 24px tall (154 x 24), as live. */
.navbar__pill-logo img {
  height: 28px;
}

@media (min-width: 992px) {
  .navbar {
    padding-top: 20px;
    padding-bottom: 12px;
  }

  /* The Academy pill is 88% white once scrolled, in both themes; the design
     system's scrolled rule (two classes) would otherwise keep 96%. */
  .navbar--light.navbar--scrolled .navbar__pill,
  .navbar--dark.navbar--scrolled .navbar__pill {
    background-color: rgba(255, 255, 255, 0.88);
  }
}

/* ---------- Navbar on the pages that open dark ----------
   academyNavbarOpensDark (academy-frame.ts): the home and the Account Security
   pages get the design system's dark theme. Live there (read 2026-11-13 at
   1440 and 1024): at the top, the logo word and Login are white over the dark
   hero, but the links pill stays light with dark text; once scrolled, and on
   phones at any scroll, every mark is dark on white, as on the other pages.
   The design system's dark theme gives the white logo and Login and the
   scrolled look; these rules keep the pill light, and the phone block below
   keeps the phone bar light. */
.navbar--dark .navbar__pill {
  background-color: var(--color-opacity-white-88);
}

.navbar--dark .navbar__nav-item {
  color: var(--color-slate-1200);
}

/* Live's nav link hover, on light and dark navbars alike, at the top and
   once scrolled: 16% grey (rgba 165,165,165,.16; 2026-11-15 preview review).
   The scrolled pair matches the design system's scrolled hover rule
   (.navbar--light.navbar--scrolled …:hover, four classes) and wins by
   coming later. */
.navbar .navbar__nav-item:hover,
.navbar .navbar__nav-item--open,
.navbar.navbar--scrolled .navbar__nav-item:hover,
.navbar.navbar--scrolled .navbar__nav-item--open {
  background-color: rgba(165, 165, 165, 0.16);
}

.navbar--dark .navbar__pill .navbar__lang-globe {
  filter: none;
}

/* Phone and tablet (live collapses the menu at 991px).
   Bar: the logo is drawn at 138.6 x 21.6 and sits 16px from the edges.
   Menu (live `.navbar_menu` open at 390): 14px links in 48px rows, text 16px
   from the edge, 16px around the two buttons, and no Login in the top bar
   while the menu is open. */
@media (max-width: 991px) {
  .navbar__bar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .navbar__logo img {
    height: 21.6px;
  }

  .navbar__drawer-nav {
    padding: 4px 4px 0;
  }

  .navbar__drawer-single,
  .navbar__drawer-lang {
    height: 48px;
    padding: 0 12px;
    font-size: 14px;
    line-height: 20px;
  }

  .navbar__drawer-footer {
    padding: 16px;
  }

  .navbar--menu-open .navbar__mobile-actions > a {
    display: none;
  }

  /* Pages that open dark (above): live's phone bar is white with dark marks
     on every Academy page (once scrolled the design system already paints it
     so). */
  .navbar--dark:not(.navbar--scrolled) .navbar__bar {
    background-color: #fff;
  }

  /* The dark-word logo on the white phone bar: drawn as the image's own
     background (same box, same drawing), while the image's white-word picture
     is moved out of its box. Works in every browser (no content replacement
     on <img>). */
  .navbar--dark .navbar__logo img {
    background: url("/region-looks/academy/academy-logo.svg") center / contain no-repeat;
    object-position: -10000px 0;
  }

  .navbar--dark .navbar__mobile-trigger {
    color: var(--color-slate-1200);
  }

  .navbar--dark .navbar__mobile-actions .white_secondary {
    color: var(--color-slate-1300);
    border-color: var(--color-slate-1300);
  }

  .navbar--dark .navbar__mobile-actions .white_secondary:hover:not(:disabled) {
    background-color: var(--color-opacity-slate-4);
  }

  .navbar--dark .navbar__mobile-actions .white_secondary:active:not(:disabled) {
    background-color: var(--color-opacity-slate-8);
  }
}

/* Arabic: live draws the navbar, its buttons and the phone bar in
   "Inter, Arial" (Arabic letters fall back to Arial), not Noto Sans Arabic. */
.navbar:lang(ar),
.navbar:lang(ar) .button,
.navbar:lang(ar) .navbar__nav-item,
.navbar:lang(ar) .navbar__drawer-single,
.navbar:lang(ar) .navbar__drawer-lang,
.navbar:lang(ar) .navbar__lang-dropdown-item,
.navbar:lang(ar) .navbar__drawer-lang-item,
.raven-mobile-sticky-oa:lang(ar) .button {
  font-family: Inter, Arial, sans-serif;
}

/* ---------- Chat and WhatsApp buttons ----------
   Academy pages are ROW pages, so they get the ROW support buttons from the
   site snippets (#deriv-support-buttons: Intercom chat and WhatsApp on ROW's
   number, the same as live Academy's). Live Academy draws them its own way
   (`.messengers_component`, read 2026-11-13): WhatsApp above chat, 64px white
   circles 16px apart, 24px from the right and the bottom, shown at once on
   wide screens; 48px circles at 767px and below, 16px from the right and
   18px above the bottom (34px at 479px and below). On phones and tablets live waits for the first scroll,
   as the ROW gate does (ROW at 100px, live at about 10px). The ROW lift above
   the phone bar stays. Live shows them on the home, the listings, the course
   pages and the Account Security pages, not on guide, lesson, Gold or
   Security item pages. */
html #deriv-support-buttons {
  right: 24px;
  bottom: 24px;
  z-index: 10;
  flex-direction: column-reverse;
  gap: 16px;
}

html #deriv-support-buttons .deriv-support-btn {
  width: 64px;
  height: 64px;
  border-radius: 96px;
  background: #fff;
  box-shadow: 0 8px 16px 2px rgba(0, 0, 0, 0.02), 0 8px 16px 2px rgba(0, 0, 0, 0.04);
}

html #deriv-support-buttons .deriv-support-btn img {
  width: 28px;
  height: 28px;
}

@media (min-width: 992px) {
  html #deriv-support-buttons {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}

@media (max-width: 767px) {
  html #deriv-support-buttons {
    right: 16px;
    bottom: 18px;
  }

  html #deriv-support-buttons .deriv-support-btn {
    width: 48px;
    height: 48px;
  }

  html #deriv-support-buttons .deriv-support-btn img {
    width: 22px;
    height: 22px;
  }
}

/* At 479px and below live keeps a gap for the phone "Open account" bar: the
   buttons sit 34px above the bottom, and 24px above the bar while it shows
   (the ROW lift would leave 43px). */
@media (max-width: 479px) {
  html #deriv-support-buttons {
    bottom: 34px;
  }

  html[data-raven-sticky-oa] body #deriv-support-buttons {
    transform: translateY(calc(-1 * var(--raven-sticky-oa-h, 72px) + 10px));
  }
}

html:has([data-raven-path^="/academy/trading-guides/"]) #deriv-support-buttons,
html:has([data-raven-path^="/academy/lessons/"]) #deriv-support-buttons,
html:has([data-raven-path^="/academy/gold-masterclass/"]) #deriv-support-buttons,
html:has([data-raven-path^="/academy/security/"]) #deriv-support-buttons {
  display: none;
}
