/* ============================================================
   SMART CIVIC SOLUTIONS — Main Stylesheet
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg:          #f5f0ea;
  --orange:      #e87722;
  --orange-dark: #c86410;
  --white:       #ffffff;
  --dark:        #1a1a1a;
  --gray:        #555555;
  --card-radius: 6px;
  --font-head:   'Raleway', sans-serif;
  --font-body:   'Open Sans', sans-serif;
  --max-width:   1200px;
}

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Scroll-reveal base state — elements start hidden */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for grid children */
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.40s; }
.reveal-delay-6 { transition-delay: 0.48s; }

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--dark);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  animation: fadeInDown 0.5s ease both;
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 88px;
}

/* Logo */
.navbar-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img {
  height: 54px;
  width: auto;
  display: block;
}

/* Nav center */
.navbar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  color: var(--dark);
  position: relative;
  padding-bottom: 3px;
  transition: color 0.25s;
}

/* Animated underline on hover */
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0;
  height: 1.5px;
  background-color: var(--orange);
  transition: width 0.28s ease;
}

.nav-link:hover { color: var(--orange); }
.nav-link:hover::after { width: 100%; }

.nav-link.active {
  color: var(--dark);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}

/* Right side */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.social-icons {
  display: flex;
  align-items: center;
  gap: 14px;
}

.social-icons a {
  font-size: 17px;
  color: var(--dark);
  transition: color 0.2s;
}

.social-icons a:hover { color: var(--orange); }

/* GET QUOTE button */
.btn-quote {
  display: inline-block;
  background-color: var(--orange);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 14px 22px;
  border-radius: 4px;
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn-quote:hover {
  background-color: var(--orange-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(232, 119, 34, 0.35);
}

.btn-quote:active { transform: translateY(0); box-shadow: none; }

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--dark);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background-color: var(--bg);
  padding: 100px 24px 120px;
  text-align: center;
}

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

.hero-headline {
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--orange);
  line-height: 1.25;
  animation: fadeInUp 0.8s ease 0.2s both;
}

/* ============================================================
   PARTNERS
   ============================================================ */
.partners {
  background-color: var(--bg);
}

.partners-banner {
  background-color: var(--orange);
  padding: 18px 24px;
  text-align: center;
}

.partners-banner h2 {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
}

.partners-logos-wrap {
  padding: 48px 60px 40px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.partners-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 24px;
}

.partner-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.partner-logo-img {
  height: 100px;
  width: 100%;
  max-width: 180px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  transition: transform 0.3s ease, opacity 0.3s ease;
  filter: grayscale(0%);
}

.partner-item:hover .partner-logo-img {
  transform: scale(1.08);
  opacity: 0.85;
}

/* Placeholder styling for partners (remove once real logos are added) */
.partner-placeholder {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  text-align: center;
  padding: 10px 16px;
  border: 1.5px solid rgba(0,0,0,0.15);
  border-radius: 4px;
  width: 100%;
  max-width: 180px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
}

.partner-placeholder small { font-size: 10px; font-weight: 400; }

