* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Open Sans", sans-serif;
}

.container {
  max-width: 1200px;
  margin: auto;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  background-color: #000;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
}

.back-to-top:hover {
  background-color: #333;
  transform: scale(1.1);
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
}

/*  --- header ---- */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background-color: white;

  position: relative;
  /* z-index: 999;
            top: 0; */
  box-shadow: 0 -8px 14px 2px rgba(0, 0, 0, 0.5);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-left,
.nav-right {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
}

.nav-left a,
.nav-right a {
  text-decoration: none;
  color: #000;
  font-weight: 500;
  font-size: 14px;
}

.nav-left a:hover,
.nav-right a:hover {
  color: #548bd3;
}

/* .nav-left a.active {
  color: #548bd3;
} */

.nav-link.active {
  font-weight: 500;
  color: #548bd3;
  /* border-bottom: 2px solid #548bd3; */
}

.logo {
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 5px;
}

.logo img {
  width: 220px;
}

.search-icon {
  font-size: 18px;
  cursor: pointer;
  margin-left: 20px;
}

/*  --- header ---- */

/* Hamburger for mobile */
.hamburger {
  display: none;
  font-size: 24px;
  cursor: pointer;
}

/* Mobile Nav Panel */
.mobile-nav-panel {
  position: fixed;
  top: 0;
  left: -100%;
  width: 80%;
  max-width: 300px;
  height: 100%;
  background: #222;
  color: #fff;
  z-index: 1000;
  padding: 20px;
  transition: left 0.3s ease-in-out;
}

.mobile-nav-panel a {
  display: block;
  padding: 10px 0;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid #444;
}

.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  display: none;
}

.mobile-nav-header {
  display: flex;
  justify-content: flex-end;
}

#closeNav {
  font-size: 24px;
  cursor: pointer;
}

@media (min-width: 801px) {
  .mobile-nav-panel {
    left: -100% !important;
  }

  .mobile-nav-overlay {
    display: none !important;
  }
}

/* Responsive */
@media (max-width: 800px) {
  .desktop-nav {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .header {
    padding: 12px 16px;
  }

  .header-inner {
    justify-content: normal;
  }

  .logo {
    justify-content: center;
    width: 100%;
  }
}

/*  ---  */

/*  ----  Footer ----- */
.site-footer {
  background-color: #fff;
  padding: 40px 20px;
  border-top: 1px solid #ddd;
  margin-top: 30px;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: left;
}

.footer-left img {
  width: 220px;
  height: auto;
  cursor: pointer;
}

.footer-left .copyright {
  font-size: 13px;
  color: #999;
  text-align: center;
}

.footer-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
}

.footer-right a {
  color: #b9b9b9;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: color 0.3s ease;
}

.footer-right a:hover {
  color: #000;
}

.footer-middle {
  width: 45%;
}

.footer-article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-article {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 15px;
}

.footer-article a {
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  color: #000;
  line-height: 1.4;
  transition: color 0.3s;
}

.footer-article a:hover {
  color: #548bd3;
}

.article-category {
  width: max-content;
  background-color: #000;
  padding: 0 6px 3px;
  border-radius: 2px;
}

.article-category a {
  color: #fff;
  font-size: 12px;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-right {
    text-align: center;
    margin-top: 20px;
  }

  .footer-left,
  .footer-right {
    align-items: center;
  }

  .footer-middle {
    width: 90%;
    align-items: center;
  }

  .footer-article {
    align-items: center;
  }
}

/*  --- footer ---  */

#loader {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/*  Loader  */
.loader {
  --dim: 3rem;
  width: var(--dim);
  height: var(--dim);
  position: relative;
  animation: spin988 2s linear infinite;
}

.loader .circle {
  --color: #333;
  --dim: 1.2rem;
  width: var(--dim);
  height: var(--dim);
  background-color: var(--color);
  border-radius: 50%;
  position: absolute;
}

.loader .circle:nth-child(1) {
  top: 0;
  left: 0;
}

.loader .circle:nth-child(2) {
  top: 0;
  right: 0;
}

.loader .circle:nth-child(3) {
  bottom: 0;
  left: 0;
}

.loader .circle:nth-child(4) {
  bottom: 0;
  right: 0;
}

@keyframes spin988 {
  0% {
    transform: scale(1) rotate(0);
  }

  20%,
  25% {
    transform: scale(1.3) rotate(90deg);
  }

  45%,
  50% {
    transform: scale(1) rotate(180deg);
  }

  70%,
  75% {
    transform: scale(1.3) rotate(270deg);
  }

  95%,
  100% {
    transform: scale(1) rotate(360deg);
  }
}

.search {
  position: relative;
}

#searchIcon {
  background: transparent;
  border: none;
  cursor: pointer;
  margin-top: 4px;
  display: inline-block;
}

#searchBarContainer {
  position: absolute;
  top: 50px;
  right: 0;
  width: 320px;
  background: white;
  border-top: 3px solid #548bd3;
  box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.2);
  z-index: 1000;

  /* Animation prep */
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Active (visible) state */
#searchBarContainer.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* #searchBarContainer.visible {
  display: none;
} */

.search-bar {
  display: flex;
  align-items: center;
  /* margin-bottom: 10px; */
  padding: 20px;
  border-bottom: 1px solid #e1e1e1;
}

#searchInput {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #e1e1e1;
  height: 30px;
}

#searchInput:focus {
  outline: none;
}

#searchButton {
  background-color: #548bd3;
  color: white;
  border: none;
  padding: 8px;
  cursor: pointer;
  height: 30px;
}

.search-results {
  /* padding: 15px 20px; */
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 20px;
}

.search-result-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
}

.search-result-item-title {
  font-size: 14px;
  font-weight: bold;
  color: #333;
  text-decoration: none;
}
