/* ==========================================================================
   Office of the Governor - ǁKharas Region (kharas.se)
   Main Stylesheet (Style.css)
   ========================================================================== */

:root {
  --namibia-blue: #003580;
  --namibia-blue-dark: #002254;
  --namibia-red: #D21034;
  --namibia-green: #009543;
  --namibia-gold: #FFCE00;
  --kalahari-sand: #F7F5F0;
  --kalahari-warm: #EDE8DE;
  --slate-900: #111827;
  --slate-700: #374151;
  --slate-600: #4B5563;
  --slate-200: #E5E7EB;
  --white: #FFFFFF;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--slate-900);
  background-color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--namibia-gold);
  outline-offset: 2px;
}

/* Top Official Utility Bar */
.gov-bar {
  background-color: var(--namibia-blue-dark);
  color: var(--white);
  font-size: 0.8rem;
  padding: 0.5rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 3px solid var(--namibia-red);
}

.gov-bar-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
}

.flag-stripe {
  display: inline-flex;
  width: 20px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
  background: linear-gradient(
    135deg,
    var(--namibia-blue) 42%,
    var(--white) 42%,
    var(--white) 46%,
    var(--namibia-red) 46%,
    var(--namibia-red) 54%,
    var(--white) 54%,
    var(--white) 58%,
    var(--namibia-green) 58%
  );
}

.gov-bar-right {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.gov-bar-right a:hover {
  text-decoration: underline;
}

/* Language Switcher */
.lang-switch {
  display: inline-flex;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 2px;
  border: 1px solid rgba(255,255,255,0.2);
}

.lang-btn {
  background: transparent;
  border: none;
  color: #E5E7EB;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s;
}

.lang-btn.active {
  background: var(--namibia-gold);
  color: var(--slate-900);
}

/* Emergency / Regional Alert Banner */
.alert-banner {
  background-color: #FEF3C7;
  border-bottom: 1px solid #F59E0B;
  color: #78350F;
  padding: 0.65rem 5%;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.alert-banner strong {
  color: #92400E;
}

.alert-banner a {
  text-decoration: underline;
  font-weight: 600;
  white-space: nowrap;
}

/* Main Header & Responsive Nav */
header {
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  padding: 0.9rem 5%;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.crest-img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--namibia-gold);
  background: var(--namibia-blue);
  flex-shrink: 0;
}

.crest-fallback {
  width: 46px;
  height: 46px;
  background: var(--namibia-blue);
  color: var(--namibia-gold);
  border-radius: 50%;
  display: none;
  place-items: center;
  font-weight: 700;
  font-size: 1.1rem;
  border: 2px solid var(--namibia-gold);
  flex-shrink: 0;
}

.brand-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 700;
  color: var(--namibia-blue-dark);
  line-height: 1.15;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--slate-600);
  font-weight: 500;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.35rem;
  font-weight: 500;
  font-size: 0.92rem;
}

nav a {
  color: var(--slate-700);
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: 0.2s;
}

nav a:hover,
nav a.active {
  color: var(--namibia-blue);
  border-bottom-color: var(--namibia-blue);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-login {
  background: var(--namibia-blue);
  color: var(--white);
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-login:hover {
  background: var(--namibia-blue-dark);
}

.mobile-menu-btn {
  display: none;
  background: var(--kalahari-sand);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 0.45rem 0.7rem;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--namibia-blue-dark);
}

/* Mobile Drawer */
.mobile-nav {
  display: none;
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  padding: 1rem 5% 1.5rem;
}

.mobile-nav.open {
  display: block;
}

.mobile-nav ul {
  list-style: none;
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.mobile-nav a {
  display: block;
  padding: 0.5rem 0;
  font-weight: 600;
  color: var(--slate-900);
  border-bottom: 1px solid var(--slate-200);
}

/* Hero Section using /pic/hero-kharas.jpg */
.hero {
  background: linear-gradient(
      105deg,
      rgba(0, 34, 84, 0.92) 0%,
      rgba(0, 53, 128, 0.84) 55%,
      rgba(0, 149, 67, 0.76) 100%
    ),
    url('/pic/hero-kharas.jpg') center/cover no-repeat;
  color: var(--white);
  padding: 3.75rem 5% 4.75rem;
}

.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-block;
  background: rgba(255, 206, 0, 0.2);
  border: 1px solid var(--namibia-gold);
  color: var(--namibia-gold);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.85rem, 4.2vw, 3.05rem);
  max-width: 780px;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero p {
  font-size: clamp(0.98rem, 1.5vw, 1.1rem);
  max-width: 660px;
  color: #E5E7EB;
  margin-bottom: 1.75rem;
}

/* Search Bar */
.search-box {
  display: flex;
  max-width: 680px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 0.35rem;
  box-shadow: var(--shadow-md);
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 0.7rem 0.9rem;
  font-size: 0.98rem;
  color: var(--slate-900);
  outline: none;
}

.search-box button {
  background: var(--namibia-red);
  color: var(--white);
  border: none;
  padding: 0.7rem 1.35rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.search-box button:hover {
  background: #B00D2B;
}

.popular-searches {
  margin-top: 0.9rem;
  font-size: 0.82rem;
  color: #D1D5DB;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.popular-searches span.pill {
  background: rgba(255,255,255,0.14);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s;
}

.popular-searches span.pill:hover {
  background: rgba(255,255,255,0.26);
  color: var(--white);
}

/* Quick E-Services Grid */
.section {
  padding: 3.25rem 5%;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
}

.e-services-wrapper {
  margin-top: -2.6rem;
  position: relative;
  z-index: 10;
  padding-top: 0;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 1.15rem;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-top: 4px solid var(--namibia-blue);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.1);
}

.service-card.accent-green {
  border-top-color: var(--namibia-green);
}

.service-card.accent-red {
  border-top-color: var(--namibia-red);
}

.service-card.accent-gold {
  border-top-color: var(--namibia-gold);
}

.service-card h3 {
  font-size: 1.08rem;
  margin-bottom: 0.45rem;
  color: var(--namibia-blue-dark);
}

.service-card p {
  font-size: 0.88rem;
  color: var(--slate-600);
  margin-bottom: 1rem;
}

.card-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--namibia-blue);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Section Headings */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 2px solid var(--slate-200);
  padding-bottom: 0.7rem;
}

