/*
 * Modern Sticky Header with Glassmorphism Effect
 * Mobile-first, minimalist design for news portal
 */

/* ==========================================================================
   BASE HEADER STYLES
   ========================================================================== */

.site-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  height: 80px !important;
  padding: 0 !important;
  padding-top: 0 !important;
}

.site-header.scrolled {
  height: 70px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12) !important;
}

.site-header-content {
  max-width: 1360px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 40px;
}

/* Add padding to body to account for fixed header */
body {
  padding-top: 80px;
}

/* ==========================================================================
   LOGO SECTION
   ========================================================================== */

.site-logo,
.site-name {
  flex-shrink: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  height: 100%;
}

.site-logo a {
  display: flex;
  align-items: center;
  height: 100%;
}

.site-logo img {
  max-width: 220px;
  height: auto;
  max-height: 50px;
  display: block;
  transition: all 0.3s ease;
}

.site-header.scrolled .site-logo img {
  max-width: 200px;
  max-height: 45px;
}

.site-name a {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.5px;
  transition: color 0.2s ease;
}

.site-name a:hover {
  color: #667eea;
}

/* ==========================================================================
   DESKTOP NAVIGATION
   ========================================================================== */

#menu {
  flex: 1;
  max-width: 800px;
  display: flex;
  align-items: center;
  height: 100%;
}

#menu > ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}

#menu > ul > li {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  height: 100%;
}

#menu > ul > li > a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  color: #4b5563;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
  white-space: nowrap;
  height: auto;
}

#menu > ul > li > a:hover,
#menu > ul > li.current-menu-item > a {
  color: #667eea;
  background: rgba(102, 126, 234, 0.08);
}

/* Dropdown menus */
#menu > ul > li {
  position: relative;
}

#menu ul ul {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 8px;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1002;
  display: block;
  height: auto;
}

#menu li:hover > ul {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#menu ul ul li {
  display: block;
  height: auto;
}

#menu ul ul li a {
  padding: 10px 16px;
  display: block;
  font-size: 14px;
  color: #4b5563;
  border-radius: 8px;
  transition: all 0.2s ease;
  line-height: 1.5;
  height: auto;
}

#menu ul ul li a:hover {
  background: rgba(102, 126, 234, 0.08);
  color: #667eea;
}

/* ==========================================================================
   SEARCH & ACTIONS
   ========================================================================== */

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.search-desktop {
  position: relative;
}

.search-desktop form {
  position: relative;
  width: 240px;
}

.search-desktop input[type="text"],
.search-desktop input[type="search"] {
  width: 100%;
  padding: 10px 40px 10px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  font-size: 14px;
  color: #1f2937;
  background: #f9fafb;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.search-desktop input:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-desktop button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #9ca3af;
  transition: color 0.2s ease;
}

.search-desktop button:hover {
  color: #667eea;
}

.search-desktop button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ==========================================================================
   MOBILE MENU BUTTON
   ========================================================================== */

#btn-menu {
  display: none;
}

#nav-icon,
label[for="btn-menu"] {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: rgba(102, 126, 234, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  z-index: 1001;
  position: relative;
}

#nav-icon:hover,
label[for="btn-menu"]:hover {
  background: rgba(102, 126, 234, 0.15);
}

.nav-icon,
.circle.nav-icon {
  width: 24px;
  height: 20px;
  position: relative;
  display: block;
  background: none;
  border-radius: 0;
  box-shadow: none;
}

.nav-icon .line {
  position: absolute;
  width: 24px;
  height: 2px;
  background: #667eea;
  border-radius: 2px;
  left: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-icon .line.top {
  top: 0;
}

.nav-icon .line.middle {
  top: 9px;
}

.nav-icon .line.bottom {
  top: 18px;
}

/* Menu open state */
#btn-menu:checked ~ label .nav-icon .line.top {
  top: 9px;
  transform: rotate(45deg);
}

#btn-menu:checked ~ label .nav-icon .line.middle {
  opacity: 0;
  transform: translateX(-10px);
}

#btn-menu:checked ~ label .nav-icon .line.bottom {
  top: 9px;
  transform: rotate(-45deg);
}

