/* MyNewsIndia - Modern News Website Styling */

/* Global Variables */
:root {
  --primary-color: #1a365d;
  --secondary-color: #e53e3e;
  --accent-color: #3182ce;
  --hover-color: #dd6b20;
  --light-gray: #f8f9fa;
  --medium-gray: #e2e8f0;
  --dark-gray: #2d3748;
  --white-color: #ffffff;
  --black-color: #000000;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
  --border-radius: 4px;
  --header-font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --body-font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Global Styles - Optimized for performance */
body {
  font-family: var(--body-font);
  line-height: 1.6;
  color: #2d3748;
  background-color: #f8f9fa;
  text-rendering: optimizeSpeed;
  width: 100%;
  overflow-x: hidden;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--secondary-color);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--header-font);
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #1a202c;
  line-height: 1.3;
}

/* Performance optimizations */
img {
  max-width: 100%;
  height: auto;
  will-change: transform;
  -webkit-backface-visibility: hidden;
}

/* SEO-focused content styling */
.article-content h2 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.article-content h3 {
  font-size: 1.25rem;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

.article-content p {
  margin-bottom: 1rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.article-content ul, 
.article-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.article-content img {
  margin: 1.5rem 0;
  border-radius: var(--border-radius);
}

/* Header & Navigation - Enhanced for better UX */
.main_header {
  background: var(--white-color);
  padding: 12px 0;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  background-color: var(--primary-color) !important;
  padding: 0;
  box-shadow: var(--box-shadow);
}

.navbar-nav .nav-link {
  color: var(--white-color) !important;
  font-weight: 600;
  padding: 15px 20px !important;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  transition: background-color 0.2s ease;
  position: relative;
}

.navbar-nav .nav-link:hover, 
.navbar-nav .nav-link.active {
  background-color: var(--secondary-color) !important;
  color: var(--white-color) !important;
}

.navbar-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  width: 60%;
  height: 3px;
  background-color: var(--white-color);
}

.navbar-toggler {
  border: none;
  padding: 8px;
  margin-right: 15px;
  background-color: transparent;
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: none;
}

/* Breaking News Bar */
.breaking-news-bar {
  background-color: var(--secondary-color);
  color: var(--white-color);
  padding: 8px 0;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.breaking-news-bar .label {
  background-color: var(--dark-gray);
  color: var(--white-color);
  padding: 2px 8px;
  font-weight: 700;
  border-radius: 3px;
  margin-right: 15px;
  display: inline-block;
  font-size: 0.8rem;
}

.breaking-news-bar .news-ticker {
  white-space: nowrap;
  animation: ticker 20s linear infinite;
  display: inline-block;
  padding-left: 100%;
}

@keyframes ticker {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

@-moz-keyframes ticker {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Cards & News Items - Optimized for engagement */
.card {
  border: none;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 25px;
  background-color: var(--white-color);
  transform: translateZ(0);
  backface-visibility: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card-img-top {
  height: 220px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .card-img-top {
  transform: scale(1.05);
}

.card-header {
  background-color: var(--primary-color);
  border-bottom: none;
  padding: 15px 20px;
}

.card-header h2.card-title {
  color: var(--white-color);
  font-size: 1.1rem;
  margin-bottom: 0;
  line-height: 1.4;
}

.card-body {
  padding: 20px;
}

.card-body.bg-light-dark {
  background-color: var(--light-gray);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--primary-color);
  line-height: 1.4;
}

.card-text {
  color: var(--dark-gray);
  font-size: 0.95rem;
  margin-bottom: 15px;
  line-height: 1.6;
}

/* Category & Trending Tags */
.category-tag {
  display: inline-block;
  background-color: var(--light-gray);
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 3px;
  margin-right: 8px;
  margin-bottom: 8px;
  text-transform: uppercase;
  transition: var(--transition);
}

.category-tag:hover {
  background-color: var(--primary-color);
  color: var(--white-color);
}

.trending-tag {
  display: inline-flex;
  align-items: center;
  background-color: #feebc8;
  color: #c05621;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 3px;
  margin-right: 8px;
  margin-bottom: 8px;
}

.trending-tag i {
  margin-right: 5px;
  font-size: 0.7rem;
}

/* Category News Listings - Refined for clarity */
.category-news .cat-news {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: start;
  align-items: flex-start;
  background: var(--white-color);
  margin-bottom: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
}

.category-news .cat-news:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.category-news .cat-img {
  width: 175px;
  height: 130px;
  overflow: hidden;
  flex-shrink: 0;
}

.category-news .cat-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.category-news .cat-news:hover .cat-img img {
  transform: scale(1.1);
}

.category-news .cat-title {
  -ms-flex: 1;
  flex: 1;
  padding: 15px 20px;
}

.category-news .cat-title a {
  color: var(--primary-color);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  display: block;
  margin-bottom: 8px;
}

.category-news .cat-title a:hover {
  color: var(--secondary-color);
}

.category-news .cat-meta {
  font-size: 0.8rem;
  color: #6c757d;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.category-news .cat-meta i {
  margin-right: 5px;
}

.category-news .cat-meta span {
  margin-right: 15px;
  display: inline-flex;
  align-items: center;
}

.category-news .cat-excerpt {
  font-size: 0.9rem;
  color: #4a5568;
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  max-height: 3em;
}

/* Featured Section */
.featured-section {
  margin-bottom: 40px;
}

.featured-main {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  height: 400px;
  margin-bottom: 20px;
}

.featured-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.featured-main:hover img {
  transform: scale(1.05);
}

.featured-main .content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0));
  color: var(--white-color);
}

.featured-main .category {
  display: inline-block;
  background-color: var(--secondary-color);
  color: var(--white-color);
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 3px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.featured-main .title {
  font-size: 1.8rem;
  margin-bottom: 10px;
  font-weight: 700;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
  letter-spacing: 0.5px;
}

.featured-main .meta {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Special Sections */
.news-card {
  padding: 25px;
  background: var(--white-color);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 30px;
}

.news-card h3 {
  color: var(--primary-color);
  font-size: 1.4rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--secondary-color);
  position: relative;
}

/* Button Styling - Improved for better CTAs */
.btn {
  padding: 8px 20px;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  margin-top: 15px;
  font-size: 0.9rem;
  border: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-secondary {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: var(--white-color);
}

/* Carousel/Slideshow - Enhanced for better presentation */
.carousel {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  margin-bottom: 30px;
}

.carousel-item {
  height: 400px;
}

.carousel-item img {
  height: 100%;
  object-fit: cover;
}

.carousel-caption {
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 15px 15px;
  text-align: left;
}

.carousel-caption h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.carousel-indicators {
  margin-bottom: 10px;
}

.carousel-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 4px;
  background-color: rgba(255, 255, 255, 0.5);
}

.carousel-indicators .active {
  background-color: var(--white-color);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  background-size: 50%;
}

/* Sidebar Widgets */
.sidebar-widget {
  background-color: var(--white-color);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: var(--box-shadow);
}

.sidebar-widget .widget-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--secondary-color);
  position: relative;
}

.sidebar-widget .popular-posts .post {
  display: flex;
  margin-bottom: 15px;
  align-items: flex-start;
}

.sidebar-widget .popular-posts .post-img {
  width: 80px;
  height: 60px;
  overflow: hidden;
  border-radius: var(--border-radius);
  margin-right: 15px;
  flex-shrink: 0;
}

.sidebar-widget .popular-posts .post-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.sidebar-widget .popular-posts .post:hover .post-img img {
  transform: scale(1.1);
}

.sidebar-widget .popular-posts .post-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 5px;
}

