/* ============================================================
   National Youth Platform Chad — Layout (Header, Footer, Nav)
   ============================================================ */
@import url('preloader.css');

/* ── Site Header ───────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--duration-normal), box-shadow var(--duration-normal);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--space-6);
}

/* Brand */
.site-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.site-brand:hover {
  opacity: 0.9;
}

.site-brand--logo-only {
  padding: var(--space-1) 0;
}

.site-brand-logo-img {
  display: block;
  width: auto;
  height: 52px;
  max-width: min(180px, 42vw);
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 2px 6px rgba(0, 38, 100, 0.12));
  transition: transform var(--duration-fast), opacity var(--duration-fast);
}

[dir='rtl'] .site-brand-logo-img {
  object-position: right center;
}

.site-brand--logo-only:hover .site-brand-logo-img {
  transform: scale(1.03);
  opacity: 0.92;
}

.site-brand-logo-img--footer {
  height: 56px;
  max-width: 200px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.footer-brand-logo {
  display: inline-block;
  text-decoration: none;
}

.site-brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--chad-blue) 0%, var(--navy) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--chad-yellow);
  font-size: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.site-brand-logo:has(.site-brand-logo-img),
.site-brand-logo img {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.site-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.site-brand-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--text-primary);
}

.site-brand-subtitle {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

@media (max-width: 575.98px) {
  .site-brand-logo-img {
    height: 44px;
    max-width: 140px;
  }

  .site-brand-text {
    display: none;
  }
}

/* Main navigation */
.site-nav {
  display: none;
  align-items: center;
  gap: var(--space-1);
}

@media (min-width: 992px) {
  .site-nav {
    display: flex;
  }
}

.nav-link-nyp {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.nav-link-nyp:hover,
.nav-link-nyp.active {
  color: var(--chad-blue);
  background: rgba(0, 38, 100, 0.06);
}

[data-theme='dark'] .nav-link-nyp:hover,
[data-theme='dark'] .nav-link-nyp.active {
  background: rgba(254, 203, 0, 0.08);
  color: var(--chad-yellow);
}

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

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  min-width: 220px;
  padding: var(--space-2);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--duration-normal) var(--ease-out);
  z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: background var(--duration-fast);
}

.nav-dropdown-item:hover {
  background: var(--bg-muted);
  color: var(--chad-blue);
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.theme-toggle:hover {
  border-color: var(--chad-blue);
  color: var(--chad-blue);
}

/* Language switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
}

.lang-switch-btn {
  min-width: 2.25rem;
  padding: 0.35rem 0.5rem;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 700;
  font-family: var(--font-en);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.lang-switch-btn:hover {
  color: var(--chad-blue);
}

.lang-switch-btn.active {
  background: var(--chad-blue);
  color: var(--white);
}

.auth-topbar .lang-switch {
  flex-shrink: 0;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme='dark'] .theme-toggle .icon-sun { display: block; }
[data-theme='dark'] .theme-toggle .icon-moon { display: none; }

.header-actions .btn-nyp {
  display: none;
}

@media (min-width: 768px) {
  .header-actions .btn-nyp-register {
    display: inline-flex;
  }
}

@media (min-width: 992px) {
  .header-actions .btn-nyp-login {
    display: inline-flex;
  }
}

/* Mobile menu toggle */
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
}

@media (min-width: 992px) {
  .menu-toggle {
    display: none;
  }
}

/* Offcanvas mobile nav */
.offcanvas-nyp {
  position: fixed;
  inset: 0;
  z-index: 1045;
  visibility: hidden;
  pointer-events: none;
}

.offcanvas-nyp.show {
  visibility: visible;
  pointer-events: auto;
}

.offcanvas-nyp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 40, 0.5);
  opacity: 0;
  transition: opacity var(--duration-normal);
}

.offcanvas-nyp.show .offcanvas-nyp-backdrop {
  opacity: 1;
}

.offcanvas-nyp-panel {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  width: min(320px, 85vw);
  height: 100%;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xl);
  transform: translateX(100%);
  transition: transform var(--duration-normal) var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

[dir='rtl'] .offcanvas-nyp-panel {
  transform: translateX(-100%);
}

.offcanvas-nyp.show .offcanvas-nyp-panel {
  transform: translateX(0);
}

.offcanvas-nyp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-color);
}

.offcanvas-nyp-body {
  padding: var(--space-4);
  flex: 1;
}

.offcanvas-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: background var(--duration-fast);
}

.offcanvas-nav-link:hover,
.offcanvas-nav-link.active {
  background: var(--bg-muted);
  color: var(--chad-blue);
}

.offcanvas-nyp-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ── Site Footer ───────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.85);
  margin-top: auto;
}

.site-footer .flag-bar {
  margin-bottom: 0;
}

.footer-main {
  padding: var(--space-16) 0 var(--space-10);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
}

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

@media (min-width: 992px) {
  .footer-grid {
    grid-template-columns: 1.4fr repeat(4, 1fr);
  }
}

.footer-brand .site-brand-logo {
  margin-bottom: var(--space-4);
}

.footer-brand p {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: rgba(255, 255, 255, 0.65);
  max-width: 280px;
}

.footer-social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  transition: all var(--duration-fast);
}

.footer-social a:hover {
  background: var(--chad-yellow);
  color: var(--navy);
  transform: translateY(-2px);
}

.footer-col h6 {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--chad-yellow);
  margin-bottom: var(--space-5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

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

.footer-links a {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color var(--duration-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.footer-links a:hover {
  color: var(--chad-yellow);
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--space-4);
}

.footer-contact-item i {
  color: var(--chad-yellow);
  margin-top: 2px;
  flex-shrink: 0;
}

.footer-bottom {
  padding: var(--space-5) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.5);
}

@media (min-width: 768px) {
  .footer-bottom-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: start;
  }
}

.footer-partners-mini {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
}

.footer-partners-mini span {
  font-size: var(--text-xs);
  opacity: 0.6;
}

/* ── Page layout helpers ───────────────────────────────────── */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-hero-mini {
  background: linear-gradient(135deg, var(--chad-blue) 0%, var(--navy) 100%);
  color: var(--white);
  padding: var(--space-12) 0 var(--space-10);
  position: relative;
  overflow: hidden;
}

.page-hero-mini::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.page-hero-mini .nyp-container {
  position: relative;
  z-index: 1;
}

/* Showcase specific */
.showcase-nav {
  position: sticky;
  top: calc(var(--header-height) + 8px);
  z-index: 100;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  margin-bottom: var(--space-8);
}

.showcase-nav a {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  text-decoration: none;
}

.showcase-nav a:hover,
.showcase-nav a.active {
  background: rgba(0, 38, 100, 0.08);
  color: var(--chad-blue);
}

.showcase-block {
  margin-bottom: var(--space-16);
  padding-bottom: var(--space-16);
  border-bottom: 1px solid var(--border-color);
}

.showcase-block:last-child {
  border-bottom: none;
}

.color-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-4);
}

.color-swatch {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.color-swatch-preview {
  height: 80px;
}

.color-swatch-info {
  padding: var(--space-3);
  background: var(--bg-surface);
  font-size: var(--text-xs);
}

.color-swatch-info strong {
  display: block;
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.typo-sample {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  background: var(--bg-surface);
}

.component-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}
