/*
Theme Name: Bytes Yatra
Theme URI: https://bytesyatra.com
Author: Bytes Yatra Team
Author URI: https://bytesyatra.com
Description: Premium Nepali technology and lifestyle editorial magazine covering gadgets, automobiles, education, travel, and internet culture.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bytes-yatra
Tags: custom-menu, featured-images, threaded-comments, translation-ready, rtl-language-support, custom-logo, editor-style, wide-blocks, full-width-template, two-columns, right-sidebar, custom-colors, custom-header

Bytes Yatra - Explore Knowledge, Technology and Beyond.
*/

/* ==========================================================================
   CSS CUSTOM PROPERTIES
   ========================================================================== */
:root {
  --by-primary: #C62828;
  --by-primary-dark: #9B1B1B;
  --by-primary-light: #EF5350;
  --by-bg: #F9FAFB;
  --by-surface: #FFFFFF;
  --by-surface-alt: #F3F4F6;
  --by-border: #E5E7EB;
  --by-text: #111827;
  --by-text-muted: #6B7280;
  --by-text-light: #9CA3AF;
  --by-heading-font: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --by-body-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --by-base-size: 16px;
  --by-line-height: 1.7;
  --by-radius: 8px;
  --by-radius-sm: 4px;
  --by-radius-lg: 12px;
  --by-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --by-shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --by-shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --by-transition: 0.25s ease;
  --by-header-height: 72px;
  --by-nav-height: 48px;
}

/* Dark Mode Variables */
body.by-dark-mode {
  --by-bg: #0D1117;
  --by-surface: #161B22;
  --by-surface-alt: #21262D;
  --by-border: #30363D;
  --by-text: #E6EDF3;
  --by-text-muted: #8B949E;
  --by-text-light: #6E7681;
  --by-shadow: 0 1px 3px rgba(0,0,0,.4);
  --by-shadow-md: 0 4px 6px rgba(0,0,0,.3);
  --by-shadow-lg: 0 10px 15px rgba(0,0,0,.4);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: var(--by-base-size);
}

body {
  font-family: var(--by-body-font);
  font-size: 1rem;
  font-weight: 400;
  line-height: var(--by-line-height);
  color: var(--by-text);
  background-color: var(--by-bg);
  transition: background-color var(--by-transition), color var(--by-transition);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--by-primary); text-decoration: none; transition: color var(--by-transition); }
a:hover { color: var(--by-primary-dark); }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--by-heading-font);
  font-weight: 700;
  line-height: 1.25;
  color: var(--by-text);
  transition: color var(--by-transition);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 3vw, 1.875rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }

/* ==========================================================================
   LAYOUT CONTAINERS
   ========================================================================== */
.by-container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 640px) { .by-container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .by-container { padding-inline: 2rem; } }

.by-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.by-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

/* Content + Sidebar layout */
.by-content-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 1023px) {
  .by-content-sidebar { grid-template-columns: 1fr; }
}

/* ==========================================================================
   READING PROGRESS BAR
   ========================================================================== */
#by-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--by-primary);
  z-index: 9999;
  transition: none;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
#by-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--by-border);
  transition: padding var(--by-transition), background var(--by-transition), box-shadow var(--by-transition);
}

body.by-dark-mode #by-header {
  background: rgba(13, 17, 23, 0.85);
}

#by-header.scrolled {
  padding-block: 0;
  box-shadow: var(--by-shadow-md);
}

.by-header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  height: var(--by-header-height);
  transition: height var(--by-transition);
}

.scrolled .by-header-inner { height: 56px; }

/* Logo */
.by-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.by-logo-text {
  font-family: var(--by-heading-font);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--by-text);
  line-height: 1;
  transition: color var(--by-transition);
}

.by-logo-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--by-primary);
  border-radius: 50%;
  margin-left: 2px;
  vertical-align: super;
}

.by-logo img {
  max-height: 48px;
  width: auto;
}

/* Search Bar */
.by-header-search {
  flex: 1;
  max-width: 560px;
  margin-inline: auto;
}

.by-search-form {
  display: flex;
  align-items: center;
  border: 2px solid var(--by-border);
  border-radius: 50px;
  overflow: hidden;
  background: var(--by-surface);
  transition: border-color var(--by-transition), box-shadow var(--by-transition);
}

.by-search-form:focus-within {
  border-color: var(--by-primary);
  box-shadow: 0 0 0 3px rgba(198, 40, 40, .15);
}

.by-search-form input[type="search"] {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.6rem 1rem;
  background: transparent;
  color: var(--by-text);
  font-size: 0.9rem;
}

.by-search-form input[type="search"]::placeholder { color: var(--by-text-muted); }

.by-search-btn {
  background: var(--by-primary);
  color: #fff;
  border: none;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: background var(--by-transition);
  white-space: nowrap;
}

.by-search-btn:hover { background: var(--by-primary-dark); }

/* Header Right */
.by-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Dark Mode Toggle */
.by-dark-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--by-surface-alt);
  color: var(--by-text);
  transition: background var(--by-transition), color var(--by-transition);
  border: 1px solid var(--by-border);
}

.by-dark-toggle:hover { background: var(--by-border); }

/* Social Icons in Header */
.by-header-socials {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.by-social-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--by-surface-alt);
  color: var(--by-text-muted);
  font-size: 0.875rem;
  transition: all var(--by-transition);
  border: 1px solid var(--by-border);
}

.by-social-icon:hover { background: var(--by-primary); color: #fff; border-color: var(--by-primary); }

/* Hamburger */
.by-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
  color: var(--by-text);
}

.by-hamburger span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all var(--by-transition);
}

