/*
Theme Name: TooljaTheme
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: 1.0
*/

/* =========================================
   ðŸ”¹ GLOBAL STYLES
========================================= */
body {
  font-family: 'Roboto', sans-serif, Verdana;
  text-align: justify;
  background-color: #f7f7f7;
  margin: 0;
  padding: 0;
}


a {
  color: #0073aa;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* =========================================
   ðŸ”¹ MAIN CONTENT AREA
========================================= */
.content-wrapper {
  display: flex;
  max-width: 1000px;
  margin: 20px auto;
  background: white;
  box-shadow: 0 0 5px #ccc;
  flex-wrap: wrap;
}

.content {
  flex: 3;
  padding: 20px;
}

/* =========================================
   ðŸ”¹ SIDEBAR STYLES
========================================= */
.sidebar {
  flex: 1;
  padding: 20px;
  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;
  text-align: left;
}

.sidebar a {
  color: #333;
  text-decoration: none;
  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;
}


/* ✅ Also style manual heading blocks inside sidebar */
.sidebar h2, .sidebar h3, .sidebar h4 {
  background: #333333; /* dark grey background */
  color: #ffffff;      /* white text for contrast */
  font-weight: bold;
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}



/* =========================================
   ðŸ”¹ FOOTER STYLES
========================================= */
footer {
  background: #333;
  color: white;
  text-align: center;
  padding: 15px;
  margin-top: 20px;
  font-size: 14px;
}

.footer-widgets {
  width: 100%;
  background: #444;
  color: #fff;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-widgets > * {
  width: 100%;
  max-width: 1000px;
  padding: 0 20px;
  margin: 0 auto;
  text-align: center;
}

.footer-widget {
  min-width: 180px;
}

.footer-widget h4,
.footer-widget-title {
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 16px;
  color: #fff;
}

.footer-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.footer-widget ul li {
  margin-bottom: 5px;
}

.footer-widget ul li a {
  color: #ccc;
  text-decoration: none;
}

.footer-widget ul li a:hover {
  text-decoration: underline;
}

/* Footer nav menu */
.footer-widgets ul.menu,
.footer-widgets .widget_nav_menu ul {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.footer-widgets ul.menu li,
.footer-widgets .widget_nav_menu ul li {
  display: inline-block;
}

.footer-widgets ul.menu li a,
.footer-widgets .widget_nav_menu ul li a {
  color: #fff;
  text-decoration: none;
  padding: 5px 10px;
}

.footer-widgets ul.menu li a:hover,
.footer-widgets .widget_nav_menu ul li a:hover {
  text-decoration: underline;
}

.footer-bottom {
  background: #333;
  text-align: center;
  padding: 10px;
  color: #ccc;
  font-size: 14px;
}


/* =========================================
   🔹 ADSENSE BANNER
========================================= */
.adsense-box {
  width: 100%;
  max-width: 100%;
  margin: 10px auto;
  box-sizing: border-box;
  text-align: center;
}



/* =========================================
   ðŸ”¹ PAGINATION STYLES
========================================= */
.pagination {
  text-align: center;
  margin-top: 20px;
}

.pagination .page-numbers {
  display: inline-block;
  margin: 0 5px;
  padding: 6px 10px;
  background: #eee;
  color: #333;
  text-decoration: none;
}

.pagination .page-numbers.current {
  background: #333;
  color: #fff;
  font-weight: bold;
}

/* =========================================
   ðŸ”¹ IMAGE RESPONSIVENESS
========================================= */
.content img,
.sidebar img {
  max-width: 100%;
  height: auto;
}

/* =========================================
   ðŸ”¹ GENERAL MOBILE RESPONSIVENESS
========================================= */
@media (max-width: 768px) {
  .content-wrapper {
    flex-direction: column;
  }

  .sidebar {
    border-left: none;
    border-top: 1px solid #ddd;
  }

  .footer-widgets .widget_nav_menu ul,
  .footer-widgets ul.menu {
    flex-direction: column;
    gap: 10px;
  }
}

/* =========================================
   ðŸ”¹ HEADER DESKTOP STYLES
========================================= */
.header.desktop-header {
  background: #333;
  color: white;
  padding: 10px 0;
}

.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  padding: 0 20px;
}

.site-title {
  font-weight: bold;
  font-size: 24px;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo {
  height: 28px;
}

.menu-container ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 15px;
}

.menu-container ul li {
  display: inline-block;
  position: relative;
}

.menu-container ul li a {
  color: white;
  font-size: 14px;
  padding: 8px 12px;
  display: block;
}

.menu-container ul li.menu-item-has-children > a::after {
  content: " \25BC";  /* ▼ Unicode arrow down */
  font-size: 10px;
  margin-left: 4px;
}

.menu-container ul li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #555;
  padding: 0;
  z-index: 999;
  min-width: 160px;
  border: 1px solid #333;
  text-align: left;
}

.menu-container ul li:hover > ul {
  display: block;
}

.menu-container ul li ul li {
  display: block;
  border-bottom: 1px solid #666;
}

.menu-container ul li ul li a {
  padding: 10px;
  color: white;
  text-align: left;
  background: #555;
}

.menu-container ul li ul li a:hover {
  background: #666;
}

/* =========================================
   ðŸ”¹ HEADER MOBILE STYLES
========================================= */
.mobile-menu-toggle {
  display: none;
  font-size: 26px;
  cursor: pointer;
  padding: 10px 12px;
  color: white;
  background: #333;
  border-radius: 4px;
  margin-left: auto;
}