/* Branded placeholders */
.partner-placeholder.plan        { color: #0077c8; border-color: #0077c8; }
.partner-placeholder.unwomen     { color: #009edb; border-color: #009edb; }
.partner-placeholder.hivetec     { color: #2db04b; border-color: #2db04b; }
.partner-placeholder.talabat     { background: var(--orange); color: var(--white); border-color: var(--orange); font-size: 15px; }
.partner-placeholder.savechildren{ color: #e31837; border-color: #e31837; }
.partner-placeholder.safecities  { color: #005f9e; border-color: #005f9e; }
.partner-placeholder.unodc       { color: #009edb; border-color: #009edb; }
.partner-placeholder.sussex      { color: #1a1a6e; border-color: #1a1a6e; font-size: 18px; font-weight: 800; }
.partner-placeholder.wotf        { color: #00857c; border-color: #00857c; }
.partner-placeholder.streetpal   { background: var(--orange); color: var(--white); border-color: var(--orange); font-size: 22px; font-weight: 900; border-radius: 6px; }

/* ============================================================
   SERVICES
   ============================================================ */
.services {
  background-color: var(--bg);
  padding: 60px 24px 80px;
}

.services-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-heading {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--orange);
  text-align: center;
  margin-bottom: 48px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.service-card {
  background-color: var(--white);
  border-radius: var(--card-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.10);
}

.service-img-wrap {
  width: 100%;
  height: 240px;
  overflow: hidden;
  flex-shrink: 0;
}

.service-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.service-card:hover .service-img-wrap img {
  transform: scale(1.04);
}

.service-card-body {
  padding: 16px 18px 20px;
}

.service-card-body h3 {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--orange);
  line-height: 1.4;
}

/* ============================================================
   NEWSLETTER
   ============================================================ */
.newsletter {
  background-color: var(--bg);
  padding: 80px 24px 100px;
  text-align: center;
}

.newsletter-inner {
  max-width: 600px;
  margin: 0 auto;
}

.newsletter h2 {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 32px;
  line-height: 1.5;
}

.newsletter-form {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  max-width: 420px;
  margin: 0 auto;
}

.newsletter-form input[type="email"] {
  flex: 1;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dark);
  background: var(--white);
  border: 1.5px solid rgba(0,0,0,0.18);
  border-right: none;
  border-radius: 4px 0 0 4px;
  outline: none;
  transition: border-color 0.2s;
}

.newsletter-form input[type="email"]:focus {
  border-color: var(--orange);
}

.newsletter-form input[type="email"]::placeholder {
  color: #aaa;
}

.newsletter-form button {
  padding: 14px 24px;
  background-color: var(--orange);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.newsletter-form button:hover { background-color: var(--orange-dark); }

.newsletter-thanks {
  margin-top: 20px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--orange);
  display: none;
}

.newsletter-thanks.visible { display: block; }

/* ============================================================
   RESPONSIVE — Tablet
   ============================================================ */
@media (max-width: 900px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .navbar-inner {
    flex-wrap: nowrap;
    min-height: 70px;
    padding: 12px 20px;
    gap: 12px;
  }

  /* Slide-in sidebar */
  .navbar-nav {
    position: fixed;
    top: 0;
    right: -320px;
    width: 280px;
    height: 100dvh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 100px 32px 40px;
    gap: 0;
    z-index: 1001;
    box-shadow: -6px 0 30px rgba(0,0,0,0.15);
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    flex: unset;
    order: unset;
  }

  .navbar-nav.open { right: 0; }

  /* Dark overlay behind sidebar */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
  }

  .nav-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  body.nav-open { overflow: hidden; }

  .nav-toggle { display: flex; }

  .nav-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
  }

  .nav-row-bottom { margin-top: 16px; }

  .navbar-right { margin-left: auto; }

  .hero { padding: 70px 24px 80px; }
}

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */
@media (max-width: 600px) {
  .services-grid {
    grid-template-columns: 1fr;
  }

  .partners-logos-wrap {
    padding: 32px 20px 28px;
    gap: 32px;
  }

  .partners-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
  }

  .partner-item { flex: 0 0 auto; }

  .partner-logo-img {
    height: 70px;
    max-width: 130px;
  }

  .partner-placeholder {
    max-width: 130px;
    height: 70px;
    font-size: 12px;
  }

  .navbar-right .social-icons { display: none; }

  .hero-headline { font-size: 1.9rem; }

  .newsletter-form {
    flex-direction: column;
    border-radius: 4px;
  }

  .newsletter-form input[type="email"] {
    border-right: 1.5px solid rgba(0,0,0,0.18);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
  }

  .newsletter-form button {
    border-radius: 0 0 4px 4px;
  }
}