.sidebar-widget .popular-posts .post-date {
  font-size: 0.75rem;
  color: #6c757d;
}

/* Footer - Enhanced for better engagement */
.footer {
  padding: 60px 0 0;
  background: var(--primary-color);
  color: var(--white-color);
}

.footer .footer-widget {
  margin-bottom: 40px;
}

.footer .footer-widget .title {
  color: var(--white-color);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--secondary-color);
}

.footer .footer-widget .title::after {
  display: none;
}

.footer .contact-info p {
  margin-bottom: 15px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}

.footer .contact-info p i {
  color: var(--secondary-color);
  margin-right: 10px;
}

.footer .footer-widget ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer .footer-widget ul li {
  margin-bottom: 10px;
}

.footer .footer-widget ul li a {
  color: rgba(255, 255, 255, 0.8);
  display: block;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.footer .footer-widget ul li a::before {
  content: '\f054';
  font-family: 'Font Awesome 5 Free', sans-serif;
  font-weight: 900;
  margin-right: 8px;
  font-size: 0.7rem;
  color: var(--secondary-color);
  display: inline-block;
}

.footer .footer-widget ul li a:hover {
  color: var(--secondary-color);
  padding-left: 5px;
}

.footer .newsletter-form {
  position: relative;
  margin-top: 15px;
}

.footer .newsletter-form input {
  width: 100%;
  padding: 12px 15px;
  border: none;
  border-radius: var(--border-radius);
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white-color);
  font-size: 0.9rem;
}