@media (max-width: 767px) {
  .by-hamburger { display: flex; }
  .by-header-search { display: none; }
  .by-header-socials { display: none; }
  .by-header-inner { grid-template-columns: auto 1fr auto; }
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
#by-navbar {
  background: var(--by-primary);
  position: sticky;
  top: var(--by-header-height);
  z-index: 999;
  transition: top var(--by-transition);
}

.scrolled ~ #by-navbar { top: 56px; }

.by-nav-inner {
  display: flex;
  align-items: center;
  height: var(--by-nav-height);
}

/* Primary Menu */
#by-primary-menu {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
}

#by-primary-menu > li {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

#by-primary-menu > li > a {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  height: 100%;
  padding-inline: 1rem;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--by-transition);
  position: relative;
}

#by-primary-menu > li > a:hover,
#by-primary-menu > li:focus-within > a,
#by-primary-menu > li.current-menu-item > a,
#by-primary-menu > li.current-menu-ancestor > a {
  background: var(--by-primary-dark);
  color: #fff;
}

/* Dropdown chevron */
#by-primary-menu > li.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(255,255,255,.8);
  margin-left: 4px;
  transition: transform var(--by-transition);
}

#by-primary-menu > li.menu-item-has-children:hover > a::after,
#by-primary-menu > li.menu-item-has-children:focus-within > a::after {
  transform: rotate(180deg);
}

/* Dropdown */
.sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--by-surface);
  border-radius: 0 0 var(--by-radius) var(--by-radius);
  box-shadow: var(--by-shadow-lg);
  border: 1px solid var(--by-border);
  border-top: 3px solid var(--by-primary);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--by-transition);
  z-index: 1001;
  padding: 0.5rem 0;
}

#by-primary-menu > li:hover .sub-menu,
#by-primary-menu > li:focus-within .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sub-menu li a {
  display: block;
  padding: 0.6rem 1.25rem;
  color: var(--by-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--by-transition);
  text-decoration: none;
}

.sub-menu li a:hover {
  background: var(--by-surface-alt);
  color: var(--by-primary);
  padding-left: 1.5rem;
}

/* Mobile: scrollable nav */
@media (max-width: 767px) {
  .by-nav-inner { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
  .by-nav-inner::-webkit-scrollbar { display: none; }
  #by-primary-menu > li > a { font-size: 0.8rem; padding-inline: 0.75rem; }
}

/* ==========================================================================
   OFFCANVAS MOBILE MENU
   ========================================================================== */
#by-offcanvas-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: all var(--by-transition);
}

#by-offcanvas-overlay.open {
  opacity: 1;
  visibility: visible;
}

#by-offcanvas-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  width: min(320px, 85vw);
  background: var(--by-surface);
  z-index: 1101;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
}

#by-offcanvas-panel.open {
  transform: translateX(0);
}

.by-offcanvas-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--by-border);
  flex-shrink: 0;
}

.by-offcanvas-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--by-surface-alt);
  color: var(--by-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1;
  border: 1px solid var(--by-border);
  transition: all var(--by-transition);
}

.by-offcanvas-close:hover { background: var(--by-primary); color: #fff; border-color: var(--by-primary); }

.by-offcanvas-search {
  padding: 1rem;
  border-bottom: 1px solid var(--by-border);
  flex-shrink: 0;
}

.by-offcanvas-search .by-search-form { border-radius: var(--by-radius); }

.by-offcanvas-nav {
  flex: 1;
  padding: 0.5rem 0;
  overflow-y: auto;
}

.by-offcanvas-nav li { border-bottom: 1px solid var(--by-border); }

.by-offcanvas-nav > li > a,
.by-offcanvas-nav-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  color: var(--by-text);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  transition: background var(--by-transition);
}

.by-offcanvas-nav-item-head:hover,
.by-offcanvas-nav > li > a:hover { background: var(--by-surface-alt); color: var(--by-primary); }

.by-offcanvas-chevron {
  transition: transform var(--by-transition);
  color: var(--by-text-muted);
}

.by-offcanvas-nav li.open .by-offcanvas-chevron { transform: rotate(90deg); }

.by-offcanvas-submenu {
  display: none;
  background: var(--by-surface-alt);
}

.by-offcanvas-nav li.open .by-offcanvas-submenu { display: block; }

.by-offcanvas-submenu a {
  display: block;
  padding: 0.65rem 2rem;
  color: var(--by-text-muted);
  font-size: 0.875rem;
  text-decoration: none;
  border-bottom: 1px solid var(--by-border);
  transition: all var(--by-transition);
}

.by-offcanvas-submenu a:hover { color: var(--by-primary); padding-left: 2.25rem; }

.by-offcanvas-foot {
  padding: 1.25rem;
  border-top: 1px solid var(--by-border);
  flex-shrink: 0;
}

.by-offcanvas-socials {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==========================================================================
   POST CARDS
   ========================================================================== */
.by-card {
  background: var(--by-surface);
  border-radius: var(--by-radius-lg);
  overflow: hidden;
  border: 1px solid var(--by-border);
  transition: all var(--by-transition);
  display: flex;
  flex-direction: column;
}

.by-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--by-shadow-lg);
}

.by-card-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--by-surface-alt);
}

.by-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

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

