/* ==========================================================================
   NewsHub Theme Redesign — Modern Editorial
   Loads AFTER styles.css to override Bootstrap 4.1.3 + legacy custom CSS.
   No !important needed — specificity handles the cascade.
   ========================================================================== */

/* ==========================================================================
   1. CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
  /* === Color Palette === */
  --nh-primary: #E63946;
  --nh-primary-hover: #C62D38;
  --nh-primary-light: #FFF0F2;
  --nh-primary-ghost: rgba(230, 57, 70, 0.08);
  --nh-secondary: #1D3557;
  --nh-secondary-light: #2B4C7E;

  --nh-bg: #F9F7F4;
  --nh-surface: #FFFFFF;
  --nh-surface-hover: #FCFAF8;

  --nh-text-heading: #1A1A2E;
  --nh-text-body: #4A4A5A;
  --nh-text-muted: #8E8E9A;
  --nh-text-inverse: #FFFFFF;

  --nh-border: #E5E0DA;
  --nh-border-light: #F0ECE7;

  /* === Success / Warning / Info === */
  --nh-success: #2D9F4E;
  --nh-success-light: #EDF7F1;
  --nh-warning: #F4A236;
  --nh-warning-light: #FFF9F0;
  --nh-info: #457B9D;
  --nh-info-light: #F0F6FA;

  /* === Shadows === */
  --nh-shadow-xs: 0 1px 2px rgba(26, 26, 46, 0.04);
  --nh-shadow-sm: 0 1px 3px rgba(26, 26, 46, 0.06);
  --nh-shadow-md: 0 4px 16px rgba(26, 26, 46, 0.08);
  --nh-shadow-lg: 0 8px 32px rgba(26, 26, 46, 0.12);
  --nh-shadow-xl: 0 16px 48px rgba(26, 26, 46, 0.16);

  /* === Border Radius === */
  --nh-radius-sm: 6px;
  --nh-radius-md: 10px;
  --nh-radius-lg: 16px;
  --nh-radius-xl: 24px;
  --nh-radius-full: 9999px;

  /* === Typography === */
  --nh-font-heading: 'Newsreader', Georgia, 'Times New Roman', serif;
  --nh-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --nh-font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;

  /* === Spacing === */
  --nh-header-height: 64px;
  --nh-content-max: 1280px;

  /* === Transitions === */
  --nh-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --nh-transition-fast: 0.15s var(--nh-ease);
  --nh-transition: 0.25s var(--nh-ease);
  --nh-transition-slow: 0.4s var(--nh-ease);

  /* === Legacy variable compat (for dark-mode.css) === */
  --bg-primary: var(--nh-surface);
  --bg-secondary: var(--nh-bg);
  --bg-card: var(--nh-surface);
  --bg-header: var(--nh-surface);
  --text-primary: var(--nh-text-heading);
  --text-secondary: var(--nh-text-body);
  --text-muted: var(--nh-text-muted);
  --border-color: var(--nh-border);
  --accent-color: var(--nh-primary);
  --accent-hover: var(--nh-primary-hover);
  --shadow-sm: var(--nh-shadow-sm);
  --shadow-md: var(--nh-shadow-md);
  --shadow-lg: var(--nh-shadow-lg);
  --hover-bg: var(--nh-surface-hover);
  --footer-bg: var(--nh-secondary);
  --footer-text: rgba(255, 255, 255, 0.7);
  --badge-bg: var(--nh-primary-light);
  --badge-text: var(--nh-primary);
  --link-color: var(--nh-primary);
  --overlay-dark: rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   2. Global Reset & Typography
   ========================================================================== */

