/* Legacy static pages: mobile-only shell and layout corrections.
   Desktop styles intentionally remain untouched. */
.legacy-mobile-toggle,
.legacy-mobile-menu {
  display: none;
}

.mobile-service-break {
  display: inline;
}

@media (min-width: 768px) {
  body.legacy-mobile-page > header.legacy-site-header .nav-item {
    display: flex;
    align-items: center;
  }

  body.legacy-mobile-page > header.legacy-site-header .nav-item > a {
    display: block;
  }
}

@media (max-width: 767px) {
  html.legacy-mobile-root {
    font-size: 100%;
  }

  body.legacy-mobile-page {
    overflow-x: clip;
  }

  body.legacy-mobile-page > header.legacy-site-header {
    min-height: 64px;
    padding: 9px 16px !important;
    box-sizing: border-box;
    flex-wrap: wrap;
    gap: 0;
  }

  body.legacy-mobile-page > header.legacy-site-header > a {
    min-width: 0;
  }

  body.legacy-mobile-page > header.legacy-site-header > a img {
    height: 36px !important;
  }

  body.legacy-mobile-page > header.legacy-site-header > a span {
    font-size: 15px !important;
    white-space: nowrap;
  }

  body.legacy-mobile-page > header.legacy-site-header > nav:not(.legacy-mobile-menu) {
    display: none !important;
  }

  .legacy-mobile-toggle {
    display: inline-flex;
    width: 44px;
    height: 44px;
    margin: -4px -4px -4px auto;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    color: #1e3a5f;
    background: transparent;
    cursor: pointer;
  }

  .legacy-mobile-toggle:focus-visible,
  .legacy-mobile-menu a:focus-visible,
  .legacy-mobile-menu summary:focus-visible {
    outline: 3px solid rgba(192, 128, 16, 0.35);
    outline-offset: 2px;
  }

  .legacy-mobile-toggle svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }

  .legacy-mobile-menu {
    flex: 0 0 calc(100% + 32px);
    margin: 9px -16px -9px;
    padding: 8px 20px 18px;
    box-sizing: border-box;
    background: #fff;
    border-top: 1px solid #f0e8d8;
  }

  .legacy-mobile-menu.is-open {
    display: block;
  }

  .legacy-mobile-menu a,
  .legacy-mobile-menu summary {
    display: block;
    min-height: 44px;
    padding: 12px 4px;
    box-sizing: border-box;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 14px;
    line-height: 20px;
    text-decoration: none;
    cursor: pointer;
  }

  .legacy-mobile-menu details {
    margin: 0;
  }

  .legacy-mobile-menu summary {
    list-style: none;
    position: relative;
    padding-right: 32px;
  }

  .legacy-mobile-menu summary::-webkit-details-marker {
    display: none;
  }

  .legacy-mobile-menu summary::after {
    content: "＋";
    position: absolute;
    top: 12px;
    right: 4px;
    color: #c08010;
    font-weight: 700;
  }

  .legacy-mobile-menu details[open] > summary::after {
    content: "−";
  }

  .legacy-mobile-menu details a {
    padding-left: 20px;
    color: #475569;
  }

  .legacy-mobile-menu .legacy-mobile-cta {
    margin-top: 12px;
    padding: 12px 16px;
    border: 0;
    border-radius: 9999px;
    color: #fff;
    background: #1e3a5f;
    font-weight: 700;
    text-align: center;
  }

  body.legacy-mobile-layout section {
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box;
  }

  body.legacy-mobile-layout [style*="white-space:nowrap"],
  body.legacy-mobile-layout [style*="white-space: nowrap"] {
    white-space: normal !important;
  }

  body.legacy-mobile-layout [style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.legacy-mobile-layout [style*="translateX"] {
    transform: none !important;
  }

  body.legacy-mobile-layout a {
    max-width: 100%;
    box-sizing: border-box;
  }

  body.legacy-mobile-layout div:has(> .stepcol) {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px;
  }

  body.legacy-mobile-layout div:has(> .stepcol) > :not(.stepcol) {
    display: none !important;
  }

  body.legacy-mobile-layout .stepcol {
    flex: 1 1 auto;
    width: 100%;
    padding: 14px 12px;
    box-sizing: border-box;
    border-radius: 12px;
    background: #faf8f3;
  }

  body.legacy-mobile-home {
    --fs-1: 1.8rem;
    --fs-hero-mid: 1.1rem;
    --fs-hero-body: 0.9375rem;
    --fs-hero-lg: 1.25rem;
    --sp-hero-pad-y1: 32px;
    --sp-hero-pad-x: 20px;
    --sp-hero-pad-y2: 24px;
    --sp-gap: 24px;
  }

  body.legacy-mobile-home [style*="grid-template-columns:1.15fr 1fr"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.legacy-mobile-home [style*="height:17.21rem"] {
    height: auto !important;
    margin-top: 0 !important;
    padding: 18px 20px !important;
  }

  body.legacy-mobile-home [style*="display:flex;gap:1rem"] {
    align-items: stretch !important;
  }

  body.legacy-mobile-home [style*="display:flex;gap:1rem"] > a {
    width: 100%;
    min-height: 44px;
    padding: 12px 16px !important;
    line-height: 1.6;
    text-align: center;
  }

  body.legacy-mobile-service {
    --fs-1: 1.65rem;
    --fs-hero-mid: 1.1rem;
    --fs-hero-body: 0.9375rem;
    --fs-hero-lg: 1.25rem;
  }

  body.legacy-mobile-service .mobile-service-break {
    display: block;
    height: 0;
  }

  body.legacy-mobile-service > div:first-of-type > section:first-of-type p {
    text-align: left;
  }

  body.legacy-mobile-service .course-cta-row a {
    min-height: 44px;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  body.legacy-mobile-beginner {
    --fs-hero-body: 0.9375rem;
    --fs-hero-mid: 1.1rem;
    --fs-hero-lg: 1.25rem;
  }

  body.legacy-mobile-beginner div:has(> .thumb-card),
  body.legacy-mobile-elementary div:has(> .thumb-card),
  body.legacy-mobile-intermediate div:has(> .thumb-card) {
    flex-direction: column !important;
    gap: 16px !important;
  }

  body.legacy-mobile-beginner .thumb-card,
  body.legacy-mobile-elementary .thumb-card,
  body.legacy-mobile-intermediate .thumb-card {
    flex: 0 0 auto;
    width: 100%;
  }

  body.legacy-mobile-beginner .thumb-card img,
  body.legacy-mobile-elementary .thumb-card img,
  body.legacy-mobile-intermediate .thumb-card img {
    display: block;
    width: 100% !important;
    max-width: 520px;
    height: auto !important;
  }
}

@media (min-width: 768px) and (max-width: 900px) {
  body.legacy-mobile-home section,
  body.legacy-mobile-service section {
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box;
  }

  body.legacy-mobile-home [style*="white-space:nowrap"],
  body.legacy-mobile-service [style*="white-space:nowrap"] {
    white-space: normal !important;
  }

  body.legacy-mobile-home [style*="grid-template-columns"],
  body.legacy-mobile-service [style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.legacy-mobile-home [style*="translateX"],
  body.legacy-mobile-service [style*="translateX"] {
    transform: none !important;
  }

  body.legacy-mobile-home div:has(> .stepcol),
  body.legacy-mobile-service div:has(> .stepcol) {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px;
  }

  body.legacy-mobile-home div:has(> .stepcol) > :not(.stepcol),
  body.legacy-mobile-service div:has(> .stepcol) > :not(.stepcol) {
    display: none !important;
  }

  body.legacy-mobile-home .stepcol,
  body.legacy-mobile-service .stepcol {
    flex: 1 1 auto !important;
    width: 100%;
    padding: 14px 12px;
    box-sizing: border-box;
    border-radius: 12px;
    background: #faf8f3;
  }
}