/* Category gradient fallbacks */
.by-cat-gadgets { background: linear-gradient(135deg, #1565C0, #42A5F5); }
.by-cat-automobiles { background: linear-gradient(135deg, #E65100, #FFA726); }
.by-cat-education { background: linear-gradient(135deg, #00695C, #26A69A); }
.by-cat-travel { background: linear-gradient(135deg, #2E7D32, #66BB6A); }
.by-cat-technology { background: linear-gradient(135deg, #4527A0, #7E57C2); }
.by-cat-default { background: linear-gradient(135deg, #37474F, #78909C); }

.by-cat-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--by-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  text-decoration: none;
  z-index: 1;
  transition: background var(--by-transition);
}

.by-cat-badge:hover { background: var(--by-primary-dark); color: #fff; }

.by-compare-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255,255,255,.9);
  color: var(--by-primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  border: 1px solid var(--by-primary);
  cursor: pointer;
  transition: all var(--by-transition);
  z-index: 1;
}

.by-compare-btn:hover,
.by-compare-btn.active {
  background: var(--by-primary);
  color: #fff;
}

.by-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.by-card-title {
  font-family: var(--by-heading-font);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--by-text);
  margin-bottom: 0.75rem;
  transition: color var(--by-transition);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.by-card-title:hover { color: var(--by-primary); }

.by-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--by-text-muted);
  margin-top: auto;
  flex-wrap: wrap;
}

.by-card-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.by-card-meta svg { width: 13px; height: 13px; }

/* Hero Card (large) */
.by-hero-card {
  position: relative;
  border-radius: var(--by-radius-lg);
  overflow: hidden;
  display: block;
  text-decoration: none;
}

.by-hero-card-thumb {
  aspect-ratio: 3/2;
  position: relative;
  overflow: hidden;
}

.by-hero-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.by-hero-card:hover .by-hero-card-thumb img { transform: scale(1.04); }

.by-hero-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.3) 50%, transparent 100%);
}

.by-hero-card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
}

.by-hero-card-title {
  font-family: var(--by-heading-font);
  font-weight: 800;
  color: #fff;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  line-height: 1.25;
  margin-block: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.by-hero-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,.8);
}

/* ==========================================================================
   HOMEPAGE HERO GRID
   ========================================================================== */
.by-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1rem;
}

.by-hero-grid .by-hero-main {
  grid-row: 1 / 3;
}

.by-hero-grid .by-hero-main .by-hero-card-thumb {
  aspect-ratio: unset;
  height: 100%;
  min-height: 400px;
}

@media (max-width: 639px) {
  .by-hero-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .by-hero-grid .by-hero-main { grid-row: unset; }
  .by-hero-grid .by-hero-main .by-hero-card-thumb { min-height: 260px; }
}

/* ==========================================================================
   SECTION HEADINGS
   ========================================================================== */
.by-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--by-border);
}

.by-section-title {
  font-family: var(--by-heading-font);
  font-weight: 800;
  font-size: 1.375rem;
  color: var(--by-text);
  padding-left: 0.875rem;
  border-left: 4px solid var(--by-primary);
  line-height: 1.2;
}

.by-view-all {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--by-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.875rem;
  border: 1px solid var(--by-primary);
  border-radius: 50px;
  transition: all var(--by-transition);
  white-space: nowrap;
}

.by-view-all:hover { background: var(--by-primary); color: #fff; }

/* ==========================================================================
   TRENDING NOW
   ========================================================================== */
.by-trending {
  background: var(--by-surface);
  border: 1px solid var(--by-border);
  border-radius: var(--by-radius-lg);
  overflow: hidden;
  margin-block: 2rem;
}

.by-trending-head {
  background: var(--by-primary);
  color: #fff;
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.by-trending-list { padding: 0; }

.by-trending-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--by-border);
  transition: background var(--by-transition);
}

.by-trending-item:last-child { border-bottom: none; }
.by-trending-item:hover { background: var(--by-surface-alt); }

.by-trending-num {
  font-family: var(--by-heading-font);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--by-primary);
  line-height: 1;
  min-width: 2rem;
  text-align: center;
}

.by-trending-content { flex: 1; min-width: 0; }

.by-trending-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--by-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  margin-bottom: 0.25rem;
  text-decoration: none;
  transition: color var(--by-transition);
}

.by-trending-title:hover { color: var(--by-primary); }

/* ==========================================================================
   SIDEBAR WIDGETS
   ========================================================================== */
.by-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

.by-sidebar.sticky-sidebar {
  position: sticky;
  top: calc(var(--by-header-height) + var(--by-nav-height) + 1rem);
}

.by-widget {
  background: var(--by-surface);
  border: 1px solid var(--by-border);
  border-radius: var(--by-radius-lg);
  overflow: hidden;
}

.by-widget-head {
  background: var(--by-surface-alt);
  padding: 0.875rem 1.25rem;
  font-family: var(--by-heading-font);
  font-weight: 700;
  font-size: 1rem;
  color: var(--by-text);
  border-bottom: 1px solid var(--by-border);
}

.by-widget-body { padding: 1rem; }

/* Latest News Widget */
.by-latest-news-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--by-border);
}

.by-latest-news-item:last-child { border-bottom: none; padding-bottom: 0; }

.by-latest-news-thumb {
  width: 70px;
  height: 55px;
  border-radius: var(--by-radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.by-latest-news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.by-latest-news-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--by-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.3rem;
  text-decoration: none;
  transition: color var(--by-transition);
}

.by-latest-news-title:hover { color: var(--by-primary); }

.by-latest-news-date {
  font-size: 0.72rem;
  color: var(--by-text-muted);
}

/* ==========================================================================
   ADVERTISEMENT ZONES
   ========================================================================== */
.by-ad-zone {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--by-radius);
  position: relative;
}

.by-ad-zone-label {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.6rem;
  color: var(--by-text-light);
  text-transform: uppercase;
  letter-spacing: .05em;
  pointer-events: none;
}

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