body {
  font-family: var(--nh-font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--nh-text-body);
  background-color: var(--nh-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--nh-font-heading);
  font-weight: 600;
  line-height: 1.25;
  color: var(--nh-text-heading);
  letter-spacing: -0.01em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

a {
  color: var(--nh-primary);
  transition: color var(--nh-transition-fast);
}
a:hover {
  color: var(--nh-primary-hover);
  text-decoration: none;
}

p {
  margin-bottom: 1rem;
  color: var(--nh-text-body);
}

strong, b {
  font-weight: 600;
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: var(--nh-primary-light);
  color: var(--nh-primary);
}

::-moz-selection {
  background: var(--nh-primary-light);
  color: var(--nh-primary);
}

/* ==========================================================================
   3. Scrollbar Styling
   ========================================================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--nh-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--nh-border);
  border-radius: var(--nh-radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--nh-text-muted);
}

/* ==========================================================================
   4. Header / Navbar
   ========================================================================== */

.site-navbar {
  background: var(--nh-surface);
  border-bottom: 1px solid var(--nh-border-light);
  padding: 0;
  height: var(--nh-header-height);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: var(--nh-shadow-xs);
  transition: box-shadow var(--nh-transition), background var(--nh-transition);
}

.site-navbar.navbar-scrolled {
  box-shadow: var(--nh-shadow-md);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
}

.site-navbar .container {
  display: flex;
  align-items: center;
  height: 100%;
}

.site-navbar .row {
  width: 100%;
  align-items: center;
}

.site-navbar .navbar-logo {
  width: auto;
  max-width: 120px;
  height: auto;
  max-height: 40px;
}

/* Header search box */
.home-search-box .input-group {
  box-shadow: var(--nh-shadow-xs);
  border-radius: var(--nh-radius-full);
  transition: box-shadow var(--nh-transition);
  overflow: hidden;
}

.home-search-box .input-group:focus-within {
  box-shadow: var(--nh-shadow-md);
}

.home-search-box .form-control {
  border: 1px solid var(--nh-border);
  border-right: none;
  border-radius: var(--nh-radius-full) 0 0 var(--nh-radius-full);
  padding: 0.5rem 1.25rem;
  font-size: 0.925rem;
  height: 42px;
  background: var(--nh-bg);
  color: var(--nh-text-body);
  transition: border-color var(--nh-transition-fast), background var(--nh-transition-fast);
}

.home-search-box .form-control:focus {
  border-color: var(--nh-primary);
  background: var(--nh-surface);
  box-shadow: none;
  outline: none;
}

.home-search-box .form-control::placeholder {
  color: var(--nh-text-muted);
}

.home-search-box .btn {
  border-radius: 0 var(--nh-radius-full) var(--nh-radius-full) 0;
  padding: 0 1.5rem;
  height: 42px;
  background: var(--nh-primary);
  border-color: var(--nh-primary);
  color: #fff;
  font-weight: 500;
  transition: background var(--nh-transition-fast);
}

.home-search-box .btn:hover {
  background: var(--nh-primary-hover);
  border-color: var(--nh-primary-hover);
}

/* Theme toggle button */
.theme-toggle-btn {
  background: var(--nh-bg);
  border: 1px solid var(--nh-border);
  border-radius: var(--nh-radius-full);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--nh-text-body);
  font-size: 1.1rem;
  transition: all var(--nh-transition);
  position: relative;
  overflow: hidden;
}

.theme-toggle-btn:hover {
  background: var(--nh-primary-light);
  border-color: var(--nh-primary);
  color: var(--nh-primary);
  transform: rotate(15deg);
}

.theme-toggle-btn .theme-toggle-icon {
  transition: transform var(--nh-transition);
  font-size: 1.25rem;
}

/* Dashboard link button */
.site-navbar .btn-outline-dark {
  border: 1px solid var(--nh-border);
  border-radius: var(--nh-radius-full);
  color: var(--nh-text-body);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 1rem;
  transition: all var(--nh-transition-fast);
}

.site-navbar .btn-outline-dark:hover {
  background: var(--nh-secondary);
  border-color: var(--nh-secondary);
  color: #fff;
}

/* Mobile toggle */
.navbar-toggler {
  border: none;
  padding: 0.5rem;
  color: var(--nh-text-heading);
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: none;
}

/* ==========================================================================
   5. Full-Width Hero Slider
   ========================================================================== */

.nh-hero-slider {
  position: relative;
  width: 100%;
  height: 460px;
  overflow: hidden;
  background: var(--nh-secondary);
  margin-top: 0;
}

.nh-hero-slider .carousel,
.nh-hero-slider .carousel-inner,
.nh-hero-slider .carousel-item {
  height: 100%;
}

.nh-hero-slide {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.nh-hero-slide__bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transition: transform 6s ease;
}

.carousel-item.active .nh-hero-slide__bg {
  transform: scale(1.05);
}

.nh-hero-slide__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(26, 26, 46, 0.1) 0%,
    rgba(26, 26, 46, 0.25) 40%,
    rgba(26, 26, 46, 0.75) 80%,
    rgba(26, 26, 46, 0.92) 100%
  );
  z-index: 1;
}

