/* ======================================================= */
/* ==================== CSS STYLES ======================= */
/* ======================================================= */

/* --- Variables and Base Styles --- */
:root {
  --color-blue-600: #2563eb;
  --color-gray-100: #f3f4f6;
  --color-gray-700: #374151;
  --color-black: #000;
  --color-white: #fff;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: #f9fafb; /* A light background to see the header shadow */
}

/* --- Header & Navbar Layout --- */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  background-color: var(--color-white);
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  transition: transform 0.3s ease-in-out;
}

.header-hidden {
  transform: translateY(-100%);
}

.container {
  /* width:  */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@media (min-width: 1024px) {
  .container {
    max-width: 1280px; /* lg:px-18 equivalent */
    padding-left: 4.5rem;
    padding-right: 4.5rem;
  }
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 5rem; /* h-20 */
}

/* --- Logo and Extra Info --- */
.logo-link {
  text-decoration: none;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.logo img {
  width: 4rem; /* w-20 */
  height: 4rem; /* h-20 */
  border-radius: 9999px; /* rounded-full */
}

.header-extra {
  display: none; /* hidden */
}
@media (min-width: 768px) {
  /* md:flex */
  .header-extra {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-gray-700);
  }
}

.esc-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  cursor: pointer;
}
.esc-member img {
  width: 3rem; /* w-12 */
  height: 3rem; /* h-12 */
  border-radius: 9999px;
}
.esc-member span {
  font-size: 0.75rem; /* text-xs */
  font-weight: 600; /* font-semibold */
}

/* --- Desktop Navigation --- */
.nav-desktop {
  display: none; /* hidden */
}
@media (min-width: 768px) {
  /* md:flex */
  .nav-desktop {
    display: flex;
    align-items: center;
    gap: 2.5rem; /* space-x-10 */
  }
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-black);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.nav-link:hover {
  color: var(--color-blue-600);
}

/* Active state for links */
.nav-link.active,
.nav-link.parent-active {
  color: var(--color-blue-600);
  font-weight: 600;
}
.nav-link.active {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Dropdown arrow rotation */
.dropdown-toggle .dropdown-arrow {
  transition: transform 0.2s ease-in-out;
}
.dropdown-toggle.open .dropdown-arrow {
  transform: rotate(180deg);
}

/* Desktop Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: .8rem;
  left: -26px;
  margin-top: 0.5rem;
  width: 12rem; /* w-48 */
  background-color: var(--color-white);
  border-radius: 0.375rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  /* padding-top: 0.25rem;
  padding-bottom: 0.25rem; */
  padding: .7rem .7rem;
  display: none;
  justify-content: center;
  align-items: start;
  gap: 0.5rem;
  flex-direction: column;
}
.dropdown-container:hover .dropdown-menu, /* Optional: show on hover */
.dropdown-toggle.open + .dropdown-menu {
  display: none;
}

.dropdown-item {
  display: flex;
  justify-content: start;
  align-items: start;
  width: 85%;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  /*text-sm*/color: var(--color-gray-700);
  text-decoration: none;
  border-radius: .5rem;
  -webkit-border-radius: .5rem;
  -moz-border-radius: .5rem;
  -ms-border-radius: .5rem;
  -o-border-radius: .5rem;
}
.dropdown-item:hover {
  background-color: var(--color-gray-100);
}
.dropdown-item.active {
  color: var(--color-blue-600);
  font-weight: 600;
}

/* --- Mobile Menu --- */
.menu-toggle {
  display: block; /* hidden on md and up */
}
.menu-toggle button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 49;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  pointer-events: none;
}
.mobile-menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: 100%;
  width: 80%; /* w-4/5 */
  max-width: 320px;
  background-color: var(--color-white);
  box-shadow: -10px 0 15px -3px rgb(0 0 0 / 0.1);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.esc-member-mobile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-gray-700);
}
.esc-member-mobile img {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
}
.esc-member-mobile span {
  font-size: 0.875rem;
  font-weight: 600;
}

#close-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-mobile {
  flex-grow: 1;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-link-mobile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 1rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  color: var(--color-black);
  font-size: 1.125rem; /* text-lg */
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.nav-link-mobile:hover {
  color: var(--color-blue-600);
  background-color: var(--color-gray-100);
}
.nav-link-mobile.active,
.nav-link-mobile.parent-active {
  color: var(--color-blue-600);
}

.nav-link-mobile-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Mobile Dropdown */
.dropdown-toggle-mobile .dropdown-arrow {
  transition: transform 0.2s ease-in-out;
}
.dropdown-toggle-mobile.open .dropdown-arrow {
  transform: rotate(90deg);
}

.dropdown-menu-mobile {
  padding-left: 2.5rem; /* pl-10 */
  padding-top: 0.5rem;
  display: none; /* Hidden by default */
  flex-direction: column;
  gap: 0.5rem;
}
.dropdown-menu-mobile.open {
  display: flex; /* Shown when open */
}

.dropdown-item-mobile {
  display: block;
  padding: 0.5rem;
  border-radius: 0.5rem;
  color: var(--color-black);
  font-size: 1rem; /* text-base */
  text-decoration: none;
}
.dropdown-item-mobile:hover {
  color: var(--color-blue-600);
}
.dropdown-item-mobile.active {
  color: var(--color-blue-600);
  font-weight: 600;
}
