/* ===============================
   Niagara Number Crunchers – Styles (v30)
   Based on v18 with certification + spacing refinements
   =============================== */

/* ----- Reset & Base Typography ----- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #0b2a4a;
  background-color: #eef4fb;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: #003a8c; transition: color .3s ease; }
a:hover { color: #005edc; }

/* ===== Header - Gradient Professional ===== */
header {
  background: linear-gradient(90deg, #0b2a4a, #1a6ca8, #2aaed6);
  padding: 10px 0;
  border-bottom: 2px solid #08304f;
  margin-bottom: 0; /* maintain spacing consistency */
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  height: 70px;
}

/* Title styling */
.site-title {
  font-size: 1.8rem;      /* larger, more presence */
  font-weight: 700;
  color: #ffffff;
}

/* Navigation links */
nav {
  display: flex;
  gap: 24px;
}

nav a {
  color: #ffffff;
  font-weight: 500;
  font-size: 1.05rem;     /* increased from .95rem */
  text-decoration: none;
  transition: color 0.3s ease;
}

nav a:hover,
nav a.active {
  color: #d8eff8;          /* soft turquoise highlight */
  text-decoration: underline;
}

/* Social icons */
.social-icons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.social-icons img {
  width: 22px;
  height: 22px;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.social-icons img:hover {
  opacity: 1;
}

/* Responsive Header */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    height: auto;
    gap: 10px;
    padding: 12px;
  }
  
  nav {
    gap: 16px;
  }
}

