/* =========================================================
   RESPONSIVIDADE
   ========================================================= */

/* ============================================
   TABLET (≤ 992px)
   ============================================ */
@media (max-width: 992px) {

  /* Variáveis de Espaçamento */
  :root {
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
  }

  /* Menu */
  .navbar {
    padding: 0.5rem var(--space-lg);
  }

  /* Hero */
  .hero {
    margin-top: 80px;
  }

  /* Tabs */
  .tabs-container,
  .metodo-tabs-container {
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: var(--space-lg);
  }

  .tabs-container.tabs--vertical {
    grid-template-columns: 200px 1fr;
  }

  .tab__title .h2,
  .metodo-tab__title .h2 {
    font-size: var(--text-sm);
  }

  .tab__content,
  .metodo-tab__content {
    padding: var(--space-lg);
    min-height: 350px;
  }

  /* Galeria */
  .galeria {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-md);
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }
}

/* ============================================
   MOBILE (≤ 768px)
   ============================================ */
@media (max-width: 768px) {

  /* Variáveis de Espaçamento */
  :root {
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    --space-3xl: 3rem;
  }


  body {
    padding-top: 80px;
  }

  /* ========== MENU ========== */
  .navbar {
    flex-wrap: wrap;
    padding: 0.5rem var(--space-lg);
  }

  .logo {
    order: 1;
    height: 70px;
  }

  .menu-toggle {
    display: block;
    order: 2;
    margin-left: auto;
  }

  .navbar>ul {
    order: 3;
    flex-direction: column;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: var(--transition-nav);
  }

  .navbar.open>ul {
    max-height: 600px;
  }

  .navbar>ul>li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .submenu {
    position: static;
    background: var(--color-primary-900);
    padding-left: var(--space-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .navbar>ul>li.active>.submenu {
    max-height: 300px;
  }

  /* ========== HERO ========== */
  .hero {
    height: 70vh;
    margin-top: 70px;
    padding: var(--space-lg) 0;
  }

  .hero-content h1 {
    font-size: var(--text-2xl);
  }

  .hero-content p {
    font-size: var(--text-base);
  }

  /* ========== TABS (AJUSTADO PARA MOBILE) ========== */
  @media (max-width: 768px) {

    .tabs-container,
    .metodo-tabs-container {
      display: flex !important;
      flex-direction: column !important;
      width: 100vw !important;
      /* ocupar toda a largura da viewport */
      max-width: 100% !important;
      margin: 0 !important;
      padding: 0 var(--space-md) !important;
      /* respiro lateral */
      box-sizing: border-box !important;
    }

    .tabs,
    .metodo-tabs {
      width: 100% !important;
      display: flex !important;
      flex-direction: column !important;
      align-items: stretch !important;
      box-shadow: none !important;
      border: none !important;
    }

    .tabs li,
    .metodo-tabs li {
      width: 100% !important;
      margin: 0 0 var(--space-xs) 0 !important;
    }

    .tab__title,
    .metodo-tab__title {
      display: block !important;
      width: 100% !important;
      text-align: left !important;
      background: var(--color-surface-elevated);
      border-radius: var(--border-radius-md);
      box-shadow: var(--shadow-sm);
    }

    .tab__content,
    .metodo-tab__content {
      display: none !important;
      width: 100% !important;
      max-width: 100% !important;
      background: var(--color-surface);
      padding: var(--space-md) !important;
      margin-top: var(--space-xs);
      border-radius: var(--border-radius-md);
      box-sizing: border-box !important;
    }

    .tabs li.active .tab__content,
    .metodo-tabs li.active .metodo-tab__content {
      display: block !important;
    }

    .tabs-container *,
    .metodo-tabs-container * {
      max-width: 100% !important;
    }
  }


  /* ========== GRID ========== */
  .features-grid,
  .two-column,
  .card-ajudars-grid,
  .grid--2cols-premios,
  .card-fiscals-fiscal-grid,
  .benefits-grid {
    grid-template-columns: 1fr;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .step-fiscal {
    grid-template-columns: 1fr;
  }

  /* ========== SEÇÕES ========== */
  .section,
  .section-ajudar,
  .section-metodologia,
  .section-galeria {
    padding: var(--space-2xl) var(--space-lg);
  }

  .oracao {
    padding: var(--space-lg);
  }

  .h1-oracao {
    font-size: var(--text-xl);
  }

  /* ========== GALERIA ========== */
  .galeria {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-md);
  }

  .galeria-item {
    max-width: 100%;
  }

  /* ========== FOOTER ========== */
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-lg);
  }

  .social-icons {
    justify-content: center;
  }

  /* ========== BOTÕES ========== */
  .btn {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
  }

  .btn-fiscal-group {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============================================
   PEQUENO MOBILE (≤ 480px)
   ============================================ */
@media (max-width: 480px) {

  /* Galeria */
  .galeria {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: var(--space-xs);
  }

  .galeria-item::after {
    font-size: 2rem;
  }

  /* Botões */
  .btn {
    padding: var(--space-xs) var(--space-sm);
  }

  /* Tipografia */
  h1,
  h2,
  h3,
  h4 {
    line-height: 1.3;
    margin-bottom: var(--space-xs);
  }
}

/* ============================================
   DESKTOP (≥ 1280px)
   ============================================ */
@media (min-width: 1280px) {

  .container,
  .container-ajudar,
  .container-fiscal,
  .container-premios,
  .container-social {
    padding: 0 var(--space-xl);
  }
}

/* ============================================
   DARK MODE
   ============================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --color-surface: #1a1a1a;
    --color-surface-elevated: #2a2a2a;
    --color-surface-hover: #3a3a3a;
    --color-text-primary: #e0e0e0;
    --color-text-secondary: #b0b0b0;
    --color-border-light: #3a3a3a;
    --color-primary-100: #1a1a1a;
  }

  .tabs,
  .metodo-tabs,
  .tab__content,
  .metodo-tab__content {
    border-color: var(--color-border-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  }
}

/* ============================================
   IMPRESSÃO
   ============================================ */
@media print {

  /* Ocultar elementos interativos */
  .navbar,
  .menu-toggle,
  .hero,
  .tabs,
  .metodo-tabs,
  .lightbox,
  .social-icons {
    display: none;
  }


  .tabs-container,
  .metodo-tabs-container {
    display: block;
  }

  .tab__content,
  .metodo-tab__content {
    display: block;
    border: 1px solid #000;
    box-shadow: none;
    page-break-inside: avoid;
    margin-bottom: var(--space-lg);
  }

  /* Ajustes de impressão */
  body {
    background: white;
    color: black;
    padding-top: 0;
  }
}

/* ============================================
   ACESSIBILIDADE
   ============================================ */

/* Redução de movimento */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Foco visível */
a:focus-visible,
button:focus-visible,
.tab__title:focus-visible,
.metodo-tab__title:focus-visible {
  outline: 2px solid var(--color-primary-700);
  outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
  REFERÊNCIAS BIBLIOGRÁFICAS
   ========================================================= */
@media (max-width: 768px) {
  .referencia-list {
    padding: var(--space-md);
    max-width: 95%;
  }

  .referencia {
    font-size: 0.9rem;
    padding-left: var(--space-sm);
  }
}

/* =========================================================
  CARDS
   ========================================================= */

@media (min-width: 1400px) {
  .flex-ajudar {
    gap: 4rem;
  }
}

/* =========================================================
  EVENTOS
   ========================================================= */

@media (max-width: 768px) {
  .container-eventos {
    padding: 0 1rem;
  }

  .header-content {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 0;
  }

  .logo {
    font-size: 1.5rem;
    text-align: center;
  }

  .filters {
    justify-content: stretch;
    flex-direction: column;
  }

  .filters>* {
    width: 100%;
  }

  .events-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    justify-items: center;
    justify-content: center;
  }

  .page-header {
    margin-bottom: 2.5rem;
    padding-top: 1rem;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .page-header p {
    font-size: 1rem;
  }

  main {
    padding: 2rem 0 3rem;
  }


  .event-date {
    position: relative;
    z-index: 1;
    min-height: auto;
    /* remove altura fixa */
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;

  }


  .date-box {
    min-width: 60px;
    padding: 0.75rem;
  }

  .date-day {
    font-size: 1.75rem;
  }

  .event-title {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .events-grid {
    gap: 1.25rem;

  }




}

/* =========================================================
  Footer
   ========================================================= */


@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: var(--space-lg);
  }

  .footer-desc {
    max-width: 100%;
  }

  .footer-title {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer {
    padding: var(--space-xl) 0 var(--space-md);
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
  }

  .footer-title {
    text-align: center;
  }
}

/* =========================================================
   LIGHTBOX
   ========================================================= */
@media (max-width: 768px) {
  .galeria {
    gap: 14px;
  }
}

/* =========================================================
   HERO CONTEUDO
   ========================================================= */
@media (max-width: 768px) {
  .hero {
    padding: clamp(1.25rem, 3vw, 1.75rem) var(--space-sm);
    margin-bottom: var(--space-md);
    min-height: clamp(110px, 16vh, 150px);
  }

  .hero h1,
  .hero__title {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
  }

  .hero__subtitle,
  .hero p {
    font-size: clamp(0.875rem, 3.5vw, 1rem);
    max-width: 95%;
  }
}

@media (max-width: 480px) {
  .hero {
    border-radius: var(--radius-md);
    min-height: clamp(100px, 18vh, 140px);
    padding: var(--space-sm);
    gap: clamp(0.375rem, 1vw, 0.5rem);
  }

  .hero__content {
    gap: clamp(0.25rem, 0.75vw, 0.375rem);
  }

  .hero h1,
  .hero__title {
    font-size: clamp(1.25rem, 6vw, 1.5rem);
    line-height: 1.15;
  }

  .hero__subtitle,
  .hero p {
    font-size: clamp(0.8rem, 4vw, 0.95rem);
    line-height: 1.35;
  }

  .hero__cta {
    flex-direction: column;
    width: 100%;
    margin-top: var(--space-xs);
  }

  .hero__cta .btn {
    width: 100%;
    max-width: 240px;
  }
}

/* =========================================================
   HOME CARDS
   ========================================================= */
@media (min-width: 768px) {
  .escola-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (min-width: 1024px) {
  .escola-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* =========================================================
   MENU PRINCIPAL
   ========================================================= */


@media (max-width: 992px) {
  .navbar {
    flex-wrap: wrap;
    padding: 0.5rem 1rem;
  }

  .menu-toggle {
    display: block;
    order: 2;
    margin-left: auto;
  }

  .logo {
    order: 1;
    height: 70px;
  }

  .navbar>ul {
    order: 3;
    flex-direction: column;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }

  .navbar.open>ul {
    max-height: 600px;
  }

  .navbar>ul>li {
    width: 100%;
    border-bottom: 1px solid var(--color-border-light);
  }

  .navbar>ul>li>a::after {
    display: none;
  }

  /* Submenu no mobile */
  .submenu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-radius: 0;
    background: var(--color-primary-900);
    padding-left: 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .navbar>ul>li.active>.submenu {
    max-height: 300px;
  }

  .submenu li a {
    padding: 0.6rem 1rem;
    font-size: 0.65rem;
    font-family: var(--font-secondary);
  }
}


/* =========================================================
   TRANSPARENCIA
   ========================================================= */
@media (max-width: 992px) {
  .transparencia-list {
    width: 80%;
    /* Ajusta no tablet */
    min-width: unset;
  }
}

@media (max-width: 576px) {
  .transparencia-list {
    width: 95%;
  }

  .transparencia {
    text-align: center;
  }

  .section-transparencia .section-title {
    text-align: center;
    padding-left: 0;
  }
}