/* ==========================================================================
   HEADER / NAV WIDGET
   Markup lives once in components/header.html and is injected by
   js/header.js, so this is the only place its look is ever defined.
   ========================================================================== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: var(--header-height);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: rgba(0, 0, 0, 0.564);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  flex-shrink: 0;
  z-index: 1001; /* Keep brand above open menu overlay if needed */
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name strong {
  color: var(--text-inverse);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.brand-name span {
  color: var(--text-inverse-muted);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* Hamburger Toggle Button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.hamburger-bar {
  height: 2px;
  width: 100%;
  background-color: var(--text-inverse, #ffffff);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger Animation when menu is open */
.nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Pill navigation (Desktop) */
nav {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px;
  border-radius: var(--radius-pill);
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
}

nav::-webkit-scrollbar {
  display: none;
}

nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

nav a.active {
  background: #ffffff;
  color: var(--dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  font-weight: 600;
}

/* Mobile Breakpoint Adjustment */
@media (max-width: 900px) {
  header {
    padding: 1rem 1.25rem;
    position: relative;
  }

  .nav-toggle {
    display: flex; /* Show Hamburger on Mobile */
  }

  nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 1rem;
    gap: 0.5rem;
    
    /* Toggle state styling */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  }

  nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  nav a {
    width: 100%;
    text-align: left;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md, 8px);
  }

  nav a.active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    box-shadow: none;
  }
}

/* ==========================================================================
   FOOTER WIDGET
   Markup lives once in components/footer.html and is injected by
   js/footer.js.
   ========================================================================== */
footer {
  margin-top: auto;
  background: rgba(0, 0, 0, 0.288);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2.5rem;
}

.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1rem;
  font-weight: 700;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
  text-decoration: none;
}

.footer-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.footer-brand strong {
  color: var(--text-inverse);
  font-size: 1.05rem;
  font-weight: 700;
}

.footer-col p {
  color: var(--text-inverse-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 32ch;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-inverse-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text-inverse);
}

.footer-contact {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-inverse-muted);
}

.footer-contact a {
  color: var(--text-inverse-muted);
  text-decoration: none;
}

.footer-contact a:hover {
  color: var(--text-inverse);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--content-width);
  margin: 0 auto;
  flex-wrap: wrap;
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.8rem;
}

.footer-social {
  display: flex;
  gap: 0.6rem;
}

.footer-social a {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer-social a:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.footer-social svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

@media (max-width: 760px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem 1.5rem 1.5rem;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }
}