/*
Theme Name: Varnilo Pro
Theme URI: https://www.varnilo.com/
Author: Mezbaur Rahman
Description: Ultra-Smooth 120FPS Affiliate Magazine Theme with Locked Sticky Desktop Sidebar & Edge-to-Edge Full-Screen Mobile Post Layout.
Version: 6.0
License: GPL v2 or later
Text Domain: varnilo-pro
*/

:root {
  --primary-dark: #0f172a;
  --secondary-dark: #1e293b;
  --accent-orange: #ff9900;
  --accent-blue: #2563eb;
  --bg-page: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* CRITICAL FIX: overflow-x: clip prevents horizontal scroll WITHOUT breaking position: sticky! */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.74;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}

img, iframe, video {
  max-width: 100% !important;
  height: auto !important;
  display: block;
}

.container {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================
   TOP BAR & STICKY HEADER
========================================== */
.top-trust-bar {
  background: #020617;
  color: #cbd5e1;
  font-size: 12px;
  text-align: center;
  padding: 6px 12px;
  border-bottom: 1px solid #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header {
  background: var(--primary-dark);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 9999;
  border-bottom: 3px solid var(--accent-orange);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 62px;
  gap: 15px;
  position: relative;
}

.brand-logo {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.brand-logo span {
  background: var(--accent-orange);
  color: #111111;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 900;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav a {
  color: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 6px;
}

.main-nav a:hover {
  background: #1e293b;
  color: var(--accent-orange);
}

.header-search-form {
  display: flex;
  align-items: center;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  overflow: hidden;
}

.header-search-input {
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 7px 11px;
  font-size: 13.5px;
  width: 175px;
  outline: none;
}

.header-search-input::placeholder {
  color: #94a3b8;
}

.header-search-btn {
  background: var(--accent-orange);
  color: #111111;
  border: none;
  padding: 7px 12px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.menu-toggle {
  display: none;
  background: #1e293b;
  border: 1px solid #334155;
  color: #ffffff;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================
   HERO BANNER WITH SEARCH BAR
========================================== */
.hero-banner {
  background: var(--primary-dark);
  color: #ffffff;
  padding: 36px 0;
  border-bottom: 1px solid #1e293b;
  margin-bottom: 35px;
  text-align: center;
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  background: #1e293b;
  color: #fbbf24;
  border: 1px solid #334155;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 10px;
}

.hero-title {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 10px;
  color: #ffffff;
}

.hero-subtitle {
  color: #cbd5e1;
  font-size: 15.5px;
  margin-bottom: 22px;
}

.hero-search-box {
  display: flex;
  max-width: 580px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--accent-orange);
}

.hero-search-box input {
  flex: 1;
  border: none;
  padding: 12px 16px;
  font-size: 15px;
  color: #0f172a;
  outline: none;
  min-width: 0;
}

.hero-search-box button {
  background: var(--accent-orange);
  color: #111111;
  border: none;
  padding: 0 22px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
}

/* ==========================================
   POST GRID WITH HD FEATURED IMAGES
========================================== */
.section-heading {
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-main);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
  margin-bottom: 50px;
}

.post-card {
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  border-color: #94a3b8;
}

.card-thumb-link {
  position: relative;
  display: block;
  width: 100%;
  height: 210px;
  background: #0f172a;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.card-thumb-link img {
  width: 100% !important;
  height: 210px !important;
  object-fit: cover;
}

.card-cat-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  border-left: 3px solid var(--accent-orange);
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-date {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.card-title {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.36;
  margin-bottom: 10px;
}

.card-title a {
  color: var(--text-main);
}

.card-title a:hover {
  color: var(--accent-blue);
}

.card-excerpt {
  font-size: 14.5px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 18px;
  flex-grow: 1;
}

.card-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.verified-mini {
  font-size: 12px;
  color: #0f766e;
  font-weight: 700;
}

.card-read-btn {
  background: var(--primary-dark);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 15px;
  border-radius: 5px;
}

.post-card:hover .card-read-btn {
  background: var(--accent-orange);
  color: #111111;
}

/* ==========================================
   SINGLE ARTICLE & DESKTOP STICKY SIDEBAR
========================================== */
.single-layout {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  margin: 28px 0 60px 0;
  width: 100%;
  position: relative;
}

.article-box {
  flex: 1;
  min-width: 0;
  background: #ffffff;
  padding: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

/* LOCKED STICKY SIDEBAR FOR PC */
.sidebar {
  width: 330px;
  flex-shrink: 0;
  position: -webkit-sticky;
  position: sticky;
  top: 82px;
  align-self: flex-start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar-card {
  background: #ffffff;
  padding: 22px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.article-title {
  font-size: 31px;
  font-weight: 900;
  line-height: 1.26;
  color: var(--text-main);
  margin-bottom: 16px;
  word-wrap: break-word;
}

.author-trust-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 22px;
  font-size: 13px;
}

.verified-badge {
  color: #0f766e;
  font-weight: 700;
}

.single-featured-image {
  margin: 0 0 26px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.single-featured-image img {
  width: 100% !important;
  max-height: 460px;
  object-fit: cover;
}

.entry-content {
  width: 100%;
  max-width: 100%;
}

.entry-content h2 {
  font-size: 23px;
  font-weight: 800;
  color: var(--text-main);
  margin: 32px 0 14px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #f1f5f9;
  line-height: 1.35;
}

.entry-content h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--secondary-dark);
  margin: 24px 0 10px 0;
  line-height: 1.35;
}

.entry-content p {
  margin-bottom: 18px;
  color: var(--text-body);
  word-wrap: break-word;
}

.entry-content ul, .entry-content ol {
  margin: 0 0 20px 22px;
}

.entry-content li {
  margin-bottom: 8px;
}

.entry-content div {
  max-width: 100% !important;
}

.entry-content table {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  border-collapse: collapse !important;
  margin: 24px 0 !important;
  font-size: 14.5px !important;
  word-break: normal !important;
}

.entry-content th, .entry-content td {
  min-width: 130px !important;
  padding: 11px 12px !important;
  border: 1px solid #cbd5e1 !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  vertical-align: middle !important;
}

/* ==========================================
   SIDEBAR WIDGETS & FOOTER
========================================== */
.widget-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-orange);
}

.sidebar-search-form {
  display: flex;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}

.sidebar-search-form input {
  flex: 1;
  border: none;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  min-width: 0;
}

.sidebar-search-form button {
  background: var(--primary-dark);
  color: #ffffff;
  border: none;
  padding: 0 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.sidebar-list {
  list-style: none;
}

.sidebar-list li {
  padding: 9px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

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

.sidebar-list a {
  color: var(--secondary-dark);
}

.sidebar-list a:hover {
  color: var(--accent-blue);
}

.site-footer {
  background: var(--primary-dark);
  color: #cbd5e1;
  padding: 45px 0 28px 0;
  margin-top: 50px;
  border-top: 4px solid var(--accent-orange);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 35px;
  margin-bottom: 30px;
}

.footer-heading {
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: #94a3b8;
  font-size: 14px;
}

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

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 20px;
  font-size: 12.5px;
  color: #64748b;
  text-align: center;
}

/* ==========================================
   MOBILE EDGE-TO-EDGE FULL SCREEN READING VIEW
========================================== */
@media (max-width: 960px) {
  .top-trust-bar {
    font-size: 11px;
    padding: 5px 10px;
  }
  .header-inner {
    min-height: 56px;
  }
  .brand-logo {
    font-size: 20px;
  }
  .menu-toggle {
    display: inline-block;
  }
  .header-right {
    display: none;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 56px;
    left: -20px;
    right: -20px;
    background: #0f172a;
    padding: 16px 20px 22px 20px;
    border-bottom: 3px solid var(--accent-orange);
    gap: 12px;
  }
  .header-right.active {
    display: flex;
  }
  .main-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .main-nav a {
    padding: 10px 12px;
    border-bottom: 1px solid #1e293b;
    font-size: 15px;
  }
  .header-search-form {
    width: 100%;
  }
  .header-search-input {
    flex: 1;
    width: auto;
    padding: 10px 12px;
  }
  .hero-banner {
    padding: 26px 0;
  }
  .hero-title {
    font-size: 23px;
  }
  .post-grid {
    grid-template-columns: 1fr;
  }

  /* ZERO OUTER MARGIN ON MOBILE SINGLE POSTS (GIANT PUBLISHER LOOK) */
  body.single, body.page {
    background-color: #ffffff;
  }
  .single-container {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .single-layout {
    flex-direction: column;
    gap: 0;
    margin: 0;
  }
  .article-box {
    width: 100%;
    padding: 18px 14px 28px 14px;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  .article-title {
    font-size: 24px;
    line-height: 1.3;
  }
  .author-trust-bar {
    padding: 10px 12px;
    font-size: 12.5px;
  }
  .sidebar {
    width: 100%;
    position: static;
    max-height: none;
    padding: 20px 14px;
    background: #f8fafc;
    border-top: 2px solid var(--border-color);
  }
  .sidebar-card {
    border: none;
    padding: 0;
    background: transparent;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}