/* ==========================================================================
   ARTICLE / SINGLE POST
   ========================================================================== */
.by-article-hero {
  position: relative;
  width: 100%;
  max-height: 520px;
  overflow: hidden;
  border-radius: var(--by-radius-lg);
  margin-bottom: 2rem;
}

.by-article-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-height: 520px;
}

.by-article-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 60%);
}

.by-article-meta-block {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  color: #fff;
}

.by-article-title-hero {
  font-family: var(--by-heading-font);
  font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.2;
  color: #fff;
  margin-block: 0.75rem 1rem;
  text-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.by-article-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
}

.by-author-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.by-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.5);
}

/* No hero image: title above */
.by-article-header-noimg { margin-bottom: 1.5rem; }

.by-article-title-noimg {
  font-family: var(--by-heading-font);
  font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.25;
  color: var(--by-text);
  margin-block: 0.75rem;
}

/* Font size adjuster */
.by-font-adjuster {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--by-surface);
  border: 1px solid var(--by-border);
  border-radius: var(--by-radius);
}

.by-font-adjuster-label {
  font-size: 0.8rem;
  color: var(--by-text-muted);
  flex: 1;
}

.by-font-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--by-radius-sm);
  background: var(--by-surface-alt);
  color: var(--by-text);
  font-weight: 700;
  border: 1px solid var(--by-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--by-transition);
}

.by-font-btn:hover { background: var(--by-primary); color: #fff; border-color: var(--by-primary); }

/* Article body typography */
.by-article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--by-text);
}

.by-article-body p { margin-bottom: 1.5rem; }
.by-article-body h2 { font-size: 1.5rem; margin-block: 2rem 1rem; padding-top: 0.5rem; }
.by-article-body h3 { font-size: 1.25rem; margin-block: 1.75rem 0.875rem; }
.by-article-body h4 { font-size: 1.1rem; margin-block: 1.5rem 0.75rem; }

.by-article-body blockquote {
  border-left: 4px solid var(--by-primary);
  background: rgba(198,40,40,.05);
  padding: 1.25rem 1.5rem;
  margin-block: 1.75rem;
  border-radius: 0 var(--by-radius) var(--by-radius) 0;
  font-style: italic;
  font-size: 1.05rem;
}

.by-article-body blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-style: normal;
  color: var(--by-text-muted);
  font-weight: 600;
}

.by-article-body pre {
  background: #0D1117;
  color: #e6edf3;
  padding: 1.25rem;
  border-radius: var(--by-radius);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.7;
  margin-block: 1.5rem;
}

.by-article-body code {
  font-family: 'Courier New', Courier, monospace;
  background: var(--by-surface-alt);
  color: var(--by-primary);
  padding: 0.15em 0.4em;
  border-radius: var(--by-radius-sm);
  font-size: 0.875em;
}

.by-article-body pre code { background: none; color: inherit; padding: 0; }

.by-article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-block: 1.5rem;
  font-size: 0.9rem;
  border-radius: var(--by-radius);
  overflow: hidden;
}

.by-article-body table th {
  background: var(--by-primary);
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
}

.by-article-body table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--by-border);
}

.by-article-body table tr:nth-child(even) td { background: var(--by-surface-alt); }

.by-article-body ul, .by-article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.by-article-body ul { list-style: disc; }
.by-article-body ol { list-style: decimal; }
.by-article-body li { margin-bottom: 0.5rem; }

.by-article-body img {
  border-radius: var(--by-radius);
  margin-block: 1rem;
}

/* Responsive videos */
.by-article-body iframe,
.by-article-body embed,
.by-article-body video {
  max-width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  border-radius: var(--by-radius);
}

/* ==========================================================================
   TABLE OF CONTENTS
   ========================================================================== */
.by-toc {
  background: var(--by-surface);
  border: 1px solid var(--by-border);
  border-radius: var(--by-radius-lg);
  overflow: hidden;
}

.by-toc-head {
  background: var(--by-surface-alt);
  padding: 0.875rem 1.25rem;
  font-weight: 700;
  font-family: var(--by-heading-font);
  border-bottom: 1px solid var(--by-border);
  font-size: 0.95rem;
}

.by-toc-list {
  padding: 0.75rem 1.25rem;
  counter-reset: toc;
}

.by-toc-list li {
  counter-increment: toc;
  margin-bottom: 0.5rem;
}

.by-toc-list li a {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--by-text-muted);
  text-decoration: none;
  line-height: 1.4;
  padding: 0.3rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.5rem;
  transition: all var(--by-transition);
}

.by-toc-list li a::before {
  content: counter(toc);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--by-primary);
  min-width: 1.25rem;
  flex-shrink: 0;
}

.by-toc-list li a:hover,
.by-toc-list li a.active {
  color: var(--by-primary);
  border-left-color: var(--by-primary);
}

.by-toc-h3-item a { padding-left: 1.5rem; }

/* ==========================================================================
   SPECIFICATION TABLE
   ========================================================================== */
.by-spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border-radius: var(--by-radius);
  overflow: hidden;
  border: 1px solid var(--by-border);
  margin-block: 2rem;
}

.by-spec-table-head {
  background: var(--by-primary);
  color: #fff;
  padding: 1rem 1.25rem;
  font-family: var(--by-heading-font);
  font-weight: 700;
  font-size: 1.1rem;
}

.by-spec-table tr:nth-child(even) { background: var(--by-surface-alt); }

.by-spec-table td {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--by-border);
  vertical-align: top;
}

.by-spec-label {
  font-weight: 600;
  width: 40%;
  color: var(--by-text-muted);
}

.by-spec-value { color: var(--by-text); }

