/* Everyday Humans — revisão mobile das cinco páginas.
   Cole no FINAL do CSS adicional, mantendo os ajustes anteriores.
   Use mobile-menu.js no rodapé para ativar o menu modal acessível.
   Desktop/tablet a partir de 768 px mantêm os estilos existentes. */

@media (max-width: 767.98px) {
  body #page#page#page#page#page {
    --eh-mobile-gutter: max(24px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
    --eh-mobile-box-padding: 24px;
    --eh-mobile-radius: 20px;
    --eh-mobile-safe-top: env(safe-area-inset-top, 0px);
    --eh-header: calc(80px + var(--eh-mobile-safe-top));
  }

  /* Cabeçalho compacto, com área de toque maior que o desenho do ícone. */
  body #page#page#page#page#page #wrapper-navbar {
    position: relative !important;
    width: 100% !important;
    height: var(--eh-header) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body #page#page#page#page#page #main-nav {
    position: fixed !important;
    top: calc(12px + var(--eh-mobile-safe-top) + var(--wp-admin--admin-bar--height, 0px)) !important;
    left: var(--eh-mobile-gutter) !important;
    right: var(--eh-mobile-gutter) !important;
    width: calc(100% - var(--eh-mobile-gutter) - var(--eh-mobile-gutter)) !important;
    height: 56px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    opacity: 1 !important;
    transform: none !important;
    overflow: visible !important;
  }

  body #page#page#page#page#page #main-nav > .container {
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  body #page#page#page#page#page #main-nav .navbar-brand {
    width: min(58vw, 190px) !important;
    max-width: calc(100% - 52px) !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 1 auto !important;
  }

  body #page#page#page#page#page #main-nav .navbar-brand img {
    width: 100% !important;
    height: auto !important;
  }

  body #page#page#page#page#page #main-nav .navbar-toggler {
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: 0 !important;
    font-size: 20px !important;
    flex: 0 0 40px !important;
  }

  body #page#page#page#page#page #main-nav .navbar-toggler-icon {
    width: 22px !important;
    height: 22px !important;
  }

  body #page#page#page#page#page #main-nav .navbar-toggler:focus-visible {
    outline: 2px solid currentColor !important;
    outline-offset: 2px !important;
  }

  body #page#page#page#page#page #main-menu :is(li, a) {
    border: 0 !important;
    box-shadow: none !important;
  }

  /* O menu original continua como alternativa sem JavaScript. */
  body #page#page#page#page#page #navbarNavDropdown.show {
    position: fixed !important;
    top: calc(var(--eh-header) + var(--wp-admin--admin-bar--height, 0px)) !important;
    left: var(--eh-mobile-gutter) !important;
    right: var(--eh-mobile-gutter) !important;
    width: auto !important;
    height: auto !important;
    max-height: calc(100dvh - var(--eh-header) - 24px) !important;
    padding: 24px !important;
    background: #f4f4f4 !important;
    border-radius: var(--eh-mobile-radius) !important;
    overflow-y: auto !important;
  }

  html.eh-mobile-nav-ready body #page#page#page#page#page #navbarNavDropdown {
    display: none !important;
  }

  /* Margem lateral comum; os fundos de seção continuam até a borda. */
  body #page#page#page#page#page :is(.eh-built, .eh-contact, .runclub-editable-content) {
    box-sizing: border-box !important;
    width: calc(100% - var(--eh-mobile-gutter) - var(--eh-mobile-gutter)) !important;
    max-width: none !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
  }

  body #page#page#page#page#page :is(.eh-built, .eh-contact) {
    padding-block: 40px !important;
  }

  body #page#page#page#page#page .eh-work-behind > .wp-block-cover__inner-container {
    width: 100% !important;
    max-width: none !important;
    padding-inline: 0 !important;
  }

  body #page#page#page#page#page .eh-work-behind .wp-block-group.container {
    width: calc(100% - var(--eh-mobile-gutter) - var(--eh-mobile-gutter)) !important;
    max-width: none !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
  }

  body #page#page#page#page#page :is(.eh-work-behind, .eh-built) :is(h2, h3, p) {
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
  }

  body #page#page#page#page#page .eh-built + .wp-block-cover > .wp-block-cover__inner-container {
    box-sizing: border-box !important;
    width: calc(100% - var(--eh-mobile-gutter) - var(--eh-mobile-gutter)) !important;
    max-width: none !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
  }

  body #page#page#page#page#page .eh-built + .wp-block-cover :is(h2, p) {
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
  }

  body #page#page#page#page#page .eh-planos {
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
    gap: 20px !important;
  }

  body #page#page#page#page#page .eh-plano__midia img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }

  /* Plans: caixas alinhadas à margem dos títulos e parágrafos. */
  body #page#page#page#page#page .dp-hero :is(h1, p):not(.dp-plan-card *) {
    box-sizing: border-box !important;
    width: calc(100% - var(--eh-mobile-gutter) - var(--eh-mobile-gutter)) !important;
    max-width: none !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
  }

  body #page#page#page#page#page :is(.dp-plan-grid, .dp-detail-grid, .dp-about-grid, .dp-benefit-list) {
    box-sizing: border-box !important;
    width: calc(100% - var(--eh-mobile-gutter) - var(--eh-mobile-gutter)) !important;
    max-width: none !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
    gap: 20px !important;
  }

  body #page#page#page#page#page .dp-detail-section > p {
    width: calc(100% - var(--eh-mobile-gutter) - var(--eh-mobile-gutter)) !important;
    max-width: none !important;
    margin-inline: auto !important;
  }

  body #page#page#page#page#page :is(.dp-plan-card, .dp-detail-card, .dp-about-callout, .dp-about-copy) {
    box-sizing: border-box !important;
    padding: var(--eh-mobile-box-padding) !important;
    border-radius: var(--eh-mobile-radius) !important;
    min-width: 0 !important;
  }

  body #page#page#page#page#page #about.dp-about {
    height: auto !important;
    min-height: 0 !important;
    padding: 40px 0 !important;
  }

  body #page#page#page#page#page .dp-about-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    height: auto !important;
    gap: 20px !important;
  }

  body #page#page#page#page#page :is(.dp-about-callout, .dp-about-copy) {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
  }

  body #page#page#page#page#page .dp-about-callout :is(h2, p) {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
  }

  body #page#page#page#page#page .dp-about-callout p {
    margin-bottom: 0 !important;
  }

  body #page#page#page#page#page .dp-about-copy > .wp-block-buttons {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    margin: 24px 0 0 !important;
  }

  /* Services: intro e lista usam a mesma margem lateral. */
  body #page#page#page#page#page :is(.sec2-intro, .sec2-list) {
    box-sizing: border-box !important;
    width: calc(100% - var(--eh-mobile-gutter) - var(--eh-mobile-gutter)) !important;
    max-width: none !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
  }

  body #page#page#page#page#page .sec2-intro p {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
  }

  body #page#page#page#page#page .sec2-list {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }

  body #page#page#page#page#page .sec2-list > h2 {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    overflow-wrap: normal;
  }

  body #page#page#page#page#page .eh-contact > h1,
  body #page#page#page#page#page .eh-contact > p,
  body #page#page#page#page#page .eh-contact > div,
  body #page#page#page#page#page .eh-contact :is(.wpcf7, form) {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
  }

  body #page#page#page#page#page .eh-contact form > p:not(:has(> input.wpcf7-submit)) {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
  }

  body #page#page#page#page#page .eh-contact form :is(label, .wpcf7-form-control-wrap) {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body #page#page#page#page#page .eh-contact form :is(input[type="text"], input[type="email"], textarea) {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body #page#page#page#page#page .runclub-page {
    margin: 0 !important;
    padding-top: 24px !important;
    padding-bottom: 80px !important;
  }

  body #page#page#page#page#page .runclub-editable-content :is(h1, h2, p) {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
  }

  /* Rodapé: corrige os recuos negativos herdados da grade. */
  body #page#page#page#page#page #wrapper-footer-full {
    box-sizing: border-box !important;
    padding: 40px var(--eh-mobile-gutter) !important;
  }

  body #page#page#page#page#page #footer-full-content,
  body #page#page#page#page#page #footer-full-content > .row,
  body #page#page#page#page#page #footer-full-content .footer-widget {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body #page#page#page#page#page #footer-full-content .wp-block-columns {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
  }

  /* Home: círculo sem faixas brancas; frase dentro, botão abaixo. */
  body #page#page#page#page#page #about.eh-about {
    width: 100% !important;
    margin: 0 !important;
  }

  body #page#page#page#page#page #about.eh-about > .wp-block-columns {
    --eh-mobile-unit: min(calc((100cqw - var(--eh-mobile-gutter) - var(--eh-mobile-gutter)) / 680), calc((100cqh - 64px) / 1450));
    --eh-mobile-title: clamp(28px, calc(90 * var(--eh-mobile-unit)), 56px);
    --eh-mobile-copy: clamp(12px, calc(30 * var(--eh-mobile-unit)), 16px);
    --eh-mobile-orb: min(calc(100cqw - var(--eh-mobile-gutter) - var(--eh-mobile-gutter)), calc(100cqh - 4.2 * var(--eh-mobile-title) - 7.8 * var(--eh-mobile-copy) - 108px));
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    align-content: center !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 12px var(--eh-mobile-gutter) !important;
    gap: 12px !important;
  }

  body #page#page#page#page#page #about.eh-about > .wp-block-columns > .wp-block-column {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    align-items: center !important;
  }

  body #page#page#page#page#page #about.eh-about h1 {
    font-size: var(--eh-mobile-title) !important;
    line-height: 1.4 !important;
    margin-bottom: 8px !important;
  }

  body #page#page#page#page#page #about.eh-about p {
    font-size: var(--eh-mobile-copy) !important;
    line-height: 1.3 !important;
    margin-inline: 0 !important;
  }

  body #page#page#page#page#page #about.eh-about p:first-of-type {
    margin-bottom: 8px !important;
  }

  body #page#page#page#page#page #about.eh-about p:first-of-type br {
    display: none !important;
  }

  body #page#page#page#page#page #about.eh-about .wp-block-cover {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: var(--eh-mobile-orb) auto !important;
    align-items: start !important;
    width: var(--eh-mobile-orb) !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    aspect-ratio: auto !important;
    translate: none !important;
    overflow: visible !important;
    background: transparent !important;
  }

  body #page#page#page#page#page #about.eh-about .wp-block-cover__image-background {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: var(--eh-mobile-orb) !important;
    height: var(--eh-mobile-orb) !important;
    object-fit: contain !important;
    object-position: center !important;
  }

  body #page#page#page#page#page #about.eh-about .wp-block-cover__inner-container {
    position: static !important;
    grid-row: 2 !important;
    inset: auto !important;
    transform: none !important;
    translate: none !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 12px 0 0 !important;
    padding: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    transition: none !important;
  }

  body #page#page#page#page#page #about.eh-about .wp-block-cover__inner-container > .wp-block-columns {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
    justify-items: center !important;
  }

  body #page#page#page#page#page #about.eh-about .wp-block-cover__inner-container > .wp-block-columns > .wp-block-column:first-child {
    position: absolute !important;
    top: calc(var(--eh-mobile-orb) / 2) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    width: 100% !important;
  }

  body #page#page#page#page#page #about.eh-about .wp-block-cover__inner-container > .wp-block-columns > .wp-block-column:last-child {
    position: static !important;
    transform: none !important;
  }

  body #page#page#page#page#page #about.eh-about ul.wp-block-list li:first-child {
    font-size: 12px !important;
    line-height: 1.3 !important;
    text-align: center !important;
  }

  body #page#page#page#page#page #about.eh-about .wp-block-buttons {
    justify-content: center !important;
  }

  body #page#page#page#page#page #about.eh-about .wp-block-button__link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
    padding: 12px 24px !important;
    border-radius: 999px !important;
  }
}

