@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

.topbar{
  background:#002b58;
  color:#ffffff;
  padding:10px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:12px;
  font-family:'Poppins','Segoe UI',Arial,sans-serif;
}
.topbar .tagline{color:#ecebeb; opacity:0.95;}
.topbar .social{display:flex;align-items:center;gap:8px;color:#ecebeb;}
.topbar .date{display:inline-flex;align-items:center;gap:8px;}
.topbar .date i{font-size:13px;}
.topbar .social a{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;color:#002b58;background:#ecebeb;transition:background .2s ease,color .2s ease;}
.topbar .social a:hover{background:#003d73;color:#ffffff;}

.mobile-menu-toggle{
  display:none;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  border:none;
  background:var(--orange);
  color:#fff;
  border-radius:4px;
  cursor:pointer;
  transition:background .18s ease, transform .18s ease;
  font-size:18px;
}
.mobile-menu-toggle:hover{background:var(--orange-dark);}
.mobile-menu-toggle.open{background:#000;}
.mobile-menu-toggle i{pointer-events:none;}

.navbar{background:linear-gradient(90deg,var(--orange),var(--orange-dark));position:relative;z-index:50;overflow:visible;font-family:'Poppins','Segoe UI',Arial,sans-serif; padding: 0 18px;}
.navbar > ul{display:flex;flex-wrap:wrap;overflow:visible;padding:0;margin:0;}
.navbar li a{
  display:block;padding:14px 20px;color:#fff;font-size:13px;font-weight:600;letter-spacing:0.3px;
  white-space:nowrap;transition:background .18s ease,color .18s ease;
}
.navbar > ul > li.active > a{background:var(--orange-dark);}
.navbar > ul > li > a:hover{background:var(--orange-dark) !important;}

.nav-item{position:relative;}
.nav-item > a{display:flex;align-items:center;gap:6px;}
.nav-item > a .nav-chevron{
  width:10px;height:6px;margin-left:4px;vertical-align:middle;
  transition:transform .18s ease;flex-shrink:0;
}
.nav-item.open > a .nav-chevron{
  transform:rotate(180deg);
}
.nav-item > a .sub-chevron{
  width:10px;height:6px;margin-left:4px;vertical-align:middle;
  transition:transform .18s ease;flex-shrink:0;
}
.nav-chevron path{fill:#fff;}
.sub-chevron path{fill:#888;}
.nav-item:hover > a .nav-chevron{transform:rotate(180deg);}
.dropdown{
  position:absolute;top:100%;left:0;min-width:240px;
  background:#fff;border:1px solid rgba(0,0,0,0.08);
  border-radius:3px;box-shadow:0 24px 48px rgba(0,0,0,0.14);
  opacity:0;visibility:hidden;transform:translateY(12px);
  transition:opacity .18s ease,transform .18s ease,visibility .18s;
  padding:8px 0;z-index:60;
}
.nav-item:hover .dropdown{opacity:1;visibility:visible;transform:translateY(0);}

/* Support keyboard and focus activation */
.nav-item:focus-within .dropdown{opacity:1;visibility:visible;transform:translateY(0);} 

/* Support explicit open state (used by JS toggle) */
.nav-item.open .dropdown{opacity:1;visibility:visible;transform:translateY(0);} 
.dropdown li a{
  display:block;color:#1a2233;font-size:14px;font-weight:600;
  white-space:nowrap;letter-spacing:0.02em;transition:background .18s ease,color .18s ease;
}
.dropdown li a:hover,
.dropdown li a:focus{background:#ffffff !important;color:var(--orange) !important;}
.dropdown li{border-bottom:1px solid rgba(0,0,0,0.06);}
.dropdown li:last-child{border-bottom:none;}
.dropdown-title{
  display:flex;align-items:center;justify-content:space-between;
  padding:0px 20px 0px 0px;color:#1a2233;font-size:14px;font-weight:600;
  text-transform:uppercase;letter-spacing:0.06em;cursor:default;
}
/* make the link text compact and inherit nav styles */
.dropdown-title > a{display:inline-block;color:inherit;font-weight:700;padding:0;margin:0;text-decoration:none}
/* caret button styled like the inline chevron used previously */
.dropdown-title .group-toggle{background:transparent;border:none;padding:4px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:inherit}
.dropdown-title .group-toggle:focus{outline:2px solid rgba(0,0,0,0.06);outline-offset:2px}
.dropdown-title .group-toggle .nav-chevron{width:10px;height:6px;margin:0}
.dropdown-title .group-chevron{width:10px;height:6px;transition:transform .18s ease;flex-shrink:0;}
.dropdown-title .group-chevron path{fill:#6f788c;}
.dropdown-group.open .dropdown-title .group-chevron{transform:rotate(180deg);}
.dropdown-menu{list-style:none;margin:0;display:none;}
.dropdown-group.open .dropdown-menu{display:block;}
.dropdown-menu li{border:none;}
.dropdown-menu li a{
  display:block;padding:10px 32px;color:#1a2233;font-size:14px;font-weight:600;
  white-space:nowrap;letter-spacing:0.02em;transition:background .18s ease,color .18s ease;
}
.dropdown-menu li a:hover,
.dropdown-menu li a:focus{background:#ffffff !important;color:var(--orange) !important;}
.nav-subitem{position:relative;}
.nav-subitem > a{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.nav-subitem > a .sub-chevron{
  width:10px;height:6px;margin-left:4px;vertical-align:middle;
  transition:transform .18s ease;flex-shrink:0;
}
.nav-subitem > a .sub-chevron path{fill:#888;}
.nav-subitem:hover > a .sub-chevron{transform:rotate(-90deg);}
.nav-subitem:hover > a{background:var(--bg-light) !important;color:var(--orange) !important;}
.subdropdown{
  position:absolute;top:100%;left:0;min-width:230px;
  background:#fff;border:1px solid rgba(0,0,0,0.08);
  border-radius:3px;box-shadow:0 24px 48px rgba(0,0,0,0.14);
  opacity:0;visibility:hidden;transform:translateY(10px);
  transition:opacity .18s ease,transform .18s ease,visibility .18s;
  padding:8px 0;z-index:70;
}
.nav-subitem:hover .subdropdown{opacity:1;visibility:visible;transform:translateY(0);}
.subdropdown li a{
  display:block;padding:12px 20px;color:#1a2233;font-size:14px;font-weight:600;
  white-space:nowrap;letter-spacing:0.02em;transition:background .18s ease,color .18s ease;
}
.subdropdown li a:hover,
.subdropdown li a:focus{background:#ffffff !important;color:var(--orange) !important;}
.subdropdown li{border-bottom:1px solid rgba(0,0,0,0.06);}
.subdropdown li:last-child{border-bottom:none;}

/* DEBUG: force-show dropdown panel for verification. Remove when done. */
.dropdown.debug-show,
.nav-item.debug-open .dropdown {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  z-index: 9999 !important;
  display: block !important;
}

/* removed temporary debug rule that forced fixed position */

/* Enhanced categories dropdown for search bar */
.search-bar select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 0px;
  background: #fff;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #1a2233;
  cursor: pointer;
  transition: all .18s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%231a2233' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 6px;
  padding-right: 28px;
}

.search-bar select:hover {
  border-color: rgba(0,0,0,0.12);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.search-bar select:focus {
  outline: none;
}

/* Dropdown options styling for native select (best-effort across browsers) */
.search-bar select option{background:#ffffff !important; color:#1a2233 !important;}
.search-bar select option:checked,
.search-bar select option:active,
.search-bar select option:hover{background:#ffffff !important; color:var(--orange) !important;}

/* Make the select itself highlight on focus */
.search-bar select:focus{border-color:var(--orange) !important; color:var(--orange) !important; box-shadow:0 8px 24px rgba(232,84,29,0.06) !important;}

/* Custom select component styling */
.search-bar{display:flex;align-items:center;gap:0;}
.search-bar input{flex:1;min-width:0;}
.search-bar button{margin:0;background:var(--orange);border:none;color:#fff;padding:0 14px;height:42px;display:flex;align-items:center;justify-content:center;border-radius:3px;cursor:pointer;transition:background .18s ease;}
.search-bar button:focus{outline:none;box-shadow:0 0 0 3px rgba(232,84,29,0.18);}
.custom-select{position:relative; display:inline-block; width:210px; min-width:210px; margin:0;}
.custom-select .select-toggle{position:relative;width:100%;min-width:0;background:#fff;border:1px solid rgba(0,0,0,0.08);padding:10px 12px;font-weight:600;color:#1a2233;display:flex;align-items:center;justify-content:center;border-radius:2px;cursor:pointer;}
.custom-select .select-label{display:block;width:100%;min-width:0;padding:0 0px;overflow:hidden;box-sizing:border-box;text-align:left;text-overflow:ellipsis;white-space:nowrap;}
.custom-select .select-toggle svg,.custom-select .select-toggle i{position:absolute;right:12px;margin-left:0;opacity:.8}
.custom-select .select-toggle .nav-chevron{width:10px;height:6px;}
.custom-select .select-toggle .nav-chevron path{fill:#1a2233;}
.custom-select .select-panel{position:absolute;left:0;top:100%;min-width:220px;background:#fff;border:1px solid rgba(0,0,0,0.08);box-shadow:0 18px 40px rgba(0,0,0,0.08);border-radius:3px;padding:6px 0;margin-top:-8px;z-index:1000}
.custom-select .select-panel[hidden]{display:none}
.custom-select .select-panel a{display:block;padding:10px 14px;cursor:pointer;color:#1a2233;font-weight:600;text-decoration:none}
  .custom-select .select-panel a:hover,.custom-select .select-panel a[aria-selected="true"]{background:transparent !important;color:var(--orange) !important}

/* Show custom select dropdown using same transition as navbar */
.custom-select.open .dropdown{opacity:1;visibility:visible;transform:none}

/* ===== MOBILE / TABLET BREAKPOINT (desktop styles above unchanged) ===== */
@media (max-width:1100px){
  .header{
    flex-wrap:wrap;
    align-items:center;
    padding:12px 16px;
  }
  .logo{flex:1 1 auto;}
  .mobile-menu-toggle{display:flex; order:2; margin-left:12px;}

  /* Post Listing button: own row, pushed right */
  .header-actions{
    order:4;
    flex:0 0 100%;
    width:100%;
    margin-top:10px;
    display:flex;
    justify-content:flex-end;
  }

  /* Search row: input full width on top, category + search button share the next row */
  .search-bar{
    order:3;
    flex:0 0 100% !important;
    width:100% !important;
    max-width:none !important;
    flex-wrap:nowrap;
    row-gap:0;
  }
  .search-bar input{
    flex:1 1 auto;
    order:1;
    min-width:0;
    border-radius:3px;
  }
  .custom-select{
    order:2;
    flex:0 0 28%;
    width:auto;
    min-width:0;
  }
  .custom-select .select-toggle{
    width:100%;
    justify-content:space-between;
    border-radius:3px 0 0 3px;
    white-space:nowrap;
    overflow:hidden;
  }
  .search-bar button{
    order:3;
    flex:0 0 56px;
    width:56px;
    min-width:56px;
    border-radius:0 3px 3px 0;
  }

  /* Navbar: full open panel with all links + dropdowns visible when toggled */
  .navbar{
    display:none;
    position:relative;
    left:auto;
    right:auto;
    width:100%;
    margin:0;
    padding:0 16px 16px;
  }
  .navbar.open{display:block;}
  .navbar > ul{flex-direction:column; align-items:stretch;}
  .navbar li a{padding:12px 16px;}
  .navbar li{width:100%;}
  .navbar .dropdown,
  .navbar .subdropdown{
    position:static;
    opacity:0;
    visibility:hidden;
    transform:none;
    box-shadow:none;
    border:none;
    background:transparent;
    padding:0;
    height:0;
    max-height:0;
    overflow:hidden;
    transition:opacity .25s ease, max-height .25s ease, visibility .25s ease, height .25s ease;
    display:block;
  }
  .nav-item.open > .dropdown,
  .nav-subitem.open > .subdropdown{
    opacity:1 !important;
    visibility:visible !important;
    height:auto !important;
    max-height:2000px !important;
    overflow:visible !important;
    padding:8px 0 !important;
    display:block !important;
  }
  .dropdown{margin-left:0;}
  .dropdown li a{color:#fff;}
  .subdropdown li a{color:#fff;}
  .dropdown li a:hover,.dropdown li a:focus,
  .subdropdown li a:hover,.subdropdown li a:focus{background:rgba(255,255,255,0.12) !important; color:#fff !important;}
  .dropdown li,.subdropdown li{border-bottom:1px solid rgba(255,255,255,0.15);}
  .nav-subitem > a{justify-content:space-between;}
  .nav-item.open > a .nav-chevron,
  .nav-subitem.open > a .sub-chevron{transform:rotate(180deg);}
  .nav-chevron path,.sub-chevron path,
  .dropdown-title .group-chevron path{fill:#fff;}
}

@media (max-width:768px) {
  .topbar{flex-direction:column; align-items:flex-start; gap:8px; padding:12px 16px;}
  .topbar .social{justify-content:flex-start; width:100%;}
  .header{padding:14px 16px 8px;}
  .logo img{height:38px;}
  .search-bar input{padding:12px 14px;}
  .search-bar button{min-width:56px;}
  .custom-select{flex-basis:38%;}
  .custom-select .select-toggle{ font-size:11px; overflow:hidden;}
  .custom-select .select-label{width:calc(100% - 24px); padding:0 0px; text-align:left;}
  .custom-select .select-toggle svg{right:10px; margin-left:0;}
  .navbar{padding:0 16px 16px;}
  .navbar li a{font-size:14px;}
  .dropdown li a, .subdropdown li a{font-size:14px;}
}