/* ============================================================
   CT Dell Futshow — production overrides
   Responsividade, estabilidade mobile, acessibilidade e performance.
   ============================================================ */

html,
body,
button,
input,
select,
textarea {
  font-family: "Ubuntu", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Do not mask layout bugs with global horizontal clipping. */
body {
  overflow-x: visible;
}

html,
body,
.shell,
main,
section,
.container {
  min-width: 0;
}

.shell {
  min-height: 100svh;
}

.hero-bottom > *,
.section-grid > *,
.training-board > *,
.community-grid > *,
.plans-grid > *,
.schedule-grid > *,
.gallery-head > *,
.gallery-grid > *,
.quick-item,
.step,
.row > *,
.plan-head > *,
.footer-top > * {
  min-width: 0;
}

img,
svg,
video,
iframe {
  max-width: 100%;
}

/* Header is intentionally always white in both themes. */
.header,
[data-theme="dark"] .header {
  background: #fff;
  color: #111;
  border-bottom-color: #e9e9e7;
}
[data-theme="dark"] .header .brand strong { color: #111; }
[data-theme="dark"] .header .brand small { color: #777; }
[data-theme="dark"] .header .navlinks a { color: #3e3e3e; }
[data-theme="dark"] .header .social-btn,
[data-theme="dark"] .header .theme-btn,
[data-theme="dark"] .header .menu-label {
  background: #fff;
  border-color: #ddd;
  color: #111;
}
[data-theme="dark"] .header .whatsapp {
  background: #111;
  border-color: #111;
  color: #fff;
}
[data-theme="dark"] .header .whatsapp:hover { background: #2a2a2a; }
[data-theme="dark"] .navlinks {
  background: #fff;
  color: #111;
  border-color: #e5e5e5;
}

/* Keep the original logo artwork; only size/crop treatment changes. */
.header .brand img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}
.footer-brand img {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  clip-path: circle(50% at 50% 50%);
  object-fit: cover;
  object-position: center;
  background: #fff;
}

.contact-row {
  margin: 0;
  font-style: normal;
}

.developer-credit a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Keyboard focus must remain clearly visible. */
a:focus-visible,
button:focus-visible,
.plan-tab:focus-within {
  outline: 3px solid rgba(224, 58, 62, .55);
  outline-offset: 3px;
}

/* Preserve the existing large-desktop composition only where viewport height
   is stable enough to make a full-height section intentional. */
@media (min-width: 821px) {
  .training,
  .method,
  .community,
  .plans,
  .schedule,
  .real-gallery,
  .final {
    min-height: calc(100svh - var(--header));
    display: flex;
    align-items: center;
  }
  .training,
  .method,
  .community,
  .plans,
  .schedule,
  .final {
    padding-top: clamp(30px, 5vh, 58px);
    padding-bottom: clamp(30px, 5vh, 58px);
  }
  .real-gallery { padding: clamp(28px, 4.5vh, 52px) 0; }
}

/* Gallery uses the local, semantic <img> sources from the HTML. This avoids
   swapping the image through CSS after first paint and improves stability. */
.real-gallery {
  padding: clamp(36px, 5vw, 76px) 0;
}
.gallery-head { margin-bottom: clamp(14px, 2.2vh, 22px); }
.gallery-grid { align-items: stretch; }
.gallery-main,
.gallery-side {
  min-height: 0;
  height: clamp(300px, 43vh, 430px);
}
.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-main img { object-position: center 42%; }
.gallery-side img { object-position: center center; }

/* Experimental lesson section keeps its approved image and copy. */
.final-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: min(68vh, 540px);
  background:
    linear-gradient(90deg, rgba(7,7,7,.92), rgba(7,7,7,.58) 60%, rgba(7,7,7,.16)),
    url("../img/aula-experimental.jpg") center 45% / cover no-repeat;
}
.final-card::after { display: none; }
.final-card .final-photo-bg { display: none !important; }

/* Medium desktop / tablet landscape: collapse navigation before it collides. */
@media (max-width: 1024px) {
  .header .brand img {
    width: 52px;
    height: 52px;
  }
  .navlinks {
    gap: 14px;
    font-size: .76rem;
  }
}

@media (max-width: 900px) {
  .navlinks {
    display: none;
    position: absolute;
    top: var(--header);
    left: 10px;
    right: 10px;
    width: auto;
    max-width: calc(100% - 20px);
    background: #fff;
    color: #111;
    border: 1px solid #e5e5e5;
    border-radius: 0 0 17px 17px;
    padding: 8px 18px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    box-shadow: 0 16px 35px rgba(0,0,0,.14);
  }
  .navlinks.open { display: flex; }
  .navlinks a {
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  .menu-label { display: flex; min-height: 44px; }
  .desktop-contact { display: none; }
}

@media (max-width: 820px) {
  /* Manual touch scrolling stays fully native on mobile/tablet. */
  html { scroll-behavior: auto; }

  .training,
  .method,
  .community,
  .real-gallery,
  .plans,
  .schedule,
  .final {
    min-height: auto;
    display: block;
    align-items: initial;
  }

  .training,
  .method,
  .community,
  .plans,
  .schedule {
    padding-top: 56px;
    padding-bottom: 56px;
  }
  .real-gallery,
  .final { padding-top: 48px; padding-bottom: 48px; }

  .gallery-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
    gap: 8px;
  }
  .gallery-main,
  .gallery-side {
    height: clamp(250px, 34vh, 330px);
  }

  .theme-btn.clean,
  .menu-label,
  .plan-tab,
  .plan-cta,
  .pill,
  .contact-chip {
    min-height: 44px;
  }

  .plan-tab {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  :root { --header: 64px; }

  .container {
    width: calc(100% - 32px);
    max-width: var(--max);
  }

  .header .brand img {
    width: 46px;
    height: 46px;
  }
  .brand strong { font-size: .78rem; }
  .brand small { font-size: .44rem; }
  .header-contacts { flex: 0 0 auto; }
  .theme-btn.clean,
  .menu-label {
    min-width: 44px;
    height: 44px;
  }

  .hero {
    min-height: calc(100svh - var(--header));
    min-height: calc(100dvh - var(--header));
    background-position: 56% center;
  }
  .hero-inner {
    width: calc(100% - 32px);
    padding: clamp(28px, 7vh, 52px) 0 30px;
  }
  .eyebrow {
    font-size: .68rem;
    line-height: 1.4;
    letter-spacing: .11em;
  }
  .hero h1 {
    max-width: 9.5em;
    font-size: clamp(2.45rem, 12vw, 3.65rem);
    line-height: .95;
    overflow-wrap: normal;
    word-break: normal;
  }
  .hero-bottom {
    margin-top: 20px;
    gap: 18px;
  }
  .hero-bottom p {
    max-width: 42ch;
    font-size: .9rem;
    line-height: 1.55;
  }
  .actions {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .btn {
    min-height: 46px;
    padding: 10px 14px;
    font-size: .78rem;
  }
  .hero-mini {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .mini-stat {
    padding: 10px 8px;
  }
  .mini-stat strong { font-size: .95rem; }
  .mini-stat span { font-size: .55rem; line-height: 1.3; }

  .training,
  .method,
  .community,
  .plans,
  .schedule,
  .real-gallery,
  .final {
    min-height: auto;
    padding-top: 44px;
    padding-bottom: 44px;
  }

  .sticky h2,
  .plans-title h2,
  .schedule-copy h2,
  .community-copy h2,
  .method-head h2,
  .gallery-head h2 {
    max-width: 11em;
    font-size: clamp(2rem, 9.5vw, 2.9rem);
    line-height: .96;
  }
  .sticky p,
  .plans-title p,
  .schedule-copy p,
  .community-copy p,
  .method-head p,
  .gallery-head p {
    font-size: .88rem;
    line-height: 1.55;
  }

  .quick-grid,
  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quick-item,
  .quick-item:not(:first-child) {
    padding: 16px 10px;
  }
  .quick-item:nth-child(odd) { padding-left: 0; }
  .quick-item:nth-child(even) { padding-right: 0; }
  .qtop { font-size: .64rem; }
  .quick-item strong { font-size: .84rem; line-height: 1.25; }
  .quick-item span { font-size: .73rem; line-height: 1.35; }

  .step,
  .step:not(:first-child) { padding: 16px 10px; }
  .step:nth-child(odd) { padding-left: 0; }
  .step:nth-child(even) { padding-right: 0; }
  .step small { font-size: .61rem; }
  .step strong { font-size: 1.12rem; }
  .step span { font-size: .75rem; line-height: 1.4; }

  .photo-card,
  .community-photo {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .focus-list { padding-inline: 14px; }
  .focus { grid-template-columns: 46px minmax(0, 1fr); gap: 9px; }
  .focus h3 { font-size: 1.03rem; }
  .focus p { font-size: .77rem; line-height: 1.45; }
  .fact { font-size: .78rem; }

  .gallery-head { gap: 10px; }
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .gallery-main,
  .gallery-side {
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
  .gallery-grid figcaption {
    left: 10px;
    bottom: 10px;
    max-width: calc(100% - 20px);
    font-size: .67rem;
  }

  .plan-tabs {
    gap: 4px;
    padding: 4px;
  }
  .plan-tab { padding: 9px 5px; }
  .plan-tab strong { font-size: .76rem; line-height: 1.25; }
  .plan-tab small { font-size: .66rem; line-height: 1.3; }
  .plan-panel { padding: 17px; }
  .plan-head h3 { font-size: 1.35rem; }
  .plan-head h3 small { font-size: .65rem; }
  .badge { font-size: .58rem !important; }
  .benefit { font-size: .77rem; line-height: 1.45; }
  .plan-cta { min-height: 46px; font-size: .78rem; }
  .plan-note { font-size: .7rem; line-height: 1.45; }

  .schedule-table { padding: 5px 12px; }
  .row {
    grid-template-columns: 76px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 0;
    font-size: .75rem;
  }
  .pill {
    min-width: 68px;
    padding: 8px 9px;
    font-size: .58rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .final-card {
    min-height: 520px;
    background-position: 58% center;
  }
  .final-copy { padding: 28px 22px; }
  .final-copy h2 {
    font-size: clamp(2.25rem, 10.5vw, 3.2rem);
    overflow-wrap: normal;
  }
  .final-copy p { font-size: .86rem; }

  .contact-row {
    width: 100%;
    justify-content: flex-start;
  }
  .contact-chip {
    font-size: .7rem;
    padding: 9px 11px;
  }
  .footer-bottom { line-height: 1.4; }
}

@media (max-width: 430px) {
  .container,
  .hero-inner { width: calc(100% - 28px); }

  .brand { gap: 7px; }
  .header .brand img {
    width: 42px;
    height: 42px;
  }
  .brand strong { font-size: .72rem; }
  .brand small { display: none; }
  .menu-label { padding-inline: 10px; font-size: .74rem; }

  .hero h1 { font-size: clamp(2.2rem, 11.5vw, 2.9rem); }

  .plan-head { align-items: flex-start; }
  .schedule-table { padding-inline: 10px; }
  .row {
    grid-template-columns: 70px minmax(0, 1fr) auto;
    gap: 6px;
  }

  .contact-chip {
    flex: 1 1 100%;
    width: 100%;
  }
}

@media (max-width: 360px) {
  .container,
  .hero-inner { width: calc(100% - 24px); }
  .header-contacts { gap: 3px; }
  .theme-btn.clean { min-width: 42px; width: 42px; }
  .menu-label { min-width: 42px; height: 42px; padding-inline: 7px; }

  .hero h1 { font-size: 2.2rem; }
  .quick-grid,
  .timeline { grid-template-columns: 1fr; }

  .quick-item,
  .quick-item:not(:first-child),
  .step,
  .step:not(:first-child) {
    padding: 14px 0;
    border-right: 0;
  }
  .quick-item { border-bottom: 1px solid var(--line); }
  .quick-item:last-child { border-bottom: 0; }
  .step { border-bottom: 1px solid #343936; }
  .step:last-child { border-bottom: 0; }

  .plan-tabs { grid-template-columns: 1fr; }
  .plan-tab { min-height: 50px; }
  .plan-head { flex-direction: column; }
  .badge { align-self: flex-start; }

  .row {
    grid-template-columns: 62px minmax(0, 1fr) auto;
    font-size: .7rem;
  }
  .pill { min-width: 62px; padding-inline: 6px; }

  .final-copy { padding-inline: 18px; }
}

@media (max-width: 340px) {
  .brand strong { font-size: .67rem; }
  .hero h1 { font-size: 2.05rem; }
  .row {
    grid-template-columns: 1fr auto;
    row-gap: 2px;
  }
  .row strong { grid-column: 1; }
  .row span { grid-column: 1; }
  .row .pill { grid-column: 2; grid-row: 1 / span 2; }
}

@media (max-height: 560px) and (orientation: landscape) and (max-width: 900px) {
  .hero {
    min-height: auto;
    align-items: stretch;
  }
  .hero-inner { padding-top: 26px; padding-bottom: 26px; }
  .hero h1 { font-size: clamp(2.2rem, 7vw, 3.5rem); }
  .hero-mini { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .final-card { min-height: 390px; }
}

@media (hover: none) and (pointer: coarse) {
  .btn,
  .plan-tab,
  .plan-cta,
  .pill,
  .contact-chip,
  .menu-label,
  .theme-btn.clean {
    -webkit-tap-highlight-color: rgba(224, 58, 62, .16);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
