/* =========================================================
   MEDIA QUERIES (OTIMIZADO — BOTÕES E MENUS PRESERVADOS)
   ========================================================= */

/* ===== TELAS GRANDES (DESKTOP) ===== */
@media (min-width: 1024px) {
  .lg\:flex {
    display: flex !important;
  }
  .lg\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #sobre > div > div:first-child {
    margin-top: 60px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1280px) {
  .mx-auto,
  .container {
    width: min(var(--largura), calc(100% - 48px));
  }
  #sobre > div {
    gap: 40px;
  }
}

/* ===== TABLETS E NOTEBOOKS MENORES ===== */
@media (max-width: 1023px) {
  header .hidden.sm\:inline-flex {
    display: inline-flex !important;
  }
  .bg-hero-warm {
    padding-top: 0;
  }
  .bg-hero-warm > div {
    min-height: auto;
  }
  .bg-hero-warm .relative > div:first-child img {
    min-height: 380px;
  }
  .contact-grid,
  .cta-inner {
    grid-template-columns: 1fr;
  }
  .cta-actions {
    justify-content: flex-start;
  }
  header > div {
    width: calc(100% - 40px);
  }
  header > div > div > button,
  header > div > div > button[aria-label="Abrir menu"],
  header > div > div > button[aria-label="Fechar menu"],
  .mobile-menu-button {
    display: inline-flex !important;
  }
  .mx-auto,
  .container {
    width: min(var(--largura), calc(100% - 32px));
  }
  #projetos,
  #form-contato,
  #contato-form {
    height: auto !important;
  }
  section.bg-green-gradient img {
    width: min(85%, 900px) !important;
    height: auto !important;
    min-height: 0 !important;
    object-fit: contain;
  }
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .site-header .container,
  .footer-container,
  .footer-bottom-content {
    width: calc(100% - 40px);
  }
  .footer-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px 30px;
    padding-top: 50px;
    padding-bottom: 40px;
  }
  .banners-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  #sobre > div {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  #sobre > div > div:first-child {
    height: 420px;
  }
  #sobre > div > div:last-child {
    min-height: auto;
  }
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 38px 28px;
  }
  .stat-card strong {
    font-size: 2.2rem;
  }
  .news-hero {
    padding: 48px 0 28px;
  }
}

/* ===== SMARTPHONES (767px PARA BAIXO) ===== */
@media (max-width: 767px) {
  .mx-auto,
  .container {
    width: calc(100% - 28px);
  }
  .section-pad {
    padding: 30px 0;
  }
  .bg-hero-warm {
    padding-top: 1rem;
  }
  .bg-hero-warm > div {
    padding-top: 20px;
    padding-bottom: 60px;
    min-height: auto;
    grid-template-columns: 1fr !important;
    gap: 30px;
  }
  .bg-hero-warm .flex-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .bg-hero-warm .flex-wrap a {
    width: 100%;
  }
  .bg-hero-warm .relative > div:first-child img {
    width: 100%;
    min-height: 0;
    height: clamp(240px, 65vw, 360px);
    object-fit: cover;
  }
  .bg-hero-warm h1 {
    max-width: 100%;
  }
  #sobre .grid,
  #projetos .grid {
    grid-template-columns: 1fr !important;
  }
  #sobre img {
    min-height: 280px;
  }
  .contact-grid {
    gap: 30px;
  }
  .contact-form {
    padding: 22px;
    border-radius: 20px;
  }
  .contact-info-list {
    gap: 14px;
  }
  .contact-info-item {
    padding: 14px;
    align-items: flex-start;
  }
  .footer-bottom-content {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
  .news-title {
    font-size: 1.25rem;
  }
  header > div {
    width: calc(100% - 24px);
    min-height: 70px;
  }
  header .font-display,
  header > div > a:first-child > span:last-child,
  .brand-name {
    font-size: 1rem;
  }
  header > div > a:first-child > span:first-child,
  .brand-mark {
    width: 38px;
    height: 38px;
  }
  .mobile-menu-open {
    left: 0;
    right: 0;
    top: calc(100% + 6px);
  }
  #sobre {
    padding: 50px 0;
  }
  #sobre > div {
    gap: 34px;
  }
  #projetos article {
    min-height: auto;
    padding: 24px;
  }
  .cta-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .cta-actions a {
    width: 100%;
  }
  body {
    padding-top: 70px;
  }
  .site-header .container,
  .header-inner {
    width: calc(100% - 28px);
    min-height: 64px;
  }
  .main-nav {
    gap: 6px;
  }
  .main-nav a {
    padding: 6px 10px;
    font-size: .84rem;
  }
  .header-button {
    padding: 9px 14px;
    font-size: .82rem;
  }
  .footer-container {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-top: 40px;
    padding-bottom: 34px;
  }
  .footer-column h4 {
    margin-bottom: 12px;
  }
  .footer-social-links {
    justify-content: flex-start;
  }
  .banner-card {
    min-height: 140px;
  }
  .banner-card img {
    height: 160px;
  }
}

@media (max-width: 640px) {
  .parcerias-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }
  .parcerias-actions .btn-doe {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
  .parcerias-actions .btn-insta-action {
    align-self: center;
    margin-top: 4px;
  }
}

@media (max-width: 600px) {
  #sobre {
    padding-top: 60px;
    padding-bottom: 60px;
  }
  #sobre > div {
    gap: 30px;
  }
  #sobre > div > div:first-child {
    height: 300px;
    border-radius: 22px;
  }
  #sobre > div > div:last-child > div {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  #sobre > div > div:last-child > div > div {
    min-height: auto;
    padding: 18px;
  }
  .header-button {
    display: none;
  }
  .news-hero {
    padding: 65px 0;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
  .footer-container {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 45px;
    padding-bottom: 40px;
  }
  .footer-bottom-content {
    min-height: auto;
    padding-top: 18px;
    padding-bottom: 18px;
    flex-direction: column;
    align-items: flex-start;
  }
  body:has(.bg-hero-warm) a.bg-accent,
  body:has(.bg-hero-warm) a.bg-info {
    min-height: 46px;
    padding: 10px 16px;
  }
  .stat-card {
    min-height: auto;
    padding: 18px 12px;
  }
  .stat-card strong {
    font-size: 1.85rem;
  }
  .stat-card span {
    font-size: .78rem;
  }
  .news-hero h1 {
    font-size: 2rem;
  }
  .news-hero p {
    font-size: .98rem;
  }
}

/* ===== CELULARES PEQUENOS ===== */
@media (max-width: 480px) {
  .mx-auto,
  .container {
    width: calc(100% - 24px);
  }
  .bg-hero-warm h1 {
    font-size: 2.2rem;
  }
  .contact-info-item {
    font-size: .92rem;
  }
  .stat-card span {
    font-size: .82rem;
  }
}

@media (max-width: 420px) {
  .site-header .container {
    width: calc(100% - 20px);
    flex-wrap: wrap;
    justify-content: space-between;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .main-nav {
    order: 3;
    width: 100%;
    justify-content: right;
  }
  .header-button {
    order: 2;
  }
  .footer-container,
  .footer-bottom-content {
    width: calc(100% - 22px);
  }
  .footer-column h3 {
    font-size: 1.35rem;
  }
  .footer-column h4 {
    font-size: .95rem;
  }
  .news-hero {
    padding: 36px 0 20px;
  }
  .news-hero h1 {
    font-size: 1.8rem;
  }
  .news-card-body {
    padding: 18px;
  }
  .news-tag {
    font-size: .75rem;
  }
  .news-meta {
    font-size: .8rem;
  }
}
