/* =====================================================================
   CK AIR CONDITIONING — MAIN STYLESHEET
   Organized by section. Add new page sections below in their own block.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. CSS VARIABLES — brand palette & shared values
   Keep all colors here so future sections stay consistent.
   --------------------------------------------------------------------- */
:root {
  /* Brand colors, based on logo */
  --color-navy: #0b2545;
  --color-navy-dark: #071a33;
  --color-blue: #4f8fd1;
  --color-blue-light: #eaf3fb;
  --color-orange: #f2843a;
  --color-orange-dark: #d96f27;
  --color-ice-blue: #7ec8e3; /* cold-air stream effect on the gallery blower */

  /* Neutrals */
  --color-white: #ffffff;
  --color-text: #1c2733;
  --color-text-light: #5a6b7b;
  --color-border: #e1e8ef;

  /* Layout */
  --max-width: 1200px;
  --header-shadow: 0 4px 8px -6px rgba(11, 37, 69, 0.45); /* negative spread keeps shadow below the bar only, no bleed above */

  /* Transitions */
  --transition-fast: 0.2s ease;

  /* Fonts */
  --font-body: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-brand: "Poppins", var(--font-body); /* matches the logo wordmark */
}

/* ---------------------------------------------------------------------
   2. RESET / BASE
   --------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-white);
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ---------------------------------------------------------------------
   3. HEADER — logo
   --------------------------------------------------------------------- */
.site-header {
  width: 100%;
}

.logo-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
  background-color: var(--color-white);
  position: relative; /* anchors the free-quote box to the top right */
}

.logo {
  height: 220px;
  width: auto;
  max-height: 25vw; /* keeps the logo from overwhelming small screens */
}

/* Free quote box — top right of the header */
.header-quote {
  position: absolute;
  top: 24px;
  right: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.header-quote-title {
  font-family: var(--font-brand);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--color-orange);
}

.header-quote-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-navy);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.header-quote-link:hover,
.header-quote-link:focus-visible {
  color: var(--color-orange);
}

.header-quote-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-blue);
}

/* ---------------------------------------------------------------------
   4. NAVIGATION — full-width bar under the logo
   --------------------------------------------------------------------- */
.site-nav {
  width: 100%;
  background-color: var(--color-navy);
  box-shadow: var(--header-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  min-height: 60px;
}

.nav-menu {
  display: flex;
  justify-content: center;
  gap: 32px;
}

.nav-menu a {
  display: inline-block;
  color: var(--color-white);
  padding: 20px 16px;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.nav-menu a:hover,
.nav-menu a:focus {
  color: var(--color-orange);
  border-bottom-color: var(--color-orange);
}

/* Drawer backdrop — only used on mobile */
.nav-backdrop {
  display: none;
}

/* Hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle .bar {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--color-white);
  border-radius: 2px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* Hamburger animates into an "X" when menu is open */
.nav-toggle.is-active .bar:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
}
.nav-toggle.is-active .bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-active .bar:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
}

/* ---------------------------------------------------------------------
   5. HERO PLACEHOLDER
   --------------------------------------------------------------------- */
.hero {
  width: 100%;
  background-color: var(--color-blue-light);
  padding: 80px 20px;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.hero-inner p {
  font-size: 1.25rem;
  color: var(--color-text-light);
}

/* ---------------------------------------------------------------------
   6. SHARED SECTION HEADING — reused by Services, About, and future sections
   --------------------------------------------------------------------- */
.section-heading {
  font-family: var(--font-brand);
  font-style: italic;
  font-size: 2rem;
  color: var(--color-navy);
  text-align: center;
  margin-bottom: 40px;
}

/* ---------------------------------------------------------------------
   7. SERVICES
   --------------------------------------------------------------------- */
.services {
  width: 100%;
  padding: 80px 20px;
  background-color: var(--color-white);
}

.services-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.service-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-orange);
  border-radius: 8px;
  padding: 32px 28px;
  box-shadow: 0 4px 10px -8px rgba(11, 37, 69, 0.3);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px -12px rgba(11, 37, 69, 0.35);
}

.service-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--color-orange);
  color: var(--color-white);
  margin-bottom: 20px;
}

.service-icon svg {
  width: 28px;
  height: 28px;
}

.service-card h3 {
  font-family: var(--font-brand);
  font-size: 2.3rem;
  color: var(--color-navy);
  margin-bottom: 12px;
}

.service-card p {
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.6;
}

/* ---------------------------------------------------------------------
   8. ABOUT
   --------------------------------------------------------------------- */
.about {
  width: 100%;
  padding: 80px 20px;
  background-color: var(--color-blue-light);
}

.about-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.about-inner p {
  font-size: 1.05rem;
  color: var(--color-text);
  line-height: 1.75;
  text-align: left;
}

/* Space between the About paragraphs so the text is easier to read */
.about-inner p + p {
  margin-top: 1.5em;
}

