/*
 * Hindusthan News — Responsive Fixes & Production CSS
 * Mobile-first, covering 320px → 1920px+
 * Author: Antigravity
 */

/* ═══════════════════════════════════════════════
   0. GLOBAL RESET & BOX MODEL
═══════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  min-width: 320px;
}

img,
video,
iframe,
embed,
object {
  max-width: 100%;
  height: auto;
}

/* ═══════════════════════════════════════════════
   1. CSS CUSTOM PROPERTIES (Design Tokens)
═══════════════════════════════════════════════ */
:root {
  --primary-color: #e63946;
  --dark-color: #1d3557;
  --accent-color: #457b9d;
  --light-color: #f1faee;
  --bg-color: #f8f9fa;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  --card-shadow-hover: 0 12px 35px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s ease;
  --navbar-height: 82px;
  --border-radius-card: 12px;
  --border-radius-sm: 8px;
  --font-body: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;
  --touch-target: 44px;
}

/* ═══════════════════════════════════════════════
   2. NAVBAR & LOGO
═══════════════════════════════════════════════ */
.navbar {
  background: rgba(249, 252, 255, 0.97) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.75rem 0;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
  min-height: var(--navbar-height);
  z-index: 1030;
}

.site-logo {
  display: block;
  width: clamp(110px, 28vw, 180px);
  height: auto;
  max-height: 56px;
  object-fit: contain;
}

.navbar-brand {
  padding: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: #fff !important;
  font-weight: 700;
  flex-shrink: 0;
}

/* Hamburger toggler */
.navbar-toggler {
  border: 2px solid rgba(13, 13, 13, 0.066);
  border-radius: 6px;
  padding: 6px 10px;
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  transition: var(--transition);
  flex-shrink: 0;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(12, 0, 1, 0.45);
  outline: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='black' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-nav .nav-link {
  font-family: var(--font-body);
  font-weight: 500;
  color: black !important;
  padding: 0.5rem 0.9rem !important;
  border-radius: 6px;
  transition: var(--transition);
  white-space: nowrap;
}



/* Collapsed menu on mobile */
.navbar-collapse {
  background: rgba(237, 240, 243, 0.99);
  border-radius: 0 0 12px 12px;
}

@media (max-width: 991.98px) {
  .navbar-collapse {
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
  }

  .navbar-nav .nav-link {
    padding: 0.7rem 0.75rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: var(--touch-target);
    display: flex;
    align-items: center;
  }

  .navbar-nav .nav-item:last-child .nav-link {
    border-bottom: none;
  }
}

@media (min-width: 992px) {
  .navbar-collapse {
    background: transparent;
    padding: 0;
    margin-top: 0;
    border-radius: 0;
  }
}

/* ═══════════════════════════════════════════════
   3. BODY OFFSET FOR FIXED NAVBAR
═══════════════════════════════════════════════ */
.page-body-offset {
  padding-top: var(--navbar-height);
}

/* ═══════════════════════════════════════════════
   4. BREAKING NEWS TICKER
═══════════════════════════════════════════════ */
.breaking-news {
  background: #fff;
  padding: 10px 0;
  border-bottom: 2px solid var(--primary-color);
  margin-bottom: 2rem;
  overflow: hidden;
}

/* Weather Widget */
.weather-wrapper {
  padding-top: 6px;
  border-top: 1px solid #f0f2f5;
  margin-top: 8px;
}

.weather-widget {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: #444;
  gap: 8px;
}

.weather-sep {
  color: #ccc;
  margin-right: 4px;
  font-weight: 300;
}

.weather-city {
  color: var(--dark-color);
  font-weight: 600;
}

.weather-temp {
  font-weight: 700;
  color: var(--primary-color);
}

.weather-icon svg {
  width: 22px;
  height: 22px;
  vertical-align: middle;
}

.bn-wrapper {
  display: flex;
  align-items: center;
  overflow: hidden;
}

.bn-title {
  color: #fff;
  padding: 6px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 16px;
  /* Animated gradient background */
  background: linear-gradient(90deg, #ff416c 0%, #ff4b2b 25%, #ff7a18 50%, #ffd200 75%, #7be495 100%);
  background-size: 200% 200%;
  animation: bn-gradient 6s linear infinite, bn-pulse 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.bn-title::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -40%;
  width: 80%;
  height: 180%;
  background: rgba(255, 255, 255, 0.12);
  transform: rotate(25deg) translateX(-120%);
  transition: transform 0.9s ease-in-out;
}

.bn-title:hover::after {
  transform: rotate(25deg) translateX(120%);
}

.bn-ticker {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.bn-ticker-inner {
  display: flex;
  gap: 2.5rem;
  white-space: nowrap;
  animation: ticker-scroll 35s linear infinite;
  will-change: transform;
}

.bn-ticker-inner:hover {
  animation-play-state: paused;
}

@keyframes bn-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes bn-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  .bn-title, .bn-title::after, .bn-ticker-inner {
    animation: none !important;
    transition: none !important;
  }
}

.bn-ticker-inner a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: color 0.2s;
}

.bn-ticker-inner a:hover {
  color: var(--primary-color);
}

@keyframes ticker-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ═══════════════════════════════════════════════
   5. FEATURED / HERO POST
═══════════════════════════════════════════════ */
.featured-post {
  position: relative;
  border-radius: var(--border-radius-card);
  overflow: hidden;
  margin-bottom: 2rem;
  height: clamp(240px, 45vw, 500px);
  box-shadow: var(--card-shadow);
  background: #1d3557;
}

.featured-post img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.featured-post:hover img {
  transform: scale(1.03);
}

.featured-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
  padding: clamp(16px, 4vw, 40px);
  color: #fff;
}