.nh-hero-slide__content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 3rem 2rem;
  color: #fff;
}

.nh-hero-slide__category {
  display: inline-block;
  background: var(--nh-primary);
  color: #fff;
  font-family: var(--nh-font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.8rem;
  border-radius: var(--nh-radius-full);
  margin-bottom: 1rem;
}

.nh-hero-slide__link {
  text-decoration: none;
  color: #fff;
}

.nh-hero-slide__link:hover {
  color: rgba(255, 255, 255, 0.9);
}

.nh-hero-slide__title {
  font-family: var(--nh-font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  margin: 0 0 1rem;
  max-width: 700px;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nh-hero-slide__meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-family: var(--nh-font-body);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.nh-hero-slide__source {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nh-hero-slide__source-logo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.nh-hero-slide__time {
  opacity: 0.75;
}

/* Hero dots */
.nh-hero-dots {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  z-index: 3;
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nh-hero-dots li {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all var(--nh-transition);
  border: none;
  text-indent: -9999px;
  overflow: hidden;
}

.nh-hero-dots li:hover {
  background: rgba(255, 255, 255, 0.7);
}

.nh-hero-dots li.active {
  background: var(--nh-primary);
  width: 28px;
  border-radius: var(--nh-radius-full);
}

/* Hero arrows */
.nh-hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--nh-transition);
  opacity: 0;
}

.nh-hero-slider:hover .nh-hero-arrow {
  opacity: 1;
}

.nh-hero-arrow:hover {
  background: var(--nh-primary);
  transform: translateY(-50%) scale(1.05);
}

.nh-hero-arrow--prev {
  left: 1.5rem;
}

.nh-hero-arrow--next {
  right: 1.5rem;
}

.nh-hero-arrow svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ==========================================================================
   6. Breaking News Ticker (Design Bonus)
   ========================================================================== */

.nh-breaking-bar {
  background: var(--nh-primary);
  color: #fff;
  font-family: var(--nh-font-body);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 0;
  overflow: hidden;
  white-space: nowrap;
}

.nh-breaking-bar__label {
  display: inline-block;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.2rem 0.8rem;
  border-radius: var(--nh-radius-sm);
  margin-right: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.nh-breaking-bar__content {
  display: inline-block;
  animation: nh-ticker-scroll 20s linear infinite;
}

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

/* ==========================================================================
   7. Category Pill Bar
   ========================================================================== */

.nh-category-bar-wrapper {
  background: var(--nh-surface);
  border-bottom: 1px solid var(--nh-border-light);
  padding: 0.75rem 0;
  position: sticky;
  top: var(--nh-header-height);
  z-index: 1025;
}

.nh-category-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0;
  flex-wrap: nowrap;
}

.nh-category-bar::-webkit-scrollbar {
  display: none;
}

.nh-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  font-family: var(--nh-font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--nh-text-body);
  background: var(--nh-bg);
  border-radius: var(--nh-radius-full);
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--nh-transition-fast);
  flex-shrink: 0;
  border: 1px solid transparent;
}

.nh-category-pill:hover {
  background: var(--nh-primary-ghost);
  color: var(--nh-primary);
  border-color: var(--nh-primary);
  transform: translateY(-1px);
  text-decoration: none;
}

.nh-category-pill--active {
  background: var(--nh-primary);
  color: #fff;
  font-weight: 600;
  border-color: var(--nh-primary);
}

.nh-category-pill--active:hover {
  background: var(--nh-primary-hover);
  color: #fff;
  border-color: var(--nh-primary-hover);
}

.nh-category-pill__icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
}

/* ==========================================================================
   8. Section Headings
   ========================================================================== */

.nh-section-heading {
  font-family: var(--nh-font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--nh-text-heading);
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--nh-border);
  position: relative;
  letter-spacing: -0.01em;
}

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

/* ==========================================================================
   9. Post Cards (Main Feed)
   ========================================================================== */

.nh-post-card {
  display: flex;
  background: var(--nh-surface);
  border-radius: var(--nh-radius-md);
  overflow: hidden;
  box-shadow: var(--nh-shadow-sm);
  transition: all var(--nh-transition);
  border: 1px solid var(--nh-border-light);
  position: relative;
}

