/* ========================================
   100xGood Design System — Layout
   Updated: April 2026
   ======================================== */

/* ===================
   CONTAINERS
   =================== */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
}

.container-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
}

.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
}

/* ===================
   SCROLL PROGRESS
   =================== */

.scroll-progress {
  position: fixed;
  right: 0;
  top: 0;
  width: 3px;
  height: 100vh;
  background: var(--border);
  z-index: 1000;
}

.scroll-progress-fill {
  width: 100%;
  background: var(--amethyst);
  transition: height 0.1s linear;
  height: 0%;
}

/* ===================
   NAVIGATION
   =================== */

.nav-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  transition: background-color var(--transition-slow), backdrop-filter var(--transition-slow);
}

.nav-wrapper.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .nav-wrapper { background: var(--obsidian); }

[data-theme="dark"] .nav-wrapper.scrolled {
  background: rgba(20, 20, 28, 0.85);
  border-bottom: 1px solid var(--border-dark);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  padding: var(--space-4) 0;
  width: 100%;
}

.nav-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-logo {
  font-family: var(--font-display-sans);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--eggplant);
}

.nav-logo:hover { color: var(--eggplant); }

[data-theme="dark"] .nav-logo { color: var(--rose-quartz); }
[data-theme="dark"] .nav-logo:hover { color: var(--rose-quartz); }

.nav-link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-default);
  padding: var(--space-1) 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--jade);
  transition: width 0.2s ease;
}

.nav-link:hover { color: var(--violet-topaz); }
.nav-link:hover::after { width: 100%; background: var(--amethyst); }

/* Dropdown */
.nav-dropdown { position: relative; }

.nav-link-dropdown {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-chevron {
  font-size: 0.7rem;
  opacity: 0.6;
  transition: transform var(--transition-base);
}

.nav-dropdown:hover .nav-chevron { transform: rotate(180deg); }

/* Mega Menu */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  min-width: 480px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 200;
  box-shadow: var(--shadow-lg);
}

.mega-menu-small { min-width: 280px; }

.nav-dropdown:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.mega-menu-inner {
  display: flex;
  gap: var(--space-8);
}

.mega-menu-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mega-menu-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.mega-menu-item:hover { background: var(--bg-subtle); }

/*
   Mega menu icon — accepts inline SVG at 20x20.
   Replace Unicode characters (◈ ◇ ⬡ ▣ ◎ ●) with SVG shapes from ICON_SYSTEM.md.
   Sector colors are auto-applied via [data-sector] attribute on .mega-menu-item.
*/
.mega-menu-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  color: var(--amethyst);
}

.mega-menu-icon svg {
  width: 100%;
  height: 100%;
}

/* Sector-specific icon colors (set via data-sector attribute on .mega-menu-item) */
.mega-menu-item[data-sector="climate"] .mega-menu-icon { color: var(--jade); }
.mega-menu-item[data-sector="health"] .mega-menu-icon { color: var(--rose-quartz-deep); }
.mega-menu-item[data-sector="equity"] .mega-menu-icon { color: var(--citrine); }
.mega-menu-item[data-sector="govtech"] .mega-menu-icon { color: var(--violet-topaz); }
.mega-menu-item[data-sector="nonprofit"] .mega-menu-icon { color: var(--amethyst); }

.mega-menu-title {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-heading);
  margin-bottom: var(--space-1);
}

.mega-menu-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Mobile menu toggle */
.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}

.nav-mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-heading);
  margin: 5px 0;
  transition: all var(--transition-slow);
}

@media (max-width: 768px) {
  .nav-left, .nav-right { display: none; }
  .nav-mobile-toggle { display: block; }
}

/* Mobile Menu Overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg-page);
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: var(--space-8);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
}

.mobile-menu.open { transform: translateX(0); }

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-12);
}

.mobile-menu-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-heading);
  cursor: pointer;
}

.mobile-menu-links { list-style: none; }

.mobile-menu-links li { margin-bottom: var(--space-6); }

.mobile-menu-links a {
  font-family: var(--font-display-sans);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--text-heading);
}

.mobile-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  font-family: var(--font-display-sans);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--text-heading);
  cursor: pointer;
  padding: 0;
}

.mobile-dropdown-toggle .chevron {
  font-size: 0.8rem;
  transition: transform var(--transition-base);
}

.mobile-dropdown-toggle.open .chevron { transform: rotate(180deg); }

.mobile-dropdown-items {
  display: none;
  padding-left: var(--space-4);
  padding-top: var(--space-3);
}

.mobile-dropdown-items.open { display: block; }

.mobile-dropdown-items a {
  display: block;
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--text-muted);
  padding: var(--space-2) 0;
}

.mobile-dropdown-items a:hover { color: var(--violet-topaz); }

.mobile-dropdown-items .sub-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--cement);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-3);
  margin-bottom: var(--space-2);
}

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

.footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  padding: var(--section-padding-sm) 0 var(--space-8);
}

[data-theme="dark"] .footer {
  background: #0F0F15;
  border-top-color: var(--border-dark);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-brand { grid-column: span 3; margin-bottom: var(--space-4); }
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
  .footer-brand { grid-column: span 2; }
}

.footer-brand { max-width: 280px; }

/* Gradient footer logo (matches brand identity) */
.footer-logo {
  font-family: var(--font-display-sans);
  font-weight: 800;
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
  display: block;
  background: linear-gradient(135deg, var(--eggplant) 0%, var(--amethyst) 50%, var(--rose-quartz) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .footer-logo {
  background: linear-gradient(135deg, var(--white) 0%, var(--rose-quartz) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-tagline {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-location {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-4);
  font-family: var(--font-ui);
}

.footer-column h4 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer-links { list-style: none; }

.footer-links li { margin-bottom: var(--space-2); }

.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-default);
  position: relative;
  transition: color 0.2s ease;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--jade);
  transition: width 0.2s ease;
}

.footer-links a:hover { color: var(--jade); }
.footer-links a:hover::after { width: 100%; }

/* Footer newsletter */
.footer-newsletter-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

.footer-newsletter-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-newsletter-input {
  padding: 0.6rem 0.75rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-default);
}

.footer-newsletter-input:focus {
  outline: none;
  border-color: var(--amethyst);
}

.footer-newsletter-btn {
  padding: 0.6rem 1rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.footer-newsletter-btn:hover { opacity: 0.85; }

/* Newsletter form feedback states */
.footer-newsletter-feedback {
  margin-top: var(--space-2);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  display: none;
}

.footer-newsletter-feedback.success {
  display: block;
  color: var(--jade);
}

.footer-newsletter-feedback.error {
  display: block;
  color: #c0665e;
}

.footer-newsletter-feedback.loading {
  display: block;
  color: var(--text-muted);
}

/* Footer bottom */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: var(--space-4);
}

[data-theme="dark"] .footer-bottom { border-top-color: var(--border-dark); }

.footer-copyright {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.footer-legal {
  display: flex;
  gap: var(--space-6);
}

.footer-legal a {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.footer-social {
  display: flex;
  gap: var(--space-6);
}

.footer-social a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-social a:hover { color: var(--text-heading); }
