/* =========================================================
   SOL*360 — CLEAN, STABLE SITE CSS (iOS SAFARI SAFE)
   ========================================================= */

/* ---------- CSS VARIABLES ---------- */
:root {
  --deep-blue: #002B45;
  --accent-blue: #0077B6;
  --gold: #FDB813;
  --charcoal: #333333;
  --light: #F5F5F5;
  --white: #ffffff;
  --maxw: 1200px;
}

/* ---------- BASE RESET ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  background: var(--white);
  color: var(--charcoal);
  font-family: -apple-system, BlinkMacSystemFont, "Avenir Next",
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------- LAYOUT ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem;
}

section {
  padding: 3.5rem 0;
}

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 .75rem;
  color: var(--deep-blue);
}

p {
  line-height: 1.6;
  margin: .5rem 0;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .85rem 1.1rem;
  border-radius: .75rem;
  background: var(--accent-blue);
  color: #fff;
  font-weight: 600;
}

.btn:hover {
  opacity: .95;
  text-decoration: none;
}

.btn-alt {
  background: var(--gold);
  color: #000;
}

/* ---------- HEADER / NAV ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.95);
  border-bottom: 1px solid #eee;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-weight: 700;
  color: var(--charcoal);
}

.brand img {
  height: 36px;
  width: auto;
}

/* Desktop nav */
.nav .actions {
  display: flex;
  gap: .5rem;
  align-items: center;
}

/* ---------- HAMBURGER (JS-BASED) ---------- */
.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--deep-blue);
  margin: 3px 0;
  border-radius: 2px;
}

/* ---------- HERO ---------- */
.hero {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(0,119,182,.15), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(253,184,19,.18), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  border-bottom: 1px solid #eef2f5;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 2rem;
  align-items: center;
  padding: 4rem 0;
}

/* ---------- GRIDS ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }

/* ---------- FOOTER GRID (CANONICAL) ---------- */
.footer-grid{
  display:grid;
  grid-template-columns:2fr 1fr 1fr;
  gap:2rem;
}

@media (max-width:980px){
  .footer-grid{
    grid-template-columns:1fr;
  }
}

/* ---------- CARDS ---------- */
.card {
  border: 1px solid #eaeaea;
  border-radius: 1rem;
  padding: 1.25rem;
  background: #fff;
}

/* ---------- FOOTER ---------- */
footer {
  background: #0d2432;
  color: #cfe6f5;
  margin-top: 3rem;
}

footer a {
  color: #cfe6f5;
}

.footer-top {
  padding: 2.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.footer-bottom {
  padding: 1.25rem 0;
  font-size: .9rem;
  color: #9dc7da;
}

/* --- Ensure footer is never constrained by page layouts --- */
#site-footer,
#site-footer footer {
  width: 100%;
  max-width: none;
}

#site-footer .footer-grid {
  width: 100%;
}

/* =========================================================
   MOBILE FIXES — THIS IS THE IMPORTANT PART
   ========================================================= */
@media screen and (max-width: 900px) {

  /* Force true mobile layout (Safari fix) */
  :root {
    --maxw: 100%;
  }

  html, body {
    width: 100%;
    overflow-x: hidden;
  }

  .container,
  header,
  section,
  main {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Collapse all grids */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
  }

  /* Header / nav */
  .hamburger {
    display: inline-flex;
  }

  .nav .actions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    padding: 1rem;
    flex-direction: column;
    gap: .75rem;
    border-bottom: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
    z-index: 999;
  }

  .nav .actions.open {
    display: flex;
  }

  .actions .btn {
    width: 100%;
    justify-content: flex-start;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    padding: 2.5rem 0;
  }
}
/* === MOBILE GRID & OVERFLOW FIX (CRITICAL) === */
@media screen and (max-width: 900px) {

  /* Force ALL grids to single column */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
  }

  /* Prevent section-level clipping */
  section,
  .container,
  .card {
    max-width: 100% !important;
    width: 100% !important;
    overflow: visible !important;
  }

  /* Allow horizontal flow if something misbehaves */
  body {
    overflow-x: auto;
  }
}
/* ===== FINAL MOBILE OVERRIDES (AUTHORITATIVE) ===== */
@media screen and (max-width: 900px) {

  /* Kill desktop nav behavior */
  .nav .actions {
    display: none !important;
  }

  .nav .actions.open {
    display: flex !important;
  }

  /* Force grids to stack */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
  }

  /* Prevent clipping */
  html, body {
    overflow-x: auto !important;
  }

  /* Preserve button colors */
  .btn {
    color: #fff !important;
  }

  .btn-alt {
    color: #000 !important;
  }
}

/* ===================12:16 recommendation================== */
@media screen and (max-width: 900px) {
  .grid-4 > .card[style*="grid-column"] {
    grid-column: auto !important;
  }
}
@media screen and (max-width: 900px) {
  header {
    position: relative;
  }
}

/* === FIX SERVICES GRID OVERFLOW (MOBILE) === */
@media screen and (max-width: 900px) {
  .grid-4 > .card[style*="grid-column"] {
    grid-column: auto !important;
  }

  header {
    position: relative;
  }
}

/* === FOOTER LAYOUT: RESILIENT DESKTOP FIX (FLEX) === */
footer .footer-grid{
  display:flex !important;
  gap:2rem !important;
  align-items:flex-start !important;
}

footer .footer-grid > div{
  flex:1 1 0 !important;
  width:auto !important;
  max-width:none !important;
}

/* Make the brand column a bit wider */
footer .footer-grid > div:first-child{
  flex:2 1 0 !important;
}

/* Mobile stacks cleanly */
@media (max-width:980px){
  footer .footer-grid{
    flex-direction:column !important;
  }
}
