/*
Theme Name: BU Lite
Theme URI: https://businessupturn.com
Author: Business Upturn
Author URI: https://businessupturn.com
Description: A modern, clean business news WordPress theme with mega menu, responsive design, and optimized for news/magazine sites.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bu-lite
Tags: news, magazine, business, responsive, custom-menu, featured-images, translation-ready

This theme is built for business news and magazine websites.
*/

/* =========================
   Business Upturn - Layout Framework
   Header, Footer, and Navigation Styles - OPTIMIZED VERSION
========================= */

/* =========================
   Base Layout
========================= */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: 0 !important;
}
main {
  flex: 1;
  padding-top: 65px !important;
}
/* Admin bar adjustments for logged-in users */
body.admin-bar main {
  padding-top: 75px !important; /* 65px header + 32px admin bar */
}

/* Reduced spacing for single post pages */
body.single main {
  padding-top: 65px !important; /* Adjust this value as needed */
}

body.single.admin-bar main {
  padding-top: 97px !important; /* 65px + 32px admin bar */
}

@media screen and (max-width: 782px) {
  main {
    padding-top: 55px !important;
  }
  
  body.admin-bar main {
    padding-top: 101px !important; /* 55px header + 46px admin bar */
  }
  
  /* Reduced spacing for single post pages on mobile */
  body.single main {
    padding-top: 45px !important; /* Adjust this value as needed */
  }
  
  body.single.admin-bar main {
    padding-top: 91px !important; /* 45px + 46px admin bar */
  }
}

/* =========================
   Layout Containers
========================= */
.header-container,
.footer-container {
  width: var(--global-width-percent);
  max-width: var(--global-max-width);
  margin: 0 auto;
}

/* =========================
   Header
========================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  border-bottom: 1px solid var(--border-light);
  background: var(--background-white);
  padding: 10px 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease;
}

/* Admin bar pushes header down */
body.admin-bar .site-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

.site-header.scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.site-header .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* Header Left Section */
.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo a {
  font-size: 16px;
  font-weight: 700;
}

.logo img {
  display: block;
  height: 45px;
}

.logo-red {
  color: var(--brand-primary);
}

.logo-bold {
  color: var(--text-primary);
}

/* Hamburger Menu */
.hamburger {
  width: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
}

.hamburger i {
  font-size: 20px;
}

/* Main Navigation */
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.main-nav a:hover {
  color: var(--brand-primary);
}

/* Header Right Section */
.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 15px;
}

/* Search Toggle Button */
.search-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.search-toggle:hover {
  color: var(--brand-primary);
}

.signin {
  border: 1px solid var(--border-light);
  padding: 6px 12px;
  background: var(--background-white);
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.signin:hover {
  background: var(--background-light);
}

/* Portal/Region Dropdown */
.portal-select {
  position: relative;
}

.portal-btn {
  border: 1px solid var(--border-light);
  padding: 6px 12px;
  background: var(--background-white);
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s ease;
}

.portal-btn:hover {
  background: var(--background-light);
}

.portal-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--background-white);
  border: 1px solid var(--border-light);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  min-width: 160px;
  display: none;
  z-index: 1001;
}

.portal-menu.open {
  display: block;
}

.portal-menu a {
  display: block;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.portal-menu a:hover {
  background: var(--background-light);
  color: var(--brand-primary);
}

/* =========================
   Search Overlay
========================= */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.search-overlay.active {
  display: flex;
  opacity: 1;
}

.search-overlay-content {
  width: 90%;
  max-width: 600px;
  position: relative;
}

.search-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: var(--background-white);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  transition: transform 0.2s ease;
}

.search-close:hover {
  transform: rotate(90deg);
}

.search-overlay .search-form {
  display: flex;
  background: var(--background-white);
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.search-overlay .search-form input {
  flex: 1;
  padding: 20px 24px;
  border: none;
  font-size: 18px;
  outline: none;
  font-family: var(--font-family);
}

.search-overlay .search-form button {
  background: var(--brand-primary);
  color: var(--background-white);
  border: none;
  padding: 0 32px;
  font-size: 16px;
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
  font-family: var(--font-family);
}

.search-overlay .search-form button:hover {
  background: var(--brand-primary-dark);
}

/* =========================
   Mega Menu
========================= */
.mega-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0a0a0a;
  z-index: 3001;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 0;
}

.mega-menu.active {
  opacity: 1;
  visibility: visible;
}

/* Admin bar adjustment for mega menu */
body.admin-bar .mega-menu {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .mega-menu {
    top: 46px;
  }
}

