/* style.mobile.css (clean v4)
   - Only mobile overrides (<= 900px)
   - Drawer menu theme uses:
     --accent  (#1f6a57)  modern green
     --accent2 (#c49a3a)  warm gold
*/

@media (max-width: 900px) {

  /* Ensure header height matches app.js offset */
  :root {
    --header-h: 84px;
  }


  /* Hide desktop nav, show hamburger */
  .nav .menu {
    display: none !important;
  }

  .only-mobile {
    display: inline-flex !important;
  }

  /* Hide header right icons on mobile (keeps layout clean) */
  header .right {
    display: none !important;
  }

  /* Keep header above page, but below open drawer */
  header {
    z-index: 50;
  }

  /* ===== Hamburger button ===== */
  #hamburger {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(31, 106, 87, .55);
    background: rgba(6, 14, 28, .65);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    position: relative;
    z-index: 100000;
  }

  /* bars base = horizontal, rotated 90deg => looks like vertical "⋮" */
  #hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: rgba(196, 154, 58, .92);
    /* gold */
    transform: rotate(90deg);
    transform-origin: center;
    transition: transform .22s ease, opacity .18s ease;
  }

  /* Open => X */
  #hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  #hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  #hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* ===== Backdrop ===== */
  #menuBackdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(3px);
    z-index: 99998;
  }

  #menuBackdrop[hidden] {
    display: none !important;
  }

  /* ===== Drawer ===== */
  #mobileMenu {
    display: block !important;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(86vw, 360px);
    overflow: auto;
    z-index: 99999;

    background:
      radial-gradient(900px 420px at 0% 0%, rgba(31, 106, 87, .18), transparent 60%),
      linear-gradient(180deg, rgba(6, 14, 28, .96), rgba(6, 14, 28, .92));
    border-left: 2px solid rgba(31, 106, 87, .45);
    box-shadow: -18px 0 60px rgba(0, 0, 0, .55);
  }

  #mobileMenu[hidden] {
    display: none !important;
  }

  /* Drawer head */
  .mobile-menu-head {
    position: sticky;
    top: 0;
    padding: 16px 16px 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(6, 14, 28, .98);
    border-bottom: 1px solid rgba(31, 106, 87, .22);
  }

  .mobile-menu-title {
    font-weight: 800;
    letter-spacing: .3px;
    color: rgba(255, 255, 255, .95);
  }

  .mobile-menu-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(196, 154, 58, .65);
    background: rgba(196, 154, 58, .10);
    color: rgba(196, 154, 58, .95);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
  }

  /* Links */
  .mobile-nav {
    padding: 12px 12px 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mobile-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;

    color: rgba(255, 255, 255, .92);
    border: 1px solid rgba(31, 106, 87, .22);
    background: rgba(255, 255, 255, .04);
  }

  .mobile-nav a:hover,
  .mobile-nav a:focus-visible {
    border-color: rgba(31, 106, 87, .55);
    background: rgba(31, 106, 87, .12);
    outline: none;
  }

  /* When menu is open:
   - keep backdrop/menu clickable
   - allow hamburger to close */
  .menu-open #mobileMenu,
  .menu-open #menuBackdrop {
    pointer-events: auto;
  }

  /* Prevent background scroll */

  .menu-open,
  .menu-open body {
    overflow: hidden;
  }

  /* Layout tweaks */
  .wrap {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Hero typography a bit tighter on mobile */
  h1 {
    font-size: clamp(28px, 7vw, 42px) !important;
  }

  h2 {
    font-size: clamp(22px, 5.8vw, 30px) !important;
  }

  /* 1-column grids */
  .tiles {
    grid-template-columns: 1fr !important;
  }

  .split {
    grid-template-columns: 1fr !important;
  }

  .foot {
    grid-template-columns: 1fr !important;
  }

  /* Logo a bit smaller on mobile */
  .logo-mark img {
    height: 64px !important;
  }

  .menu-page {
    background-size: 117px auto,
      105px auto,
      80px auto,
      93px auto;
    background-position: left 60px, right 110px, left calc(100% - 120px), right calc(100% - 90px);
  }

  /* ===== Welcome section: menos “ar” e mais organizado ===== */
  #welcome.section {
    padding: 22px 0 !important;
  }

  #welcome .title {

    margin: 0 0 12px !important;
    max-width: none !important;
  }

  #welcome .title h2 {
    font-size: 26px !important;
    line-height: 1.15 !important;
    margin-bottom: 8px !important;
  }

  #welcome .title p {
    font-size: 14px !important;
    line-height: 1.45 !important;
    margin-top: 0 !important;
  }

  /* ===== Tiles: cards mais compactos e com hierarquia melhor ===== */
  #welcome .tiles {
    gap: 10px !important;
    margin-top: 12px !important;
  }

  #welcome .tile {
    padding: 14px !important;
    min-height: 0 !important;
    /* remove altura “forçada” */
    border-radius: 16px !important;
  }

  /* bloco texto */
  #welcome .tile>div {
    display: grid;
    gap: 6px;
  }

  #welcome .tile b {
    font-size: 16px !important;
    line-height: 1.2 !important;
  }

  #welcome .tile span {
    font-size: 13px !important;
    line-height: 1.35 !important;
    margin-top: 0 !important;
    color: rgba(18, 18, 18, .70);
  }

  /* CTA: vira “botão” organizado no rodapé do card */
  #welcome .tile a {
    margin-top: 10px !important;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(31, 106, 87, .22);
    background: rgba(31, 106, 87, .06);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-weight: 900;
    width: 100%;
  }

  #welcome .tile a:hover {
    background: rgba(31, 106, 87, .10);
    border-color: rgba(31, 106, 87, .35);
  }

  /* ===== FIX FOOTER MOBILE ===== */
  footer {
    width: 100%;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  footer * {
    max-width: 100%;
    box-sizing: border-box;
  }

  .foot .meta {
    grid-template-columns: 1fr;
  }

}