/* ==========================================================
   layout.css
   Structure only: grids, spacing, responsive behaviour.
   No colours, fonts or decoration. Those live in the theme file.
   ========================================================== */

:root {
  --container: 1200px;
  --gutter: 40px;
  --section-space: 80px;
  --gap: 56px;
  --media-ratio: 4 / 3;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 140px; }

body {
  margin: 0;
  line-height: 1.55;
}

img, video, svg { max-width: 100%; }
img, video { display: block; }
h1, h2, h3, p, ul, address, figure { margin: 0; }
ul { padding: 0; list-style: none; }
address { font-style: normal; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Inline SVG icon sprite: takes no space (moved here from an inline style so the CSP needs no 'unsafe-inline') */
.icon-sprite { position: absolute; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  padding: 10px 16px;
}
.skip-link:focus { top: 8px; }

/* ---------- Sticky top (contact bar + header) ---------- */
.site-top {
  position: sticky;
  top: 0;
  z-index: 50;
}
/* Sits behind the bar and carries the shadow that fades in once it is stuck.
   The shadow itself (the look) is in the theme file. */
.site-top::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* With JS (all screen sizes): the bar scrolls away with the page, then is fixed to the top once the
   page has scrolled past its own height (main.js adds .is-fixed and slides it down). It stays fixed
   until the page is back at the very top. The body padding takes over the bar's space so the page
   does not jump. Without JS the bar simply stays sticky (above). */
.bar-js .site-top { position: relative; }
.bar-js .site-top.is-fixed { position: fixed; top: 0; left: 0; right: 0; }
.bar-js.has-fixed-bar body { padding-top: var(--site-top-height, 0px); }

.contact-bar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px 24px;
  flex-wrap: wrap;
  min-height: 40px;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
  min-height: 88px;
}

.logo { display: inline-flex; align-items: center; }
.logo__box { display: inline-flex; align-items: center; justify-content: center; width: 128px; height: 64px; }

.site-nav ul {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 50px;
}

/* ---------- Generic section ---------- */
.sec { position: relative; }

/* ---------- Buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 28px;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
}
.btn--small { min-height: 40px; padding: 8px 20px; }
.btn__icon { flex: none; width: 26px; height: 26px; }

/* ---------- Media placeholder / images ---------- */
.media { position: relative; width: 100%; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--hero { aspect-ratio: auto; height: auto; }
.media--hero video { width: 100%; height: auto; aspect-ratio: 16 / 9; } /* 640 x 360 */
/* img/video are display:block above, which would override the hidden attribute */
.media--hero img[hidden],
.media--hero video[hidden] { display: none; }
/* Swap area: the outgoing item is lifted out of flow while it animates away */
.hero-stage { position: relative; }
.hero-stage .is-leaving { position: absolute; top: 0; left: 0; right: 0; margin-inline: auto; }
.media--range { height: 340px; }

/* ---------- Hero ---------- */
.hero__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  align-items: center;
  padding-block: 72px;
}
.hero__text { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.lede { max-width: 34em; }

/* ---------- Trust strip ---------- */
.trust__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 32px;
  padding-block: 32px;
}
.trust__item { display: flex; align-items: center; gap: 16px; }
.icon-slot { flex: none; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; }
.icon-slot svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Ranges ---------- */
.ranges { display: flex; flex-direction: column; padding-top: var(--section-space); }
.ranges__intro { display: flex; flex-direction: column; gap: 14px; padding-bottom: 16px; }
.ranges__intro > * { max-width: 36em; }

/* each range sits in a full-width band so it can carry its own background */
.range-band { padding-block: 76px; }

.range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  align-items: center;
}
.range--reverse .media { order: 2; }
.range__text { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.feature-list { display: flex; flex-direction: column; gap: 12px; }
.feature-list li { padding-left: 24px; position: relative; }
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chips li { padding: 6px 12px; }
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.6em;
  width: 10px; height: 10px;
}

/* ---------- About ---------- */
.about { padding-block: var(--section-space); }
.about__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}
.about__grid > div { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Contact ---------- */
.contact { padding-block: var(--section-space); }
.contact .container { display: flex; flex-direction: column; gap: 14px; }
.contact__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 18px;
}
.card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 24px; min-width: 0; }
.card a, .card address { overflow-wrap: anywhere; }
.icon-slot + h3 { margin-top: 2px; }

/* ---------- Footer ---------- */
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  padding-block: 40px 28px;
}
.site-footer__brand { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 28px; }
/* Logo and copyright text sit in one row, vertically centred on each other */
.site-footer__legal { width: 100%; font-size: 0.875rem; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
/* Size the GS logo by height only; width follows the image's own proportions so it is never stretched */
.site-footer__legal .logo img { height: 36px; width: auto; } /* desktop: 1.4x of 26px; mobile sets its own height below */
.badge { display: inline-block; padding: 10px 16px; width: 150px; height: auto; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1024px) {
  :root { --gutter: 32px; --gap: 40px; }
  .contact__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  :root { --gutter: 20px; --section-space: 56px; --gap: 28px; }
  /* the fixed header covers the top of the screen, so anchors must land below it
     (--site-top-height is measured and set by main.js; 150px is the fallback) */
  html { scroll-padding-top: calc(var(--site-top-height, 150px) + 8px); }
  .hero__grid,
  .range,
  .about__grid { grid-template-columns: minmax(0, 1fr); }

  .hero__grid { padding-block: 48px; }
  .media--range { height: 240px; }

  /* image always above the text on small screens */
  .range--reverse .media { order: 0; }

  .trust__list { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-block: 24px; }
  .range-band { padding-block: 48px; }

  /* Header: logo centered above a single, centered row of nav links (never stacked) */
  .site-header__inner {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-height: 0;
    padding-block: 10px;
  }
  .logo__box { width: 96px; height: 48px; }
  .site-nav { max-width: 100%; }
  .site-nav ul { flex-wrap: nowrap; justify-content: center; gap: 0 2.2em; }
  .site-footer__legal .logo img { height: 35px; width: auto; display: inline-block; vertical-align: middle; }

  .badge { display: inline-block; padding: 10px 16px; width: 100px; height: auto; }
}

@media (max-width: 520px) {
  .contact__grid { grid-template-columns: minmax(0, 1fr); }
  .btn-row .btn { width: 100%; }
  .contact-bar__inner { justify-content: center; font-size: 0.8125rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