/* Mega Menu Header */
.mega-menu-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  z-index: 10;
  height: 65px;
}

.mega-menu-header .logo {
  display: flex;
  align-items: center;
  height: 100%;
}

.mega-menu-header .logo img {
  height: 45px;
  display: block;
}

.mega-menu-close {
  background: none;
  border: none;
  color: #000000;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  width: 40px;
  height: 40px;
  line-height: 1;
}

.mega-menu-close:hover {
  color: var(--brand-primary);
}

.mega-menu .header-container {
  padding: 85px 40px 40px;
  height: 100vh;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mega-menu .header-container {
  width: var(--global-width-percent);
  max-width: var(--global-max-width);
  margin: 0 auto;
}

/* Mega Menu Search */
.mega-search {
  display: flex;
  margin-bottom: 40px;
  border: 2px solid #333;
  overflow: hidden;
  background: #1a1a1a;
  flex-shrink: 0;
  max-width: 800px;
}

.mega-search input {
  flex: 1;
  padding: 16px 20px;
  border: none;
  outline: none;
  font-size: 16px;
  background: #1a1a1a;
  color: #ffffff;
}

.mega-search input::placeholder {
  color: #888;
}

.mega-search button {
  background: var(--brand-primary);
  border: none;
  padding: 0 30px;
  cursor: pointer;
  font-size: 18px;
  color: var(--background-white);
  transition: background-color 0.2s ease;
}

.mega-search button:hover {
  background: var(--brand-primary-dark);
}

/* Mega Menu Columns */
.mega-menu .columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 50px 40px;
  overflow-y: auto;
  padding-right: 20px;
  padding-bottom: 20px;
}

.mega-menu .columns::-webkit-scrollbar {
  width: 8px;
}

.mega-menu .columns::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.mega-menu .columns::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

.mega-menu .columns::-webkit-scrollbar-thumb:hover {
  background: #444;
}

.mega-menu h4 {
  font-size: 16px;
  margin-bottom: 16px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mega-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mega-menu li {
  margin-bottom: 10px;
}

.mega-menu a {
  font-size: 15px;
  color: #b3b3b3;
  transition: color 0.2s ease, padding-left 0.2s ease;
  display: inline-block;
  line-height: 1.5;
}

.mega-menu a:hover {
  color: #ffffff;
  padding-left: 4px;
}

/* =========================
   Footer
========================= */
.footer-dark {
  background: #000;
  color: #f3f4f6;
  font-family: var(--font-family);
  padding: 32px 0 36px;
}

.footer-dark .footer-container {
  width: var(--global-width-percent);
  max-width: var(--global-max-width);
  margin: 0 auto;
}

.footer-dark a {
  color: #f3f4f6;
  text-decoration: none;
  transition: 0.2s color, 0.2s background-color, 0.2s border-color;
}

.footer-dark a:hover:not(.btn-outline) {
  color: var(--brand-primary);
}

/* Footer Top Section */
.ft-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  margin-bottom: 18px;
}

.ft-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ft-brand img {
  height: 50px;
}

.ft-social {
  display: flex;
  gap: 18px;
}

.ft-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.ft-icon:hover {
  opacity: 1;
  color: var(--brand-primary);
}

/* Footer Main Grid */
.ft-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 44px;
  padding: 10px 0 6px;
}

/* Footer Link Columns */
.ft-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.links-col {
  list-style: none;
  margin: 0;
  padding: 0;
}

.links-col li + li {
  margin-top: 6px;
}

.links-col a {
  display: inline-block;
  line-height: 1.6;
  padding-block: 4px;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
  font-size: 15px;
  font-weight: 600;
}

/* Footer CTA Boxes */
.ft-ctas {
  display: grid;
  gap: 18px;
  align-content: start;
}

.cta-box {
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 16px 18px;
}

.cta-box .mota {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color:#fff;
}

.cta-box p {
  margin: 0 0 14px;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.5;
}

/* Newsletter Section */
.ft-newsletter {
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 16px 18px;
  align-self: start;
}

.ft-newsletter strong {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color:#fff;
}

.ft-newsletter .fa-envelope {
  margin-right: 8px;
}

.ft-newsletter p {
  margin: 0 0 14px;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.5;
}

/* Outline Button */
.btn-outline {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid #f3f4f6;
  color: #f3f4f6;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 14px;
  transition: all 0.2s ease;
}

.btn-outline:hover,
.footer-dark .btn-outline:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--background-white);
  text-decoration: none;
}

/* Footer Legal Section */
.ft-legal {
  margin-top: 22px;
}

