/*
Theme Name: TooljaTheme3
Theme URI: https://toolja.in
Author: Ashok Gaikwad
Author URI: https://toolja.in
Description: A simple theme with top bar, header, sidebar, AdSense, Verdana font, and justified text.
Version: 3.0 (Modernized with CSS Variables & Mobile Fixes)
*/

/* =========================================
   ✅ MODERN GLOBALS & VARIABLES
   Centralized colors to easily change theme branding in the future
========================================= */
:root {
  /* Brand Colors */
  --brand-blue: #1e3a8a;
  --brand-blue-gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  --brand-yellow: #ffeb3b;
  
  /* SaaS Navy Theme (Replaces old #333, #444 grey) */
  --header-bg: #0f172a;       /* Premium Dark Slate/Navy for Header/Footer */
  --menu-hover: #1e293b;      /* Slightly lighter for hover states */
  --menu-nested: #334155;     /* Lighter again for dropdowns */
  
  /* Layout Colors */
  --bg-light: #f1f5f9;
  --text-dark: #475569;
}

/* Universal Box Sizing to prevent layout stretching */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Premium smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
}

/* =========================================
   HEADINGS - DESKTOP
========================================= */
.content h1, .content h2, .content h3 {
  color: var(--brand-blue);
  margin-top: 35px;
  margin-bottom: 15px;
  line-height: 1.3;
  font-weight: 800; /* Bold, punchy headings */
}
.content h1 { font-size: 32px; }
.content h2 { font-size: 28px; }
.content h3 { font-size: 24px; }

/* =========================================
   PAGE TITLES (UPDATED FOR VERY SMALL SIZE)
========================================= */
.content h1.page-title, .content h1.single-title, .page-title, .single-title {
  text-align: center;
  background: var(--brand-blue-gradient);
  color: white !important;
  padding: 5px 10px; /* Made the blue background line very thin */
  border-radius: 4px;
  margin: 0px 0 15px 0 !important; /* Forces the gap to disappear */
  font-size: 13px !important; /* Made font very small */
  font-weight: bold !important;
  line-height: 1.2 !important; 
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.2); 
}

@media (max-width: 768px) {
  .page-title, .single-title {
    font-size: 12px !important;
    padding: 4px 8px;
    margin: 8px 0 12px 0;
  }
}

/* =========================================
   SITE TITLE
========================================= */
.site-title span {
  font-size: 20px;
  color: var(--brand-yellow);
}
@media (max-width: 768px) {
  .site-title span {
    font-size: 16px;
  }
}

/* =========================================
   GLOBAL STYLES
========================================= */
body {
  font-family: 'Roboto', sans-serif, Verdana;
  text-align: justify;
  background-color: var(--bg-light);
  color: var(--text-dark);
  margin: 0;
  padding: 0;
}
a {
  color: #2563eb; /* Modern link blue */
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* =========================================
   MAIN CONTENT
========================================= */
.content-wrapper {
  display: flex;
  max-width: 1100px;
  margin: 10px auto !important; 
  background: white;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08); /* Premium landing-page shadow */
  border-radius: 8px;
  flex-wrap: wrap;
  padding-top: 8px; /* <--- ADD THIS LINE */
  padding-left: 30px;
  padding-right: 30px;
  gap: 30px; 
  align-items: flex-start; 
}

.content {
  flex: 3;
  padding: 0px;
}
.content p, .content li {
  line-height: 1.8; 
  margin-bottom: 15px;
  font-size: 1.05rem;
}
.content img {
  max-width: 100%;
  height: auto;
}

/* =========================================
   SIDEBAR
========================================= */
.sidebar {
  flex: 1;
  padding: 15px;
  background: #f2f2f2;
  border-left: 1px solid #ddd;
  text-align: left;
}
.sidebar ul {
  list-style-type: disc;
  padding-left: 20px;
  margin: 0;
}
.sidebar li {
  margin-bottom: 8px;
}
.sidebar a {
  color: #333;
  font-size: 15px;
}
.sidebar a:hover {
  text-decoration: underline;
}
.sidebar .widget {
  margin-bottom: 20px;
}
.sidebar .widget-title {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 10px;
  color: #000;
}
.sidebar h2, .sidebar h3, .sidebar h4 {
  background: #003366;
  color: #fff !important;
  font-weight: bold;
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

/* =========================================
   FOOTER
========================================= */
footer {
  background: var(--header-bg);
  color: white;
  text-align: center;
  padding: 15px;
  margin-top: 20px;
  font-size: 14px;
}
.footer-widgets {
  background: var(--menu-hover);
  color: #fff;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.footer-widgets > * {
  width: 100%;
  max-width: 1000px;
  padding: 0 20px;
}
.footer-widget h4 {
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 16px;
  color: #fff;
}
.footer-widget ul {
  list-style: none;
  padding: 0;
}
.footer-widget ul li {
  margin-bottom: 5px;
}
.footer-widget ul li a {
  color: #ccc;
}
.footer-widget ul li a:hover {
  text-decoration: underline;
}
.footer-widgets ul.menu,
.footer-widgets .widget_nav_menu ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}
.footer-bottom {
  background: var(--header-bg);
  text-align: center;
  padding: 10px;
  color: #ccc;
  font-size: 14px;
}
footer a {
  color: #ffffff !important;
  text-decoration: none;
}
footer a:hover {
  color: var(--brand-yellow) !important; 
  text-decoration: underline; 
}