.section-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.45rem, 2.8vw, 1.75rem);
  color: var(--namibia-blue-dark);
}

.section-header a {
  color: var(--namibia-blue);
  font-weight: 600;
  font-size: 0.88rem;
}

/* Governor Spotlight */
.bg-sand {
  background-color: var(--kalahari-sand);
}

.gov-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.9fr;
  gap: 2rem;
  align-items: start;
}

.gov-profile {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.6rem;
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
}

.gov-photo-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.gov-photo {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--namibia-gold);
  background: var(--namibia-blue);
  flex-shrink: 0;
}

.gov-avatar-fallback {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--namibia-blue);
  color: var(--white);
  display: none;
  place-items: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  border: 3px solid var(--namibia-gold);
  flex-shrink: 0;
}

.gov-profile blockquote {
  font-style: italic;
  color: var(--slate-700);
  border-left: 3px solid var(--namibia-gold);
  padding-left: 0.95rem;
  margin: 1rem 0;
  font-size: 0.92rem;
}

.priorities-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.priority-item {
  background: var(--white);
  padding: 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--slate-200);
}

.priority-item span {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--namibia-green);
  margin-bottom: 0.25rem;
}

.priority-item h4 {
  font-size: 0.98rem;
  margin-bottom: 0.35rem;
}

.priority-item p {
  font-size: 0.86rem;
  color: var(--slate-600);
}

/* Interactive Constituency Explorer (Mobile swipeable tabs) */
.constituency-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tab-btn {
  padding: 0.55rem 1rem;
  border: 1px solid var(--slate-200);
  background: var(--white);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--slate-700);
  white-space: nowrap;
  flex-shrink: 0;
  transition: 0.2s;
}

.tab-btn.active,
.tab-btn:hover {
  background: var(--namibia-blue);
  color: var(--white);
  border-color: var(--namibia-blue);
}

.constituency-panel {
  background: var(--kalahari-sand);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.stat-pills {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.stat-pill {
  background: var(--white);
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--slate-200);
  font-size: 0.82rem;
  flex: 1 1 130px;
}

.stat-pill strong {
  display: block;
  font-size: 1rem;
  color: var(--namibia-blue-dark);
}

/* Open Data Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.metric-card {
  background: var(--namibia-blue-dark);
  color: var(--white);
  padding: 1.35rem;
  border-radius: var(--radius);
}

.metric-card .num {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--namibia-gold);
}

.metric-card .label {
  font-size: 0.88rem;
  color: #D1D5DB;
  margin-top: 0.25rem;
}

/* News & Public Notices */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.news-card {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 1.35rem;
  background: var(--white);
}

.news-meta {
  font-size: 0.78rem;
  color: var(--slate-600);
  margin-bottom: 0.4rem;
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.badge {
  background: var(--kalahari-warm);
  color: var(--slate-900);
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.news-card h3 {
  font-size: 1.02rem;
  margin-bottom: 0.45rem;
  color: var(--namibia-blue-dark);
}

.news-card p {
  font-size: 0.88rem;
  color: var(--slate-600);
}

/* Footer */
footer {
  background: var(--slate-900);
  color: #D1D5DB;
  padding: 3rem 5% 2rem;
  font-size: 0.88rem;
}

.footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.75rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #374151;
}

footer h4 {
  color: var(--white);
  margin-bottom: 0.85rem;
  font-size: 0.98rem;
}

footer ul {
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

footer a:hover {
  color: var(--namibia-gold);
  text-decoration: underline;
}

.footer-bottom {
  max-width: 1280px;
  margin: 1.25rem auto 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #9CA3AF;
}

/* Mobile & Tablet Breakpoints */
@media (max-width: 920px) {
  nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .gov-grid,
  .constituency-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .gov-bar {
    justify-content: center;
    text-align: center;
  }

  .hide-mobile {
    display: none;
  }

  .alert-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding: 2.75rem 5% 4rem;
  }

  .search-box {
    flex-direction: column;
    gap: 0.35rem;
    background: transparent;
    box-shadow: none;
    padding: 0;
  }

  .search-box input {
    border-radius: var(--radius);
    width: 100%;
  }

  .search-box button {
    width: 100%;
    padding: 0.8rem;
  }

  .btn-login {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
}
