body {
  margin: 0;
  padding: 0;
}

/* HEADER STYLE */
header {
  padding: 30px;
  font-size: 20px;
  text-align: center;
  background: var(--primary-color);
  color: var(--font-color);
}

nav {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: var(--menu-bg-color);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 9999;
}

nav .navbar {
  height: 100%;
  max-width: 1250px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: auto;
  padding: 0 50px;
}

.navbar .logo a {
  font-size: 30px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

nav .navbar .nav-links {
  line-height: 70px;
  height: 100%;
}

nav .navbar .links {
  display: flex;
}

nav .navbar .links li {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  padding: 0 14px;
}

nav .navbar .links li a {
  height: 100%;
  text-decoration: none;
  white-space: nowrap;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
}

nav .navbar .links li a:hover {
  color: var(--primary-color);
}

.links li:hover .htmlcss-arrow,
.links li:hover .js-arrow {
  transform: rotate(180deg);
}

nav .navbar .links li .arrow {
  height: 100%;
  width: 22px;
  line-height: 70px;
  text-align: center;
  display: inline-block;
  color: #fff;
  transition: all 0.3s ease;
}

nav .navbar .links li .sub-menu {
  position: absolute;
  top: 70px;
  left: 0;
  line-height: 40px;
  background-color: var(--menu-bg-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  border-radius: 0 0 4px 4px;
  display: none;
  z-index: 2;
}

/* nav .navbar .links li:hover .htmlCss-sub-menu,
nav .navbar .links li:hover .js-sub-menu {
  display: block;
} */
/* Show dropdown on hover for desktop screens */
@media (min-width: 851px) {
  nav .navbar .links li:hover > .sub-menu {
    display: block;
  }
}


.navbar .links li .sub-menu li {
  padding: 0 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar .links li .sub-menu a {
  color: #fff;
  font-size: 15px;
  font-weight: 500;
}

.navbar .links li .sub-menu .more-arrow {
  line-height: 40px;
}

.navbar .links li .htmlCss-more-sub-menu {
  line-height: 40px;
}

.navbar .links li .sub-menu .more-sub-menu {
  position: absolute;
  top: 0;
  left: 100%;
  border-radius: 0 4px 4px 4px;
  z-index: 1;
  display: none;
}

.links li .sub-menu .more:hover .more-sub-menu {
  display: block;
}

.navbar .nav-links .sidebar-logo {
  display: none;
}

.navbar .fa-menu {
  display: none;
}

#mode-icon {
  color: var(--primary-color);
  background-color: inherit;
  font-size: 20px;
}

#mode-icon:hover {
  color: var(--menu-font-color);
}

/* Medium screens */
@media (max-width:920px) {
  nav .navbar {
    max-width: 100%;
    padding: 0 25px;
  }
  nav .navbar .logo a {
    font-size: 27px;
  }
  nav .navbar .links li {
    padding: 0 10px;
    white-space: nowrap;
  }
  nav .navbar .links li a {
    font-size: 15px;
  }
}

/* Mobile screens */
@media (max-width:850px) {
  nav .navbar {
    justify-content: flex-start; /* ✅ keep logo + hamburger aligned left */
    gap: 15px;
  }

  .navbar .fa-menu {
    display: block;
    cursor: pointer;
    font-size: 24px;
    color: #fff;
  }

  nav .navbar .nav-links {
    position: fixed;
    top: 0;               /* ✅ start from top */
    left: -100%;
    height: 100vh;        /* ✅ take full screen height */
    width: 270px;
    overflow-y: auto;     /* ✅ scrollable if long */
    background-color: var(--menu-bg-color);
    line-height: 40px;
    padding: 0 20px;      /* ✅ remove top padding, only side padding */
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    transition: left 0.4s ease;
    z-index: 1000;
  }

  .navbar .nav-links .sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .sidebar-logo .logo-name {
    font-size: 25px;
    color: #fff;
  }

  .sidebar-logo i,
  .navbar .fa-menu {
    font-size: 25px;
    color: #fff;
  }

  nav .navbar .links {
    display: block;
    margin-top: 20px;
  }

  nav .navbar .links li {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  nav .navbar .links li .arrow {
    line-height: 40px;
    margin-left: auto;
    transition: transform 0.3s ease;
  }

  /* ✅ Accordion submenu style */
  .navbar .links li .sub-menu {
    position: relative;
    top: 0;
    left: 0;
    box-shadow: none;
    display: none;
    padding-left: 15px;
  }

  .navbar .links li.active .sub-menu {
    display: block;
  }

  .navbar .links li.active .arrow {
    transform: rotate(180deg);
  }
}

/* Very small screens */
@media (max-width:370px) {
  nav .navbar {
    padding: 0 15px;
  }
  nav .navbar .nav-links {
    max-width: 100%;
    width: 100%;
  }
}

.navbar .search-box {
  position: relative;
  height: 40px;
  width: 40px;
}

.navbar .search-box i {
  position: absolute;
  height: 100%;
  width: 100%;
  line-height: 40px;
  text-align: center;
  font-size: 22px;
  color: var(--primary-color);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.navbar .search-box i:hover {
  color: var(--menu-font-color);
}

.navbar .search-box .input-box {
  position: absolute;
  right: calc(100% - 20px);
  top: 80px;
  height: 60px;
  width: 300px;
  background-color: var(--menu-bg-color);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s ease;
}

.navbar.showInput .search-box .input-box {
  top: 60px;
  opacity: 1;
  pointer-events: auto;
} 

.search-box .input-box input {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 35px;
  width: 280px;
  outline: none;
  padding: 0 15px;
  font-size: 16px;
  border: 1px solid var(--primary-color);
} 

/* Search results */
#searchResults {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

#searchResults .post-list {
  background-color: var(--background-color);
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 20px;
  width: 100%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#searchResults .post-list h5,
#searchResults .post-list a {
  margin: 0 0 10px;
  color: var(--primary-color);
}

#searchResults .post-list p {
  margin: 0;
  color: var(--font-color);
}

#searchResults .post-list .read-more {
  color: var(--primary-color);
}

