/* ==========================================================================
   IncisiorNews — Responsive Stylesheet (Mobile-First)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base (already mobile-first in style.css)
   Most components default to single column — expand at breakpoints.
   -------------------------------------------------------------------------- */

/* ===========================
   BREAKPOINT: max 1200px
   =========================== */
@media (max-width: 1200px) {
  :root {
    --container-max: 100%;
  }

  .container {
    padding: 0 1.5rem;
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 2rem;
  }

  .footer-grid > *:last-child {
    grid-column: span 3;
  }

  .hero-grid-layout {
    grid-template-columns: 1fr 300px;
  }

  .video-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .articles-grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===========================
   BREAKPOINT: max 1024px
   =========================== */
@media (max-width: 1024px) {
  /* Navigation */
  .nav-menu {
    gap: 0;
  }

  .nav-link {
    padding: 0 0.65rem;
    font-size: 0.74rem;
  }

  /* Hero */
  .hero-grid-layout {
    grid-template-columns: 1fr;
  }

  .hero-side-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  /* Main layout */
  .main-content-area {
    grid-template-columns: 1fr 260px;
    gap: 1.5rem;
  }

  /* Category strip */
  .category-strip-grid {
    grid-template-columns: 1fr 1fr;
  }

  .category-strip-main {
    grid-column: span 2;
  }

  .category-strip-sidebar {
    grid-column: span 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  /* Category page */
  .category-articles-layout {
    grid-template-columns: 1fr 260px;
  }

  /* Article page */
  .article-full-layout {
    grid-template-columns: 1fr 260px;
  }

  /* Video grid */
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Related articles */
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .footer-grid > *:last-child {
    grid-column: unset;
  }

  /* Articles grids */
  .articles-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .articles-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===========================
   BREAKPOINT: max 768px (Tablet)
   =========================== */
@media (max-width: 768px) {
  /* ---- Top Bar ---- */
  .top-bar-left .top-bar-weather,
  .top-bar-links {
    display: none;
  }

  .top-bar {
    height: auto;
    padding: 0.45rem 0;
  }

  /* ---- Breaking News Bar ---- */
  .breaking-label {
    font-size: 0.7rem;
    padding: 0 0.65rem;
  }

  .ticker-track span {
    font-size: 0.8rem;
    padding-right: 2rem;
  }

  /* ---- Site Header ---- */
  .site-header .container {
    height: 60px;
    gap: 1rem;
  }

  .logo-incisor,
  .logo-news {
    font-size: 1.5rem;
  }

  .logo-tagline {
    display: none;
  }

  .header-search {
    max-width: 220px;
  }

  .btn-subscribe {
    display: none;
  }

  /* ---- Navigation ---- */
  .main-nav .nav-menu {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .nav-inner {
    justify-content: space-between;
    padding: 0 0;
  }

  .nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .nav-live-badge {
    font-size: 0.62rem;
    padding: 0.18rem 0.4rem;
  }

  /* Mobile nav is active now */
  .mobile-nav {
    display: block;
  }

  /* ---- Crypto Bar ---- */
  .crypto-ticker-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .crypto-ticker-bar::-webkit-scrollbar {
    display: none;
  }

  .crypto-ticker-scroll {
    overflow: visible;
  }

  .crypto-item {
    padding: 0 0.9rem;
  }

  /* ---- Hero Section ---- */
  .hero-grid-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hero-side-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .hero-main-content .article-title {
    font-size: 1.3rem;
  }

  /* ---- Main Layout ---- */
  .main-content-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }

  /* ---- Category Strip ---- */
  .category-strip-grid {
    grid-template-columns: 1fr;
  }

  .category-strip-main {
    grid-column: span 1;
  }

  .category-strip-sidebar {
    grid-column: span 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  /* ---- Category Page ---- */
  .category-articles-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .category-articles-layout .sidebar {
    grid-template-columns: 1fr 1fr;
  }

  .category-articles-grid {
    grid-template-columns: 1fr;
  }

  /* ---- Article Full ---- */
  .article-full-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .article-full-layout .sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: static;
  }

  .article-header {
    padding: 1.25rem 1.25rem 0.75rem;
  }

  .article-content {
    padding: 1.25rem;
    font-size: 1rem;
  }

  .article-title-main {
    font-size: 1.6rem;
  }

  .article-featured-image {
    max-height: 320px;
  }

  .social-share {
    padding: 1rem 1.25rem;
  }

  .article-footer {
    padding: 1rem 1.25rem;
  }

  /* ---- Comments ---- */
  .comments-section {
    padding: 1.25rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

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

  /* ---- Video Section ---- */
  .video-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* ---- Articles Grids ---- */
  .articles-grid-3,
  .articles-grid-4 {
    grid-template-columns: 1fr 1fr;
  }

  .articles-grid-2 {
    grid-template-columns: 1fr;
  }

  /* ---- Search Results ---- */
  .search-result-item {
    flex-direction: column;
    gap: 0.75rem;
  }

  .search-result-img {
    width: 100%;
    height: 180px;
    min-width: unset;
  }

  /* ---- Footer ---- */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
  }

  .footer-grid > *:first-child {
    grid-column: span 2;
  }

  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .footer-bottom-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }

  /* ---- Section header ---- */
  .section-title {
    font-size: 1.15rem;
  }

  /* ---- Ad zones ---- */
  .ad-leaderboard,
  .ad-skyscraper {
    display: none;
  }

  .ad-rectangle {
    width: 100%;
    min-height: 200px;
  }

  /* ---- Category Banner ---- */
  .category-banner {
    padding: 2rem 0;
  }

  .category-banner-title {
    font-size: 2rem;
  }

  /* ---- Error page ---- */
  .error-actions {
    flex-direction: column;
    align-items: center;
  }
}

/* ===========================
   BREAKPOINT: max 480px (Mobile)
   =========================== */
@media (max-width: 480px) {
  /* Base */
  body { font-size: 15px; }

  .container { padding: 0 1rem; }

  /* ---- Top Bar ---- */
  .top-bar { display: none; }

  /* ---- Site Header ---- */
  .site-header .container {
    height: 56px;
    gap: 0.75rem;
  }

  .logo-incisor,
  .logo-news {
    font-size: 1.35rem;
  }

  .header-search {
    max-width: 160px;
  }

  .header-search-form input {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
  }

  .theme-toggle {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  /* ---- Breaking News ---- */
  .breaking-label {
    display: none;
  }

  /* ---- Crypto Bar ---- */
  .crypto-ticker-label {
    display: none;
  }

  /* ---- Hero ---- */
  .hero-section { padding: 1rem 0; }

  .hero-side-stack {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .hero-main-content .article-title {
    font-size: 1.2rem;
  }

  .hero-main-content .article-excerpt {
    display: none;
  }

  /* ---- Article Cards ---- */
  .article-card.horizontal {
    flex-direction: column;
  }

  .article-card.horizontal .article-card-img {
    width: 100%;
    height: 180px;
    aspect-ratio: unset;
  }

  /* ---- Grids become single col ---- */
  .articles-grid-2,
  .articles-grid-3,
  .articles-grid-4,
  .related-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }

  .category-strip-sidebar {
    grid-template-columns: 1fr;
  }

  /* ---- Hero side stack ---- */
  .hero-side-stack {
    display: flex;
    flex-direction: column;
  }

  /* ---- Sidebar ---- */
  .sidebar {
    display: flex;
    flex-direction: column;
  }

  /* ---- Article Full ---- */
  .article-full-layout .sidebar {
    display: flex;
    flex-direction: column;
  }

  .article-header {
    padding: 1rem;
  }

  .article-content {
    padding: 1rem;
    font-size: 0.95rem;
  }

  .article-content p:first-child::first-letter {
    font-size: 2.8rem;
  }

  .article-content h2 { font-size: 1.35rem; }
  .article-content h3 { font-size: 1.1rem; }

  .article-title-main {
    font-size: 1.4rem;
  }

  .article-byline {
    gap: 0.6rem;
  }

  .article-featured-image {
    max-height: 240px;
  }

  .social-share {
    padding: 0.75rem 1rem;
    gap: 0.35rem;
  }

  .share-btn {
    padding: 0.35rem 0.7rem;
    font-size: 0.74rem;
  }

  /* ---- Comments ---- */
  .comments-section {
    padding: 1rem;
  }

  .comment-item {
    gap: 0.65rem;
  }

  .comment-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  /* ---- Footer ---- */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-grid > *:first-child {
    grid-column: span 1;
  }

  .footer-brand-desc {
    max-width: 100%;
  }

  .footer-bottom-links {
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
  }

  /* ---- Pagination ---- */
  .page-link {
    min-width: 34px;
    height: 34px;
    font-size: 0.82rem;
  }

  /* ---- Section header ---- */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  /* ---- Trending ---- */
  .trending-number {
    font-size: 1.3rem;
    min-width: 1.5rem;
  }

  .trending-thumb {
    width: 52px;
    height: 42px;
  }

  /* ---- Category Banner ---- */
  .category-banner { padding: 1.5rem 0; }
  .category-banner-title { font-size: 1.6rem; }
  .category-banner-desc { font-size: 0.875rem; }

  /* ---- Breadcrumbs ---- */
  .breadcrumb-list {
    font-size: 0.73rem;
  }

  /* ---- Error page ---- */
  .error-page {
    min-height: 50vh;
    padding: 2rem 1rem;
  }

  /* ---- Back to top ---- */
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }

  /* ---- Toast ---- */
  .toast {
    font-size: 0.82rem;
    padding: 0.6rem 1rem;
  }

  /* ---- Buttons ---- */
  .btn-lg {
    padding: 0.7rem 1.35rem;
    font-size: 0.92rem;
  }

  /* ---- Video card ---- */
  .video-play-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  /* ---- Search results ---- */
  .search-result-img {
    height: 150px;
  }

  /* ---- Weather widget ---- */
  .weather-temp {
    font-size: 2.2rem;
  }

  .weather-icon {
    font-size: 2.4rem;
  }
}

/* ===========================
   BREAKPOINT: max 360px (Small Mobile)
   =========================== */
@media (max-width: 360px) {
  .container { padding: 0 0.75rem; }

  .logo-incisor,
  .logo-news {
    font-size: 1.2rem;
  }

  .header-search {
    max-width: 130px;
  }

  .header-search-form input {
    padding: 0.35rem 0.6rem;
  }

  .hamburger {
    width: 32px;
    height: 32px;
  }

  .hamburger-bar {
    width: 18px;
  }

  .hero-main-content {
    padding: 0.85rem;
  }

  .hero-main-content .article-title {
    font-size: 1.1rem;
  }

  .article-card-body {
    padding: 0.75rem;
  }

  .article-card-body .article-title {
    font-size: 0.9rem;
  }

  .section-title {
    font-size: 1rem;
  }

  .mobile-nav {
    width: 100%;
    right: -100%;
  }

  .footer-social-link {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .share-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
  }

  .trending-thumb {
    width: 44px;
    height: 36px;
  }

  .trending-title {
    font-size: 0.78rem;
  }

  .pagination {
    gap: 0.25rem;
  }

  .page-link {
    min-width: 30px;
    height: 30px;
    font-size: 0.78rem;
  }

  .btn-subscribe {
    display: none !important;
  }

  .back-to-top {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }
}

/* ===========================
   Admin Responsive
   =========================== */
@media (max-width: 1024px) {
  .admin-sidebar {
    transform: translateX(-100%);
    position: fixed;
    z-index: 1000;
    transition: transform 0.3s ease;
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0 !important;
  }

  .admin-topbar-toggle {
    display: flex !important;
  }

  .admin-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }

  .admin-overlay.active {
    display: block;
  }
}

@media (max-width: 768px) {
  .admin-stats-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .admin-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-table-responsive table {
    min-width: 700px;
  }

  .admin-content {
    padding: 1rem !important;
  }

  .admin-topbar {
    padding: 0.75rem 1rem !important;
  }

  .admin-form-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .admin-stats-grid {
    grid-template-columns: 1fr !important;
  }

  .admin-topbar-right {
    gap: 0.5rem !important;
  }

  .admin-topbar-user-name {
    display: none !important;
  }
}

/* ===========================
   Utility Responsive
   =========================== */
@media (max-width: 768px) {
  .hide-tablet { display: none !important; }
}

@media (max-width: 480px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 769px) {
  .show-mobile-only { display: none !important; }
}

/* Landscape phone fix */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-main-image {
    aspect-ratio: 2/1;
  }

  .video-modal-inner {
    width: 80%;
  }

  .article-featured-image {
    max-height: 240px;
  }
}