/* ==========================================================================
   RATING SYSTEM
   ========================================================================== */
.by-ratings-block {
  background: var(--by-surface);
  border: 1px solid var(--by-border);
  border-radius: var(--by-radius-lg);
  padding: 1.5rem;
  margin-block: 2rem;
}

.by-ratings-overall {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--by-border);
}

.by-ratings-score-big {
  font-family: var(--by-heading-font);
  font-weight: 800;
  font-size: 3.5rem;
  color: var(--by-primary);
  line-height: 1;
}

.by-stars {
  display: flex;
  gap: 0.2rem;
  color: #F59E0B;
  font-size: 1.25rem;
}

.by-rating-bar-item { margin-bottom: 0.875rem; }

.by-rating-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.by-rating-bar-track {
  height: 8px;
  background: var(--by-surface-alt);
  border-radius: 50px;
  overflow: hidden;
}

.by-rating-bar-fill {
  height: 100%;
  background: var(--by-primary);
  border-radius: 50px;
  transition: width 0.8s ease;
}

/* ==========================================================================
   SOCIAL SHARE
   ========================================================================== */
.by-share-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-block: 1.5rem;
}

.by-share-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  transition: opacity var(--by-transition), transform var(--by-transition);
}

.by-share-btn:hover { opacity: .85; transform: translateY(-1px); color: #fff; }
.by-share-fb { background: #1877F2; }
.by-share-wa { background: #25D366; }
.by-share-tw { background: #000; }
.by-share-copy { background: var(--by-surface-alt); color: var(--by-text); border: 1px solid var(--by-border); }
.by-share-copy:hover { color: var(--by-text); }

/* Floating share sidebar */
.by-share-float {
  position: fixed;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 500;
}

.by-share-float .by-share-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
  justify-content: center;
}

.by-share-float .by-share-btn span { display: none; }

@media (max-width: 1279px) { .by-share-float { display: none; } }

/* ==========================================================================
   TAG PILLS
   ========================================================================== */
.by-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block: 1.5rem;
}

.by-tag-pill {
  display: inline-block;
  padding: 0.35rem 0.875rem;
  background: var(--by-surface-alt);
  border: 1px solid var(--by-border);
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--by-text-muted);
  text-decoration: none;
  transition: all var(--by-transition);
}

.by-tag-pill:hover { background: var(--by-primary); color: #fff; border-color: var(--by-primary); }

/* ==========================================================================
   AUTHOR BOX
   ========================================================================== */
.by-author-box {
  display: flex;
  gap: 1.5rem;
  background: var(--by-surface);
  border: 1px solid var(--by-border);
  border-radius: var(--by-radius-lg);
  padding: 1.5rem;
  margin-block: 2rem;
  align-items: flex-start;
}

.by-author-box-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--by-primary);
  flex-shrink: 0;
}

.by-author-box-name {
  font-family: var(--by-heading-font);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.by-author-box-role {
  font-size: 0.78rem;
  color: var(--by-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 0.75rem;
}

.by-author-box-bio {
  font-size: 0.875rem;
  color: var(--by-text-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.by-author-socials { display: flex; gap: 0.5rem; }

@media (max-width: 479px) {
  .by-author-box { flex-direction: column; }
}

/* ==========================================================================
   POST NAVIGATION
   ========================================================================== */
.by-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-block: 2rem;
}

.by-post-nav-item {
  background: var(--by-surface);
  border: 1px solid var(--by-border);
  border-radius: var(--by-radius-lg);
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: var(--by-text);
  transition: all var(--by-transition);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.by-post-nav-item:hover {
  border-color: var(--by-primary);
  box-shadow: var(--by-shadow-md);
  color: var(--by-text);
}

.by-post-nav-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--by-primary);
}

.by-post-nav-title {
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.by-post-nav-next { text-align: right; }

@media (max-width: 479px) { .by-post-nav { grid-template-columns: 1fr; } }

/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */
.by-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--by-text-muted);
  padding: 0.875rem 0;
  margin-bottom: 1rem;
}

.by-breadcrumb a { color: var(--by-text-muted); text-decoration: none; transition: color var(--by-transition); }
.by-breadcrumb a:hover { color: var(--by-primary); }
.by-breadcrumb .sep { color: var(--by-text-light); }
.by-breadcrumb .current { color: var(--by-text); font-weight: 500; }

/* ==========================================================================
   CATEGORY PAGE HERO
   ========================================================================== */
.by-cat-hero {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #fff;
  padding: 3rem 0 2rem;
  margin-bottom: 2rem;
}

body.by-dark-mode .by-cat-hero { background: linear-gradient(135deg, #0d1117, #161b22); }

.by-cat-hero-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.9;
}

.by-cat-hero-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--by-primary-light);
  margin-bottom: 0.5rem;
}

.by-cat-hero-title {
  font-family: var(--by-heading-font);
  font-weight: 800;
  font-size: clamp(1.75rem, 5vw, 3rem);
  margin-bottom: 0.75rem;
  color: #fff;
}

.by-cat-hero-desc {
  font-size: 0.95rem;
  color: rgba(255,255,255,.75);
  max-width: 600px;
  margin-bottom: 1.5rem;
}

.by-cat-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.by-cat-stat-num {
  font-family: var(--by-heading-font);
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--by-primary-light);
  display: block;
}

.by-cat-stat-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,.6);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Sub-category pills */
.by-subcat-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--by-border);
}

.by-subcat-pill {
  padding: 0.4rem 1rem;
  background: var(--by-surface);
  border: 1px solid var(--by-border);
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--by-text-muted);
  text-decoration: none;
  transition: all var(--by-transition);
}