.featured-overlay .badge {
  background: var(--primary-color) !important;
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 4px;
  margin-bottom: 10px;
  display: inline-block;
}

.featured-overlay h1,
.featured-overlay .featured-title {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 3.5vw, 2rem);
  line-height: 1.3;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.featured-overlay p {
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  opacity: 0.9;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════
   6. NEWS CARDS
═══════════════════════════════════════════════ */
.news-card {
  background: #fff;
  border: none;
  border-radius: var(--border-radius-card);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  height: 100%;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.news-card a:has(img) {
  display: block;
  overflow: hidden;
  flex-shrink: 0;
}

.news-card img.card-img-top,
.news-card .card-img-top {
  width: 100%;
  height: clamp(150px, 22vw, 220px);
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.news-card:hover img.card-img-top {
  transform: scale(1.04);
}

.news-card .card-body {
  padding: clamp(1rem, 2.5vw, 1.5rem);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-category {
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  display: block;
}

.card-title {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin-bottom: 0.6rem;
  line-height: 1.4;
  color: var(--dark-color);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-text {
  color: #555;
  font-size: clamp(0.85rem, 1.4vw, 0.95rem);
  line-height: 1.6;
  flex: 1;
}

.read-more {
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.read-more:hover {
  color: var(--primary-color);
  text-decoration: none;
}

/* ═══════════════════════════════════════════════
   7. SIDEBAR WIDGETS
═══════════════════════════════════════════════ */
.sidebar-widget {
  background: #fff;
  border-radius: var(--border-radius-card);
  padding: clamp(1rem, 2.5vw, 1.5rem);
  box-shadow: var(--card-shadow);
  margin-bottom: 1.75rem;
}

.widget-title {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  border-bottom: 3px solid var(--primary-color);
  padding-bottom: 10px;
  margin-bottom: 18px;
  color: var(--dark-color);
}

/* Search widget */
.sidebar-widget .input-group {
  flex-wrap: nowrap;
}

.sidebar-widget .form-control {
  min-height: var(--touch-target);
  font-size: 0.95rem;
}

.sidebar-widget .btn {
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  white-space: nowrap;
}

/* Category list */
.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-list li {
  padding: 8px 0;
  border-bottom: 1px solid #eef0f3;
}

.category-list li:last-child {
  border-bottom: none;
}

.category-list a {
  color: #444;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  font-size: 0.95rem;
  min-height: var(--touch-target);
}

.category-list a::before {
  content: '›';
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.1em;
}

.category-list a:hover {
  color: var(--primary-color);
  padding-left: 4px;
}

/* Recent posts thumbnail */
.recent-thumb {
  width: 64px;
  height: 64px;
  min-width: 64px;
  object-fit: cover;
  border-radius: 8px;
}

.recent-post-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eef0f3;
}

.recent-post-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.recent-post-item h6 {
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
}

.recent-post-item h6 a {
  color: #333;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.recent-post-item h6 a:hover {
  color: var(--primary-color);
}

/* ═══════════════════════════════════════════════
   8. PAGINATION
═══════════════════════════════════════════════ */
.pagination {
  flex-wrap: wrap;
  gap: 4px;
}

.pagination li a,
.pagination li span {
  border-radius: 6px !important;
  background: #fff;
  color: var(--dark-color);
  border: 1px solid #dde2e8;
  padding: 8px 14px;
  text-decoration: none;
  display: inline-block;
  min-width: 38px;
  min-height: var(--touch-target);
  line-height: 1.6;
  text-align: center;
  transition: var(--transition);
}

.pagination li.active a,
.pagination li.active span {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.pagination li a:hover {
  background: var(--dark-color);
  color: #fff;
  border-color: var(--dark-color);
}

/* ═══════════════════════════════════════════════
   9. POST DETAIL PAGE
═══════════════════════════════════════════════ */
.post-container {
  background: #fff;
  padding: clamp(1rem, 4vw, 2.5rem);
  border-radius: var(--border-radius-card);
  box-shadow: var(--card-shadow);
}

.post-category-badge {
  background: var(--primary-color);
  color: #fff;
  padding: 5px 15px;
  border-radius: 5px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 15px;
  display: inline-block;
}

.post-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  color: var(--dark-color);
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin-bottom: 0.75rem;
}

.post-meta {
  color: #6c757d;
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 1.5rem;
}

.post-hero-img {
  width: 100%;
  max-height: clamp(220px, 45vw, 500px);
  object-fit: cover;
  border-radius: var(--border-radius-card);
  display: block;
  margin-bottom: 2rem;
}

.post-content {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  line-height: 1.9;
  color: #3a3a3a;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-family: var(--font-heading);
  color: var(--dark-color);
  line-height: 1.3;
  word-wrap: break-word;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.post-content p {
  margin-bottom: 1.25rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem auto;
  display: block;
}

.post-content pre,
.post-content code {
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  background: #f4f6f8;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  max-width: 100%;
  overflow-x: auto;
}

.post-content table {
  width: 100%;
  overflow-x: auto;
  display: block;
  border-collapse: collapse;
}

.post-content table td,
.post-content table th {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  min-width: 100px;
}

/* ═══════════════════════════════════════════════
   10. COMMENTS SECTION
═══════════════════════════════════════════════ */
.comment-card {
  background: #f8f9fa;
  border-radius: 10px;
  padding: clamp(12px, 2.5vw, 20px);
  margin-bottom: 1rem;
  border-left: 3px solid var(--primary-color);
}

.comment-author-img {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-author-name {
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 4px;
}

.comment-text {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin: 0;
}

/* Comment form */
.comment-form .form-label {
  font-weight: 600;
  color: var(--dark-color);
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.comment-form .form-control {
  background: #f0f2f5;
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  min-height: var(--touch-target);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-form .form-control:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(69, 123, 157, 0.15);
  background: #fff;
}

/* Submit button */
.btn-primary {
  background: var(--primary-color) !important;
  border: none !important;
  padding: 0.75rem 2rem !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.95rem;
  min-height: var(--touch-target);
  transition: var(--transition) !important;
}

.btn-primary:hover {
  background: #c1121f !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(230, 57, 70, 0.35) !important;
}

.btn-primary:focus {
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.4) !important;
}

/* ═══════════════════════════════════════════════
   11. ARCHIVE / CATEGORY / SEARCH TITLES
═══════════════════════════════════════════════ */
.archive-title,
.search-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  border-left: 5px solid var(--primary-color);
  padding-left: clamp(12px, 2vw, 20px);
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--dark-color);
  line-height: 1.3;
}

/* ═══════════════════════════════════════════════
   12. CATEGORY EXPLORER SECTION
═══════════════════════════════════════════════ */
.category-explorer {
  margin-bottom: 3rem;
}

.category-explorer .sidebar-widget {
  padding: clamp(1.25rem, 3vw, 2.5rem);
  text-align: center;
}

.category-explorer h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 1.25rem;
  color: var(--dark-color);
}

.category-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  border: 2px solid var(--dark-color);
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--dark-color);
  text-decoration: none;
  margin: 0.3rem;
  transition: var(--transition);
  min-height: var(--touch-target);
}

.category-pill:hover {
  background: var(--dark-color);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(29, 53, 87, 0.25);
}

/* ═══════════════════════════════════════════════
   13. FOOTER
═══════════════════════════════════════════════ */
.site-footer {
  background: var(--dark-color);
  color: rgba(255, 255, 255, 0.75);
  padding: clamp(2.5rem, 5vw, 4rem) 0 0;
  margin-top: clamp(2.5rem, 5vw, 5rem);
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  color: #fff;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: block;
}

.footer-brand span {
  color: var(--primary-color);
}

.footer-tagline {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  max-width: 280px;
}

.footer-heading {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 10px;
}

.footer-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--primary-color);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.6rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.68);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-links a:hover {
  color: #fff;
  padding-left: 4px;
}

