/* ============================================================
   Akwa Pools — shared stylesheet

   The structural rules below are the same for every page.
   Each page picks its own hero and gallery images through a
   body class (e.g. <body class="page-installation">), defined
   in the "Per-page images" section at the bottom of this file.

   Sections:
     0.  Global variables (:root)  ← change brand colours, fonts
                                      and sizing here, in one place
     1.  Base / reset
     2.  Top bar
     3.  Header & logo
     4.  Navigation
     5.  Hero banner
     6.  Buttons
     7.  Page layout
     8.  Service cards
     9.  Section title
     10. Info band
     11. Gallery (recent work)
     12. Footer
     13. Responsive layout
     14. Per-page images
   ============================================================ */


/* ---------- 0. Global variables ----------
   Edit a value here and it updates everywhere it is used. */

:root {
  /* ---- Brand colours ---- */
  --c-navy:         #062653;  /* primary dark — body text, top bar, footer */
  --c-blue-deep:    #06387e;  /* deep blue — section titles, info band */
  --c-blue:         #064aa2;  /* mid blue — logo, icons, quote button */
  --c-blue-bright:  #0b63c7;  /* bright accent — buttons, active nav, links */
  --c-blue-light:   #49a5ff;  /* light blue — script tagline */
  --c-card-title:   #064096;  /* card headings */
  --c-text-muted:   #243f65;  /* secondary text — card copy */
  --c-bg:           #f5f8fc;  /* page background */
  --c-panel:        #eef5ff;  /* light info-band panel */
  --c-footer-link:  #e5eefb;  /* footer links */
  --c-white:        #fff;
  --c-hero-overlay: 3, 28, 60; /* RGB tinted over hero images (with opacity) */

  /* ---- Shadows ---- */
  --shadow-header: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-card:   0 4px 14px rgba(8, 40, 80, 0.13);
  --shadow-soft:   0 4px 14px rgba(8, 40, 80, 0.1);

  /* ---- Fonts ---- */
  --font-base:   Arial, Helvetica, sans-serif;
  --font-script: 'Brush Script MT', 'Segoe Script', cursive;

  --fw-bold:      700;
  --fw-extrabold: 800;
  --fw-black:     900;

  /* ---- Font sizes (smallest → largest) ---- */
  --fs-nav:      11px;  /* nav links, quote button */
  --fs-small:    12px;  /* buttons, card copy */
  --fs-body:     13px;  /* top bar, footer */
  --fs-text:     15px;  /* hero copy, card headings */
  --fs-lead:     16px;  /* info-band copy */
  --fs-subtitle: 17px;  /* logo "POOLS" wordmark */
  --fs-title:    19px;  /* section titles */
  --fs-heading:  22px;  /* info-band heading */
  --fs-icon:     23px;  /* card icon glyph */
  --fs-script:   29px;  /* handwritten tagline */
  --fs-logo:     32px;  /* footer logo */
  --fs-logo-lg:  36px;  /* header logo */
  --fs-hero:     42px;  /* hero heading */

  /* ---- Layout & sizing ---- */
  --container-max: 1180px; /* main content width */
  --header-height: 74px;
  --topbar-height: 30px;
  --gap:           24px;   /* grid gaps */
  --radius:        8px;    /* cards, info band */
  --radius-sm:     4px;    /* buttons */
  --radius-xs:     3px;    /* quote button */
  --radius-round:  50%;    /* icons, wave */
}


/* ---------- 1. Base / reset ---------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--c-navy);
  background: var(--c-bg);
}

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


/* ---------- 2. Top bar (phone / location / email strip) ---------- */

.topbar {
  background: var(--c-navy);
  color: var(--c-white);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
}


/* ---------- 3. Header & logo ---------- */