/* =========================================
   HEADER
========================================= */
.header.desktop-header {
  background: var(--header-bg);
  color: white;
  padding: 10px 0;
}
.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}
.site-title {
  display: flex;
  align-items: center;
  font-weight: bold;
  font-size: 24px;
  gap: 10px;
}
.site-logo {
  height: 28px;
}

/* =========================================
   MENU (DESKTOP + MOBILE SAME LOGIC)
========================================= */
.menu-container ul {
  list-style: none;
  display: flex;
  gap: 15px;
}
.menu-container ul li a {
  color: white;
  font-size: 14px;
  padding: 8px 12px;
  display: block; /* Forces the browser to render the full button height */
}
.menu-container ul li.menu-item-has-children > a::after {
  content: "\25BC";
  font-size: 12px;
  margin-left: 5px;
}
.menu-container ul li ul {
  display: none;
  position: absolute;
  background: var(--menu-hover);
  min-width: 160px;
  z-index: 999;
}
.menu-container ul li:hover > ul,
.menu-container ul li ul li:hover > ul {
  display: block;
}
.menu-container ul li ul li ul {
  top: 0;
  left: 100%;
  position: absolute;
}

/* =========================================
   PAGINATION, SEARCH, ADSENSE
========================================= */
.pagination {
  text-align: center;
  margin-top: 20px;
}
.pagination .page-numbers {
  display: inline-block;
  margin: 0 5px;
  padding: 6px 10px;
  background: #eee;
}
.pagination .current {
  background: var(--header-bg);
  color: #fff;
}
.adsense-box {
  text-align: center;
  margin: 10px auto;
}
.search-icon {
  font-size: 24px;
  color: white;
  cursor: pointer;
  margin-left: 10px;
}
.header-search-form {
  display: none;
  position: absolute;
  top: 60px;
  right: calc((100% - 1000px)/2 + 20px);
  width: 280px;
  background: var(--header-bg);
  padding: 10px 20px;
  border-radius: 4px;
  z-index: 1000;
}
.header-search-form.active {
  display: block;
}
.header-search-form input[type="search"] {
  width: 100%;
  padding: 10px;
  border-radius: 4px;
}

/* =========================================
   RESPONSIVE: SINGLE MOBILE MENU BLOCK
   (All Mobile fixes are cleanly inside here)
========================================= */
@media (max-width: 768px) {
  .content-wrapper { flex-direction: column; }
  .sidebar { display: none; }

  .menu-container {
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--header-bg);
    position: static;
    z-index: 9999;
  }
  .menu-container.active { display: flex; }

  .menu-container ul {
    flex-direction: column;
    width: 100%;
  }
  .menu-container ul li {
    width: 100%;
    border-top: 1px solid var(--menu-nested);
    position: relative;
  }
  .menu-container ul li a {
    padding: 12px 20px;
    background: var(--menu-hover);
    color: #fff;
    display: block;
  }
  .menu-container ul li a:hover { background: var(--menu-nested); }

  .menu-container ul li ul {
    display: none;
    position: static;
    background: var(--menu-hover);
  }
  .menu-container ul li:hover > ul {
    display: block;
  }
  .menu-container ul li ul li a {
    padding-left: 30px;
    background: var(--menu-hover);
  }
  .menu-container ul li ul li ul {
    display: none;
    position: static;
    background: var(--menu-nested);
  }
  .menu-container ul li ul li:hover > ul {
    display: block;
  }
  .menu-container ul li ul li ul li a {
    padding-left: 45px;
    background: var(--menu-nested);
  }

  /* ✅ MOBILE HEADER FIX: Wrap text & center layout safely */
  .header-flex {
    flex-wrap: wrap !important;
    row-gap: 12px !important;
    justify-content: center !important;
    padding: 10px 10px 15px 10px !important;
  }

  .site-title, 
  .site-title a, 
  .site-title span {
    width: 100% !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    text-align: center !important;
    line-height: 1.4 !important;
    display: block !important;
  }

  .header-flex > div, 
  .header-flex > a {
    text-align: center !important;
  }
  
  .mobile-menu-toggle {
    display: block;
    font-size: 24px;
    padding: 8px 10px;
  }
  .header-search-form {
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
  }
  
  /* ✅ RESPONSIVE MAIN CONTENT (Padding & Sizing adjustments) */
  .content-wrapper {
    width: 95%;            
    max-width: 95%;
    margin: 0 auto;        
    padding-left: 10px;    
    padding-right: 10px;   
  }

  .content, .content * {
    max-width: 100%;         
    overflow-wrap: break-word; 
    word-wrap: break-word;     
  }
  
  .content * {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .content img.aligncenter {
    margin-left: auto !important;
    margin-right: auto !important;
    display: block;
  }
  
  /* Table full width */
  table {
    width: 100% !important; 
  }
  
  /* Header font sizes */
  h1 { font-size: 20px !important; margin-top: 24px !important; }
  h2 { font-size: 18px !important; margin-top: 20px !important; }
  h3 { font-size: 16px !important; margin-top: 16px !important; }
  
  /* ✅ SUBSCRIPTION PRICING TABLE FIX */
  .pricing-table th,
  .pricing-table td {
    padding: 10px 8px !important;
  }
  .pricing-table tbody tr:first-child td {
    font-size: 1.2rem !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
  }
  .pricing-table {
    display: block !important;
    overflow-x: auto !important;
    width: auto !important; 
    -webkit-overflow-scrolling: touch; 
  }
} /* End of All Mobile Media Queries */