.footer-bottom {
  background: rgba(0, 0, 0, 0.25);
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  padding: 1rem 0;
  text-align: center;
  font-size: 0.85rem;
}

.footer-bottom p {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
}

/* ═══════════════════════════════════════════════
   14. ADMIN PANEL — MOBILE FIXES
═══════════════════════════════════════════════ */
/* Only applied inside .sidebar-mini wrapper (admin layout) */
@media (max-width: 767px) {
  .wrapper .sidebar-mini .content-wrapper,
  .content-wrapper {
    margin-left: 0 !important;
  }

  .main-sidebar {
    left: -220px;
    transition: left 0.3s ease;
  }

  .sidebar-open .main-sidebar {
    left: 0;
  }

  .dashboard-header .col-lg-3,
  .dashboard-header .col-md-6 {
    margin-bottom: 1rem;
  }

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

  .main-header-top {
    padding: 0.5rem 1rem;
  }
}

/* ═══════════════════════════════════════════════
   15. RESPONSIVE BREAKPOINTS
═══════════════════════════════════════════════ */

/* ── 320px – 479px: Extra Small Mobile ── */
@media (max-width: 479px) {
  :root {
    --navbar-height: 70px;
  }

  .site-logo {
    width: clamp(90px, 38vw, 140px);
    max-height: 46px;
  }

  .featured-post {
    height: clamp(200px, 60vw, 280px);
    border-radius: 10px;
    margin-bottom: 1.25rem;
  }

  .featured-overlay {
    padding: 14px;
  }

  .featured-overlay h1,
  .featured-overlay .featured-title {
    font-size: clamp(0.9rem, 4.5vw, 1.1rem);
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .featured-overlay p {
    display: none;
  }

  .news-card img.card-img-top {
    height: clamp(140px, 45vw, 180px);
  }

  .bn-title {
    font-size: 0.7rem;
    padding: 4px 10px;
  }

  .breaking-news {
    margin-bottom: 1rem;
  }

  .post-container {
    border-radius: 8px;
  }

  .post-title {
    font-size: clamp(1.2rem, 6vw, 1.5rem);
  }

  .comment-form .row .col-md-6 {
    margin-bottom: 0.75rem;
  }

  .category-pill {
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
  }
}

/* ── 480px – 767px: Small Mobile ── */
@media (min-width: 480px) and (max-width: 767px) {
  :root {
    --navbar-height: 76px;
  }

  .featured-post {
    height: clamp(220px, 50vw, 320px);
  }

  .featured-overlay h1,
  .featured-overlay .featured-title {
    font-size: clamp(1rem, 4vw, 1.3rem);
  }

  .news-card img.card-img-top {
    height: 180px;
  }
}

/* ── 768px – 1023px: Tablet ── */
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --navbar-height: 80px;
  }

  .featured-post {
    height: clamp(280px, 42vw, 400px);
  }

  .news-card img.card-img-top {
    height: 200px;
  }

  .sidebar-widget {
    margin-bottom: 1.25rem;
  }
}