.by-subcat-pill:hover,
.by-subcat-pill.active {
  background: var(--by-primary);
  color: #fff;
  border-color: var(--by-primary);
}

/* ==========================================================================
   FILTER SYSTEM
   ========================================================================== */
.by-filter-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 639px) { .by-filter-layout { grid-template-columns: 1fr; } }

/* Archive toolbar */
.by-archive-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 0.875rem 1rem;
  background: var(--by-surface);
  border: 1px solid var(--by-border);
  border-radius: var(--by-radius);
}

.by-toolbar-search {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--by-surface-alt);
  border: 1px solid var(--by-border);
  border-radius: 50px;
  padding: 0.4rem 0.875rem;
}

.by-toolbar-search input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  color: var(--by-text);
  font-size: 0.875rem;
}

.by-sort-btns { display: flex; gap: 0.4rem; }

.by-sort-btn, .by-view-btn {
  padding: 0.4rem 0.875rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--by-border);
  background: var(--by-surface-alt);
  color: var(--by-text-muted);
  cursor: pointer;
  transition: all var(--by-transition);
}

.by-sort-btn.active, .by-sort-btn:hover,
.by-view-btn.active, .by-view-btn:hover {
  background: var(--by-primary);
  color: #fff;
  border-color: var(--by-primary);
}

/* Filter Sidebar */
.by-filter-sidebar {
  background: var(--by-surface);
  border: 1px solid var(--by-border);
  border-radius: var(--by-radius-lg);
  overflow: hidden;
}

body.by-dark-mode .by-filter-sidebar { background: var(--by-surface); }

.by-filter-sidebar-head {
  background: #1a1a2e;
  color: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.9rem;
}

body.by-dark-mode .by-filter-sidebar-head { background: var(--by-surface-alt); }

.by-filter-clear-all {
  font-size: 0.75rem;
  color: var(--by-primary-light);
  cursor: pointer;
  background: none;
  border: none;
  font-weight: 600;
  padding: 0;
}

.by-active-filters {
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  border-bottom: 1px solid var(--by-border);
  min-height: 0;
}

.by-active-filters:empty { display: none; }

.by-active-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(198,40,40,.1);
  color: var(--by-primary);
  border: 1px solid rgba(198,40,40,.3);
  border-radius: 50px;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.by-active-filter-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--by-primary);
  font-weight: 700;
  line-height: 1;
  font-size: 0.875rem;
  padding: 0;
  margin: 0;
}

/* Filter Groups */
.by-filter-group {
  border-bottom: 1px solid var(--by-border);
}

.by-filter-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--by-text);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background var(--by-transition);
}

.by-filter-group-head:hover { background: var(--by-surface-alt); }

.by-filter-group-chevron {
  transition: transform var(--by-transition);
  color: var(--by-text-muted);
}

.by-filter-group.open .by-filter-group-chevron { transform: rotate(180deg); }

.by-filter-group-body {
  display: none;
  padding: 0.5rem 1.25rem 1rem;
}

.by-filter-group.open .by-filter-group-body { display: block; }

.by-filter-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  cursor: pointer;
}

.by-filter-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  accent-color: var(--by-primary);
  cursor: pointer;
}

.by-filter-item-label {
  flex: 1;
  font-size: 0.85rem;
  color: var(--by-text);
  cursor: pointer;
}

.by-filter-count {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  background: var(--by-surface-alt);
  border-radius: 50px;
  color: var(--by-text-muted);
  min-width: 24px;
  text-align: center;
}

.by-filter-item input:checked ~ .by-filter-count {
  background: var(--by-primary);
  color: #fff;
}

/* Price Range */
.by-price-range { padding: 0.25rem 0; }

.by-price-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.by-price-input {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--by-border);
  border-radius: var(--by-radius-sm);
  background: var(--by-surface-alt);
  color: var(--by-text);
  font-size: 0.8rem;
  width: 100%;
  outline: none;
}

.by-price-input:focus { border-color: var(--by-primary); }

/* District/Province cascading */
.by-cascade-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--by-border);
  border-radius: var(--by-radius-sm);
  background: var(--by-surface-alt);
  color: var(--by-text);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  outline: none;
}

.by-cascade-select:focus { border-color: var(--by-primary); }

/* Mobile filter button */
.by-mobile-filter-btn {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: var(--by-primary);
  color: #fff;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  position: fixed;
  bottom: 80px;
  right: 1rem;
  z-index: 400;
  box-shadow: var(--by-shadow-lg);
}

.by-mobile-filter-count {
  background: #fff;
  color: var(--by-primary);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 639px) {
  .by-filter-sidebar { display: none; }
  .by-mobile-filter-btn { display: flex; }
  .by-filter-layout { grid-template-columns: 1fr; }
}

/* Filter overlay for mobile */
#by-filter-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: all var(--by-transition);
}

#by-filter-overlay.open { opacity: 1; visibility: visible; }

#by-filter-panel-mobile {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(300px, 90vw);
  background: var(--by-surface);
  z-index: 1051;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
}

#by-filter-panel-mobile.open { transform: translateX(0); }

/* Loading overlay on grid */
.by-grid-loading {
  position: relative;
  pointer-events: none;
}

.by-grid-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.6);
  border-radius: var(--by-radius);
  z-index: 10;
}

body.by-dark-mode .by-grid-loading::after {
  background: rgba(13,17,23,.6);
}

.by-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 11;
  width: 40px;
  height: 40px;
  border: 3px solid var(--by-border);
  border-top-color: var(--by-primary);
  border-radius: 50%;
  animation: by-spin 0.7s linear infinite;
}