.nh-post-card:hover {
  box-shadow: var(--nh-shadow-md);
  transform: translateY(-2px);
  border-color: var(--nh-border);
}

.nh-post-card__image-wrapper {
  flex: 0 0 200px;
  position: relative;
  overflow: hidden;
}

.nh-post-card__image-wrapper a {
  display: block;
  height: 100%;
  overflow: hidden;
}

.nh-post-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--nh-transition-slow);
}

.nh-post-card:hover .nh-post-card__image {
  transform: scale(1.06);
}

.nh-post-card__category {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--nh-primary);
  color: #fff;
  font-family: var(--nh-font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: var(--nh-radius-sm);
  z-index: 1;
}

.nh-post-card__content {
  flex: 1;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.nh-post-card__title {
  font-family: var(--nh-font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--nh-text-heading);
  margin: 0 0 0.6rem;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nh-post-card__title:hover {
  color: var(--nh-primary);
}

.nh-post-card__footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
  font-family: var(--nh-font-body);
  font-size: 0.8rem;
  color: var(--nh-text-muted);
  padding-top: 0.75rem;
  border-top: 1px solid var(--nh-border-light);
}

.nh-post-card__source {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nh-post-card__source-logo {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.nh-post-card__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.nh-post-card__meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nh-post-card__meta-item svg,
.nh-post-card__meta-item .svg-icon {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

/* Post admin buttons */
.nh-post-card .btn-sm {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: var(--nh-radius-sm);
}

/* ==========================================================================
   10. Ad Break (In-Feed)
   ========================================================================== */

.nh-ad-break {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--nh-surface);
  border: 2px dashed var(--nh-border);
  border-radius: var(--nh-radius-md);
  text-align: center;
  position: relative;
}

.nh-ad-break::before {
  content: 'Advertisement';
  display: block;
  font-family: var(--nh-font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nh-text-muted);
  margin-bottom: 1rem;
}

/* ==========================================================================
   11. Sidebar Blocks
   ========================================================================== */

.nh-sidebar-block {
  background: var(--nh-surface);
  border: 1px solid var(--nh-border-light);
  border-radius: var(--nh-radius-md);
  box-shadow: var(--nh-shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.nh-sidebar-block__heading {
  font-family: var(--nh-font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--nh-text-heading);
  padding: 1rem 1.25rem;
  margin: 0;
  border-bottom: 1px solid var(--nh-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: -0.01em;
}

.nh-sidebar-block__heading::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--nh-primary);
  border-radius: 2px;
  margin-right: 0.6rem;
  vertical-align: middle;
}

.nh-sidebar-block__heading span {
  display: inline-flex;
  align-items: center;
}

.nh-sidebar-block__body {
  padding: 1rem 1.25rem;
}

/* Sidebar search */
.nh-sidebar-block .input-group .form-control {
  border-radius: var(--nh-radius-full) 0 0 var(--nh-radius-full);
  border: 1px solid var(--nh-border);
  border-right: none;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  height: 40px;
  background: var(--nh-bg);
}

.nh-sidebar-block .input-group .form-control:focus {
  border-color: var(--nh-primary);
  box-shadow: none;
}

.nh-sidebar-block .input-group-append .input-group-text {
  border-radius: 0 var(--nh-radius-full) var(--nh-radius-full) 0;
  border: 1px solid var(--nh-border);
  border-left: none;
  background: var(--nh-bg);
  color: var(--nh-primary);
  padding: 0 1rem;
  cursor: pointer;
}

/* ==========================================================================
   12. Popular Posts (Sidebar)
   ========================================================================== */

.nh-popular-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--nh-border-light);
  transition: background var(--nh-transition-fast);
}

.nh-popular-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.nh-popular-item:hover {
  background: var(--nh-surface-hover);
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: var(--nh-radius-sm);
}

.nh-rank-badge {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--nh-font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--nh-radius-sm);
  color: #fff;
  background: var(--nh-text-muted);
  line-height: 1;
}

.nh-rank-badge--1 {
  background: var(--nh-primary);
}

.nh-rank-badge--2 {
  background: var(--nh-secondary-light);
}

.nh-rank-badge--3 {
  background: var(--nh-info);
}

/* ==========================================================================
   12b. Sidebar Post Item (compact)
   ========================================================================== */

.nh-sidebar-post {
  flex: 1;
  min-width: 0;
}

.nh-sidebar-post .post-feat-image {
  flex-shrink: 0;
}

.nh-sidebar-post .post-feat-image .post-img-link {
  display: block;
  overflow: hidden;
  height: 60px;
  width: 60px;
  border-radius: var(--nh-radius-sm);
}

.nh-sidebar-post .post-feat-image .post-feat-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--nh-transition-slow);
}