.header {
  height: var(--header-height);
  background: var(--c-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  box-shadow: var(--shadow-header);
  position: sticky;
  top: 0;
  z-index: 5;
}

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

/* Legacy text-logo styles — kept in case the wordmark is ever
   used again instead of the logo image. */
.logo {
  font-weight: var(--fw-black);
  line-height: 0.82;
  font-size: var(--fs-logo-lg);
  color: var(--c-blue);
  letter-spacing: -2px;
}

.logo small {
  display: block;
  font-size: var(--fs-subtitle);
  color: var(--c-navy);
  letter-spacing: 0;
  margin-left: 55px;
}

.wave {
  display: block;
  width: 92px;
  height: 8px;
  border-bottom: 5px solid var(--c-blue-bright);
  border-radius: var(--radius-round);
  margin-top: 3px;
}


/* ---------- 4. Navigation ---------- */

.nav {
  display: flex;
  gap: 22px;
  align-items: center;
  font-size: var(--fs-nav);
  font-weight: var(--fw-black);
  text-align: center;
  color: var(--c-navy);
}

.nav a {
  white-space: pre-line;
  padding: 26px 0 22px;
  border-bottom: 3px solid transparent;
}

.nav a.active {
  color: var(--c-blue-bright);
  border-bottom-color: var(--c-blue-bright);
}

/* "Request a quote" button in the header */
.quote {
  background: var(--c-blue);
  color: var(--c-white);
  border-radius: var(--radius-xs);
  padding: 13px 18px;
  font-size: var(--fs-nav);
  font-weight: var(--fw-black);
}

/* Hamburger toggle — hidden on desktop, shown at the mobile breakpoint.
   The three <span>s are the bars; they morph into an X when open. */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  margin: 0 auto;
  background: var(--c-navy);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* CTA shown inside the open mobile menu (the header's standalone
   .quote button is hidden at that breakpoint). Hidden on desktop. */
.quote-mobile {
  display: none;
}


/* ---------- 5. Hero banner ---------- */

.hero {
  /* Locked height so every page's banner matches on desktop. Set above
     the tallest page's content (Pool Servicing, ~442px) so shorter pages
     pad up to the same height rather than each sizing to its own text.
     Overridden per breakpoint below. */
  min-height: 460px;
  /* Dark blue gradient laid over the per-page hero image so the
     white heading text stays readable. */
  background:
    linear-gradient(
      90deg,
      rgba(var(--c-hero-overlay), 0.92),
      rgba(var(--c-hero-overlay), 0.62),
      rgba(var(--c-hero-overlay), 0.18)
    ),
    var(--hero);
  background-position: center;
  background-size: cover;
  display: flex;
  align-items: center;
  padding: 42px 36px;
  color: var(--c-white);
}

.hero-inner {
  max-width: 520px;
}

.hero h1 {
  font-size: var(--fs-hero);
  line-height: 1.02;
  margin: 0 0 8px;
  font-weight: var(--fw-black);
  white-space: pre-line;
}

.script {
  font-family: var(--font-script);
  font-size: var(--fs-script);
  color: var(--c-blue-light);
  margin: 0 0 12px;
}

.hero p {
  font-size: var(--fs-text);
  line-height: 1.65;
  margin: 0 0 22px;
}


/* ---------- 6. Buttons ---------- */

.buttons {
  display: flex;
  gap: 16px;
}

.btn {
  display: inline-block;
  background: var(--c-blue-bright);
  color: var(--c-white);
  font-size: var(--fs-small);
  font-weight: var(--fw-black);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
}

.btn.secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.7);
}


/* ---------- 7. Page layout ---------- */

main {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 32px 28px 56px;
}


/* ---------- 8. Service cards ---------- */

/* Home page: the four service cards under the "Our Services" title */
.home-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

/* Service pages: the row of four service cards */
.services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