/* ── 1024px – 1279px: Small Laptop ── */
@media (min-width: 1024px) and (max-width: 1279px) {
  .featured-post {
    height: clamp(350px, 38vw, 450px);
  }

  .news-card img.card-img-top {
    height: 210px;
  }
}

/* ── 1280px – 1439px: Laptop ── */
@media (min-width: 1280px) and (max-width: 1439px) {
  .featured-post {
    height: 480px;
  }

  .news-card img.card-img-top {
    height: 220px;
  }
}

/* ── 1440px – 1919px: Desktop ── */
@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }

  .featured-post {
    height: 500px;
  }
}

/* ── 1920px+: Ultra Wide ── */
@media (min-width: 1920px) {
  .container {
    max-width: 1600px;
  }

  .featured-post {
    height: 560px;
  }

  .news-card img.card-img-top {
    height: 260px;
  }

  :root {
    --navbar-height: 90px;
  }
}

/* ═══════════════════════════════════════════════
   16. ACCESSIBILITY
═══════════════════════════════════════════════ */

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--primary-color);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 9999;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 6px 0;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* Focus ring */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Screen-reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Ensure minimum touch targets */
a,
button,
[role="button"],
input[type="submit"],
input[type="button"],
input[type="reset"],
label[for] {
  min-height: 44px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .bn-ticker-inner {
    animation: none;
  }
}