.footer .newsletter-form button {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  padding: 0 15px;
  background-color: var(--secondary-color);
  border: none;
  color: var(--white-color);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.footer .newsletter-form button:hover {
  background-color: var(--hover-color);
}

.footer .newsletter-form input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.3);
}

.footer .social-links {
  margin-top: 20px;
}

.footer .social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white-color);
  border-radius: 50%;
  margin-right: 10px;
  transition: all 0.2s ease;
}

.footer .social-links a:hover {
  background-color: var(--secondary-color);
  transform: translateY(-3px);
}

.footer-menu {
  background: var(--dark-gray);
  padding: 15px 0;
}

.footer-menu .f-menu {
  text-align: center;
}

.footer-menu .f-menu a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin-right: 15px;
  padding-right: 15px;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  transition: var(--transition);
}

.footer-menu .f-menu a:last-child {
  border-right: none;
}

.footer-menu .f-menu a:hover {
  color: var(--secondary-color);
}

.footer-bottom {
  background: #151e2c;
  padding: 20px 0;
  text-align: center;
}

.footer-bottom .copyright p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  font-size: 0.9rem;
}

.footer-bottom .copyright p a {
  color: var(--secondary-color);
  font-weight: 600;
}

/* Performance & SEO optimizations */
.lazy-load {
  -webkit-transition: opacity 0.3s;
  transition: opacity 0.3s;
  opacity: 0;
}

.lazy-loaded {
  opacity: 1;
}

/* Responsive Adjustments - Enhanced for all devices */
@media (max-width: 991px) {
  .navbar-collapse {
    background-color: var(--primary-color);
    padding: 10px;
    max-height: 80vh;
    overflow-y: auto;
  }
  
  .navbar-nav .nav-link {
    padding: 12px 15px !important;
  }
  
  .category-news .cat-img {
    width: 120px;
    height: 100px;
  }
  
  .category-news .cat-title a {
    font-size: 1rem;
  }
  
  .featured-main {
    height: 350px;
  }
  
  .featured-main .title {
    font-size: 1.5rem;
  }
  
  .carousel-item {
    height: 350px;
  }
}

@media (max-width: 767px) {
  .card-img-top {
    height: 200px;
  }
  
  .title {
    font-size: 1.4rem;
  }
  
  .footer .footer-widget .title {
    font-size: 1.2rem;
  }
  
  .footer-menu .f-menu a {
    font-size: 0.8rem;
    margin-right: 10px;
    padding-right: 10px;
  }
  
  .featured-main {
    height: 300px;
  }
  
  .featured-main .title {
    font-size: 1.3rem;
  }
  
  .carousel-item {
    height: 300px;
  }
  
  .carousel-caption h3 {
    font-size: 1.3rem;
  }
}

@media (max-width: 575px) {
  .category-news .cat-news {
    flex-direction: column;
  }
  
  .category-news .cat-img {
    width: 100%;
    height: 180px;
  }
  
  .card-img-top {
    height: 180px;
  }
  
  .featured-main {
    height: 250px;
  }
  
  .featured-main .title {
    font-size: 1.2rem;
  }
  
  .carousel-item {
    height: 250px;
  }
  
  .carousel-caption h3 {
    font-size: 1.1rem;
  }
  
  .footer .social-links a {
    width: 32px;
    height: 32px;
    margin-right: 8px;
  }
}

/* Fix for owl carousel */
.owl-nav {
  display: flex !important;
  justify-content: space-between;
  position: absolute;
  top: 50%;
  width: 100%;
  transform: translateY(-50%);
  pointer-events: none;
}