.card {
  background: var(--c-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  min-height: 190px;
}

.card-img {
  height: 84px;
  background: var(--tile);
  background-size: cover;
  background-position: center;
}

/* Round icon that sits across the top of each card */
.icon {
  width: 54px;
  height: 54px;
  margin: -27px auto 12px;
  background: var(--c-blue);
  border-radius: var(--radius-round);
  border: 4px solid var(--c-white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-white);
  font-size: var(--fs-icon);
  font-weight: var(--fw-black);
}

.card h3 {
  font-size: var(--fs-text);
  line-height: 1.1;
  text-transform: uppercase;
  text-align: center;
  color: var(--c-card-title);
  margin: 0 16px 10px;
}

.card p {
  text-align: center;
  font-size: var(--fs-small);
  line-height: 1.5;
  margin: 0 18px 22px;
  color: var(--c-text-muted);
}


/* ---------- 9. Section title ---------- */

.section-title {
  text-align: center;
  color: var(--c-blue-deep);
  font-size: var(--fs-title);
  font-weight: var(--fw-black);
  /* Generous space above each titled section so blocks don't butt together.
     The first title in <main> resets this — it sits just under the hero. */
  margin: 48px 0 22px;
}

main > .section-title:first-child {
  margin-top: 8px;
}


/* ---------- 10. Info band (split colour panel) ---------- */

.info-band {
  margin-top: 24px;
  /* Dark blue on the left, light panel on the right (split at 45%). */
  background: linear-gradient(
    90deg,
    var(--c-blue-deep) 0,
    var(--c-blue) 45%,
    var(--c-panel) 45%,
    var(--c-panel) 100%
  );
  border-radius: var(--radius);
  min-height: 124px;
  display: grid;
  grid-template-columns: 45% 55%;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.info-band h2 {
  margin: 0;
  color: var(--c-white);
  font-size: var(--fs-heading);
  line-height: 1.1;
  padding: 32px 32px 10px;
  text-transform: uppercase;
}

.info-band p {
  margin: 0;
  padding: 34px 32px;
  color: var(--c-blue-deep);
  font-size: var(--fs-lead);
  font-weight: var(--fw-extrabold);
  line-height: 1.55;
}

.info-band a {
  color: var(--c-blue-bright);
  font-weight: var(--fw-black);
  text-decoration: underline;
}


/* ---------- 11. Gallery (recent work) ---------- */

.recent {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-top: 24px;
}

.recent img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 7px;
  box-shadow: var(--shadow-soft);
}


/* ---------- 11b. Brand logos ---------- */

.brands {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
  margin-top: 24px;
}

/* Each logo sits centred on its own white tile, capped in height so the
   differently-shaped brand marks line up to a consistent size. */
.brand {
  flex: 0 1 calc((100% - 2 * var(--gap)) / 3);
  background: var(--c-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 24px;
  min-height: 116px;
}

.brand img {
  max-width: 100%;
  max-height: 46px;
  width: auto;
  height: auto;
}

/* Waterco is a stacked (two-line) mark, so the shared 46px height cap left it
   looking small next to the wide wordmarks — give it a taller cap to match. */
.brand img.logo-waterco {
  max-height: 72px;
}


/* ---------- 12. Footer ---------- */

footer {
  background: var(--c-navy);
  color: var(--c-white);
  margin-top: 24px;
  padding: 30px 38px;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 24px;
  font-size: var(--fs-body);
}

.footer-logo {
  font-size: var(--fs-logo);
  font-weight: var(--fw-black);
  color: var(--c-white);
  line-height: 0.85;
}

.footer-title {
  font-weight: var(--fw-black);
  margin-bottom: 9px;
}

footer a,
footer p {
  display: block;
  margin: 5px 0;
  color: var(--c-footer-link);
}


/* ---------- 12b. Quote form ---------- */

.quote-intro {
  max-width: 720px;
  margin: 0 auto 22px;
  text-align: center;
  color: var(--c-text-muted);
  font-size: var(--fs-text);
  line-height: 1.6;
}

.quote-form {
  max-width: 720px;
  margin: 0 auto;
  background: var(--c-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 28px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
}

/* Fields that should span the full width of the form */
.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: var(--fs-small);
  font-weight: var(--fw-extrabold);
  color: var(--c-blue-deep);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}

.req {
  color: var(--c-blue-bright);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-base);
  font-size: var(--fs-text);
  color: var(--c-navy);
  background: var(--c-white);
  padding: 12px 14px;
  border: 1px solid #cdd9ea;
  border-radius: var(--radius-sm);
}

.field textarea {
  min-height: 130px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--c-blue-bright);
  box-shadow: 0 0 0 3px rgba(11, 99, 199, 0.15);
}

/* Submit button — full-width version of .btn */
.btn-block {
  display: block;
  width: 100%;
  margin-top: 22px;
  border: 0;
  cursor: pointer;
  text-align: center;
}