/* ═══════════════════════════════════════════════
   17. PERFORMANCE & CLS REDUCTION
═══════════════════════════════════════════════ */

/* Reserve space for images to prevent CLS */
.news-card a:has(img),
.news-card .card-img-wrapper {
  aspect-ratio: 16 / 9;
  background: #e9ecef;
  display: block;
  overflow: hidden;
}

.news-card img.card-img-top {
  aspect-ratio: 16 / 9;
  height: auto;
}

/* Override the fixed height approach with aspect-ratio for better CLS */
@supports (aspect-ratio: 16/9) {
  .news-card img.card-img-top {
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  .featured-post {
    aspect-ratio: unset;
  }
}

/* Font display optimization */
@font-face {
  font-display: swap;
}

/* Contain layout paint for heavy components */
.sidebar-widget,
.news-card,
.featured-post,
.post-container {
  contain: layout style;
}

/* ═══════════════════════════════════════════════
   18. UTILITY CLASSES
═══════════════════════════════════════════════ */
.container-content {
  /* Fix for pages using .container-content (was undefined) */
  width: 100%;
  max-width: 1320px;
  padding-left: clamp(0.75rem, 2vw, 1.5rem);
  padding-right: clamp(0.75rem, 2vw, 1.5rem);
  margin: 0 auto;
}

.text-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thumb-sm {
  width: 60px;
  height: 60px;
  min-width: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.container {
  width: min(100% - 24px, 1320px);
}

@media (min-width: 1400px) {
  .container {
    width: calc(100% - 64px);
    max-width: 1760px;
  }
}

@media (min-width: 1920px) {
  .container {
    width: calc(100% - 80px);
    max-width: 1840px;
  }
}

