/**
 * NewsTheme Custom Stylesheet
 * Bootstrap 5 Enhanced News Magazine Styles
 * Fully Responsive & Mobile-First Optimized
 */

/* ==========================================================================
   Typography & Base
   ========================================================================== */
html, body {
  overflow-x: clip;
}

h1, h2, h3, h4, h5, h6,
.font-serif {
  font-family: 'Merriweather', Georgia, serif;
}

.text-decoration-none:hover {
  text-decoration: none !important;
}

.transition-hover {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.transition-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08) !important;
}

/* Line clamp helpers */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

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

/* ==========================================================================
   Top Bar & Ticker
   ========================================================================== */
.top-bar {
  font-size: 0.85rem;
  background-color: #1a1e21;
  color: #adb5bd;
}

.top-bar a {
  color: #adb5bd;
}

.top-bar a:hover {
  color: #ffffff;
}

.breaking-ticker {
  overflow: hidden;
  position: relative;
  white-space: nowrap;
  min-width: 0;
  width: 100%;
}

.ticker-title-badge {
  background-color: #dc3545;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}

.ticker-content {
  display: inline-block;
  white-space: nowrap;
  animation: tickerSlide 30s linear infinite;
  padding-left: 20px;
}

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

@keyframes tickerSlide {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* ==========================================================================
   Main Header & Navigation
   ========================================================================== */
.main-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e9ecef;
}

.site-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
}

.site-title a {
  color: #0d6efd;
}

.site-description {
  font-size: 0.85rem;
  color: #6c757d;
  margin: 0;
}

.header-ad-placeholder {
  max-width: 100%;
  box-sizing: border-box;
}

/* Main Navbar */
.main-navigation {
  background-color: #ffffff;
  border-bottom: 2px solid #0d6efd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.main-navigation .nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: #212529;
  padding: 0.75rem 1rem !important;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

.main-navigation .nav-link:hover,
.main-navigation .nav-item.active .nav-link {
  color: #0d6efd !important;
}

.dropdown-submenu {
  position: relative;
}

.dropdown-submenu .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -1px;
}

@media (max-width: 991.98px) {
  .main-navigation .navbar-collapse {
    max-height: 75vh;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
  }
  .main-navigation .nav-link {
    padding: 0.55rem 0.75rem !important;
    border-bottom: 1px solid #f8f9fa;
  }
  .dropdown-menu {
    border: none;
    box-shadow: none;
    background-color: #f8f9fa;
    padding-left: 0.75rem;
    margin-top: 0;
  }
  .dropdown-submenu .dropdown-menu {
    left: 0;
  }
}

/* ==========================================================================
   Hero Featured Bento/Grid Section
   ========================================================================== */
.hero-news-section .hero-main-post {
  position: relative;
  min-height: 420px;
  border-radius: 8px;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 30%, rgba(0, 0, 0, 0.88) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  color: #ffffff;
  transition: background 0.3s ease;
}

.hero-main-post:hover .hero-overlay {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 20%, rgba(0, 0, 0, 0.94) 100%);
}

.hero-sub-post {
  position: relative;
  min-height: 200px;
  border-radius: 8px;
  overflow: hidden;
}

.hero-sub-post .hero-overlay {
  padding: 1rem;
}

.hero-sub-post h6 {
  font-size: 0.95rem;
  line-height: 1.35;
}

@media (max-width: 767.98px) {
  .hero-news-section .hero-main-post {
    min-height: 280px;
  }
  .hero-sub-post {
    min-height: 180px;
  }
  .hero-overlay {
    padding: 1.1rem;
  }
  .hero-overlay h2 {
    font-size: 1.25rem !important;
    line-height: 1.35;
  }
}

@media (max-width: 575.98px) {
  .hero-news-section .hero-main-post {
    min-height: 250px;
  }
  .hero-sub-post {
    min-height: 170px;
  }
}

/* ==========================================================================
   Section Blocks & Headings
   ========================================================================== */