/* =========================================
   PREVENT OVERFLOW, CLEAN TABLES & MEDIA
========================================= */
html, body { max-width: 100%; overflow-x: hidden; }
img, iframe, video { max-width: 100%; height: auto; }
table { display: block; overflow-x: auto; }
pre, code { white-space: pre-wrap; overflow-x: auto; }

/* =========================================
   GLOBAL HEADINGS RESET (Desktop)
========================================= */
h1, h2, h3, h4, h5, h6 { font-weight: bold !important; line-height: 1.3 !important; }
@media (min-width: 769px) {
  h1 { font-size: 26px !important; margin-top: 30px !important; }
  h2 { font-size: 24px !important; margin-top: 26px !important; }
  h3 { font-size: 20px !important; margin-top: 22px !important; }
}

/* Center images with aligncenter class */
.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* =========================================
   PAGE BUTTON STYLE
========================================= */
.buy-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.buy-buttons .my-button {
  display: inline-block;
  background: #007acc; /* bright blue */
  color: #fff;
  padding: 10px 18px;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid #005fa3;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.buy-buttons .my-button:hover {
  background: #005fa3;
  border-color: #004b80;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* =========================================
   FORCE BREAK LONG WORDS IN CONTENT
========================================= */
.content, .content-wrapper, p, li, td, th {
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Force right-side spacing for archive, category, and search on desktop */
@media screen and (min-width: 768px) {
  body.archive .site-content,
  body.search .site-content,
  body.category .site-content,
  body.blog .site-content,
  body.archive .content,
  body.search .content,
  body.category .content,
  body.blog .content {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* =========================================
   REUSABLE HIGHLIGHT BOX (For important text)
========================================= */
.highlight-box {
  padding: 25px;
  background-color: #f8fafc;
  border-left: 5px solid var(--brand-blue);
  border-radius: 6px;
  margin: 30px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.highlight-box p:last-child {
  margin-bottom: 0; /* Prevents extra space at the bottom of the box */
}


/* ✅ GLOBAL GAP FIX: Shrink space between header and main content */
.header.desktop-header, .site-header {
    margin-bottom: 0 !important;
    padding-bottom: 12px !important; /* Increased from 0 to stop cropping */
}

.content-wrapper, 
.site-content, 
.page-content, 
.post-content, 
.home-page-content,
#content, 
#primary {
    margin-top: 10px !important;
}


/* =========================================
   SMART ADSENSE BANNER (Revenue-Safe Auto-Collapse)
========================================= */
.smart-top-banner { 
  display: block; 
  width: 100%; 
  margin: 0 auto; 
  min-height: 100px; /* CRITICAL: Tells Google the space exists to trigger the ad auction */
}

@media (min-width: 768px) { 
  .smart-top-banner { 
    max-width: 970px; 
    min-height: 90px; 
  } 
}

/* Google's Official rule to hide their frame if no ad is returned */
ins.adsbygoogle[data-ad-status="unfilled"] {
  display: none !important;
}

/* Modern CSS: Collapses your outer wrapper ONLY IF Google says it is unfilled */
.smart-top-banner:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
  min-height: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}