/* ==========================================================================
   Header & Footer Redesign — OneSun Capital
   Design spec: Figma feature/3-header-footer
   ========================================================================== */

/* ── Google Fonts (fallback import — also added as <link> in HTML) ── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 20px 20px 0;
  pointer-events: none; /* let clicks pass through the wrapper gap */
}

/* ── Pill container ── */
.site-header__inner {
  pointer-events: all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 1400px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 40px;
  border: 1.5px solid transparent;
  background-clip: padding-box;
  box-shadow:
    0 4px 24px rgba(31, 44, 66, 0.10),
    0 1px 4px rgba(31, 44, 66, 0.06),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.70);
  /* Gradient border via outline trick */
  outline: 1.5px solid rgba(200, 220, 255, 0.40);
  outline-offset: -1.5px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* ── Logo ── */
.site-header__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-header__logo img {
  height: 36px;
  width: auto;
  display: block;
}

/* ── Nav links (desktop) ── */
.site-header__nav {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}

.site-header__nav li {
  position: relative;
}

.site-header__nav a {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  color: var(--color-secondary);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.site-header__nav a:hover {
  color: var(--color-primary);
  background: rgba(31, 44, 66, 0.06);
}

/* Active link: plain text, no pill highlight — issue #19 */
.site-header__nav a.active {
  color: var(--color-primary);
  background: transparent;
  font-weight: var(--weight-medium);
}

/* Dropdown toggle chevron */
.site-header__nav .nav-dropdown-toggle {
  cursor: pointer;
}

.site-header__nav .nav-dropdown-toggle .nav-chevron {
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease;
}

/* #32 — hide circular SVG badge; use CSS chevron instead */
.site-header__nav .nav-dropdown-toggle .nav-chevron img {
  display: none;
}

.site-header__nav .nav-dropdown-toggle .nav-chevron::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--color-primary);
  border-bottom: 1.5px solid var(--color-primary);
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.site-header__nav li:hover .nav-dropdown-toggle .nav-chevron::after,
.site-header__nav li.dropdown-open .nav-dropdown-toggle .nav-chevron::after {
  opacity: 1;
}

/* ── Dropdown menu ── */
.site-header__nav .nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 160px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1.5px solid rgba(200, 220, 255, 0.50);
  box-shadow: 0 8px 32px rgba(31, 44, 66, 0.12);
  padding: 8px;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  transform: translateX(-50%) translateY(-4px);
}

/* Open state (hover desktop / class on mobile) */
.site-header__nav li:hover > .nav-dropdown,
.site-header__nav li.dropdown-open > .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

/* Flip chevron when dropdown open */
.site-header__nav li:hover > a .nav-chevron,
.site-header__nav li.dropdown-open > a .nav-chevron {
  transform: rotate(180deg);
}

.site-header__nav .nav-dropdown a {
  display: block;
  padding: 8px 14px;
  border-radius: 12px;
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  color: var(--color-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.site-header__nav .nav-dropdown a:hover {
  color: var(--color-primary);
  background: rgba(31, 44, 66, 0.06);
}

/* ── CTA text link — issue #19: plain link with arrow, no filled button ── */
.site-header__cta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  background: transparent;
  color: var(--color-primary) !important;
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  border-radius: 0;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s ease, gap 0.2s ease;
}

.site-header__cta:hover {
  color: var(--color-accent) !important;
  gap: 10px;
}

.site-header__cta img {
  width: 16px;
  height: 16px;
  filter: none;
  opacity: 0.8;
  transition: transform 0.2s ease;
}

.site-header__cta:hover img {
  transform: translateX(3px);
  opacity: 1;
}

/* ── Hamburger (mobile only) ── */
.site-header__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 10px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.site-header__hamburger:hover {
  background: rgba(31, 44, 66, 0.08);
}

.site-header__hamburger img {
  width: 24px;
  height: 24px;
  display: block;
}

/* ── Mobile drawer ── */
.site-header__mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-direction: column;
  padding: 100px 24px 40px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.site-header__mobile-nav.is-open {
  display: flex;
  transform: translateX(0);
}

.site-header__mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-header__mobile-nav a {
  font-family: var(--font-primary);
  font-size: 18px;
  font-weight: var(--weight-regular);
  color: var(--color-secondary);
  text-decoration: none;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.2s ease, background 0.2s ease;
}

.site-header__mobile-nav a:hover,
.site-header__mobile-nav a.active {
  color: var(--color-primary);
  background: rgba(31, 44, 66, 0.05);
}

/* Mobile sub-list */
.site-header__mobile-nav .mobile-sub {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: 16px;
  padding-top: 4px;
}

.site-header__mobile-nav .mobile-sub.is-open {
  display: flex;
}

.site-header__mobile-nav .mobile-sub a {
  font-size: 16px;
  padding: 10px 14px;
}

.site-header__mobile-nav .mobile-cta {
  margin-top: 24px;
}

.site-header__mobile-nav .mobile-cta a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-primary);
  color: var(--color-white) !important;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: var(--weight-regular);
  padding: 14px 24px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.site-header__mobile-nav .mobile-cta a:hover {
  background: #2d3f5c;
}