.form-note {
  max-width: 720px;
  margin: 14px auto 0;
  text-align: center;
  font-size: var(--fs-small);
  color: var(--c-text-muted);
}

.form-note a {
  color: var(--c-blue-bright);
  font-weight: var(--fw-black);
}


/* ---------- 13. Responsive layout ---------- */

/* Tablet and below */
@media (max-width: 850px) {
  main {
    padding: 22px 18px 40px;
  }

  .section-title {
    margin: 34px 0 18px;
  }

  .header {
    /* Keep a single fixed-height bar: logo on the left, hamburger on the
       right. The sticky header is the containing block for the dropdown. */
    gap: 15px;
    padding: 0 15px;
  }

  .nav-toggle {
    display: flex;
  }

  /* The standalone header CTA gives way to the in-menu one on mobile. */
  .header > .quote {
    display: none;
  }

  /* Nav collapses into a full-width panel that drops below the header. */
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--c-white);
    border-top: 1px solid #e3ebf6;
    box-shadow: var(--shadow-header);
    padding: 6px 0;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    /* Full-width tappable rows; drop the forced two-line labels. */
    padding: 14px 22px;
    text-align: left;
    white-space: normal;
    border-bottom: 0;
    font-size: var(--fs-body);
  }

  .nav a.active {
    border-bottom: 0;
    background: var(--c-panel);
  }

  .nav .quote-mobile {
    display: block;
    margin: 8px 22px 6px;
    text-align: center;
    background: var(--c-blue);
    color: var(--c-white);
    border-radius: var(--radius-xs);
    padding: 13px 18px;
    font-size: var(--fs-nav);
    font-weight: var(--fw-black);
  }

  .hero h1 {
    font-size: 32px;
  }

  .home-grid,
  .services,
  .recent {
    grid-template-columns: 1fr 1fr;
  }

  .info-band {
    grid-template-columns: 1fr;
    background: var(--c-blue-deep);
  }

  .info-band p {
    background: var(--c-panel);
  }

  .topbar {
    padding: 0 15px;
  }

  .hero {
    /* Tablet: text column is still width-capped, so all heroes share a
       constant height here too — lock them level just above the tallest. */
    min-height: 400px;
    padding: 35px 20px;
  }

  footer {
    grid-template-columns: 1fr 1fr;
  }
}

/* Large phones — shrink the top bar so phone and email fit on one line */
@media (max-width: 620px) {
  .topbar {
    font-size: var(--fs-nav);
    padding: 0 14px;
  }
}

/* Phones — stack everything into a single column */
@media (max-width: 560px) {
  .home-grid,
  .services,
  .recent,
  footer,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .buttons {
    flex-direction: column;
  }

  .brand {
    flex-basis: calc((100% - var(--gap)) / 2);
  }
}


/* ============================================================
   14. Per-page images

   Each page uses two background images:
     --hero  = the wide banner behind the page heading
     --tile  = the small image strip on the service cards
   Gallery photos are real <img> tags in the HTML (so they can
   lazy-load and carry alt text), not CSS backgrounds.

   The files below are web-optimised copies generated from the
   untouched originals in Fortbubble/original-images/ by the
   script Fortbubble/optimize-images.ps1 — edit and re-run that
   script rather than re-saving these by hand.
   ============================================================ */

.page-home         { --hero: url("images/hero-home.jpg");         --tile: url("images/pool-backyard.jpg"); }
.page-quote        { --hero: url("images/hero-quote.jpg");        --tile: url("images/pool-backyard.jpg"); }
.page-servicing    { --hero: url("images/hero-servicing.jpg");    --tile: url("images/pool-infinity-spa.jpg"); }
.page-installation { --hero: url("images/hero-installation.jpg"); --tile: url("images/pool-sunset-firebowls.jpg"); }
.page-renovations  { --hero: url("images/hero-renovations.jpg");  --tile: url("images/renovation-resurface.jpg"); }
.page-landscaping  { --hero: url("images/hero-landscaping.jpg");  --tile: url("images/pool-sunken-lounge.jpg"); }
.page-heating      { --hero: url("images/hero-heating.jpg");      --tile: url("images/pool-night-villa.jpg"); }