.about-image {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  margin: 0 auto 60px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ---------------------------------------------------------------------
   9. GALLERY / CONVEYOR BELT — "Our Work"
   --------------------------------------------------------------------- */
.gallery {
  width: 100%;
  padding: 70px 0;
  background-color: var(--color-navy);
  overflow: hidden;
}

.gallery .section-heading {
  color: var(--color-white);
  padding: 0 20px;
}

/* Clips the belt so it can't cause horizontal page scroll */
.gallery-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Pause the belt while the lightbox is open (see js/script.js) */
.gallery-track.is-paused {
  animation-play-state: paused;
}

/* AC unit graphic, pinned at the start of the belt */
.gallery-blower {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  width: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, var(--color-navy) 60%, transparent);
}

.blower-unit {
  width: 96px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

/* Wind streaks blowing out of the unit's fan/vent toward the belt */
.wind-line {
  position: absolute;
  left: 92px;
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--color-ice-blue), transparent);
  opacity: 0;
  animation: wind-blow 1.8s ease-in-out infinite;
}

/* Vertically centered on the unit's fan grille (roughly mid-height of the image) */
.wind-line-1 { top: 98px; animation-delay: 0s; }
.wind-line-2 { top: 112px; animation-delay: 0.4s; }
.wind-line-3 { top: 126px; animation-delay: 0.8s; }

@keyframes wind-blow {
  0%   { transform: translateX(0); opacity: 0; }
  30%  { opacity: 0.9; }
  100% { transform: translateX(40px); opacity: 0; }
}

/* The scrolling belt itself — two identical image sets side by side.
   Animating from -50% to 0% shifts exactly one set's width, so the
   loop has no visible jump. */
.gallery-track {
  display: flex;
  align-items: center;
  width: max-content;
  gap: 20px;
  padding: 0 20px 0 150px; /* left padding clears the blower graphic */
  animation: conveyor-scroll 50.4s linear infinite; /* 42s base, slowed 20% */
  /* Keep the belt on its own GPU layer so iOS Safari repaints the photos
     while it moves (otherwise they can stay blank until tapped) */
  will-change: transform;
  transform: translateZ(0);
}

@keyframes conveyor-scroll {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0%); }
}

.gallery-photo {
  height: 220px;
  width: auto;
  flex-shrink: 0;
  object-fit: cover;
  border: 5px solid #111111;
  border-radius: 2px;
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.gallery-photo:focus-visible {
  outline: 3px solid var(--color-orange);
  outline-offset: 2px;
}

/* Respect users who'd rather not see continuous motion */
@media (prefers-reduced-motion: reduce) {
  .gallery-track {
    animation: none;
  }
}

/* Lightbox — click-to-enlarge overlay for gallery photos */
.lightbox {
  position: fixed;
  inset: 0;
  background-color: rgba(7, 26, 51, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast);
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 5px solid var(--color-white);
  border-radius: 2px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background-color: var(--color-orange);
  color: var(--color-white);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast);
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  background-color: var(--color-orange-dark);
}

/* ---------------------------------------------------------------------
   9b. CONTACT
   --------------------------------------------------------------------- */
.contact {
  width: 100%;
  padding: 80px 20px;
  background-color: var(--color-blue-light);
}

.contact-inner {
  max-width: 760px;
  margin: 0 auto;
}

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  font-size: 2.3rem;
  color: var(--color-navy);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color var(--transition-fast);
}

.contact-link:hover,
.contact-link:focus-visible {
  color: var(--color-orange);
}

.contact-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  color: var(--color-blue);
}

/* ---------------------------------------------------------------------
   9c. FAQ & AREAS WE COVER
   --------------------------------------------------------------------- */
.faq,
.areas {
  width: 100%;
  padding: 80px 20px;
  background-color: var(--color-blue-light);
}

.faq-inner,
.areas-inner {
  max-width: 760px;
  margin: 0 auto;
}

.placeholder-text {
  font-size: 1.05rem;
  color: var(--color-text-light);
  text-align: center;
}

/* Areas We Cover map — covered areas are set in js/areas.js */
.areas-intro {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-text);
  text-align: center;
  margin-bottom: 32px;
}

.areas-map {
  max-width: 520px;
  margin: 0 auto;
}

.england-map {
  display: block;
  width: 100%;
  height: auto;
}

.map-area {
  fill: var(--color-white);
  stroke: var(--color-navy);
  stroke-width: 0.4;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill var(--transition-fast);
}

.map-area.is-covered {
  fill: var(--color-blue);
}

.map-area.is-active {
  fill: var(--color-orange);
}

.areas-map-label {
  min-height: 1.6em;
  margin: 16px 0 12px;
  font-weight: 600;
  color: var(--color-navy);
  text-align: center;
}

.areas-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 0.95rem;
  color: var(--color-text);
}

.areas-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.areas-legend-swatch {
  width: 18px;
  height: 18px;
  border: 1px solid var(--color-navy);
  border-radius: 3px;
  background-color: var(--color-white);
}

.areas-legend-swatch.is-covered {
  background-color: var(--color-blue);
}

