/* ==========================================================================
   Responsive layout
   Type, spacing and most sizes are already fluid (clamp() tokens in style.css);
   this file only changes layout at these breakpoints:
     ≤ 1180  small laptops      ≤ 1024  tablets landscape / header → mobile menu
     ≤ 860   tablets portrait   ≤ 640   phones          ≤ 380  small phones
   ========================================================================== */

/* ---------- Large screens ---------- */
@media (min-width: 1600px) {
  :root { --container: 1320px; }
}

/* ---------- Small laptops ---------- */
@media (max-width: 1180px) {
  .site-header__inner { gap: 1.25rem; }
  .site-logo img, .site-header.is-scrolled .site-logo img { height: 60px; }
  .main-nav > ul { gap: 0; }
  .nav-link { padding-inline: .6rem; }
  .nav-link[aria-current="page"]::after, .is-current > .nav-link::after { left: .75rem; right: .75rem; }
  .has-dropdown .nav-link::after { right: 1.9rem; }
  .value-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-main { grid-template-columns: 1.3fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.5rem 2.5rem; }
  .footer-brand__logo, .footer-brand p { margin: 0; }
  .course-body { grid-template-columns: minmax(0, 1fr) 300px; }
  .apply-layout { grid-template-columns: 1fr 300px; }
}

/* ---------- Header: switch to the mobile menu before the desktop nav gets crowded ---------- */
@media (max-width: 1100px) {
  :root { --header-h: 80px; }
  .main-nav, .header-actions .btn--apply { display: none; }
  .menu-toggle { display: grid; }
  .site-logo img, .site-header.is-scrolled .site-logo img { height: 60px; }
}