.nh-sidebar-post:hover .post-feat-img {
  transform: scale(1.08);
}

.nh-sidebar-post__title {
  font-family: var(--nh-font-heading);
  font-size: 0.925rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--nh-text-heading);
  margin: 0 0 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.01em;
}

.nh-sidebar-post__title:hover {
  color: var(--nh-primary);
}

.nh-sidebar-post__meta {
  font-family: var(--nh-font-body);
  font-size: 0.75rem;
  color: var(--nh-text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nh-sidebar-post__meta svg,
.nh-sidebar-post__meta .svg-icon {
  width: 12px;
  height: 12px;
  opacity: 0.5;
}

/* ==========================================================================
   13. Ad Container (Sidebar)
   ========================================================================== */

.nh-ad-container {
  margin: 0 0 1.25rem;
  padding: 1rem;
  background: var(--nh-bg);
  border: 1px solid var(--nh-border-light);
  border-radius: var(--nh-radius-md);
  text-align: center;
  position: relative;
}

.nh-ad-container::before {
  content: 'Sponsored';
  display: block;
  font-family: var(--nh-font-body);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--nh-text-muted);
  margin-bottom: 0.75rem;
}

.nh-ad-container img {
  max-width: 100%;
  height: auto;
  border-radius: var(--nh-radius-sm);
}

/* ==========================================================================
   14. Left Sidebar Navigation (Categories)
   ========================================================================== */

.nh-sidebar-nav {
  background: var(--nh-surface);
  border: 1px solid var(--nh-border-light);
  border-radius: var(--nh-radius-md);
  overflow: hidden;
  box-shadow: var(--nh-shadow-xs);
}

.nh-sidebar-nav__label {
  font-family: var(--nh-font-body);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nh-text-muted);
  padding: 1rem 1.25rem 0.5rem;
}

.nh-sidebar-nav__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--nh-font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--nh-text-body);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all var(--nh-transition-fast);
}

.nh-sidebar-nav__item:hover {
  background: var(--nh-primary-ghost);
  color: var(--nh-primary);
  text-decoration: none;
}

.nh-sidebar-nav__item--active {
  background: var(--nh-primary-light);
  color: var(--nh-primary);
  border-left-color: var(--nh-primary);
  font-weight: 600;
}

.nh-sidebar-nav__item--active:hover {
  background: var(--nh-primary-light);
  color: var(--nh-primary);
}

.nh-sidebar-nav__icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ==========================================================================
   15. Sidebar Footer Block
   ========================================================================== */

.nh-sidebar-footer {
  background: var(--nh-secondary);
  color: rgba(255, 255, 255, 0.8);
  border-radius: var(--nh-radius-md);
  padding: 1.25rem;
  font-size: 0.85rem;
  line-height: 1.6;
}

.nh-sidebar-footer a {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.nh-sidebar-footer a:hover {
  color: #fff;
}

.nh-sidebar-footer .locale-icon {
  width: 16px;
  height: auto;
  border-radius: 2px;
}

/* ==========================================================================
   16. Page Hero (Category / Archive pages)
   ========================================================================== */

.nh-page-hero {
  background: linear-gradient(135deg, var(--nh-secondary) 0%, var(--nh-secondary-light) 100%);
  color: #fff;
  padding: 2.5rem 0;
  margin-bottom: 1.5rem;
}

.nh-page-hero__title {
  font-family: var(--nh-font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
}

.nh-page-hero__subtitle {
  font-family: var(--nh-font-body);
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0.5rem 0 0;
}

/* ==========================================================================
   17. Single Post (Reading-Optimized)
   ========================================================================== */

.nh-post-single {
  max-width: 860px;
  margin: 0 auto;
  background: var(--nh-surface);
  border-radius: var(--nh-radius-lg);
  padding: 2rem 2.5rem;
  box-shadow: var(--nh-shadow-sm);
  border: 1px solid var(--nh-border-light);
}

.nh-post-single__title {
  font-family: var(--nh-font-heading);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--nh-text-heading);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.nh-post-single__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--nh-border-light);
  font-family: var(--nh-font-body);
  font-size: 0.875rem;
  color: var(--nh-text-muted);
}

