/**
 * COLÉGIO APRENDIZ — CAMADA DE PORTABILIDADE + MOBILE DEDICADO
 * O desktop permanece visualmente regido pelo CSS original.
 * Este arquivo neutraliza somente wrappers do Elementor e corrige a experiência
 * em telas menores sem trocar a identidade, componentes, tipografia ou paleta.
 */

/* Elementor não deve introduzir largura, gap ou min-width capazes de alterar o markup original. */
.aprendiz-site-shell .elementor,
.aprendiz-site-shell .elementor-element,
.aprendiz-site-shell .e-con,
.aprendiz-site-shell .e-con-inner,
.aprendiz-site-shell .elementor-widget,
.aprendiz-site-shell .elementor-widget-container {
  min-width: 0;
  max-width: 100%;
}

.aprendiz-site-shell .elementor-widget-container {
  width: 100%;
}

.aprendiz-scroll-lock {
  overflow: hidden;
  overscroll-behavior: none;
}

.aprendiz-site-shell :where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid rgba(237, 125, 4, 0.48);
  outline-offset: 3px;
}

.apr-field-error {
  display: block;
  margin-top: .42rem;
  color: #B42318;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.35;
}

.aprendiz-consent-row,
.contato-consent {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--aprendiz-text-muted);
}

.aprendiz-consent-row input,
.contato-consent input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: .1rem;
  accent-color: var(--aprendiz-orange);
}

/* Tablet: preserva composição original, mas elimina tracks que forçam overflow. */
@media (max-width: 1023px) {
  .aprendiz-site-shell {
    overflow-x: clip;
  }

  .aprendiz-site-shell :where(.section-container, .header-container, .footer-container,
    .editorial-hero-grid, .about-overview-grid, .contato-main-grid,
    .estrutura-gallery-grid, .blog-cards-grid, .segments-grid,
    .diff-grid-v2, .sobre-timeline-grid) > * {
    min-width: 0;
  }

  .editorial-hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .editorial-hero-content,
  .editorial-hero-media,
  .about-narrative-block,
  .about-visual-composition {
    width: 100%;
    min-width: 0;
  }

  .paired-actions,
  .about-actions-group,
  .editorial-hero-actions,
  .blog-hero-actions,
  .estrutura-hero-actions,
  .contato-hero-actions,
  .pre-footer-cta-section .cta-actions {
    max-width: 100%;
  }
}

