/**
 * Arkum site — layout e menu mobile apenas em telas estreitas.
 * Não altera styles.css; carregue este arquivo depois de styles.css.
 */

.arkum-mobile-ui {
  display: none;
}

@media (max-width: 991.98px) {
  :root {
    --arkum-mobile-menu-btn: 46px;
    --arkum-mobile-menu-btn-inset: 10px;
    /* Recuo mínimo do texto em relação à viewport para não ficar sob o botão fixo */
    --arkum-mobile-text-gutter: max(
      1.1rem,
      calc(env(safe-area-inset-left, 0px) + var(--arkum-mobile-menu-btn-inset) + var(--arkum-mobile-menu-btn) + 12px)
    );
  }

  .arkum-mobile-ui {
    display: block;
  }

  body.arkum-mobile-nav-open {
    overflow: hidden;
    touch-action: none;
  }

  /* Esconde o menu hambúrguer original do header e o painel dropdown antigo no mobile */
  .site-header .menu-toggle {
    display: none !important;
  }

  .site-header #siteMenu {
    display: none !important;
  }

  .site-header .nav-actions {
    margin-left: auto;
    gap: 8px;
  }

  .site-header .nav-wrap {
    padding-left: 52px;
    padding-right: 8px;
    min-height: 56px;
    align-items: center;
  }

  .site-header .brand {
    margin: 0 auto;
  }

  .arkum-mobile-menu-btn {
    position: fixed;
    top: max(10px, env(safe-area-inset-top, 0px));
    left: max(10px, env(safe-area-inset-left, 0px));
    right: auto;
    z-index: 2020;
    width: var(--arkum-mobile-menu-btn);
    height: var(--arkum-mobile-menu-btn);
    transition:
      left 0.28s cubic-bezier(0.4, 0, 0.2, 1),
      right 0.28s cubic-bezier(0.4, 0, 0.2, 1),
      box-shadow 0.2s ease,
      background 0.2s ease;
    border: none;
    border-radius: 12px;
    background: var(--surface-strong, #fff);
    box-shadow: var(--shadow, 0 8px 24px rgba(15, 42, 66, 0.15));
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    border: 1px solid var(--border, rgba(16, 45, 68, 0.1));
  }

  .arkum-mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--nav-text, #20415c);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  body[data-theme="dark"] .arkum-mobile-menu-btn span {
    background: var(--nav-text, #d8e5f0);
  }

  body.arkum-mobile-nav-open .arkum-mobile-menu-btn span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.arkum-mobile-nav-open .arkum-mobile-menu-btn span:nth-child(2) {
    opacity: 0;
  }

  body.arkum-mobile-nav-open .arkum-mobile-menu-btn span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Com o menu aberto, o botão vai para a direita para não cobrir o drawer (antes: z-index maior que o painel). */
  body.arkum-mobile-nav-open .arkum-mobile-menu-btn {
    left: auto;
    right: max(12px, env(safe-area-inset-right, 0px));
  }

  .arkum-mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2005;
    background: rgba(6, 20, 35, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  body[data-theme="dark"] .arkum-mobile-backdrop {
    background: rgba(0, 0, 0, 0.55);
  }

  body.arkum-mobile-nav-open .arkum-mobile-backdrop {
    opacity: 1;
    visibility: visible;
  }

  .arkum-mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    z-index: 2010;
    background: var(--surface-strong, #fff);
    box-shadow: 8px 0 32px rgba(15, 42, 66, 0.18);
    transform: translateX(-102%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: clamp(64px, 15vw, 84px) 22px max(28px, env(safe-area-inset-bottom, 0px))
      max(20px, env(safe-area-inset-left, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-right: 1px solid var(--border, rgba(16, 45, 68, 0.1));
  }

  body.arkum-mobile-nav-open .arkum-mobile-drawer {
    transform: translateX(0);
  }

  .arkum-mobile-drawer-head {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-soft, #557086);
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border, rgba(16, 45, 68, 0.12));
    width: 100%;
  }

  body[data-theme="dark"] .arkum-mobile-drawer-head {
    color: rgba(255, 255, 255, 0.55);
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .arkum-mobile-drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    min-width: 0;
  }

  .arkum-mobile-drawer-link {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-strong, #0f2233);
    text-decoration: none;
    border: 1px solid transparent;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body[data-theme="dark"] .arkum-mobile-drawer-link {
    color: var(--text-strong, #fff);
  }

  .arkum-mobile-drawer-link:hover,
  .arkum-mobile-drawer-link:focus {
    background: var(--surface-dark, rgba(237, 246, 251, 0.88));
    border-color: var(--border, rgba(16, 45, 68, 0.1));
    color: var(--nav-hover, #1fae4b);
  }

  .arkum-mobile-drawer-sublink {
    font-size: 14px;
    font-weight: 500;
    padding-left: 22px;
    padding-right: 14px;
    color: var(--text-soft, #557086);
  }

  body[data-theme="dark"] .arkum-mobile-drawer-sublink {
    color: rgba(255, 255, 255, 0.65);
  }

  .arkum-mobile-nav-group {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border, rgba(16, 45, 68, 0.08));
    width: 100%;
    min-width: 0;
  }

  body[data-theme="dark"] .arkum-mobile-nav-group {
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }

  .arkum-mobile-drawer-cta {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border, rgba(16, 45, 68, 0.1));
  }

  .arkum-mobile-drawer-cta .btn {
    width: 100%;
    border-radius: 12px;
    justify-content: center;
  }

  /* Conteúdo mobile padrão: margens equilibradas */
  .content-shell {
    width: calc(100% - 24px) !important;
    max-width: 100% !important;
    padding-left: max(1rem, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(1rem, env(safe-area-inset-right, 0px)) !important;
    box-sizing: border-box;
  }

  /* Hero também segue a mesma margem padrão no mobile */
  .hero .content-shell {
    padding-left: max(1rem, env(safe-area-inset-left, 0px)) !important;
  }

  .hero h1 {
    font-size: clamp(1.55rem, 5.5vw, 2.1rem) !important;
    line-height: 1.2 !important;
  }

  .carousel-word {
    font-size: clamp(2.5rem, 14vw, 4.2rem) !important;
  }

  .carousel-caption {
    font-size: 1rem !important;
  }

  /* Ajustes de vídeo no carrossel para mobile */
  .carousel-track,
  .carousel-overlay {
    min-height: 360px !important;
  }

  .carousel-bg-video {
    inset: 10px 0 !important;
    height: calc(100% - 20px) !important;
    object-fit: cover !important;
  }

  .carousel-media video {
    width: min(300px, 78vw) !important;
    max-height: 260px !important;
    margin: 8px 0 !important;
    padding: 8px !important;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .section {
    padding: 44px 0 !important;
  }

  .site-footer .container.footer-wrap,
  .site-footer .container.footer-bar-inner {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }

  /* Rodapé: uma coluna até 991px (o base só quebra .footer-main em ≤820px). */
  .site-footer {
    margin-top: 12px;
    padding: 22px 0 max(18px, env(safe-area-inset-bottom, 0px));
  }

  .footer-main {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 26px !important;
    padding: 28px 0 24px !important;
    align-items: stretch;
  }

  .footer-brand-block {
    padding-left: 0 !important;
    justify-content: flex-start;
    justify-self: stretch;
  }

  /* Mapa do site no rodapé: oculto só no mobile (navegação no menu lateral) */
  .site-footer .footer-links-area {
    display: none !important;
  }

  .footer-cta-side {
    align-items: stretch !important;
    padding-right: 0 !important;
    padding-top: 22px;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
  }

  .footer-cta-side .social-links {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .footer-contact-btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    text-align: center;
  }

  .footer-bar-inner {
    padding-inline: 16px;
    min-height: auto;
    padding-block: 14px;
  }

  .footer-copy p,
  .footer-copy span {
    line-height: 1.45;
  }

  .floating-actions {
    right: max(10px, env(safe-area-inset-right, 0px)) !important;
    bottom: max(10px, calc(10px + env(safe-area-inset-bottom, 0px))) !important;
  }
}