/* ---------- Tablet landscape: switch to mobile navigation ---------- */
@media (max-width: 1024px) {
  :root { --header-h: 80px; }
  .main-nav, .header-actions .btn--apply { display: none; }
  .menu-toggle { display: grid; }
  .site-logo img, .site-header.is-scrolled .site-logo img { height: 60px; }
  .site-header__inner { gap: 1rem; }

  .hero__grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .hero__facts { grid-template-columns: repeat(3, 1fr); }
  .hero__badge { left: 1rem; bottom: 1rem; }

  .split__card { right: 1rem; bottom: 1rem; }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-cards { gap: 1rem; }
  .testimonials { grid-template-columns: 1fr 1fr; }
  .testimonials > :last-child { grid-column: 1 / -1; }
  .cta { grid-template-columns: 1fr; }

  .course-hero__grid { grid-template-columns: 1fr 1fr; }
  .course-body, .apply-layout { grid-template-columns: 1fr; }
  .course-body .aside-card, .apply-layout .aside-card { position: static; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .trainer { grid-template-columns: 280px 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .contact-list { grid-template-columns: 1fr 1fr; }
}

/* ---------- Tablet portrait ---------- */
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { max-width: 560px; width: 100%; margin-inline: auto; margin-bottom: 1.75rem; }
  .hero__frame { aspect-ratio: 16 / 11; }
  .hero__badge { left: 50%; bottom: -1.75rem; transform: translateX(-50%); width: max-content; max-width: calc(100% - 2rem); }
  .hero__content { text-align: center; }
  .hero__lead { margin-inline: auto; }
  .hero__actions { justify-content: center; }
  .hero__facts { justify-content: center; text-align: center; }

  .section-head { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .section-head--center { align-items: center; }

  .split { grid-template-columns: 1fr; }
  .split__media { max-width: 600px; width: 100%; margin-inline: auto; }
  .split--media-left .split__media { order: 0; }
  .split__media > img { aspect-ratio: 4 / 3.4; }
  .split__card { position: relative; right: auto; bottom: auto; max-width: none; margin: -3rem 1rem 0; }

  .career-head { grid-template-columns: 1fr; gap: 1.5rem; }
  .stat { justify-self: start; }
  .feature-cards { grid-template-columns: 1fr; }
  .feature-card { display: grid; grid-template-columns: 220px 1fr; }
  .feature-card__img { aspect-ratio: auto; height: 100%; }

  .course-hero__grid { grid-template-columns: 1fr; }
  .gallery { max-width: 560px; }
  .gallery__open img { aspect-ratio: 4 / 3.2; }

  .trainer { grid-template-columns: 1fr; text-align: center; }
  .trainer__photo { width: min(320px, 80%); margin-inline: auto; }
  .trainer .eyebrow, .hero__content .eyebrow, .section-head--center .eyebrow { margin-inline: auto; }

  .footer-main { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-template-columns: 1fr; }
  .footer-brand .socials { justify-content: flex-start; }

  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar__sort select { flex: 1; min-width: 0; }
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  body { font-size: 1rem; }
  /* logo fills the row: the language switch moves into the menu panel (it already has one) */
  .site-header__inner { gap: .75rem; }
  .header-actions .lang-switch { display: none; }
  .site-logo { flex: 1 1 0; }
  .site-logo img, .site-header.is-scrolled .site-logo img { width: 100%; max-width: 280px; height: auto; }
  .eyebrow { font-size: .72rem; letter-spacing: .1em; }
  .hero__content .eyebrow { max-width: 100%; text-align: left; }
  .btn { min-height: 50px; }
  .hero__actions .btn, .cta__actions .btn, .course-summary__actions .btn, .not-found .btn { flex: 1 1 100%; }
  .hero__facts { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .hero__facts strong { font-size: 1.35rem; }
  .hero__badge { padding: 10px 14px 10px 10px; }
  .hero__badge img { width: 48px; height: 48px; }
  .hero__chip { top: 1rem; right: 1rem; }

  .partners__logos img { height: 36px; }
  .course-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  /* swipeable row on phones (home + related trainings) */
  .course-grid--carousel {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(82%, 320px); gap: 1rem;
    margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter) 1.25rem;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .course-grid--carousel::-webkit-scrollbar { display: none; }
  .course-grid--carousel > * { scroll-snap-align: start; }
  .course-grid--carousel .course-card:hover { transform: none; }
  .value-grid { grid-template-columns: 1fr; }
  .feature-card { grid-template-columns: 1fr; }
  .feature-card__img { aspect-ratio: 16 / 9; }
  .testimonials { grid-template-columns: 1fr; }
  .testimonial { padding: 1.6rem; }
  .cta { border-radius: var(--r-lg); }
  .stat { width: 100%; }

  .contact-list { grid-template-columns: 1fr; }
  .form__grid { grid-template-columns: 1fr; }
  .form-card { border-radius: var(--r); }
  .form__submit .btn { width: 100%; }

  .facts { grid-template-columns: 1fr 1fr; }
  .tabs__list { width: 100%; }
  .tabs__tab { flex: 1; }

  /* sticky apply bar on course pages */
  .mobile-buybar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 700;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .75rem var(--gutter) calc(.75rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    box-shadow: 0 -10px 30px -18px rgba(21, 18, 13, .3);
    transform: translateY(110%); transition: transform var(--t);
  }
  .mobile-buybar.is-visible { transform: none; }
  .mobile-buybar strong { display: block; font-size: 1.15rem; line-height: 1.2; color: var(--ink); }
  .mobile-buybar span { display: block; font-size: var(--fs-xs); color: var(--muted); }
  .mobile-buybar .btn { flex: 0 0 auto; }
  .has-buybar .to-top { bottom: 92px; }
  .has-buybar .site-footer { padding-bottom: 76px; }

  .footer-main { grid-template-columns: 1fr; gap: 2.25rem; }
  .footer-partners { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .cookie-notice { flex-direction: column; align-items: stretch; gap: .9rem; }
  .cookie-notice__actions .btn { flex: 1; }
}

/* ---------- Small phones ---------- */
@media (max-width: 380px) {
  :root { --gutter: 1rem; }
  .header-actions { gap: .5rem; }
  .offcanvas__head img { height: 44px; }
  .lang-switch a { min-width: 38px; padding: 0 .5rem; }
  .hero__facts { gap: .5rem; }
  .hero__facts strong { font-size: 1.15rem; }
  .hero__facts span { font-size: .7rem; }
  .hero__badge { gap: 10px; }
  .hero__badge span { display: none; }
  .facts { grid-template-columns: 1fr; }
  .facts li:last-child:nth-child(odd) { grid-column: auto; }
  .mobile-buybar .btn { padding-inline: 1.1em; }
}

/* ---------- Hover-less devices: no lift effects ---------- */
@media (hover: none) {
  .course-card:hover, .testimonial:hover, .value-card:hover, .feature-card:hover, .btn:hover { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .offcanvas, .site-footer, .cookie-notice, .to-top, .mobile-buybar, .map, .cta { display: none !important; }
  .page-header { background: none; color: #000; padding: 0 0 1rem; }
  .page-header h1, .page-header p { color: #000; }
  .page-header::before, .page-header__bg { display: none; }
  .js-reveal [data-reveal] { opacity: 1; transform: none; }
}