.nh-post-single__meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nh-post-single__meta-item svg {
  opacity: 0.5;
}

.nh-post-single__featured {
  border-radius: var(--nh-radius-md);
  margin: 1.25rem 0;
  overflow: hidden;
  min-height: 300px;
  background: var(--nh-secondary);
  background-size: cover;
  background-position: center;
}

.nh-post-single__content {
  font-family: var(--nh-font-body);
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--nh-text-body);
}

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

.nh-post-single__content h1,
.nh-post-single__content h2,
.nh-post-single__content h3,
.nh-post-single__content h4 {
  font-family: var(--nh-font-heading);
  margin: 2rem 0 1rem;
}

.nh-post-single__content img {
  border-radius: var(--nh-radius-md);
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
  display: block;
}

.nh-post-single__content blockquote {
  border-left: 4px solid var(--nh-primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--nh-bg);
  border-radius: 0 var(--nh-radius-md) var(--nh-radius-md) 0;
  font-style: italic;
  color: var(--nh-text-body);
}

.nh-post-single__content blockquote p:last-child {
  margin-bottom: 0;
}

.nh-post-single__content a {
  color: var(--nh-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Source link button */
.nh-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  background: var(--nh-primary);
  color: #fff;
  font-family: var(--nh-font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--nh-radius-full);
  text-decoration: none;
  transition: all var(--nh-transition);
  margin: 1.5rem 0;
}

.nh-source-btn:hover {
  background: var(--nh-primary-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--nh-shadow-md);
  text-decoration: none;
}

/* Share bar */
.nh-share-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1.25rem 0;
  border-top: 1px solid var(--nh-border-light);
  margin-top: 1.5rem;
}

.nh-share-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--nh-radius-full);
  font-family: var(--nh-font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all var(--nh-transition-fast);
  text-decoration: none;
}

.nh-share-bar__btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--nh-shadow-md);
  filter: brightness(1.1);
  color: #fff;
  text-decoration: none;
}