@keyframes by-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* ==========================================================================
   PAGINATION
   ========================================================================== */
.by-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.by-page-btn {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--by-radius);
  border: 1px solid var(--by-border);
  background: var(--by-surface);
  color: var(--by-text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  padding-inline: 0.75rem;
  transition: all var(--by-transition);
}

.by-page-btn:hover,
.by-page-btn.current {
  background: var(--by-primary);
  color: #fff;
  border-color: var(--by-primary);
}

/* ==========================================================================
   COMPARISON SYSTEM
   ========================================================================== */
.by-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.by-compare-table th {
  background: var(--by-primary);
  color: #fff;
  padding: 1rem;
  text-align: left;
}

.by-compare-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--by-border);
  vertical-align: top;
}

.by-compare-table tr:nth-child(even) td { background: var(--by-surface-alt); }

.by-compare-table td:first-child { font-weight: 600; color: var(--by-text-muted); width: 30%; }

.by-compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--by-surface);
  border-top: 2px solid var(--by-primary);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 800;
  transform: translateY(100%);
  transition: transform 0.35s ease;
  box-shadow: 0 -4px 12px rgba(0,0,0,.15);
}

.by-compare-bar.visible { transform: translateY(0); }

.by-compare-bar-items { display: flex; gap: 0.75rem; flex: 1; }

.by-compare-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--by-surface-alt);
  border: 1px solid var(--by-border);
  border-radius: var(--by-radius);
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.by-compare-chip button {
  color: var(--by-text-muted);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.by-compare-now-btn {
  background: var(--by-primary);
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.875rem;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: background var(--by-transition);
}

.by-compare-now-btn:hover { background: var(--by-primary-dark); }

/* ==========================================================================
   COPY PROTECTION
   ========================================================================== */
.by-copy-protected { user-select: none; -webkit-user-select: none; }
.by-copy-protected img { pointer-events: none; }
.by-copy-notice {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(0,0,0,.85);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 500;
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: all var(--by-transition);
  white-space: nowrap;
}

.by-copy-notice.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   MOBILE BOTTOM NAV
   ========================================================================== */
#by-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--by-surface);
  border-top: 1px solid var(--by-border);
  z-index: 900;
  padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 767px) { #by-bottom-nav { display: block; } }

.by-bottom-nav-inner {
  display: flex;
  align-items: stretch;
}

.by-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.25rem;
  text-decoration: none;
  color: var(--by-text-muted);
  font-size: 0.62rem;
  font-weight: 600;
  gap: 0.2rem;
  transition: all var(--by-transition);
  min-height: 56px;
}

.by-bottom-nav-item svg { width: 22px; height: 22px; }
.by-bottom-nav-item.active { color: var(--by-primary); }
.by-bottom-nav-item:hover { color: var(--by-primary); }

/* Push content up on mobile to avoid overlap */
@media (max-width: 767px) {
  body { padding-bottom: 60px; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
#by-footer {
  background: #0D1117;
  color: rgba(255,255,255,.75);
  padding-top: 3.5rem;
  margin-top: 4rem;
}

body.by-dark-mode #by-footer { background: #010409; }

.by-footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

@media (max-width: 1023px) { .by-footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 479px) { .by-footer-grid { grid-template-columns: 1fr; } }

.by-footer-logo-text {
  font-family: var(--by-heading-font);
  font-weight: 800;
  font-size: 1.4rem;
  color: #fff;
}

.by-footer-tagline {
  font-size: 0.82rem;
  color: rgba(255,255,255,.5);
  margin-block: 0.5rem 1.25rem;
  font-style: italic;
}

.by-footer-socials { display: flex; gap: 0.5rem; }

.by-footer-social {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  transition: all var(--by-transition);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.1);
}

.by-footer-social:hover { background: var(--by-primary); color: #fff; border-color: var(--by-primary); }

.by-footer-col-title {
  font-family: var(--by-heading-font);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--by-primary);
  display: inline-block;
}

.by-footer-links { display: flex; flex-direction: column; gap: 0.6rem; }

.by-footer-links a {
  font-size: 0.875rem;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: color var(--by-transition);
}