/* ==========================================================================
   TABLET STYLES (768px - 1023px)
   ========================================================================== */

@media (max-width: 1023px) {
  .site-header-content {
    padding: 0 20px;
    gap: 20px;
  }

  #menu {
    display: none; /* Hide desktop menu on tablet */
  }

  #nav-icon,
  label[for="btn-menu"] {
    display: flex;
  }

  .search-desktop form {
    width: 180px;
  }
}

/* ==========================================================================
   MOBILE STYLES (max-width: 767px)
   ========================================================================== */

@media (max-width: 767px) {
  .site-header {
    height: 60px;
  }

  .site-header.scrolled {
    height: 56px;
  }

  body {
    padding-top: 60px;
  }

  .site-header-content {
    padding: 0 16px;
    gap: 12px;
  }

  .site-logo img {
    max-width: 140px;
  }

  .site-header.scrolled .site-logo img {
    max-width: 130px;
  }

  .site-name a {
    font-size: 20px;
  }

  /* Hide desktop search on mobile */
  .search-desktop {
    display: none;
  }

  /* Show mobile menu button */
  #nav-icon,
  label[for="btn-menu"] {
    display: flex;
  }

  /* Mobile menu overlay */
  #menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    padding: 24px 16px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    z-index: 999;
    display: block;
  }

  #btn-menu:checked ~ nav#menu {
    transform: translateX(0);
  }

  #menu > ul {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  #menu > ul > li > a {
    padding: 16px 20px;
    font-size: 16px;
    border-radius: 12px;
  }

  /* Mobile search in menu */
  .search-responsive {
    margin-bottom: 16px;
  }

  .search-responsive form {
    position: relative;
  }

  .search-responsive input {
    width: 100%;
    padding: 14px 50px 14px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  }

  .search-responsive input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  }

  .search-responsive button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #667eea;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .search-responsive button svg {
    width: 20px;
    height: 20px;
    stroke: white;
    stroke-width: 2;
    fill: none;
  }

  /* Mobile dropdown menus */
  #menu ul ul {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: #f9fafb;
    margin-top: 4px;
    border-radius: 12px;
  }

  /* Backdrop blur when menu is open */
  #btn-menu:checked ~ label::before {
    content: '';
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 998;
  }
}

/* ==========================================================================
   SOCIAL ICONS IN HEADER
   ========================================================================== */

.social-desktop {
  display: flex;
  align-items: center;
  gap: 8px;
}

.social-desktop a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #6b7280;
  transition: all 0.2s ease;
}

.social-desktop a:hover {
  background: rgba(102, 126, 234, 0.08);
  color: #667eea;
}

.social-desktop svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 1023px) {
  .social-desktop {
    display: none;
  }
}

/* ==========================================================================
   SCROLL BEHAVIOR
   ========================================================================== */

/* Add smooth scroll animation */
html {
  scroll-behavior: smooth;
}

/* Hide header when scrolling down, show when scrolling up (optional enhancement) */
.site-header.header-hidden {
  transform: translateY(-100%);
}

.site-header.header-visible {
  transform: translateY(0);
}

/* ==========================================================================
   ULTRA-SPECIFIC OVERRIDES FOR WORDPRESS CUSTOMIZER
   These MUST come last to override inline customizer styles
   ========================================================================== */

/* Override customizer background: #333333 with white glassmorphic effect */
body .site-header,
body header.site-header,
header.site-header,
.site-header {
  background: rgba(255, 255, 255, 0.95) !important;
  background-color: rgba(255, 255, 255, 0.95) !important;
}

body .site-header.scrolled,
body header.site-header.scrolled,
header.site-header.scrolled,
.site-header.scrolled {
  background: rgba(255, 255, 255, 0.98) !important;
  background-color: rgba(255, 255, 255, 0.98) !important;
}

/* ==========================================================================
   LOGO FIX - Remove dark background from logo
   ========================================================================== */

.site-logo,
.site-logo a,
.site-logo img {
  background: transparent !important;
  background-color: transparent !important;
  mix-blend-mode: multiply; /* Removes dark backgrounds from images */
}