.site-header__mobile-nav .mobile-cta a img {
  width: 16px;
  height: 16px;
  filter: invert(1);
}

/* ── Responsive breakpoint ── */
@media (max-width: 430px) {
  .site-header {
    padding: 12px 12px 0;
  }

  .site-header__inner {
    padding: 10px 16px;
    border-radius: 28px;
  }

  /* Hide desktop nav & CTA */
  .site-header__nav,
  .site-header__cta {
    display: none;
  }

  /* Show hamburger */
  .site-header__hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Tablet — shrink gaps slightly */
@media (min-width: 431px) and (max-width: 900px) {
  .site-header__nav a {
    padding: 8px 10px;
    font-size: 14px;
  }

  .site-header__cta {
    padding: 9px 16px;
    font-size: 14px;
  }
}

/* ── Body offset so content starts below fixed header ── */
body {
  padding-top: 96px;
}

@media (max-width: 430px) {
  body {
    padding-top: 80px;
  }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
  background: var(--color-white);
  border-top: 1px solid rgba(94, 111, 141, 0.12);
  padding: 64px 20px 0;
  font-family: var(--font-primary);
}

.site-footer__inner {
  max-width: 1400px;
  margin: 0 auto;
}

/* ── 4-column grid ── */
.site-footer__columns {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
  padding-bottom: 48px;
}

/* Column 1 — brand */
.site-footer__brand .footer-logo {
  display: inline-flex;
  margin-bottom: 20px;
}

.site-footer__brand .footer-logo img {
  height: 36px;
  width: auto;
}

.site-footer__brand p {
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  color: var(--color-secondary);
  line-height: 1.7;
  max-width: 280px;
}

/* Column headings */
.site-footer__col-title {
  font-family: var(--font-primary);
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  color: var(--color-primary);
  margin-bottom: 20px;
}

/* Links */
.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__links a {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  color: var(--color-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-block;
}

.site-footer__links a:hover {
  color: var(--color-primary);
}

/* Address column */
.site-footer__address {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  color: var(--color-secondary);
  line-height: 1.8;
}

/* Social icons */
.site-footer__social {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.site-footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(94, 111, 141, 0.25);
  color: var(--color-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: var(--weight-medium);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.site-footer__social a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(103, 95, 143, 0.06);
}

/* ── Bottom bar ── */
.site-footer__bottom {
  border-top: 1px solid rgba(94, 111, 141, 0.15);
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer__legal {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-footer__legal a {
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  color: var(--color-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer__legal a:hover {
  color: var(--color-primary);
}

.site-footer__legal .sep {
  color: var(--color-secondary);
  opacity: 0.5;
  font-size: var(--text-sm);
}

.site-footer__copyright {
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  color: var(--color-secondary);
}

/* ── Mobile: stack columns ── */
@media (max-width: 430px) {
  .site-footer {
    padding: 48px 16px 0;
  }

  .site-footer__columns {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-bottom: 36px;
  }

  .site-footer__brand p {
    max-width: 100%;
  }

  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 0;
  }
}

/* Tablet */
@media (min-width: 431px) and (max-width: 900px) {
  .site-footer__columns {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }
}
