/**
 * Global Diaspora Connect (GDC) Layout Components
 * Header, Sticky Navigation, Mobile Drawer, Sticky Mobile Bar & Footer
 */

/* ==========================================================================
   1. SITE HEADER & NAVIGATION
   ========================================================================== */

.gdc-site-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--gdc-white);
  border-bottom: 1px solid var(--gdc-line);
  transition: all var(--gdc-transition-normal);
}

.gdc-site-header.is-scrolled {
  box-shadow: 0 4px 20px rgba(10, 31, 68, 0.08);
  border-bottom-color: transparent;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
}

.gdc-header-inner {
  max-width: var(--gdc-container-max);
  margin: 0 auto;
  padding: 0.75rem var(--gdc-container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Brand Logo */
.gdc-header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.gdc-brand-emblem {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gdc-navy-700), var(--gdc-blue-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gdc-gold-500);
  box-shadow: var(--gdc-shadow-sm);
}

.gdc-brand-text {
  display: flex;
  flex-direction: column;
}

.gdc-brand-name {
  font-family: var(--gdc-font-heading);
  font-size: 1.125rem;
  font-weight: var(--gdc-weight-bold);
  color: var(--gdc-navy-700);
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.gdc-brand-tagline {
  font-family: var(--gdc-font-body);
  font-size: 0.625rem;
  font-weight: var(--gdc-weight-semibold);
  color: var(--gdc-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Primary Navigation Menu */
.gdc-primary-nav {
  display: none;
}

@media (min-width: 1024px) {
  .gdc-primary-nav {
    display: flex;
    align-items: center;
  }
}

.gdc-primary-nav ul {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.25rem;
}

.gdc-primary-nav .menu-item {
  position: relative;
}

.gdc-primary-nav .menu-item a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0;
  font-family: var(--gdc-font-body);
  font-size: calc(var(--gdc-text-sm) * 1.15);
  font-weight: var(--gdc-weight-medium);
  color: var(--gdc-navy-700);
  text-decoration: none;
  position: relative;
  transition: color var(--gdc-transition-fast);
}

.gdc-primary-nav .menu-item a:hover {
  color: var(--gdc-blue-600);
}

/* Active State: Gold Underline per Mockup */
.gdc-primary-nav .menu-item.current-menu-item > a,
.gdc-primary-nav .menu-item.current-page-ancestor > a {
  color: var(--gdc-navy-900);
  font-weight: var(--gdc-weight-semibold);
}

.gdc-primary-nav .menu-item.current-menu-item > a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--gdc-gold-500);
  border-radius: var(--gdc-radius-pill);
}

/* Dropdown / Submenu */
.gdc-primary-nav .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background-color: var(--gdc-white);
  border: 1px solid var(--gdc-line);
  border-radius: var(--gdc-radius-md);
  box-shadow: var(--gdc-shadow-lg);
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--gdc-transition-normal);
  z-index: 100;
}

.gdc-primary-nav .menu-item-has-children:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.gdc-primary-nav .sub-menu .menu-item a {
  padding: 0.6rem 1.25rem;
  width: 100%;
  font-size: 0.85rem;
}

.gdc-primary-nav .sub-menu .menu-item a:hover {
  background-color: var(--gdc-surface);
}

/* Header Utilities */
.gdc-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.gdc-search-toggle {
  background: none;
  border: none;
  color: var(--gdc-navy-700);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--gdc-transition-fast);
}

.gdc-search-toggle:hover {
  background-color: var(--gdc-surface);
}

.gdc-mobile-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--gdc-line);
  border-radius: var(--gdc-radius-md);
  cursor: pointer;
  padding: 8px;
}

@media (min-width: 1024px) {
  .gdc-mobile-toggle {
    display: none;
  }
}

.gdc-mobile-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--gdc-navy-700);
  border-radius: 2px;
}

/* ==========================================================================
   2. MOBILE OFF-CANVAS DRAWER
   ========================================================================== */