/* Mobile é uma composição própria: mesmos materiais, outra hierarquia espacial. */
@media (max-width: 767px) {
  .aprendiz-site-shell {
    width: 100%;
    max-width: 100vw;
  }

  .aprendiz-site-shell img,
  .aprendiz-site-shell video,
  .aprendiz-site-shell iframe,
  .aprendiz-site-shell svg {
    max-width: 100%;
  }

  /* Aviso + header: compactos, sem virar uma versão espremida do desktop. */
  .top-bar-notice {
    min-height: 38px;
    padding: .48rem .9rem;
    gap: .28rem;
    font-size: .72rem;
    line-height: 1.35;
    flex-wrap: wrap;
  }

  .header-container {
    padding: .62rem 1rem;
    min-height: 64px;
  }

  .site-logo-img {
    height: 43px;
    max-width: min(178px, 58vw);
  }

  .menu-toggle-btn {
    width: 44px;
    height: 44px;
  }

  .drawer-content {
    width: min(88vw, 360px);
    max-width: 100%;
    padding: 1.05rem 1rem calc(1.4rem + var(--sab, 0px));
  }

  .drawer-nav-list {
    gap: .25rem;
  }

  .drawer-nav-item a {
    min-height: 48px;
  }

  /* A home já tem arte mobile dedicada: preserva o banner integral e recalibra controles. */
  .hero-slider-section,
  .hero-slider-container,
  .hero-slide,
  .hero-slide-picture {
    width: 100%;
    max-width: 100vw;
  }

  .hero-slide-img {
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: none;
    object-fit: cover;
    object-position: center top;
  }

  .slider-arrow {
    width: 38px;
    height: 38px;
    font-size: .92rem;
  }

  .slider-arrow.prev { left: .65rem; }
  .slider-arrow.next { right: .65rem; }
  .slider-dots { bottom: .8rem; }

  /* Ritmo geral: mantém os mesmos tokens do original, com leitura de celular. */
  .section-wrapper {
    padding: 3.25rem 1.1rem;
  }

  .section-container {
    width: 100%;
    max-width: 100%;
  }

  .section-title {
    max-width: 100%;
    font-size: clamp(2rem, 10.2vw, 2.7rem);
    line-height: 1.06;
    text-wrap: balance;
  }

  .section-subtitle {
    width: 100%;
    max-width: 34rem;
    margin-bottom: 1.85rem;
    font-size: .96rem;
    line-height: 1.62;
  }

  .section-tag {
    margin-bottom: .65rem;
  }

  /* Sobre da home: narrativa primeiro, campus depois; métricas viram trilho tocável. */
  .about-overview-section {
    padding: 3.25rem 1.1rem;
  }

  .about-overview-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.25rem;
  }

  .about-overview-section .section-title {
    font-size: clamp(2rem, 9vw, 2.55rem);
    line-height: 1.12;
  }

  .about-text-lead {
    font-size: 1rem;
    line-height: 1.6;
  }

  .about-text-body {
    font-size: .92rem;
    line-height: 1.68;
  }

  .about-metrics-grid {
    display: flex;
    gap: .8rem;
    width: calc(100% + 1.1rem);
    margin-right: -1.1rem;
    padding-right: 1.1rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .about-metrics-grid::-webkit-scrollbar { display: none; }

  .about-metric-card {
    flex: 0 0 min(76vw, 280px);
    scroll-snap-align: start;
  }

  .about-actions-group,
  .paired-actions,
  .editorial-hero-actions,
  .blog-hero-actions,
  .estrutura-hero-actions,
  .contato-hero-actions,
  .pre-footer-cta-section .cta-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-flow: row;
    gap: .72rem;
    width: 100%;
    margin-inline: 0;
  }

  .about-actions-group > *,
  .paired-actions > *,
  .editorial-hero-actions > *,
  .blog-hero-actions > *,
  .estrutura-hero-actions > *,
  .contato-hero-actions > *,
  .pre-footer-cta-section .cta-actions > * {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    justify-content: center;
    text-align: center;
  }

  .tour-main-frame {
    aspect-ratio: 4 / 3.3;
    border-radius: 18px;
  }

  .tour-slide-img {
    min-height: 100%;
    object-fit: cover;
  }

  .tour-thumbnails-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 28%;
    grid-template-columns: none;
    gap: .5rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding-bottom: .15rem;
  }
  .tour-thumbnails-strip::-webkit-scrollbar { display: none; }
  .tour-thumb-item { scroll-snap-align: start; }

  /* Cards originais: mesmas superfícies; densidade adequada ao polegar. */
  .segments-grid,
  .diff-grid-v2,
  .blog-cards-grid,
  .estrutura-gallery-grid,
  .sobre-timeline-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.15rem;
  }

  .segment-card,
  .diff-card-v2,
  .blog-card,
  .gallery-card,
  .sobre-era-card {
    width: 100%;
    min-width: 0;
  }

  .diff-card-v2 {
    padding: 1.7rem 1.35rem;
  }

  .diff-watermark-number {
    right: -12px;
    bottom: -18px;
    font-size: 7.25rem;
  }

  .segment-thumb {
    aspect-ratio: 16 / 11;
  }

  /* Hero editorial de Segmentos/Sobre: mesma composição e fotografia, ordem/escala móvel próprias. */
  .page-editorial-hero {
    padding: 2.4rem 1.1rem 2.8rem;
  }

  .page-editorial-hero::before {
    width: 250px;
    height: 250px;
    top: -70px;
    right: -100px;
  }

  .editorial-hero-grid {
    gap: 1.8rem;
  }

  .editorial-hero-title {
    font-size: clamp(2.2rem, 11vw, 3rem);
    line-height: 1.03;
    margin-bottom: .85rem;
  }

  .editorial-hero-lead {
    font-size: .98rem;
    line-height: 1.65;
    margin-bottom: 1.35rem;
  }

  .editorial-hero-actions {
    margin-bottom: 1.35rem;
  }

  .editorial-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem .65rem;
    padding-top: 1.1rem;
  }

  .editorial-hero-stat-item {
    align-items: flex-start;
    font-size: .8rem;
    line-height: 1.35;
  }

  .editorial-hero-photo-card {
    border-radius: 20px;
  }

  .editorial-hero-photo-card img {
    width: 100%;
    max-height: none;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  .editorial-hero-float-badge {
    left: .75rem;
    right: .75rem;
    bottom: .75rem;
    padding: .72rem .85rem;
    border-radius: 14px;
  }

  .editorial-hero-pills {
    flex-wrap: nowrap;
    width: calc(100% + 1.1rem);
    margin-right: -1.1rem;
    padding-right: 1.1rem;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  .editorial-hero-pills::-webkit-scrollbar { display: none; }
  .editorial-hero-pill-link { flex: 0 0 auto; scroll-snap-align: start; }

  /* Heróis centrais de Blog/Estrutura/Contato: identidade intacta, sem stats comprimidos. */
  .blog-hero-wrap,
  .estrutura-hero-wrap,
  .contato-hero-wrap,
  .legal-hero-section {
    padding: 2.65rem 1.1rem 2.7rem;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
  }

  .blog-hero-title,
  .estrutura-hero-title,
  .contato-hero-title,
  .legal-hero-title {
    max-width: 100%;
    font-size: clamp(2.2rem, 10.5vw, 2.95rem);
    line-height: 1.05;
    margin-top: .9rem;
  }

  .blog-hero-lead,
  .estrutura-hero-lead,
  .contato-hero-lead {
    font-size: .96rem;
    line-height: 1.62;
    margin-bottom: 1.55rem;
  }

  .blog-hero-actions,
  .estrutura-hero-actions,
  .contato-hero-actions {
    margin-bottom: 1.6rem;
  }

  .blog-stats-bar,
  .estrutura-stats-bar,
  .contato-stats-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    padding: .65rem;
    border-radius: 16px;
  }

  .blog-stat-box,
  .estrutura-stat-box,
  .contato-stat-box {
    min-width: 0;
    padding: .72rem .45rem;
  }

  .blog-stat-num,
  .estrutura-stat-num,
  .contato-stat-num {
    overflow-wrap: anywhere;
    font-size: clamp(1.08rem, 4.9vw, 1.45rem);
  }

  .blog-stat-label,
  .estrutura-stat-label,
  .contato-stat-label {
    font-size: .72rem;
  }

  /* Blog: filtros e cards pensados como navegação editorial móvel. */
  .blog-filter-bar,
  .gallery-filter-bar {
    justify-content: flex-start;
    flex-wrap: nowrap;
    width: calc(100% + 1.1rem);
    margin-right: -1.1rem;
    padding-right: 1.1rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .blog-filter-bar::-webkit-scrollbar,
  .gallery-filter-bar::-webkit-scrollbar { display: none; }

  .blog-filter-btn,
  .gallery-filter-btn {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .blog-thumb-wrapper,
  .gallery-card-media {
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .blog-card-content,
  .gallery-card-body {
    padding: 1.25rem;
  }

  /* Contato: primeiro o caminho principal, sem campos lado a lado ou cartões apertados. */
  .contato-main-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    margin-top: 1.5rem;
  }

  .contato-form-card {
    padding: 1.35rem 1.05rem;
    border-radius: 20px;
  }

  .contato-sidebar {
    gap: .9rem;
  }

  .card-direct-whatsapp,
  .card-info-pratica {
    padding: 1.15rem;
    border-radius: 18px;
  }

  .channel-item-link {
    padding: .8rem .9rem;
    gap: .75rem;
  }

  .map-embed-wrapper {
    height: min(72vh, 430px);
    border-radius: 20px;
  }

  /* Estrutura: galeria visual antes de densidade textual. */
  .gallery-card-media {
    min-height: 210px;
  }

  .gallery-card-desc {
    line-height: 1.55;
  }

  /* Artigos e legais: leitura real em 390px, sem cartões desktop reduzidos. */
  .article-container,
  .legal-content-container,
  .legal-container {
    width: 100%;
    max-width: 100%;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .article-header {
    padding-top: 2rem;
  }

  .article-hero-title {
    font-size: clamp(2.15rem, 10vw, 2.9rem);
    line-height: 1.08;
  }

  .article-content {
    font-size: .98rem;
    line-height: 1.78;
  }

  .article-content h2 {
    font-size: 1.55rem;
    line-height: 1.25;
  }

  .article-callout,
  .legal-section-card {
    padding: 1.2rem 1.05rem;
    border-radius: 18px;
  }

  .legal-heading {
    align-items: flex-start;
    font-size: 1.12rem;
  }

  /* CTA mantém o componente original; no celular vira ação inequívoca de uma coluna. */
  .pre-footer-cta-section {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .pre-footer-cta-section .cta-inner-card {
    border-radius: 22px;
    padding: 2rem 1.15rem;
  }

  .pre-footer-cta-section .cta-title {
    font-size: clamp(2.15rem, 10vw, 2.8rem);
    line-height: 1.04;
  }

  /* Footer: permanece o original, reorganizado para leitura/tap mobile. */
  .site-footer {
    padding: 4rem 1.1rem calc(6rem + var(--sab, 0px));
  }

  .footer-main-layout {
    gap: 2.4rem;
  }

  .footer-links-directory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.8rem 1rem;
  }

  .footer-social-channels {
    width: 100%;
    align-items: stretch;
  }

  .footer-social-link {
    max-width: 100%;
  }

  .footer-credentials-bar,
  .footer-legal-bar {
    gap: 1rem;
  }

  /* Modal como sheet mobile, mantendo exatamente os controles visuais originais. */
  .lead-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .lead-modal-container {
    width: 100%;
    max-width: none;
    max-height: min(92dvh, 820px);
    border-radius: 24px 24px 0 0;
    padding-bottom: calc(1rem + var(--sab, 0px));
  }

  .modal-header,
  .modal-step-content,
  .modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .segment-radio-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Barra inferior permanece a ação persistente oficial do projeto original. */
  .mobile-bottom-bar {
    gap: .45rem;
    padding: .45rem .65rem calc(.45rem + var(--sab, 0px));
  }

  .mobile-bottom-bar .bar-btn-wa,
  .mobile-bottom-bar .bar-btn-cta,
  .mobile-bottom-bar .bar-btn-tel {
    min-width: 0;
    padding: .45rem .35rem;
  }

  .mobile-bottom-bar .bar-btn-wa,
  .mobile-bottom-bar .bar-btn-tel {
    font-size: .7rem;
  }

  .mobile-bottom-bar .bar-btn-cta {
    font-size: .74rem;
  }
}

@media (max-width: 380px) {
  .top-bar-notice { font-size: .68rem; }
  .site-logo-img { max-width: 152px; }
  .section-wrapper, .about-overview-section { padding-left: .9rem; padding-right: .9rem; }
  .blog-stats-bar, .estrutura-stats-bar, .contato-stats-bar { grid-template-columns: 1fr; }
  .footer-links-directory { grid-template-columns: 1fr; }
}

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

  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Portabilidade Elementor: o container que hospeda o header global participa do sticky original. */
@supports selector(:has(*)) {
  .aprendiz-site-shell .e-con:has(.elementor-widget-aprendiz-global-reference .site-header) {
    position: sticky;
    top: 0;
    z-index: 990;
  }
  .admin-bar.aprendiz-site-shell .e-con:has(.elementor-widget-aprendiz-global-reference .site-header) { top: 32px; }
  @media (max-width: 782px) {
    .admin-bar.aprendiz-site-shell .e-con:has(.elementor-widget-aprendiz-global-reference .site-header) { top: 46px; }
  }
}
.aprendiz-site-shell .aprendiz-header-host { position: sticky; top: 0; z-index: 990; }
.admin-bar.aprendiz-site-shell .aprendiz-header-host { top: 32px; }
@media (max-width: 782px) { .admin-bar.aprendiz-site-shell .aprendiz-header-host { top: 46px; } }

@media (max-width: 767px) {
  .aprendiz-blog-dynamic .blog-filter-bar {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: .15rem .1rem .55rem;
    margin-inline: -.25rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .aprendiz-blog-dynamic .blog-filter-bar::-webkit-scrollbar { display: none; }
  .aprendiz-blog-dynamic .blog-filter-btn { flex: 0 0 auto; white-space: nowrap; }
  .aprendiz-blog-dynamic .blog-cards-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .aprendiz-blog-dynamic .blog-thumb-wrapper { height: 205px; }
  .aprendiz-blog-dynamic .blog-card-content { padding: 1.3rem; }
  .aprendiz-blog-single .article-container { padding: 2rem 1rem 3rem; }
  .aprendiz-blog-single .article-hero-title { font-size: clamp(1.9rem, 8vw, 2.35rem); }
  .aprendiz-blog-single .article-header > div { gap: .5rem .75rem !important; }
  .aprendiz-blog-single .article-header > div > span:nth-child(2),
  .aprendiz-blog-single .article-header > div > span:nth-child(4) { display: none; }
  .aprendiz-blog-single .table-of-contents { padding: 1.2rem; }
  .aprendiz-blog-single .article-content { font-size: 1rem; line-height: 1.75; }
  .aprendiz-blog-single .article-content h2 { font-size: 1.45rem; margin-top: 2.15rem; }
  .aprendiz-blog-single .author-box { align-items: flex-start; padding: 1.2rem; }
  .aprendiz-blog-single .related-articles-grid { grid-template-columns: 1fr; }
}