.ft-policy {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 10px;
}

.ft-policy a {
  font-size: 14px;
  font-weight: 600;
}

.ft-policy .sep {
  opacity: 0.5;
}

.ft-copy {
  margin: 8px 0 0;
  color: #cbd5e1;
  line-height: 1.6;
  font-size: 14px;
}

.ft-disclaimer {
  margin: 8px 0 0;
  color: #a3a3a3;
  line-height: 1.6;
  font-size: 14px;
}

.ft-provider {
  margin: 10px 0 0;
  color: #a3a3a3;
  font-size: 14px;
}

/* Focus Accessibility */
.footer-dark a:focus-visible,
.btn-outline:focus-visible,
.ft-icon:focus-visible,
.footer-dark .btn-outline:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* =========================
   Loading States
========================= */
body.loading {
  overflow: hidden;
}

body.loaded {
  overflow: visible;
}

/* Prevent body scroll when mega menu is open */
body.mega-menu-open {
  overflow: hidden;
}

/* =========================
   Media Queries
========================= */

/* Large screens */
@media (max-width: 1100px) {
  .ft-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  
  .ft-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Tablet and Mobile */
@media (max-width: 768px) {
  body {
    padding-top: 0;
  }
  
  main {
    padding-top: 55px;
  }
  
  body.admin-bar main {
    padding-top: 101px; /* 55px header + 46px admin bar */
  }
  
  /* Header adjustments */
  .header-left {
    gap: 12px;
    flex: 1;
  }
  
  .logo img {
    height: 35px;
  }
  
  /* HIDE search toggle button on mobile */
  .search-toggle {
    display: none !important;
  }
  
  /* HIDE search overlay completely on mobile */
  .search-overlay {
    display: none !important;
  }
  
  /* Hide other header elements on mobile */
  .main-nav,
  .portal-select,
  .signin {
    display: none !important;
  }
  
  /* Hide entire header-right section on mobile */
  .header-right {
    display: none !important;
  }
  
  /* Header container positioning */
  .site-header .header-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
  }
  
  /* Hamburger positioning */
  .hamburger {
    position: relative !important;
    right: auto;
    left: auto;
    top: auto;
    transform: none;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
  }
  
  /* Mega menu mobile layout */
  .mega-menu-header {
    padding: 0 15px;
    height: 55px;
  }
  
  .mega-menu-header .logo {
    display: flex;
    align-items: center;
    height: 100%;
  }
  
  .mega-menu-header .logo img {
    height: 35px;
  }
  
  .mega-menu-close {
    font-size: 24px;
    width: 36px;
    height: 36px;
    padding: 0;
  }
  
  .mega-menu .header-container {
    padding: 70px 20px 30px;
    height: 100vh;
    max-width: 100%;
  }
  
  .mega-search {
    margin-bottom: 25px;
    max-width: 100%;
  }
  
  .mega-search input {
    padding: 12px 16px;
    font-size: 15px;
  }
  
  .mega-search button {
    padding: 0 20px;
    font-size: 16px;
  }
  
  .mega-menu .columns {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px 20px;
  }
  
  .mega-menu h4 {
    font-size: 14px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--brand-primary);
    padding-bottom: 6px;
  }
  
  .mega-menu a {
    font-size: 13px;
  }
  
  .mega-menu li {
    margin-bottom: 8px;
  }
  
  /* Make mega menu search more prominent on mobile */
  .mega-search {
    margin-bottom: 20px;
  }
  
  .mega-search input {
    padding: 12px;
    font-size: 16px;
  }
  
  .mega-search button {
    padding: 0 20px;
  }
  
  .mega-menu .columns {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .mega-social {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
  }
  
  .mega-social .social-icons a {
    font-size: 20px;
  }
}

/* Very small mobile screens */
@media (max-width: 480px) {
  .mega-menu .columns {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Small mobile screens */
@media (max-width: 640px) {
  .ft-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  
  .ft-social {
    gap: 14px;
  }
}

/* Navigation scroll for tablets */
@media (min-width: 769px) and (max-width: 1024px) {
  .main-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  
  .main-nav::-webkit-scrollbar {
    display: none;
  }
  
  .main-nav ul {
    flex-wrap: nowrap;
    gap: 18px;
  }
  
  .main-nav a {
    font-size: 15px;
    white-space: nowrap;
  }
  
  .header-right {
    gap: 10px;
  }
  
  .portal-btn {
    padding: 6px 10px;
    font-size: 14px;
  }
  
  .portal-menu a {
    padding: 12px 14px;
  }
}