.by-footer-links a:hover { color: #fff; }

/* Footer popular post */
.by-footer-post {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
  align-items: flex-start;
}

.by-footer-post-thumb {
  width: 60px;
  height: 48px;
  border-radius: var(--by-radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.by-footer-post-thumb img { width: 100%; height: 100%; object-fit: cover; }

.by-footer-post-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,.75);
  line-height: 1.4;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.by-footer-post-title:hover { color: #fff; }

.by-footer-post-date { font-size: 0.7rem; color: rgba(255,255,255,.4); margin-top: 0.2rem; }

/* Footer bottom bar */
.by-footer-bottom {
  padding: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.by-footer-copy {
  font-size: 0.8rem;
  color: rgba(255,255,255,.4);
}

.by-footer-bottom-links {
  display: flex;
  gap: 1rem;
}

.by-footer-bottom-links a {
  font-size: 0.8rem;
  color: rgba(255,255,255,.4);
  text-decoration: none;
  transition: color var(--by-transition);
}

.by-footer-bottom-links a:hover { color: rgba(255,255,255,.75); }

/* ==========================================================================
   UTILITIES
   ========================================================================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.by-mt-1 { margin-top: 0.5rem; }
.by-mt-2 { margin-top: 1rem; }
.by-mt-3 { margin-top: 1.5rem; }
.by-mt-4 { margin-top: 2rem; }
.by-mb-1 { margin-bottom: 0.5rem; }
.by-mb-2 { margin-bottom: 1rem; }
.by-mb-3 { margin-bottom: 1.5rem; }
.by-mb-4 { margin-bottom: 2rem; }

/* Related Posts */
.by-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-block: 2rem;
}

@media (max-width: 767px) { .by-related-grid { grid-template-columns: 1fr; } }
@media (max-width: 1023px) and (min-width: 768px) { .by-related-grid { grid-template-columns: repeat(2, 1fr); } }

/* Search Results */
.by-search-header {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--by-border);
  margin-bottom: 2rem;
}

.by-search-count {
  font-size: 0.875rem;
  color: var(--by-text-muted);
  margin-top: 0.25rem;
}

/* 404 Page */
.by-404 {
  text-align: center;
  padding: 5rem 1rem;
}

.by-404-code {
  font-family: var(--by-heading-font);
  font-weight: 800;
  font-size: 8rem;
  color: var(--by-primary);
  line-height: 1;
  opacity: 0.3;
}

/* ==========================================================================
   ADMIN METABOXES
   ========================================================================== */
.by-metabox { padding: 0 !important; }
.by-metabox .inside { padding: 0 !important; margin: 0 !important; }

.by-meta-inner {
  padding: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.by-meta-field {
  margin-bottom: 1rem;
}

.by-meta-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #3c434a;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.by-meta-input,
.by-meta-select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  font-size: 13px;
  color: #3c434a;
  background: #fff;
}

.by-meta-input:focus,
.by-meta-select:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
  outline: none;
}

/* Dark mode admin styles */
body.by-dark-mode .by-meta-input,
body.by-dark-mode .by-meta-select {
  background: var(--by-surface);
  color: var(--by-text);
  border-color: var(--by-border);
}

/* Spec table builder */
.by-spec-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  align-items: center;
}

.by-spec-row input { flex: 1; }

.by-spec-row-del {
  background: #d63638;
  color: #fff;
  border: none;
  border-radius: 3px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

.by-spec-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.by-spec-tpl-btn {
  padding: 4px 10px;
  background: #f0f0f1;
  border: 1px solid #c3c4c7;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  color: #3c434a;
  transition: all .2s;
}

.by-spec-tpl-btn:hover { background: #2271b1; color: #fff; border-color: #2271b1; }

.by-add-spec-row {
  background: #2271b1;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  margin-top: 6px;
}

/* Star preview in ratings metabox */
.by-star-preview {
  color: #F59E0B;
  font-size: 1rem;
  margin-top: 4px;
  letter-spacing: 2px;
}

/* ==========================================================================
   ADMIN THEME PANEL
   ========================================================================== */
.by-admin-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 1200px;
  margin: 20px 20px 20px 0;
}

.by-admin-header {
  background: linear-gradient(135deg, #C62828, #9B1B1B);
  color: #fff;
  padding: 1.5rem 2rem;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.by-admin-logo { font-weight: 800; font-size: 1.5rem; font-family: Georgia, serif; }
.by-admin-tagline { font-size: 0.82rem; opacity: .8; }

.by-admin-tabs {
  display: flex;
  background: #fff;
  border-bottom: 2px solid #C62828;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.by-admin-tab {
  padding: 0.875rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #3c434a;
  cursor: pointer;
  border: none;
  background: none;
  transition: all .2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.by-admin-tab.active, .by-admin-tab:hover {
  color: #C62828;
  border-bottom-color: #C62828;
}

.by-admin-panel { display: none; padding: 1.5rem 0; }
.by-admin-panel.active { display: block; }

.by-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.by-stat-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.by-stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: #C62828;
  font-family: Georgia, serif;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.by-stat-label { font-size: 0.78rem; color: #6B7280; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

.by-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.by-toggle-info .label { font-weight: 600; font-size: 0.9rem; color: #3c434a; }
.by-toggle-info .desc { font-size: 0.78rem; color: #6B7280; margin-top: 2px; }

/* Toggle Switch */
.by-toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.by-toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.by-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 50px;
  transition: .3s;
}

.by-toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .3s;
}

.by-toggle-switch input:checked + .by-toggle-slider { background: #C62828; }
.by-toggle-switch input:checked + .by-toggle-slider::before { transform: translateX(20px); }

/* Ads Manager table */
.by-ads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.by-ads-table th {
  background: #f8f9fa;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: #3c434a;
  border-bottom: 1px solid #e0e0e0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.by-ads-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  color: #3c434a;
  vertical-align: middle;
}

.by-ads-table tr:last-child td { border-bottom: none; }

.by-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
}

.by-status-active { background: #dcfce7; color: #166534; }
.by-status-inactive { background: #fee2e2; color: #991b1b; }

/* ==========================================================================
   SEARCH RESULTS PAGE
   ========================================================================== */
.by-search-results-grid {
  display: grid;
  gap: 1rem;
}

/* ==========================================================================
   MEDIA QUERIES - ARTICLE PAGE
   ========================================================================== */
@media (max-width: 767px) {
  .by-article-meta-block { padding: 1rem; }
  .by-article-title-hero { font-size: 1.25rem; }
  .by-article-body h2 { font-size: 1.25rem; }
  .by-article-body h3 { font-size: 1.1rem; }
  .by-toc { display: none; }
}

/* ==========================================================================
   PRINT
   ========================================================================== */
@media print {
  #by-header, #by-navbar, #by-offcanvas-overlay, #by-offcanvas-panel,
  #by-bottom-nav, .by-share-float, .by-compare-bar,
  .by-font-adjuster, .by-ad-zone, #by-progress-bar { display: none !important; }

  body { background: #fff; color: #000; }
  .by-article-body { font-size: 12pt; }
  a { color: #000; text-decoration: underline; }
}