@media (max-width: 360px) {
  body #page#page#page#page#page {
    --eh-mobile-gutter: max(20px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  }
}

@media (max-width: 479.98px) {
  body #page#page#page#page#page .dp-plan-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 767.98px) and (min-aspect-ratio: 1001/1000) {
  body #page#page#page#page#page #about.eh-about > .wp-block-columns {
    --eh-mobile-title: clamp(20px, calc(10cqh), 44px);
    --eh-mobile-copy: 12px;
    --eh-mobile-orb: min(calc((100cqw - var(--eh-mobile-gutter) - var(--eh-mobile-gutter) - 16px) / 2), calc(100cqh - 80px));
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    align-content: stretch !important;
    gap: 16px !important;
  }

  body #page#page#page#page#page #about.eh-about > .wp-block-columns > .wp-block-column {
    height: 100% !important;
  }
}

@media (max-width: 767.98px) and (min-aspect-ratio: 1001/1000) and (max-height: 300px) {
  body #page#page#page#page#page #about.eh-about > .wp-block-columns {
    --eh-mobile-title: calc(10cqh);
    --eh-mobile-copy: calc(4.4cqh);
  }

  body #page#page#page#page#page #about.eh-about h1,
  body #page#page#page#page#page #about.eh-about p:first-of-type {
    margin-bottom: 4px !important;
  }
}

