/* Additional WordPress + RWD enhancements */
html { scroll-behavior: smooth; }
body.mobile-nav-open { overflow: hidden; }
img, video, iframe { max-width: 100%; height: auto; }
.site-header .header-login-btn + .header-login-btn { margin-left: 8px; }
.primary-nav .nav-link.active { color: var(--text-primary); background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); }
.sma-scroll-row { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.sma-scroll-row > * { flex-shrink: 0; }
footer .footer-nav-group a { word-break: break-word; }

@media (max-width: 1200px) {
  .header-inner { gap: 12px; }
  .hero-content-wrap, .sponsor-hero-grid, .news-layout, .music-layout, .about-grid, .rank-layout { gap: 24px !important; }
  .hero-posters { justify-content: center; }
}

@media (max-width: 900px) {
  .site-header { backdrop-filter: blur(22px); }
  .header-inner { min-height: 72px; }
  .header-actions { margin-left: auto; gap: 8px; }
  .header-login-btn, .header-register-btn, .header-sponsor-btn { display: none !important; }
  .mobile-menu-btn { display: inline-flex !important; }
  .primary-nav {
    position: fixed;
    top: 78px;
    right: 12px;
    left: 12px;
    width: auto !important;
    max-height: calc(100vh - 96px);
    overflow: auto;
    padding: 14px;
    border-radius: 24px;
    background: rgba(12, 15, 27, .92);
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 24px 60px rgba(0,0,0,.32);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    display: flex !important;
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px;
  }
  .primary-nav.mobile-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .primary-nav > .nav-link,
  .primary-nav > .nav-item > .nav-link {
    width: 100%;
    justify-content: space-between;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,.04);
  }
  .nav-more-item { width: 100%; }
  .nav-more-dropdown {
    position: static !important;
    transform: none !important;
    display: none;
    opacity: 1 !important;
    pointer-events: auto !important;
    width: 100%;
    margin-top: 8px;
    border-radius: 16px;
  }
  .nav-more-dropdown.nav-more-open { display: block; }
  .hero-section { padding-top: 120px !important; }
  .hero-content-wrap,
  .news-layout,
  .music-layout,
  .rank-layout,
  .sponsor-hero-grid,
  .season-layout,
  .about-grid,
  .info-grid,
  .two-col,
  .split-layout {
    grid-template-columns: 1fr !important;
    display: grid !important;
  }
  .hero-posters { margin-top: 20px; gap: 12px; }
  .hero-posters .poster-item { width: calc(33.333% - 8px) !important; min-width: 96px; margin-top: 0 !important; }
  .hero-actions, .page-actions, .cta-row { flex-wrap: wrap; }
  .hero-actions .btn, .page-actions .btn, .cta-row .btn { width: 100%; justify-content: center; }
  .section-header, .page-hero .container, .footer-top { gap: 16px; }
  .footer-top { display: grid !important; grid-template-columns: 1fr 1fr; }
  .news-sidebar, aside, .sidebar { order: 2; }
  .news-main-grid, .main-grid { order: 1; }
  .ranking-table-wrap, .data-table-wrap, .table-wrap { overflow-x: auto; }
}

@media (max-width: 768px) {
  .container { padding-left: 18px !important; padding-right: 18px !important; }
  .page-title, .hero-title { line-height: 1.15; }
  .hero-stats { gap: 10px; flex-wrap: wrap; }
  .hero-stat { min-width: calc(50% - 8px); }
  .hero-stat-divider { display: none; }
  .poster-item img { aspect-ratio: 2 / 3; object-fit: cover; }
  .section, main.container, .page-hero { padding-left: 0; padding-right: 0; }
  .tool-filter, .news-filter, .tab-row, .weekday-tabs, .music-tag-list { display: flex; flex-wrap: nowrap; }
  .anime-grid, .tools-grid, .news-card-list, .cards-grid, .ranking-grid, .music-grid, .merch-grid, .vtuber-grid, .cosplay-grid, .games-grid, .manga-grid, .pilgrimage-grid {
    grid-template-columns: 1fr !important;
  }
  .site-footer { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 480px) {
  .logo-text { font-size: 16px; }
  .logo-icon-box { width: 34px; height: 34px; }
  .header-inner { min-height: 66px; }
  .primary-nav { top: 72px; }
  .hero-title { font-size: clamp(30px, 10vw, 42px) !important; }
  .page-title { font-size: clamp(26px, 8.5vw, 34px) !important; }
  .hero-subtitle, .page-subtitle { font-size: 14px !important; }
  .hero-posters { display: grid !important; grid-template-columns: repeat(3, 1fr); align-items: start; }
  .hero-posters .poster-item { width: 100% !important; }
  .glass, .glass-mid, .glass-light, .news-card, .tool-card, .sidebar-widget { border-radius: 18px !important; }
}



/* 2026-04 fix pack: WP/BuddyPress/bbPress layout isolation */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  background: var(--grad-bg) !important;
}
body.wp-theme-smileacg-wp {
  min-width: 320px;
}
body.wp-theme-smileacg-wp section,
body.wp-theme-smileacg-wp .section,
body.wp-theme-smileacg-wp .page-hero,
body.wp-theme-smileacg-wp .hero-section,
body.wp-theme-smileacg-wp .site-footer,
body.wp-theme-smileacg-wp .site-header {
  width: 100%;
  max-width: 100%;
}
body.wp-theme-smileacg-wp .container {
  width: min(100%, 1280px);
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}
body.wp-theme-smileacg-wp .nav-link,
body.wp-theme-smileacg-wp .btn,
body.wp-theme-smileacg-wp .chip,
body.wp-theme-smileacg-wp .news-filter-btn,
body.wp-theme-smileacg-wp .tool-filter-btn,
body.wp-theme-smileacg-wp .tab-btn {
  white-space: nowrap;
}
body.wp-theme-smileacg-wp .hero-content-wrap {
  align-items: center;
}
body.wp-theme-smileacg-wp .hero-text,
body.wp-theme-smileacg-wp .hero-posters,
body.wp-theme-smileacg-wp .news-layout > *,
body.wp-theme-smileacg-wp .music-layout > * {
  min-width: 0;
}
body.wp-theme-smileacg-wp .poster-item,
body.wp-theme-smileacg-wp .anime-card,
body.wp-theme-smileacg-wp .news-card,
body.wp-theme-smileacg-wp .tool-card,
body.wp-theme-smileacg-wp .sidebar-widget {
  max-width: 100%;
}
body.wp-theme-smileacg-wp [class*='grid'] {
  min-width: 0;
}
body.wp-theme-smileacg-wp .wp-block,
body.wp-theme-smileacg-wp .bp-wrap,
body.wp-theme-smileacg-wp .buddypress-wrap,
body.wp-theme-smileacg-wp .bbp-wrapper {
  max-width: 100%;
}
body.wp-theme-smileacg-wp .search-overlay.open,
body.wp-theme-smileacg-wp .search-overlay.active {
  display: flex;
}