.gdc-drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(10, 31, 68, 0.6);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: all var(--gdc-transition-normal);
  backdrop-filter: blur(4px);
}

.gdc-drawer-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.gdc-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background-color: var(--gdc-white);
  z-index: 1100;
  box-shadow: -4px 0 24px rgba(10, 31, 68, 0.15);
  transform: translateX(100%);
  transition: transform var(--gdc-transition-normal);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  overflow-y: auto;
}

.gdc-mobile-drawer.is-open {
  transform: translateX(0);
}

.gdc-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gdc-line);
  margin-bottom: 1.5rem;
}

.gdc-drawer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gdc-navy-700);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.gdc-mobile-menu {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
}

.gdc-mobile-menu .menu-item {
  border-bottom: 1px solid var(--gdc-surface-2);
}

.gdc-mobile-menu .menu-item a {
  display: block;
  padding: 0.85rem 0;
  color: var(--gdc-navy-900);
  font-weight: var(--gdc-weight-medium);
  text-decoration: none;
}

.gdc-mobile-drawer-ctas {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ==========================================================================
   3. MOBILE PERSISTENT BOTTOM BAR
   ========================================================================== */

.gdc-mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--gdc-white);
  border-top: 1px solid var(--gdc-line);
  box-shadow: 0 -4px 16px rgba(10, 31, 68, 0.08);
  padding: 0.75rem var(--gdc-container-pad);
  z-index: 990;
  display: flex;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .gdc-mobile-bottom-bar {
    display: none;
  }
}

.gdc-mobile-bottom-bar .gdc-btn {
  flex: 1;
  padding: 0.65rem 0.5rem;
  font-size: 0.8125rem;
}

/* ==========================================================================
   4. SITE FOOTER
   ========================================================================== */

.gdc-site-footer {
  background-color: var(--gdc-navy-900);
  color: var(--gdc-white);
  margin-top: auto;
  border-top: 4px solid var(--gdc-gold-500);
}

.gdc-footer-main {
  max-width: var(--gdc-container-max);
  margin: 0 auto;
  padding: 4rem var(--gdc-container-pad) 3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .gdc-footer-main {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .gdc-footer-main {
    grid-template-columns: 1.5fr 1fr 1fr 1.25fr;
  }
}

.gdc-footer-col h4 {
  color: var(--gdc-white);
  font-size: 1.125rem;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.gdc-footer-col h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background-color: var(--gdc-gold-500);
}

.gdc-footer-col p {
  color: #B5C4DB;
  font-size: 0.875rem;
  line-height: 1.6;
}

.gdc-footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.gdc-footer-nav li {
  margin-bottom: 0.65rem;
}

.gdc-footer-nav a {
  color: #B5C4DB;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--gdc-transition-fast);
}

.gdc-footer-nav a:hover {
  color: var(--gdc-gold-500);
  padding-left: 4px;
}

/* Social Icon Cluster */
.gdc-footer-social {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.gdc-social-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gdc-white);
  transition: all var(--gdc-transition-fast);
  text-decoration: none;
}

.gdc-social-icon:hover {
  background-color: var(--gdc-gold-500);
  color: var(--gdc-navy-900);
  border-color: var(--gdc-gold-500);
  transform: translateY(-2px);
}

/* Bottom Bar / Legal */
.gdc-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem var(--gdc-container-pad);
  background-color: #071633;
}