/* Modal nativo, fora do cabeçalho para não herdar opacidade ou recortes. */
@media (max-width: 767.98px) {
  body dialog.eh-mobile-menu {
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: max(16px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px));
    border: 0;
    background: transparent;
    color: #262631;
    overscroll-behavior: contain;
  }

  body dialog.eh-mobile-menu[open] {
    display: grid;
    align-items: start;
    justify-items: center;
  }

  body dialog.eh-mobile-menu::backdrop {
    background: rgba(38, 38, 49, 0.55);
  }

  body dialog.eh-mobile-menu .eh-mobile-menu-panel {
    box-sizing: border-box;
    width: 100%;
    max-width: 520px;
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top, 0px)) - max(16px, env(safe-area-inset-bottom, 0px)));
    padding: 20px 24px 24px;
    border: 0;
    border-radius: 24px;
    background: #f4f4f4;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16);
  }

  body dialog.eh-mobile-menu .eh-mobile-menu-head {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
  }

  body dialog.eh-mobile-menu .navbar-brand {
    display: block;
    width: min(52vw, 176px);
    max-width: calc(100% - 52px);
    margin: 0;
    padding: 0;
  }

  body dialog.eh-mobile-menu .navbar-brand img {
    display: block;
    width: 100%;
    height: auto;
    filter: none !important;
  }

  body dialog.eh-mobile-menu .eh-mobile-menu-close {
    position: relative;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #262631;
    cursor: pointer;
  }

  body dialog.eh-mobile-menu .eh-mobile-menu-close::before,
  body dialog.eh-mobile-menu .eh-mobile-menu-close::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 1.5px;
    left: 9px;
    top: 19px;
    background: currentColor;
    transform: rotate(45deg);
  }

  body dialog.eh-mobile-menu .eh-mobile-menu-close::after {
    transform: rotate(-45deg);
  }

  body dialog.eh-mobile-menu ul {
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
  }

  body dialog.eh-mobile-menu :is(ul, li, a) {
    border: 0 !important;
    box-shadow: none;
  }

  body dialog.eh-mobile-menu .nav-link {
    display: block;
    padding: 10px 0;
    font-size: 24px;
    line-height: 1.3;
    font-weight: inherit;
    color: #262631;
    text-decoration: none;
  }

  body dialog.eh-mobile-menu .nav-link:is(:hover, [aria-current="page"]) {
    text-decoration: underline;
    text-underline-offset: 5px;
    text-decoration-thickness: 1px;
  }

  body dialog.eh-mobile-menu :is(button, a):focus-visible {
    outline: 2px solid #262631;
    outline-offset: 4px;
  }

  body dialog.eh-mobile-menu .eh-mobile-menu-title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (max-width: 360px) {
  body dialog.eh-mobile-menu {
    padding-inline: max(20px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  }
}
