/* ==========================================================================
   GuiaNF Editorial — Responsive
   Media queries extraídas de app/globals.css linhas 1479-1840.
   Breakpoints: 1120px, 820px, 560px
   ========================================================================== */

/* ==========================================================================
   ≤ 1120px — Tablet landscape / Desktop estreito
   ========================================================================== */
@media (max-width: 1120px) {
  .brand-subtitle,
  .brand-divider {
    display: none;
  }

  .topic-grid,
  .highlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topic-grid {
    width: 100%;
  }

  .desktop-nav {
    gap: 28px;
  }

  .theme-section {
    grid-template-columns: 1fr 1.25fr;
  }
}

/* ==========================================================================
   ≤ 820px — Tablet / Mobile landscape
   ========================================================================== */
@media (max-width: 820px) {
  .post-detail--directory .wp-content > ul {
    grid-template-columns: 1fr;
  }

  /* Header mobile */
  .site-header {
    top: 0;
    width: 100%;
    min-height: 70px;
    margin: 0;
    padding: 12px 18px;
  }

  .desktop-nav {
    display: none;
  }

  /* Mobile menu (details/summary) */
  .mobile-menu {
    position: relative;
    display: block;
  }

  .mobile-menu summary {
    display: flex;
    width: 48px;
    height: 48px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 12px;
    background: var(--aqua-soft);
    cursor: pointer;
    list-style: none;
    transition: transform 140ms ease, background 140ms ease;
  }

  .mobile-menu summary:active {
    transform: scale(0.95);
  }

  .mobile-menu summary::-webkit-details-marker {
    display: none;
  }

  .mobile-menu summary span {
    width: 22px;
    height: 2.5px;
    border-radius: 999px;
    background: var(--petrol);
    transition: transform 180ms ease;
  }

  .mobile-menu[open] .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(5, 29, 40, 0.52);
    backdrop-filter: blur(8px);
    animation: fade-in 200ms ease-out both;
  }

  .mobile-menu[open] nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    width: min(320px, 86vw);
    flex-direction: column;
    gap: 6px;
    padding: 32px 20px 24px;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    background: var(--surface);
    box-shadow: -10px 0 40px rgba(5, 29, 40, 0.18);
    animation: drawer-in 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .mobile-menu nav a {
    display: flex;
    min-height: 48px;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--ink-deep);
    font-size: 1.02rem;
    font-weight: 750;
    transition: background 160ms ease, color 160ms ease;
  }

  .mobile-menu nav a.active {
    background: var(--aqua-soft);
    color: var(--teal);
  }

  .mobile-menu nav a:hover,
  .mobile-menu nav a:focus-visible {
    background: var(--aqua-soft);
    outline: none;
  }

  /* Hero mobile */
  .hero {
    width: min(100% - 24px, 720px);
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 40px 6px 12px;
  }

  .hero-copy {
    grid-column: 1;
    padding-top: 0;
    text-align: center;
  }

  .hero h1,
  .hero-description,
  .search-box {
    margin-right: auto;
    margin-left: auto;
  }

  .search-quick-pills {
    justify-content: center;
  }

  .popular-searches {
    display: none;
  }

  .hero-art {
    position: relative;
    top: auto;
    right: auto;
    width: min(100%, 540px);
    margin: 22px auto 8px;
    transform: none;
  }

  .hero-art img {
    width: 100%;
    max-width: 540px;
  }

  /* Topic grid mobile */
  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
  }

  .topic-card {
    min-height: 94px;
    padding: 14px 14px;
  }

  /* Sections mobile */
  .highlights {
    width: min(100% - 24px, 720px);
    padding: 64px 6px 80px;
  }

  .themes {
    width: min(100% - 24px, 720px);
    padding: 0 6px 80px;
  }

  .theme-section {
    grid-template-columns: 1fr;
  }

  .regional-cta {
    width: min(100% - 24px, 720px);
    align-items: flex-start;
    flex-direction: column;
  }

  /* Footer mobile */
  .footer-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-main > p {
    text-align: left;
  }

  /* Post list thumbnail mobile */
  .post-list-item a:has(.post-list-thumb) {
    grid-template-columns: 80px 1fr auto;
    gap: 16px;
  }

  .post-list-thumb {
    width: 80px;
    aspect-ratio: 1;
    border-radius: 6px;
  }

  /* Related posts mobile */
  .related-posts-grid {
    grid-template-columns: 1fr;
  }

  /* Bottom nav — visível em mobile */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    align-items: center;
    justify-content: space-around;
    height: 64px;
    padding: 0 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(8, 43, 56, 0.96);
    backdrop-filter: blur(12px);
  }

  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.65rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 160ms ease;
  }

  .bottom-nav a.active {
    color: white;
  }

  .bottom-nav a:hover {
    color: rgba(255, 255, 255, 0.85);
  }

  .bottom-nav svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* Footer adjusts for bottom nav */
  .site-footer {
    padding-bottom: 90px;
  }
}

/* ==========================================================================
   ≤ 560px — Mobile compacto
   ========================================================================== */
@media (max-width: 560px) {
  .brand-name {
    font-size: 1.7rem;
  }

  .hero {
    padding-top: 28px;
  }

  .hero h1 {
    font-size: clamp(2.4rem, 11vw, 3.4rem);
  }

  .hero h1 span {
    white-space: normal;
  }

  .hero-description {
    margin: 18px auto;
    font-size: 0.98rem;
  }

  .search-box {
    min-height: auto;
    grid-template-columns: 24px 1fr;
    padding: 12px 14px;
  }

  .search-box button {
    width: auto;
    grid-column: 1 / -1;
    min-height: 50px;
  }

  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .topic-card {
    min-height: 82px;
    padding: 12px 10px;
    gap: 8px;
  }

  .topic-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }

  .topic-icon svg {
    width: 22px;
    height: 22px;
  }

  .topic-content strong {
    font-size: 0.92rem;
  }

  .topic-content small {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.7rem;
    line-height: 1.25;
  }

  .topic-arrow {
    display: none;
  }

  .highlight-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .theme-section {
    padding: 30px 20px;
    border-radius: 24px;
  }

  .theme-feed > a {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 18px 4px;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .footer-bottom {
    flex-direction: column;
  }

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

  .pagination-pages {
    justify-content: center;
  }

  .content-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 16px 14px;
  }

  .category-links {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-links::-webkit-scrollbar {
    display: none;
  }

  .category-links a {
    flex-shrink: 0;
  }
}