@media (max-width: 900px) {
  body.wp-theme-smileacg-wp .hero-section {
    padding-top: 116px !important;
  }
  body.wp-theme-smileacg-wp .hero-content-wrap {
    display: grid !important;
    grid-template-columns: 1fr !important;
    text-align: left !important;
  }
  body.wp-theme-smileacg-wp .hero-text {
    max-width: none;
  }
  body.wp-theme-smileacg-wp .hero-stats,
  body.wp-theme-smileacg-wp .hero-actions {
    justify-content: flex-start !important;
  }
  body.wp-theme-smileacg-wp .hero-posters {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
  }
  body.wp-theme-smileacg-wp .hero-posters .poster-item,
  body.wp-theme-smileacg-wp .hero-posters .poster-item:nth-child(1),
  body.wp-theme-smileacg-wp .hero-posters .poster-item:nth-child(2),
  body.wp-theme-smileacg-wp .hero-posters .poster-item:nth-child(3) {
    width: 100% !important;
    margin-top: 0 !important;
    opacity: 1 !important;
  }
  body.wp-theme-smileacg-wp .news-layout,
  body.wp-theme-smileacg-wp .music-layout,
  body.wp-theme-smileacg-wp .rank-layout,
  body.wp-theme-smileacg-wp .about-grid,
  body.wp-theme-smileacg-wp .footer-top {
    grid-template-columns: 1fr !important;
  }
  body.wp-theme-smileacg-wp .news-filter,
  body.wp-theme-smileacg-wp .tool-filter,
  body.wp-theme-smileacg-wp .weekday-tabs,
  body.wp-theme-smileacg-wp .tab-switch,
  body.wp-theme-smileacg-wp .music-tag-list {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    padding-bottom: 6px;
  }
  body.wp-theme-smileacg-wp .news-filter > *,
  body.wp-theme-smileacg-wp .tool-filter > *,
  body.wp-theme-smileacg-wp .weekday-tabs > *,
  body.wp-theme-smileacg-wp .tab-switch > *,
  body.wp-theme-smileacg-wp .music-tag-list > * {
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  body.wp-theme-smileacg-wp .container {
    width: 100%;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  body.wp-theme-smileacg-wp .hero-title {
    font-size: clamp(30px, 9vw, 42px) !important;
  }
  body.wp-theme-smileacg-wp .hero-subtitle,
  body.wp-theme-smileacg-wp .page-subtitle {
    font-size: 14px !important;
  }
  body.wp-theme-smileacg-wp .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }
  body.wp-theme-smileacg-wp .hero-stat-divider {
    display: none !important;
  }
  body.wp-theme-smileacg-wp .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
  body.wp-theme-smileacg-wp .anime-grid,
  body.wp-theme-smileacg-wp .tools-grid,
  body.wp-theme-smileacg-wp .news-card-list,
  body.wp-theme-smileacg-wp .music-grid,
  body.wp-theme-smileacg-wp .coming-cards-grid,
  body.wp-theme-smileacg-wp .games-grid,
  body.wp-theme-smileacg-wp .manga-grid,
  body.wp-theme-smileacg-wp .merch-grid,
  body.wp-theme-smileacg-wp .cosplay-grid,
  body.wp-theme-smileacg-wp .vtuber-grid,
  body.wp-theme-smileacg-wp .pilgrimage-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  body.wp-theme-smileacg-wp .site-header .header-inner {
    min-height: 64px;
  }
  body.wp-theme-smileacg-wp .hero-posters {
    display: none !important;
  }
}