.section-block-header {
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-block-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1e21;
  position: relative;
  margin: 0;
  padding-bottom: 0.5rem;
}

.section-block-title::after {
  content: '';
  position: absolute;
  bottom: -0.6rem;
  left: 0;
  width: 45px;
  height: 3px;
  background-color: #0d6efd;
}

/* ==========================================================================
   Post Cards & Lists
   ========================================================================== */
.news-card {
  border-radius: 8px;
  overflow: hidden;
  background-color: #ffffff;
}

.news-card .card-thumb-wrapper {
  overflow: hidden;
  position: relative;
}

.news-card .card-thumb-wrapper img {
  transition: transform 0.35s ease;
}

.news-card:hover .card-thumb-wrapper img {
  transform: scale(1.05);
}

.news-list-item {
  transition: background-color 0.2s ease;
}

.news-list-item:hover {
  background-color: rgba(13, 110, 253, 0.03);
}

/* ==========================================================================
   Single Post Typography & Responsive Elements
   ========================================================================== */
.single-post-title {
  font-size: 2.15rem;
  font-weight: 700;
  line-height: 1.28;
  color: #1a1e21;
  overflow-wrap: break-word;
}

.single-post-excerpt {
  font-size: 1.15rem;
  font-weight: 500;
  color: #495057;
  line-height: 1.6;
}

.entry-content {
  font-size: 1.05rem;
  line-height: 1.78;
  color: #212529;
  overflow-wrap: break-word;
}

.entry-content p {
  margin-bottom: 1.4rem;
}

.entry-content table {
  display: block;
  width: 100% !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
  border-collapse: collapse;
}

.entry-content table th,
.entry-content table td {
  padding: 0.6rem 0.85rem;
  border: 1px solid #dee2e6;
  white-space: nowrap;
}

.entry-content img,
.entry-content iframe,
.entry-content embed,
.entry-content video {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.entry-content pre {
  overflow-x: auto;
  max-width: 100%;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 6px;
}

.entry-content blockquote {
  border-left: 4px solid #0d6efd;
  background-color: #f8f9fa;
  padding: 1rem 1.5rem;
  font-style: italic;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
}

@media (max-width: 767.98px) {
  .single-post-title {
    font-size: 1.55rem;
    line-height: 1.32;
  }
  .single-post-container {
    padding: 1.25rem 1rem !important;
  }
  .author-bio-box {
    flex-direction: column;
    text-align: center;
  }
  .author-bio-box .author-avatar {
    margin: 0 auto;
  }
}

/* ==========================================================================
   Widgets & Sidebar
   ========================================================================== */
.widget-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: #0d6efd;
}

.popular-posts-list .rank-badge {
  font-size: 1.25rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background-color: #15181b;
  color: #adb5bd;
  margin-top: 3.5rem;
  padding-top: 3.5rem;
  padding-bottom: 1.5rem;
  border-top: 4px solid #0d6efd;
}

.site-footer a {
  color: #ced4da;
  text-decoration: none;
}

.site-footer a:hover {
  color: #ffffff;
}

.footer-widget-title::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 35px;
  height: 2px;
  background-color: #0d6efd;
}

.site-footer ul {
  list-style: none;
  padding-left: 0;
}

.site-footer ul li {
  margin-bottom: 0.5rem;
}

/* Back to top button */
#btn-back-to-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  display: none;
  z-index: 999;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  padding: 0;
  line-height: 42px;
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@media (max-width: 575.98px) {
  #btn-back-to-top {
    bottom: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    line-height: 38px;
    font-size: 0.85rem;
    opacity: 0.9;
  }
}

/* Search Dropdown / Modal */
.header-search-form .form-control {
  border-radius: 20px 0 0 20px;
}

.header-search-form .btn {
  border-radius: 0 20px 20px 0;
}

@media (max-width: 575.98px) {
  .comment-form {
    padding: 1.25rem 1rem !important;
  }
}