.nh-share-bar__btn--facebook { background: #1877F2; }
.nh-share-bar__btn--twitter { background: #000000; }
.nh-share-bar__btn--whatsapp { background: #25D366; }

/* ==========================================================================
   18. Related Posts
   ========================================================================== */

.nh-related-posts {
  margin-top: 2rem;
}

.nh-related-posts__title {
  font-family: var(--nh-font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--nh-text-heading);
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   19. Breadcrumbs
   ========================================================================== */

.breadcrumb {
  background: transparent;
  padding: 0.75rem 0;
  margin: 0;
  font-family: var(--nh-font-body);
  font-size: 0.85rem;
}

.breadcrumb-item a {
  color: var(--nh-text-muted);
}

.breadcrumb-item a:hover {
  color: var(--nh-primary);
}

.breadcrumb-item.active {
  color: var(--nh-text-body);
  font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--nh-text-muted);
}

/* ==========================================================================
   20. Pagination
   ========================================================================== */

.pagination {
  gap: 0.25rem;
}

.pagination .page-link {
  border-radius: var(--nh-radius-sm);
  border: 1px solid var(--nh-border-light);
  color: var(--nh-text-body);
  font-family: var(--nh-font-body);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  transition: all var(--nh-transition-fast);
}

.pagination .page-link:hover {
  background: var(--nh-primary-ghost);
  border-color: var(--nh-primary);
  color: var(--nh-primary);
}

.pagination .page-item.active .page-link {
  background: var(--nh-primary);
  border-color: var(--nh-primary);
  color: #fff;
}

.pagination .page-item.disabled .page-link {
  color: var(--nh-text-muted);
  opacity: 0.5;
}

/* ==========================================================================
   21. Scroll to Top Button
   ========================================================================== */

.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--nh-primary);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--nh-transition);
  box-shadow: var(--nh-shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: var(--nh-primary-hover);
  transform: translateY(-3px);
  box-shadow: var(--nh-shadow-lg);
}

/* ==========================================================================
   22. Empty State
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--nh-surface);
  border-radius: var(--nh-radius-lg);
  border: 2px dashed var(--nh-border);
}

.empty-state svg {
  opacity: 0.3;
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: 1rem;
  color: var(--nh-text-muted);
  margin-bottom: 1rem;
}

/* ==========================================================================
   23. Page Content
   ========================================================================== */

.nh-page-title {
  font-family: var(--nh-font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--nh-text-heading);
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.nh-page-content {
  background: var(--nh-surface);
  border-radius: var(--nh-radius-md);
  padding: 2rem;
  box-shadow: var(--nh-shadow-xs);
  border: 1px solid var(--nh-border-light);
  font-size: 1rem;
  line-height: 1.7;
}

/* ==========================================================================
   24. Legacy Class Overrides (for Bootstrap components in use)
   ========================================================================== */

/* Override old site-heading */
.site-heading {
  font-family: var(--nh-font-heading);
  font-size: 1.5rem !important;
  font-weight: 700;
  color: var(--nh-text-heading);
  border-bottom: 2px solid var(--nh-border);
  text-transform: none;
  letter-spacing: -0.01em;
}

.site-heading span {
  border-left: none;
  border-bottom: 3px solid var(--nh-primary);
  padding: 0 0 0.5rem;
  display: inline-block;
}

/* Override old post-item for non-redesigned templates */
.post-item {
  background: var(--nh-surface);
  border: 1px solid var(--nh-border-light);
  border-radius: var(--nh-radius-md);
  overflow: hidden;
  transition: all var(--nh-transition);
}

.post-item:hover {
  box-shadow: var(--nh-shadow-md);
  transform: translateY(-2px);
}

.post-item .post-title {
  font-family: var(--nh-font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--nh-text-heading);
}

.post-item .post-title:hover {
  color: var(--nh-primary);
}

/* Feed logo */
.feed-logo-img {
  border-radius: 50%;
  max-height: 20px;
  width: auto;
}

/* Category icon */
.category-icon {
  border-radius: 4px;
}

/* ==========================================================================
   25. Dark Mode Overrides
   ========================================================================== */

[data-theme="dark"] {
  --nh-bg: #0F1923;
  --nh-surface: #1A2735;
  --nh-surface-hover: #1F3040;
  --nh-text-heading: #E8ECF0;
  --nh-text-body: #B0B8C1;
  --nh-text-muted: #6B7A8A;
  --nh-border: #2A3A4A;
  --nh-border-light: #223040;
  --nh-primary: #FF6B6B;
  --nh-primary-hover: #FF8585;
  --nh-primary-light: rgba(255, 107, 107, 0.12);
  --nh-primary-ghost: rgba(255, 107, 107, 0.06);
  --nh-secondary: #152230;
  --nh-secondary-light: #1D3040;
  --nh-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --nh-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --nh-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --nh-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

  /* Legacy compat */
  --bg-primary: var(--nh-surface);
  --bg-secondary: var(--nh-bg);
  --bg-card: var(--nh-surface);
  --bg-header: var(--nh-surface);
  --text-primary: var(--nh-text-heading);
  --text-secondary: var(--nh-text-body);
  --border-color: var(--nh-border);
  --accent-color: var(--nh-primary);
  --accent-hover: var(--nh-primary-hover);
  --hover-bg: var(--nh-surface-hover);
  --footer-bg: #0D1520;
  --footer-text: rgba(255, 255, 255, 0.6);
  --overlay-dark: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] body {
  background: var(--nh-bg);
  color: var(--nh-text-body);
}

[data-theme="dark"] .site-navbar {
  background: var(--nh-surface);
  border-bottom-color: var(--nh-border);
}

[data-theme="dark"] .site-navbar.navbar-scrolled {
  background: rgba(26, 39, 53, 0.92);
}

[data-theme="dark"] .nh-category-bar-wrapper {
  background: rgba(15, 25, 35, 0.95);
  border-bottom-color: var(--nh-border);
}

[data-theme="dark"] .nh-category-pill {
  background: var(--nh-surface);
  color: var(--nh-text-body);
}

[data-theme="dark"] .nh-category-pill:hover {
  background: var(--nh-primary-ghost);
  color: var(--nh-primary);
  border-color: var(--nh-primary);
}

[data-theme="dark"] .nh-hero-dots li {
  background: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .nh-hero-dots li.active {
  background: var(--nh-primary);
}

[data-theme="dark"] .nh-hero-arrow {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--nh-bg);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--nh-border);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: var(--nh-text-muted);
}

[data-theme="dark"] .home-search-box .form-control {
  background: var(--nh-surface);
  border-color: var(--nh-border);
  color: var(--nh-text-body);
}

[data-theme="dark"] .home-search-box .form-control:focus {
  border-color: var(--nh-primary);
  background: var(--nh-surface);
}

[data-theme="dark"] .nh-sidebar-block .input-group .form-control {
  background: var(--nh-surface);
}

[data-theme="dark"] .nh-sidebar-block .input-group-append .input-group-text {
  background: var(--nh-surface);
}

[data-theme="dark"] .theme-toggle-btn {
  background: var(--nh-surface);
  border-color: var(--nh-border);
  color: var(--nh-text-body);
}

[data-theme="dark"] .site-navbar .btn-outline-dark {
  border-color: var(--nh-border);
  color: var(--nh-text-body);
}

[data-theme="dark"] .site-navbar .btn-outline-dark:hover {
  background: var(--nh-primary);
  border-color: var(--nh-primary);
  color: #fff;
}

/* ==========================================================================
   26. Animations & Micro-Interactions
   ========================================================================== */

@keyframes nh-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes nh-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.nh-animate-in {
  animation: nh-fadeInUp 0.5s var(--nh-ease) forwards;
}

/* ==========================================================================
   27. Responsive Breakpoints
   ========================================================================== */

/* Tablet (≤ 991.98px) */
@media (max-width: 991.98px) {
  .nh-hero-slider {
    height: 360px;
  }

  .nh-hero-slide__title {
    font-size: 1.75rem;
  }

  .nh-hero-slide__content {
    padding: 2rem 1.5rem;
  }

  .nh-post-card {
    flex-direction: row;
  }

  .nh-post-card__image-wrapper {
    flex: 0 0 150px;
    min-height: 120px;
  }

  .nh-post-card__content {
    padding: 1rem;
  }

  .nh-post-card__title {
    font-size: 1rem;
  }

  .nh-post-single {
    padding: 1.5rem;
  }

  .nh-post-single__title {
    font-size: 1.6rem;
  }
}

/* Mobile (≤ 767.98px) */
@media (max-width: 767.98px) {
  .site-navbar {
    height: 56px;
  }

  .nh-hero-slider {
    height: 280px;
  }

  .nh-hero-slide__title {
    font-size: 1.35rem;
  }

  .nh-hero-slide__content {
    padding: 1.5rem 1rem;
  }

  .nh-hero-slide__category {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
  }

  .nh-hero-slide__meta {
    font-size: 0.75rem;
    gap: 0.75rem;
  }

  .nh-hero-dots {
    bottom: 1rem;
    right: 1rem;
  }

  .nh-hero-arrow {
    width: 36px;
    height: 36px;
  }

  .nh-hero-arrow--prev { left: 0.5rem; }
  .nh-hero-arrow--next { right: 0.5rem; }

  .nh-category-bar {
    gap: 0.35rem;
  }

  .nh-category-pill {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
  }

  .nh-post-card {
    flex-direction: column;
  }

  .nh-post-card__image-wrapper {
    flex: none;
    height: 200px;
    width: 100%;
  }

  .nh-post-card__content {
    padding: 1rem;
  }

  .nh-post-card__title {
    font-size: 1.05rem;
  }

  .nh-post-card__footer {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .nh-post-single {
    padding: 1.25rem;
    border-radius: var(--nh-radius-md);
  }

  .nh-post-single__title {
    font-size: 1.4rem;
  }

  .nh-post-single__content {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .nh-section-heading {
    font-size: 1.25rem;
  }

  .nh-page-hero {
    padding: 1.75rem 0;
  }

  .nh-page-hero__title {
    font-size: 1.5rem;
  }

  /* Sidebar no-shadow on mobile */
  .no-shadow-xs {
    box-shadow: none !important;
  }

  .sidebar {
    height: auto !important;
  }

  .sidebar .inner-wrapper-sticky {
    transform: none !important;
    position: static !important;
  }

  .nh-sidebar-nav {
    margin-bottom: 1rem;
  }
}

/* Large Desktop (≥ 1200px) */
@media (min-width: 1200px) {
  .nh-hero-slider {
    height: 520px;
  }

  .nh-hero-slide__title {
    font-size: 2.75rem;
    max-width: 800px;
  }

  .nh-post-card__image-wrapper {
    flex: 0 0 240px;
  }
}