#searchResults .post-list a:hover {
  color: var(--secondary-color);
}


/* Mobile submenu toggle */
@media (max-width:850px) {
  .navbar .links li .sub-menu {
    display: none;
  }
  .navbar .links li.active .sub-menu {
    display: block;
  }
  .navbar .links li .arrow {
    transition: transform 0.3s ease;
  }
  .navbar .links li.active .arrow {
    transform: rotate(180deg);
  }
}


/* ===== Icons-only menu for 85px–1200px ===== */
/* Hide menu text for icons-only layout (851px–1200px) */
@media (max-width:1200px) and (min-width:851px) {
  /* Hide menu text for icons-only layout */
  nav .navbar .links li a .menu-text {
    display: none;
  }

  /* Show submenu on hover for icons-only layout */
  nav .navbar .links li:hover .sub-menu {
    display: block;
  }
}

/* Show menu text on larger screens */
@media (min-width:1201px) {
  nav .navbar .links li a .menu-text {
    display: inline;
  }
}

/* On mobile (below 850px), show text again */
@media (max-width:850px) {
  nav .navbar .links li a .menu-text {
    display: inline;
  }
}

/* Keep hamburger menu active below 800px (existing) */
@media (max-width:850px) {
  nav .navbar .links li a {
    justify-content: flex-start; /* text + icon */
  }
}

/* Prevent search and mode icons from overlapping */
nav .navbar {
  display: flex;
  align-items: center;
  justify-content: space-between; /* ensures space between left and right sections */
  flex-wrap: nowrap; /* prevent wrapping */
  gap: 10px; /* optional spacing between items */
}

.navbar .search-box {
  flex-shrink: 0; /* prevent shrinking */
}

#mode-icon {
  flex-shrink: 0; /* prevent shrinking */
  margin-left: 10px; /* keep a small gap from search icon */
}

/* Right-side icons container */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 10px;        /* spacing between search and mode icon */
  flex-shrink: 0;   /* prevent shrinking */
}

.navbar .search-box,
#mode-icon {
  flex-shrink: 0;   /* prevent icons from shrinking */
}

