/*
 * Naghshname responsive hardening layer
 * Loaded after the visual themes so layout fixes win without changing PHP behavior.
 */
:where(*, *::before, *::after) { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { min-width: 320px; overflow-wrap: anywhere; }
img, video, iframe, svg { max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { max-width: 100%; }
input, select, textarea { min-width: 0; }
:where(.nq-main, .nq-content, .nq-container, .nq-wrap, .nq-section,
       .nq-card, .nq-card__body, .artist-details, .movie-details,
       .profile-hero-inner, .profile-body-col, .profile-poster-col) {
  min-width: 0;
}
:where(.nq-cardgrid, .nq-cardgrid--archive, .nq-cardgrid--grouped,
       .nq-feedgrid, .nq-feedgrid--news, .nq-why__grid, .nq-footer__grid) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
:where(table) { max-width: 100%; }
@media (max-width: 760px) {
  :where(.nq-main, .nq-content, .nq-container, .nq-wrap) {
    width: min(100% - 24px, 100%);
    max-width: 100%;
  }
  :where(.nq-cardgrid, .nq-cardgrid--archive, .nq-cardgrid--grouped,
         .nq-feedgrid, .nq-feedgrid--news) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  :where(.nq-footer__grid, .nq-why__grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  :where(.nq-header, .nq-header__inner, .nq-navbar, .nq-nav) {
    min-width: 0;
  }
  :where(.nq-nav, .nq-header-actions) { flex-wrap: wrap; }
  :where(.nq-staticpage, .community-page) {
    width: calc(100% - 24px);
    max-width: 100%;
    padding: clamp(16px, 4vw, 24px);
    border-radius: 18px;
  }
  :where(.nq-table-wrap, .table-responsive, .admin-table-wrap) {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  :where(.admin-table, .nq-table) { min-width: 620px; }
}
@media (max-width: 520px) {
  :where(.nq-cardgrid, .nq-cardgrid--archive, .nq-cardgrid--grouped,
         .nq-feedgrid, .nq-feedgrid--news, .nq-footer__grid, .nq-why__grid) {
    grid-template-columns: minmax(0, 1fr);
  }
  :where(.nq-main, .nq-content, .nq-container, .nq-wrap) {
    width: calc(100% - 20px);
  }
  :where(.nq-staticpage, .community-page) {
    width: calc(100% - 20px);
    padding: 16px;
  }
  :where(.nq-btn, .nq-button, .btn) {
    max-width: 100%;
    white-space: normal;
  }
  :where(h1) { font-size: clamp(1.45rem, 7vw, 2rem); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