/* ----- Hero Section (logo pulled up) ----- */
.hero {
  background-color: #eef4fb;
  padding: 14px 0 22px;
  margin-top: -15px;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero-logo-wrap {
  margin-top: -10px;
  margin-bottom: -20px;
}
.hero-logo-wrap img {
  width: clamp(340px, 35vw, 440px);
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ----- Hero content layout (side-by-side) ----- */
.hero-content {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 2rem;
  margin-top: 0;
  padding: 0;
  width: 100%;
  max-width: 1100px;
}

.hero-text {
  flex: 1 1 480px;
  max-width: 500px;
  text-align: left;
}

.hero-text h1 {
  font-size: 1.9rem;
  font-weight: 700;
  color: #0b2a4a;
  margin-bottom: 10px;
}

.hero-text p { margin-bottom: 10px; font-size: 1rem; }

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  justify-content: center; /* centers buttons horizontally */
}

.btn-outline {
  border: 2px solid #003a8c;
  padding: 10px 20px;
  color: #003a8c;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-weight: 500;
}
.btn-outline:hover { background-color: #003a8c; color: #fff; }

/* ----- Video Container (clean 16:9, no shadow/bleed) ----- */
.hero-video {
  position: relative;
  width: 100%;
  max-width: 520px;
  border: 3px solid #003a8c;
  border-radius: 10px;
  overflow: hidden;
  background-color: #e9f0f7;
  box-shadow: none !important;
  margin-top: 6px;
}
.hero-video::before { content: ""; display: block; padding-top: 56.25%; }
.hero-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background-color: #e9f0f7;
  border-radius: 10px;
  box-shadow: none !important;
  object-fit: cover;
}

/* Responsive fallback */
@media (max-width:768px) {
  .hero-content { flex-direction: column; align-items: center; gap: 1.2rem; }
  .hero-text { text-align: center; }
  .hero-video { max-width: 100%; border-width: 2px; margin: 1rem auto 0; display: block; }
}

/* --- Why Choose Section (no background box, tighter spacing) --- */
.why-choose {
  background: none;            /* removes boxed look */
  padding: 40px 20px;          /* balanced vertical space */
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.why-choose h2 {
  font-size: 1.6rem;
  color: #002b5c;
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.why-choose p {
  max-width: 800px;
  margin: 0 auto 25px;
}

.why-choose ul {
  list-style: disc;
  padding-left: 40px;
  max-width: 700px;
  margin: 0 auto;
  text-align: left;
}

.why-choose li {
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Tighten spacing above Why Choose section */
.why-choose {
  margin-top: 1.2rem;     /* was around 2rem previously */
  padding-top: 20px;      /* reduce inside spacing */
}

/* ===== Certifications Section (Final v29 – unified & refined) ===== */
.certifications {
  background-color: #eef4fb;
  text-align: center;
  padding: 15px 20px 30px;   /* balanced, tighter spacing */
  margin-top: 0.5rem;        /* lifts closer to section above */
  margin-bottom: 1rem;       /* comfortable space above footer */
}

.certifications h2 {
  color: #002b5c;
  font-weight: 700;
  margin-bottom: 2rem;
}

/* Layout for certificate rows */
.certifications .cert-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* Top row – slightly taller */
.certifications .cert-row.top-row img,
.certifications .cert-row:first-of-type img {
  display: block;
  width: auto;
  height: 115px;             /* top row image height */
  object-fit: contain;
  object-position: center;
  border-radius: 6px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 0 4px rgba(0,0,0,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Bottom row – about 25% smaller */
.certifications .cert-row.bottom-row img,
.certifications .cert-row.small-row img {
  width: auto;
  height: 70px;              /* smaller bottom row badges */
  object-fit: contain;
  object-position: center;
  border-radius: 6px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 0 4px rgba(0,0,0,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Spacing between rows */
.certifications .cert-row.top-row,
.certifications .cert-row:first-of-type {
  margin-bottom: 0.6rem;
}

.certifications .cert-row.bottom-row {
    margin-top: 0.9rem !important;   /* space between rows */
}

/* bottom row – add vertical space above it */
.certifications .cert-row:last-of-type {
  margin-top: 1.2rem !important;
}

/* Hover polish */
.certifications .cert-row img:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 10px rgba(0,58,140,0.2);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  .certifications .cert-row {
    gap: 10px;
  }

  .certifications .cert-row.top-row img,
  .certifications .cert-row:first-of-type img {
    height: 90px;            /* reduce top row height on small screens */
  }

  .certifications .cert-row.bottom-row img,
  .certifications .cert-row.small-row img {
    height: 60px;            /* reduce bottom row height on small screens */
  }
}

/* --- Services Page Polishing (matches home layout) --- */
.services {
  background: none;
  text-align: left;
  padding: 50px 20px 60px;
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.7;
}

.services h1 {
  color: #0b2a4a;
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.5rem;
}

.services p {
  font-size: 1rem;
  margin-bottom: 12px;
  color: #0b2a4a;
}

.services b {
  color: #002b5c;
}

.services a.btn-outline {
  display: inline-block;
  margin-top: 20px;
  text-align: center;
  border: 2px solid #003a8c;
  padding: 10px 20px;
  border-radius: 6px;
  color: #003a8c;
  transition: all 0.3s ease;
}

.services a.btn-outline:hover {
  background-color: #003a8c;
  color: #fff;
}

/* Prevent extra top gap before content */
.services {
  margin-top: 0;
}

/* Footer consistency with home */
footer {
  margin-top: 1.2rem; /* matches homepage subtle gap */
  border-top: 1px solid #d0deec; /* soft divider line */
}

/* --- Footer (refined spacing & alignment) --- */
footer {
  background-color: #0b2a4a;
  color: #fff;
  text-align: center;
  padding: 32px 10px 34px; /* medium thickness */
  font-size: 0.95rem;
  margin-top: 0.5rem;  /* gentle separation from certifications */
}

footer a {
  color: #aad4ff;
  transition: color 0.3s ease;
}

footer a:hover {
  color: #fff;
}

footer p {
  margin: 0 auto;
  text-align: center;
  max-width: 900px;
  color: #fff;
  line-height: 1.4;
}

.ssl-seal {
  text-align: center;
  margin-top: 10px;
  overflow: hidden;
}

.ssl-seal img {
  display: inline-block;
  border: 0;
}

/* ----- Floating Back-to-Top Button ----- */
.back-to-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background-color: #0b2a4a;
  color: #fff;
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: bold;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  opacity: 0.75;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 999;
}
.back-to-top:hover { opacity: 1; transform: scale(1.1); }

/* ----- Responsive Tweaks ----- */
@media (max-width:900px) {
  .header-container { flex-wrap: wrap; justify-content: center; text-align: center; }
  .social-icons { justify-content: center; margin-top: 10px; }
  .hero-video { width: 90%; }
  .hero-logo-wrap img { width: 70%; }
}

/* ===== Services Page button ===== */
.services a.btn-outline {
  display: inline-block;
  margin-top: 15px;
  text-align: center;
}

/* ===== Services Section (Aligned and Centered) ===== */
.services {
  background-color: #eef4fb;
  text-align: center;
  padding: 60px 20px 80px;
}

.services h2 {
  color: #002b5c;
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.services p {
  max-width: 900px;
  margin: 0 auto 25px;
  color: #0b2a4a;
  font-size: 1rem;
  line-height: 1.6;
}

/* Keep bullet list left-aligned but centered overall */
.services ul {
  text-align: left;
  max-width: 900px;
  margin: 0 auto 25px;
  padding-left: 40px;
}

.services li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.services .btn-container {
  text-align: center;
  margin-top: 25px;
}

/* ===== Contact Section ===== */
.contact {
  background-color: #eef4fb;
  padding: 60px 20px;
  text-align: center;
}

.contact h2 {
  color: #002b5c;
  font-weight: 700;
  margin-bottom: 1rem;
}

.contact p {
  max-width: 700px;
  margin: 0 auto 25px;
  font-size: 1rem;
  color: #0b2a4a;
}

/* Contact Form Layout */
.contact-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  max-width: 650px;
  margin: 0 auto;
}

.contact-form .form-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.contact-form input,
.contact-form textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #b5c7e3;
  border-radius: 6px;
  font-size: 1rem;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #0b2a4a;
  box-sizing: border-box;
}

.contact-form .full-width {
  width: 100%;
}

.contact-form textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

.contact-form button {
  border: 2px solid #003a8c;
  padding: 10px 24px;
  color: #003a8c;
  border-radius: 6px;
  background: transparent;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.contact-form button:hover {
  background-color: #003a8c;
  color: #fff;
}

/* Thank-you message */
.thank-you {
  color: #003a8c;
  font-weight: 500;
  margin: 0 auto 25px;
  padding: 10px 15px;
  background-color: #e6efff;
  border: 1px solid #b5c7e3;
  border-radius: 6px;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 58, 140, 0.1);
}

/* Responsive layout */
@media (max-width: 768px) {
  .contact-form .form-row {
    flex-direction: column;
  }
}

/* ===== Privacy Section ===== */
.privacy {
  background-color: #eef4fb;
  padding: 60px 20px 80px; /* adds vertical breathing room */
  text-align: center;
}

.privacy h2 {
  color: #002b5c;
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.privacy p {
  max-width: 900px;
  margin: 0 auto 20px;
  font-size: 1rem;
  color: #0b2a4a;
  line-height: 1.6;
}

.privacy a {
  color: #003a8c;
  text-decoration: none;
  font-weight: 500;
}

.privacy a:hover {
  text-decoration: underline;
}

/* --- Ensure footer sits at the bottom for short-content pages --- */

/* Pages that need footer anchoring */
body.privacy-page,
body.services-page,
body.contact-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Footer on those pages */
body.privacy-page footer,
body.services-page footer,
body.contact-page footer {
  margin-top: auto;
}

/* === Certifications spacing override – keep 2-row layout === */
section.certifications {
  margin-top: 0.2rem !important;     /* pulls section upward */
  padding-top: 10px !important;      /* slightly tighter at the top */
  padding-bottom: 25px !important;   /* keeps space below */
}

section.certifications .cert-row:first-of-type {
  margin-bottom: 0.6rem !important;  /* balanced spacing between rows */
}

/* --- Fix spacing between Why Choose and Certifications (stop margin collapse) --- */
section.why-choose {
  margin-bottom: 0;          /* remove collapsing margin */
  padding-bottom: 10px;      /* keep a little breathing room */
}

section.certifications {
  margin-top: 0;
  padding-top: 28px;   /* exact match */
}

/* Optional: if anything still resists due to earlier duplicates */
section.why-choose,
section.certifications {
  border-top: 0 solid transparent;   /* creates a new block formatting context */
  overflow: hidden;                   /* also prevents margin collapse */
}

/* Reduce space between the video section and Why Choose */
.hero {
    padding-bottom: 10px !important;   /* remove large default padding */
    margin-bottom: 0 !important;
}

.hero-content {
    margin-bottom: 0 !important;       /* removes gap under hero text/video */
}

.hero-video {
    margin-bottom: 0 !important;
}