.owl-prev, .owl-next {
  background-color: rgba(0, 0, 0, 0.5) !important;
  color: white !important;
  width: 40px;
  height: 40px;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 10px;
  pointer-events: auto;
  transition: background-color 0.2s ease;
}

.owl-prev:hover, .owl-next:hover {
  background-color: var(--secondary-color) !important;
}

/* Fix for dropdown menu */
.dropdown-menu {
  background: var(--white-color);
  border: none;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 8px 0;
  min-width: 200px;
}

.dropdown-item {
  color: var(--primary-color);
  font-size: 0.9rem;
  padding: 8px 20px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-item:hover, 
.dropdown-item:focus, 
.dropdown-item:active {
  background-color: var(--light-gray);
  color: var(--secondary-color);
}

/* Job listings and other page specific styles */
h1.job_title {
  color: var(--primary-color);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 20px;
}

/* Print Styles for SEO */
@media print {
  .navbar, .footer, .sidebar-widget, .carousel {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }
  
  .container {
    width: 100%;
    max-width: none;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }
  
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* Loading animations for perceived performance */
.skeleton-loader {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--border-radius);
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Fix 10: Fix mobile device overflow issues */
body {
  width: 100%;
  overflow-x: hidden;
}

/* Fix 11: Ensure proper display of Font Awesome icons */
.footer .footer-widget ul li a::before {
  content: '\f054';
  font-family: 'Font Awesome 5 Free', sans-serif;
  font-weight: 900;
  margin-right: 8px;
  font-size: 0.7rem;
  color: var(--secondary-color);
  display: inline-block;
}

/* Fix 12: Fix breaking news ticker display on certain browsers */
.breaking-news-bar {
  background-color: var(--secondary-color);
  color: var(--white-color);
  padding: 8px 0;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.breaking-news-bar .news-ticker {
  white-space: nowrap;
  animation: ticker 20s linear infinite;
  display: inline-block;
  padding-left: 100%;
}

/* Fix 13: Add specific prefixes for certain CSS3 properties */
.lazy-load {
  -webkit-transition: opacity 0.3s;
  transition: opacity 0.3s;
  opacity: 0;
}

/* Fix 14: Fix for inconsistent font rendering across browsers */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Fix 15: Add support for dark mode preference */
@media (prefers-color-scheme: dark) {
  :root {
    --light-gray: #2d3748;
    --medium-gray: #4a5568;
    --dark-gray: #1a202c;
  }
  
  /* Optional dark mode styles that can be uncommented if needed
  body {
    background-color: #1a202c;
    color: #e2e8f0;
  }
  
  .card, .news-card, .sidebar-widget {
    background-color: #2d3748;
  }
  
  .card-title, h1, h2, h3, h4, h5, h6 {
    color: #e2e8f0;
  }
  
  .card-text {
    color: #cbd5e0;
  }
  */
}

/* Fix 16: Improve animation performance */
@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Use transform instead of left/right for animations (better performance) */
@keyframes ticker {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Fix 17: Add missing placeholder styling */
::placeholder {
  color: rgba(255, 255, 255, 0.5);
  opacity: 1;
}

::-ms-input-placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Fix 18: Add print media query optimization for images */
@media print {
  img {
    max-width: 500px !important; /* Limit image size for printing */
  }
}

/* Fix 19: Add accessibility improvements */
.visually-hidden:not(:focus):not(:active) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  white-space: nowrap;
  clip-path: inset(100%);
  clip: rect(0 0 0 0);
  overflow: hidden;
}

/* Fix 20: Add support for reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .card:hover {
    transform: none;
  }
  
  .category-news .cat-news:hover {
    transform: none;
  }
  
  .footer .social-links a:hover {
    transform: none;
  }
}

/* Mobile-friendly viewport settings */
@viewport {
  width: device-width;
  zoom: 1.0;
}

@-ms-viewport {
  width: device-width;
}

/* Improved touch targets for mobile */
@media (max-width: 767px) {
  /* Larger touch targets for mobile */
  .btn,
  .navbar-toggler,
  .footer .social-links a,
  .category-tag,
  .trending-tag {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Make form inputs more touch-friendly */
  input, 
  select, 
  textarea {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
  }

  /* Improve footer menu spacing for touch */
  .footer-menu .f-menu a {
    padding: 8px 12px;
    margin: 5px 0;
    display: inline-block;
  }

  /* Better spacing for stacked elements */
  .card {
    margin-bottom: 20px;
  }
  
  /* Mobile-friendly padding */
  .card-body, 
  .news-card,
  .sidebar-widget {
    padding: 15px;
  }
  
  /* Adjust font sizes for better mobile readability */
  .card-title {
    font-size: 1.1rem;
  }
  
  .card-text, .category-news .cat-excerpt {
    font-size: 0.9rem;
  }
  
  /* Improved spacing for the mobile menu */
  .navbar-nav .nav-link {
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  
  .navbar-nav .nav-link:last-child {
    border-bottom: none;
  }
}

/* Additional small screen improvements */
@media (max-width: 575px) {
  /* Better padding for small screens */
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* Adjust heading sizes for mobile */
  h1 {
    font-size: 1.8rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.3rem;
  }
  
  /* Single column footer on very small screens */
  .footer .col-6,
  .footer .col-md-4,
  .footer .col-lg-3 {
    width: 100%;
    margin-bottom: 20px;
  }
  
  /* Handle long words on mobile */
  p, .card-text, .cat-excerpt, .featured-main .title {
    overflow-wrap: break-word;
    word-wrap: break-word;
    -ms-word-break: break-all;
    word-break: break-word;
    hyphens: auto;
  }
  
  /* Adjust footer menu on mobile */
  .footer-menu .f-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .footer-menu .f-menu a {
    margin: 5px 8px;
    border-right: none;
    padding-right: 0;
  }
  
  /* Enhance tap targets in dropdown menu */
  .dropdown-item {
    padding: 12px 20px;
  }
  
  /* Make buttons full width on very small screens for easier tapping */
  .btn {
    display: block;
    width: 100%;
    margin-bottom: 10px;
  }
}

/* Better handling of fixed elements on mobile */
@media (max-width: 767px) {
  .main_header {
    position: relative; /* Avoid fixed position issues on some mobile browsers */
  }
  
  /* Reduce sticky header height on mobile */
  .navbar-brand img {
    max-height: 40px;
    width: auto;
  }
  
  /* Ensure proper fixed positioning on iOS */
  .main_header.sticky {
    position: sticky;
    -webkit-transform: translateZ(0);
  }
  
  /* Better handling of news ticker on mobile */
  .breaking-news-bar {
    padding: 8px 10px;
  }
  
  .breaking-news-bar .label {
    margin-bottom: 5px;
    display: block;
  }
  
  /* Adjust card layouts for mobile-friendly viewing */
  .card-img-top {
    height: auto;
    aspect-ratio: 16/9;
  }
  
  /* Enhance mobile search experience */
  .search-form input {
    height: 44px;
    font-size: 16px; /* Prevents iOS zoom */
  }
  
  /* Better handling of navigation toggles */
  .navbar-toggler {
    margin-right: 0;
    padding: 10px;
  }
}

/* Fix for iOS momentum scrolling */
.navbar-collapse {
  -webkit-overflow-scrolling: touch;
}

/* Add tap highlight for better mobile UX feedback */
a, button, .btn, .nav-link {
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

/* Adjust touchscreen hover states */
@media (hover: none) {
  a:hover, 
  .btn:hover, 
  .card:hover,
  .category-news .cat-news:hover,
  .sidebar-widget .popular-posts .post:hover .post-img img,
  .featured-main:hover img {
    /* Reset hover effects on touch devices */
    transform: none;
  }
  
  /* Use active states instead of hover on touch devices */
  a:active, 
  .btn:active {
    color: var(--secondary-color);
  }
  
  .navbar-nav .nav-link:active {
    background-color: var(--secondary-color) !important;
  }
}

/* Fix for mobile screen rotation */
@media screen and (orientation: portrait) {
  .featured-main {
    height: 300px;
  }
}

@media screen and (orientation: landscape) and (max-width: 767px) {
  .featured-main {
    height: 200px;
  }
  
  .carousel-item {
    height: 200px;
  }
}