@media (max-width: 768px) {
  .header-flex {
    flex-direction: column;
    align-items: flex-start;
  }

  .menu-container {
    display: none;
    width: 100%;
  }

  .menu-container.active {
    display: block;
  }

  .menu-container ul {
    flex-direction: column;
    width: 100%;
  }

  .menu-container ul li {
    width: 100%;
    border-top: 1px solid #444;
  }

  .menu-container ul li a {
    background: #444;
    padding: 10px 15px;
    width: 100%;
  }

  .menu-container ul li a:hover {
    background: #555;
  }

  .site-title {
    width: 100%;
    justify-content: center;
    margin-bottom: 10px;
  }

  .mobile-menu-toggle {
    display: block;
  }
}



/* =========================================
   ðŸ”¹ FINAL MOBILE HEADER FIX
========================================= */
@media (max-width: 768px) {
  .header.desktop-header {
    position: relative;
  }

  .header-flex {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .site-title {
    display: flex;
    align-items: center;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    min-width: 0;
  }

  .site-logo {
    height: 22px;
    flex-shrink: 0;
    margin-right: 6px;
  }

  .mobile-menu-toggle {
    font-size: 24px;
    flex-shrink: 0;
    color: white;
    background-color: #333;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 8px;
  }

  .search-icon {
    font-size: 22px;
    margin-left: 8px;
    flex-shrink: 0;
  }

  .menu-container {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #333;
    z-index: 1000;
  }

  .menu-container.active {
    display: block;
  }

  .menu-container ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
    width: 100%;
  }

  .menu-container ul li {
    width: 100%;
    border-top: 1px solid #444;
  }

  .menu-container ul li a {
    display: block;
    width: 100%;
    background-color: #444;
    color: white;
    padding: 12px 20px;
    text-align: left;
  }

  .menu-container ul li a:hover {
    background-color: #555;
  }
}

/* =========================================
   ðŸ”¹ SEARCH ICON AND TOOLTIP
========================================= */
.search-icon {
  font-size: 24px;
  color: white;
  cursor: pointer;
  margin-left: 10px;
  z-index: 1100;
  position: relative;
}

.search-icon::after {
  content: "SEARCH";
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

.search-icon:hover::after {
  opacity: 1;
}

/* =========================================
   ðŸ”¹ SEARCH BOX CONTAINER & INPUT
========================================= */
.header-search-form {
  display: none;
  position: absolute;
  top: 60px;
  right: calc((100% - 1000px) / 2 + 20px);
  width: 280px;
  background: #333;
  padding: 10px 20px;
  border-radius: 4px;
  z-index: 1000;
  box-sizing: border-box;
}

.header-search-form.active {
  display: block;
}

.header-search-form input[type="search"] {
  width: 100%;
  padding: 10px;
  border-radius: 4px;
  border: none;
  font-size: 14px;
  background-color: #fff;
  color: #000;
}

/* =========================================
   ðŸ”¹ MOBILE SEARCH BOX CENTER FIX
========================================= */
@media (max-width: 768px) {
  .header-search-form {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    background: #333;
    padding: 12px 15px;
    border-radius: 4px;
    z-index: 9999;
    box-sizing: border-box;
  }
}


/* ------------------------------
   ✅ Prevent Horizontal Scroll in Mobile View
---------------------------------------------- */

/* ✅ Fix mobile overflow for iframes only */

.adsense-banner {
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
}


/* ✅ Mobile Overflow Protection */
@media (max-width: 768px) {
  /* Wrap overflowing tables */
  .entry-content table,
  .content table,
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
  }

  /* Prevent cells from breaking layout */
  .entry-content td,
  .entry-content th,
  td, th {
    white-space: nowrap;
  }

  /* Prevent all elements from overflowing */
  .entry-content,
  .content,
  .content-wrapper {
    overflow-x: auto;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
  }

  /* Ensure images, iframes, videos scale down */
  img, iframe, video {
    max-width: 100%;
    height: auto;
    display: block;
  }

  /* Handle code blocks and preformatted text */
  pre, code {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    max-width: 100%;
    display: block;
  }

  /* Apply to everything inside content */
  .entry-content * {
    box-sizing: border-box;
    max-width: 100% !important;
  }
}


/* ✅ Prevent horizontal scroll on mobile */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}



/* =========================================
   COMMENTS AREA
========================================= */
.comments-area {
  max-width: 75%;
  margin-right: auto;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-wrap: break-word;
}


.comments-area input,
.comments-area textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}


/* ✅ Remove all unwanted lines from all widgets */
.sidebar *,
.sidebar *::before,
.sidebar *::after {
  border: none !important;
  box-shadow: none !important;
  background: none !important;
  background-image: none !important;
  content: none !important;
}

/* ✅ Restore borders for input boxes */
/* ✅ Restore input borders in sidebar after global wipe */
.sidebar input,
.sidebar textarea,
.sidebar select {
  border: 1px solid #ccc !important;
  border-radius: 4px !important;
  background: #fff !important;
  padding: 6px 8px !important;
  box-sizing: border-box !important;
}

/* ✅ Reapply widget header styles after global wipe */
.sidebar h2,
.sidebar h3,
.sidebar h4 {
  background: #333333 !important;
  color: #ffffff !important;
  font-weight: bold !important;
  padding: 8px 10px !important;
  border-radius: 4px !important;
  margin-bottom: 10px !important;
}


.adsbygoogle, .google-auto-placed, ins, iframe {
  max-width: 100%;
  box-sizing: border-box;
  height: auto;
}




/* ✅ Clean hide sidebar only on mobile */
@media (max-width: 768px) {
  .sidebar {
    display: none !important;
  }

  .content-wrapper {
    flex-direction: column !important;
  }

  .content {
    flex: 1 1 100% !important;
  }
}


/* ✅ Prevent sidebar dropping below on wider screens by disabling wrap */
@media (min-width: 769px) {
  .content-wrapper {
    flex-wrap: nowrap;
  }
}