.gdc-footer-bottom-inner {
  max-width: var(--gdc-container-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8125rem;
  color: #8A9BB3;
  text-align: center;
}

@media (min-width: 768px) {
  .gdc-footer-bottom-inner {
    flex-direction: row;
    text-align: left;
  }
}

.gdc-footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gdc-footer-legal-links a {
  color: #8A9BB3;
  text-decoration: none;
}

.gdc-footer-legal-links a:hover {
  color: var(--gdc-gold-500);
}

/* Compact footer and single-row masthead from the approved mockup */
.gdc-header-inner {
  max-width: 1440px;
  min-height: 68px;
  padding: 0.45rem clamp(0.75rem, 2vw, 1.75rem);
  gap: 1rem;
}

.gdc-header-brand {
  gap: 0.45rem;
  --brand-flush-offset: max(
    calc(min(1440px, 100vw) / 2 - 620px - clamp(12px, 2vw, 28px)),
    calc(clamp(16px, 3vw, 32px) - clamp(12px, 2vw, 28px))
  );
  margin-left: var(--brand-flush-offset);
  margin-right: calc(-1 * var(--brand-flush-offset));
}

.gdc-header-brand .gdc-site-logo {
  width: auto;
  max-width: 256px;
  max-height: 60px;
  object-fit: contain;
}

.gdc-brand-emblem {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: var(--gdc-gold-500);
  background: var(--gdc-navy-900);
}

.gdc-brand-name {
  font-size: 0.95rem;
  letter-spacing: 0;
}

.gdc-brand-tagline {
  font-size: 0.48rem;
  letter-spacing: 0.04em;
}

@media (min-width: 1024px) {
  .gdc-primary-nav ul {
    gap: clamp(0.45rem, 0.9vw, 0.9rem);
  }

  .gdc-primary-nav .menu-item a {
    font-size: 0.805rem;
    white-space: nowrap;
  }

  .gdc-header-actions {
    gap: 0.25rem;
  }
}

.gdc-footer-main {
  max-width: 1440px;
  min-height: 58px;
  padding: 0.55rem clamp(0.75rem, 2vw, 1.75rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.gdc-footer-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  color: var(--gdc-white);
  text-decoration: none;
}

.gdc-footer-brand .gdc-brand-emblem {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
}

.gdc-footer-brand .gdc-brand-name {
  color: var(--gdc-white);
  font-size: 0.72rem;
}

.gdc-footer-brand .gdc-brand-tagline {
  color: var(--gdc-gold-500);
  font-size: 0.4rem;
}

.gdc-footer-brand .gdc-site-logo {
  width: auto;
  max-width: 180px;
  max-height: 38px;
  object-fit: contain;
  padding: 3px 0;
  border-radius: 2px;
  background: transparent;
}

.gdc-footer-nav-wrap {
  min-width: 0;
}

.gdc-footer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem clamp(0.5rem, 1vw, 1rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gdc-footer-nav li {
  margin: 0;
}

.gdc-footer-nav a {
  color: #d8e1ed;
  font-size: 0.62rem;
  text-decoration: none;
  white-space: nowrap;
}

.gdc-footer-nav a:hover,
.gdc-footer-legal-links a:hover {
  color: var(--gdc-gold-500);
}

.gdc-footer-social {
  gap: 0.35rem;
  margin: 0;
  flex: 0 0 auto;
}

.gdc-social-icon {
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 2px;
  background: transparent;
}

.gdc-social-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.gdc-footer-bottom {
  padding: 0.45rem clamp(0.75rem, 2vw, 1.75rem);
  background: #071633;
}

.gdc-footer-bottom-inner {
  max-width: 1440px;
  flex-direction: row;
  text-align: left;
  gap: 0.75rem;
  font-size: 0.58rem;
}

.gdc-footer-legal-links {
  gap: 0.8rem;
}

.gdc-footer-legal-links a {
  font-size: 0.58rem;
}

@media (max-width: 767px) {
  .gdc-header-inner {
    min-height: 60px;
  }

  .gdc-header-brand .gdc-brand-tagline {
    max-width: 175px;
    line-height: 1.3;
  }

  .gdc-footer-main {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1rem;
    padding-block: 0.85rem;
  }

  .gdc-footer-brand {
    flex: 1 1 100%;
    justify-content: center;
  }

  .gdc-footer-nav {
    gap: 0.4rem 0.75rem;
  }

  .gdc-footer-bottom-inner {
    flex-direction: column;
    text-align: center;
  }
}