.areas-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.areas-list li {
  padding: 6px 14px;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--color-navy);
}

.areas-credit {
  margin-top: 32px;
  font-size: 0.75rem;
  color: var(--color-text-light);
  text-align: center;
}

/* FAQ accordion — click a question to reveal its answer */
.faq-group-heading {
  font-family: var(--font-brand);
  font-size: 1.35rem;
  color: var(--color-navy);
  margin: 40px 0 16px;
}

.faq-group-heading:first-of-type {
  margin-top: 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}

.faq-question {
  position: relative;
  padding: 18px 56px 18px 20px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-navy);
  cursor: pointer;
  list-style: none;
  transition: color var(--transition-fast);
}

.faq-question::-webkit-details-marker {
  display: none;
}

/* plus sign that turns into a minus when open */
.faq-question::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
  color: var(--color-orange);
}

/* when open, the plus becomes a down arrow (chevron drawn with borders) */
.faq-item[open] .faq-question::after {
  content: "";
  width: 10px;
  height: 10px;
  margin-top: -3px;
  border-right: 2px solid var(--color-orange);
  border-bottom: 2px solid var(--color-orange);
  transform: translateY(-50%) rotate(45deg);
}

.faq-question:hover,
.faq-question:focus-visible {
  color: var(--color-orange);
}

.faq-answer {
  padding: 0 20px 20px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
}

/* ---------------------------------------------------------------------
   9d. FREE QUOTE CALL TO ACTION — home page, below the gallery
   --------------------------------------------------------------------- */
.quote-cta {
  width: 100%;
  padding: 72px 20px;
  background: linear-gradient(135deg, var(--color-orange) 0%, var(--color-orange-dark) 100%);
  text-align: center;
}

.quote-cta-inner {
  max-width: 900px;
  margin: 0 auto;
}

.quote-cta-heading {
  font-family: var(--font-brand);
  font-style: italic;
  font-weight: 800;
  font-size: 2.6rem;
  line-height: 1.2;
  color: var(--color-white);
  margin-bottom: 12px;
}

.quote-cta-text {
  font-size: 1.15rem;
  color: var(--color-white);
  margin-bottom: 32px;
}

.quote-cta-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.quote-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  padding: 16px 28px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-navy);
  background-color: var(--color-white);
  border-radius: 999px;
  text-decoration: none;
  overflow-wrap: anywhere;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.quote-cta-btn:hover,
.quote-cta-btn:focus-visible {
  background-color: var(--color-navy);
  color: var(--color-white);
  transform: translateY(-2px);
}

.quote-cta-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .quote-cta {
    padding: 56px 16px;
  }

  .quote-cta-heading {
    font-size: 1.8rem;
  }

  .quote-cta-btn {
    font-size: 1rem;
    padding: 14px 22px;
  }
}

/* ---------------------------------------------------------------------
   10. RESPONSIVE — hamburger nav on mobile/tablet
   --------------------------------------------------------------------- */
@media (max-width: 768px) {
  .logo {
    height: 160px;
  }

  .logo-wrap {
    flex-direction: column;
    gap: 16px;
  }

  .header-quote {
    position: static;
    align-items: center;
  }

  /* Mobile nav: no bar — a burger pinned top left opens a drawer
     that slides in from the left (see js/script.js) */
  .site-nav {
    position: static;
    background: none;
    box-shadow: none;
  }

  .nav-inner {
    min-height: 0;
    padding: 0;
  }

  .nav-toggle {
    display: flex;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1002;
    width: 48px;
    height: 48px;
    padding: 14px 11px;
    border-radius: 10px;
    background-color: var(--color-navy);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1001;
    width: 78%;
    max-width: 300px;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    padding-top: 76px; /* clears the burger button */
    background-color: var(--color-navy);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
    overflow-y: auto;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s ease;
  }

  .nav-menu.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-menu a {
    display: block;
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-navy-dark);
  }

  .nav-menu a:hover,
  .nav-menu a:focus {
    border-bottom-color: var(--color-navy-dark);
  }

  /* Dimmed backdrop behind the open drawer */
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background-color: rgba(7, 26, 51, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .nav-backdrop.is-open {
    opacity: 1;
    visibility: visible;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    font-size: 1.6rem;
  }

  .services,
  .about {
    padding: 56px 20px;
  }

  .gallery {
    padding: 48px 0;
  }

  .gallery-blower {
    width: 90px;
  }

  .blower-unit {
    width: 64px;
  }

  .wind-line {
    left: 64px;
    width: 22px;
  }

  /* Re-centered on the smaller unit graphic's fan at this breakpoint */
  .wind-line-1 { top: 65px; }
  .wind-line-2 { top: 75px; }
  .wind-line-3 { top: 85px; }

  .gallery-track {
    gap: 12px;
    padding: 0 16px 0 100px;
    animation-duration: 72s; /* 60s base, slowed 20% to match desktop ratio */
  }

  .gallery-photo {
    height: 150px;
    border-width: 4px;
  }
}
