/* ==========================================================================
   SUPPLEMENTVISTA — BASE
   Typography, layout containers, buttons, and the small set of utilities
   every page uses. Scoped under .sv-site so nothing leaks into the
   WordPress admin bar or any plugin's own markup.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. RESET, kept minimal
   -------------------------------------------------------------------------- */

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

.sv-site {
  font-family: var(--sv-font-body);
  font-size: var(--sv-body);
  line-height: var(--sv-lh-body);
  color: var(--sv-text);
  background-color: var(--sv-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Nothing may push the page sideways. A single over-wide element causes
   horizontal scrolling on phones, which is one of the fastest ways to
   lose a mobile visitor. */
/* `clip`, not `hidden`.
   overflow-x: hidden forces the other axis to compute as `auto`, which
   turns html and body into scroll containers. A position: sticky header
   then sticks to that container instead of the viewport, so it silently
   scrolls away. overflow-x: clip hides the same overflow without
   creating a scroll container, and the header stays put.
   The `hidden` line below is the fallback for anything too old to know
   `clip`; browsers that support it take the second declaration. Astra
   also sets `body { overflow-x: hidden }`, but `body.sv-site` outranks
   a bare `body`, so this wins without !important. */
html,
body.sv-site {
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   2. TYPOGRAPHY

   WHY EVERY ELEMENT BELOW SITS INSIDE :where()
   --------------------------------------------
   A selector like `.sv-site a` has specificity 0-1-1, while a component
   class like `.sv-btn--primary` has only 0-1-0. The generic reset would
   therefore beat every component rule that tries to set a colour, a
   height or a margin, which is the opposite of what a reset is for.

   `:where()` wraps the element name and contributes zero specificity, so
   these rules count as 0-1-0 — the weight of `.sv-site` alone. They
   still override the theme's bare element styles, but any component
   class now wins against them, as it should.

   Do not remove the :where() wrappers. Version 1.0.0 did not have them,
   and the result was a logo rendering at its full natural height and
   button text drawn in the same colour as the button.
   -------------------------------------------------------------------------- */

.sv-site :where(h1, h2, h3, h4, h5, h6) {
  font-family: var(--sv-font-heading);
  font-weight: var(--sv-weight-semi);
  line-height: var(--sv-lh-tight);
  letter-spacing: var(--sv-track-tight);
  color: var(--sv-ink);
  margin: 0 0 var(--sv-space-4);
  text-wrap: balance; /* stops a lone word dropping to its own line */
}

.sv-site :where(h1) { font-size: var(--sv-h1); font-weight: var(--sv-weight-bold); }
.sv-site :where(h2) { font-size: var(--sv-h2); }
.sv-site :where(h3) { font-size: var(--sv-h3); line-height: var(--sv-lh-snug); }
.sv-site :where(h4) { font-size: var(--sv-h4); line-height: var(--sv-lh-snug); }

.sv-site :where(p) {
  margin: 0 0 var(--sv-space-5);
  max-width: 68ch; /* long lines are tiring to read */
}

.sv-site :where(p, ul, ol):last-child {
  margin-bottom: 0;
}

.sv-site :where(a) {
  color: var(--sv-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--sv-speed-fast) var(--sv-ease);
}

.sv-site :where(a):hover {
  color: var(--sv-link-hover);
}

.sv-site :where(strong, b) {
  font-weight: var(--sv-weight-semi);
  color: var(--sv-ink);
}

/* Eyebrow label above a section heading */
.sv-eyebrow {
  display: inline-block;
  font-family: var(--sv-font-body);
  font-size: var(--sv-tiny);
  font-weight: var(--sv-weight-semi);
  letter-spacing: var(--sv-track-wide);
  text-transform: uppercase;
  color: var(--sv-blue-btn);
  margin-bottom: var(--sv-space-3);
}

/* Every dark context, listed explicitly. Button Blue measures only
   2.75:1 against the navy, so the eyebrow has to switch to cyan or it
   fails WCAG AA for small text. */
.sv-on-dark .sv-eyebrow,
.sv-dark .sv-eyebrow,
.sv-hero .sv-eyebrow,
.sv-section--dark .sv-eyebrow,
.sv-cta--dark .sv-eyebrow,
.sv-leadform .sv-eyebrow,
.sv-focus-panel .sv-eyebrow,
.sv-footer .sv-eyebrow {
  color: var(--sv-cyan);
}

.sv-lead {
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  color: var(--sv-text-muted);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   3. FOCUS — visible, always

   Never remove this. Keyboard users navigate entirely by it, and an
   invisible focus ring makes a site unusable for them.
   -------------------------------------------------------------------------- */

.sv-site :focus-visible {
  outline: var(--sv-focus-width) solid var(--sv-focus);
  outline-offset: var(--sv-focus-offset);
  border-radius: var(--sv-radius-sm);
}

/* Skip link: hidden until a keyboard user tabs to it, which is the first
   thing a screen reader user wants so they can jump past the navigation. */
.sv-skip-link {
  position: absolute;
  left: var(--sv-space-4);
  top: -100px;
  z-index: calc(var(--sv-z-header) + 10);
  padding: var(--sv-space-3) var(--sv-space-5);
  background: var(--sv-midnight);
  color: var(--sv-white);
  border-radius: 0 0 var(--sv-radius-sm) var(--sv-radius-sm);
  font-weight: var(--sv-weight-semi);
  text-decoration: none;
  transition: top var(--sv-speed) var(--sv-ease);
}

.sv-skip-link:focus {
  top: 0;
  color: var(--sv-white);
}

/* Visually hidden, but still read aloud by screen readers. */
.sv-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   4. LAYOUT
   -------------------------------------------------------------------------- */

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

.sv-container--narrow {
  max-width: var(--sv-container-narrow);
}

@media (min-width: 768px) {
  .sv-container { padding-inline: var(--sv-pad-x-tablet); }
}

@media (min-width: 1024px) {
  .sv-container { padding-inline: var(--sv-pad-x-desktop); }
}

.sv-section {
  padding-block: var(--sv-section-y);
}

@media (min-width: 768px) {
  .sv-section { padding-block: var(--sv-section-y-tablet); }
}

@media (min-width: 1024px) {
  .sv-section { padding-block: var(--sv-section-y-desktop); }
}

.sv-section--alt  { background: var(--sv-surface-alt); }

/* ---- Canvas: for the white sections ----
   Flat white across three long sections made the middle of the page
   feel empty. This keeps the background white but lays two very soft
   colour washes over it — blue from the top right, cyan from the
   bottom left — so the area has some depth without competing with the
   content. Both are under 6% opacity: you should notice the page feels
   less bare, not that there is a gradient on it.

   Drawn with gradients rather than images, so it costs no request and
   scales to any screen. */
.sv-section--canvas {
  position: relative;
  background: var(--sv-white);
  overflow: hidden;
}

.sv-section--canvas::before,
.sv-section--canvas::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.sv-section--canvas::before {
  top: -22%;
  right: -12%;
  width: 46vw;
  height: 46vw;
  max-width: 680px;
  max-height: 680px;
  background: radial-gradient(circle, rgba(8, 127, 193, 0.10) 0%, rgba(8, 127, 193, 0) 68%);
}

.sv-section--canvas::after {
  bottom: -26%;
  left: -14%;
  width: 40vw;
  height: 40vw;
  max-width: 580px;
  max-height: 580px;
  background: radial-gradient(circle, rgba(22, 185, 213, 0.10) 0%, rgba(22, 185, 213, 0) 68%);
}

/* Content has to sit above the washes. */
.sv-section--canvas > .sv-container { position: relative; z-index: 1; }
.sv-section--dark {
  background: var(--sv-gradient-cta);
  color: var(--sv-text-on-dark);
}

.sv-section--dark h1,
.sv-section--dark h2,
.sv-section--dark h3,
.sv-section--dark h4 {
  color: var(--sv-white);
}

.sv-section--dark p {
  color: var(--sv-text-on-dark-mu);
}

/* Section heading block */
.sv-section-head {
  max-width: 720px;
  margin-bottom: var(--sv-space-10);
}

.sv-section-head--center {
  margin-inline: auto;
  text-align: center;
}

/* Grid */
.sv-grid {
  display: grid;
  gap: var(--sv-space-6);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .sv-grid--2,
  .sv-grid--3,
  .sv-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .sv-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .sv-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* --------------------------------------------------------------------------
   5. BUTTONS
   -------------------------------------------------------------------------- */

.sv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sv-space-2);
  min-height: var(--sv-btn-height);
  padding: 0 var(--sv-space-8);
  border: 2px solid transparent;
  border-radius: var(--sv-radius-pill);
  font-family: var(--sv-font-body);
  font-size: var(--sv-small);
  font-weight: var(--sv-weight-semi);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color var(--sv-speed) var(--sv-ease),
    border-color     var(--sv-speed) var(--sv-ease),
    color            var(--sv-speed) var(--sv-ease),
    transform        var(--sv-speed-fast) var(--sv-ease),
    box-shadow       var(--sv-speed) var(--sv-ease);
}

.sv-btn:hover { transform: translateY(-1px); }
.sv-btn:active { transform: translateY(0); }

.sv-btn .sv-icon {
  transition: transform var(--sv-speed) var(--sv-ease);
}

.sv-btn:hover .sv-icon {
  transform: translateX(3px);
}

/* Each variant is written as .sv-btn.sv-btn--x rather than
   .sv-btn--x on its own. Buttons are <a> elements, and a theme's link
   colour rule will otherwise repaint the label. Doubling the class puts
   these at 0-2-0, comfortably above anything Astra sets. */

/* Primary */
.sv-btn.sv-btn--primary {
  background: var(--sv-blue-btn);
  border-color: var(--sv-blue-btn);
  color: var(--sv-white);
  box-shadow: var(--sv-shadow-btn);
}

.sv-btn.sv-btn--primary:hover,
.sv-btn.sv-btn--primary:focus-visible {
  background: var(--sv-navy);
  border-color: var(--sv-navy);
  color: var(--sv-white);
  box-shadow: 0 4px 14px rgba(7, 59, 96, 0.3);
}

/* Secondary — outlined, for use on light backgrounds */
.sv-btn.sv-btn--secondary {
  background: transparent;
  border-color: var(--sv-border);
  color: var(--sv-navy);
}

.sv-btn.sv-btn--secondary:hover,
.sv-btn.sv-btn--secondary:focus-visible {
  background: var(--sv-surface-alt);
  border-color: var(--sv-blue);
  color: var(--sv-navy);
}

/* Ghost — for use on the navy hero */
.sv-btn.sv-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--sv-white);
  backdrop-filter: blur(6px);
}

.sv-btn.sv-btn--ghost:hover,
.sv-btn.sv-btn--ghost:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--sv-cyan);
  color: var(--sv-white);
}

/* Cyan — the single loudest action on a dark section */
.sv-btn.sv-btn--accent {
  background: var(--sv-cyan);
  border-color: var(--sv-cyan);
  color: var(--sv-midnight);
}

.sv-btn.sv-btn--accent:hover,
.sv-btn.sv-btn--accent:focus-visible {
  background: var(--sv-cyan-light);
  border-color: var(--sv-cyan-light);
  color: var(--sv-midnight);
}

.sv-btn--sm {
  min-height: var(--sv-btn-height-sm);
  padding: 0 var(--sv-space-5);
  font-size: var(--sv-tiny);
}

.sv-btn--full {
  width: 100%;
}

.sv-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sv-space-3);
}

/* --------------------------------------------------------------------------
   6. CARDS
   -------------------------------------------------------------------------- */

.sv-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--sv-space-8);
  background: var(--sv-white);
  border: 1px solid var(--sv-border);
  border-radius: var(--sv-radius);
  box-shadow: var(--sv-shadow-sm);
  transition:
    transform   var(--sv-speed) var(--sv-ease),
    box-shadow  var(--sv-speed) var(--sv-ease),
    border-color var(--sv-speed) var(--sv-ease);
}

/* A gradient hairline across the top, revealed on hover. It gives the
   card somewhere to "light up" without changing its size or colour. */
.sv-card--link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--sv-gradient-accent);
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity   var(--sv-speed) var(--sv-ease),
              transform var(--sv-speed) var(--sv-ease);
}

.sv-card--link:hover::before,
.sv-card--link:focus-within::before {
  opacity: 1;
  transform: scaleX(1);
}

.sv-card--link:hover,
.sv-card--link:focus-within {
  transform: translateY(-4px);
  border-color: rgba(8, 127, 193, 0.4);
  box-shadow: var(--sv-shadow-lg);
}

/* Tinted rather than near-white. At --sv-surface-alt the chip was the
   same colour as the light sections it sits on, so the icons read as
   faint grey squares instead of a deliberate element. */
.sv-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-bottom: var(--sv-space-5);
  border-radius: 14px;
  background: linear-gradient(135deg, #E3F1FA 0%, #D4EEF6 100%);
  box-shadow: inset 0 0 0 1px rgba(8, 127, 193, 0.16);
  color: var(--sv-blue);
  flex-shrink: 0;
  transition: background  var(--sv-speed) var(--sv-ease),
              color       var(--sv-speed) var(--sv-ease),
              box-shadow  var(--sv-speed) var(--sv-ease),
              transform   var(--sv-speed) var(--sv-ease);
}

.sv-card--link:hover .sv-card__icon,
.sv-card--link:focus-within .sv-card__icon {
  background: var(--sv-gradient-accent);
  box-shadow: 0 6px 18px rgba(8, 127, 193, 0.34);
  color: var(--sv-white);
  transform: translateY(-2px);
}

.sv-card__title {
  font-size: var(--sv-h4);
  margin-bottom: var(--sv-space-2);
}

.sv-card__text {
  color: var(--sv-text-muted);
  font-size: var(--sv-small);
  margin-bottom: var(--sv-space-5);
}

/* `display: inline` is blockified here because the card is a flex
   container, which keeps margin-top:auto working — but it makes the
   contents flow as inline text, so the arrow stays attached to the last
   word. As a flex row it detached and floated to the right whenever the
   label wrapped onto two lines, as "Website Design & Development" does. */
.sv-card__more {
  margin-top: auto;
  display: inline;
  font-size: var(--sv-small);
  font-weight: var(--sv-weight-semi);
  line-height: 1.5;
  color: var(--sv-link);
  text-decoration: none;
}

.sv-card__more .sv-icon {
  vertical-align: -4px;
  margin-left: 6px;
  transition: transform var(--sv-speed) var(--sv-ease);
}

.sv-card--link:hover .sv-card__more .sv-icon {
  transform: translateX(4px);
}

/* Stretched link: the whole card is clickable, but only one real link
   exists in the markup, so screen readers announce one destination
   rather than three. */
.sv-card__more::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--sv-radius);
}

/* --------------------------------------------------------------------------
   7. LISTS
   -------------------------------------------------------------------------- */

.sv-list-check {
  list-style: none;
  margin: 0 0 var(--sv-space-5);
  padding: 0;
  display: grid;
  gap: var(--sv-space-3);
}

.sv-list-check li {
  position: relative;
  padding-left: 30px;
  color: var(--sv-text-muted);
  font-size: var(--sv-small);
}

.sv-list-check li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sv-surface-alt);
  border: 1.5px solid var(--sv-blue);
}

.sv-list-check li::after {
  content: '';
  position: absolute;
  left: 5.5px;
  top: 0.78em;
  width: 7px;
  height: 4px;
  border-left: 2px solid var(--sv-blue-btn);
  border-bottom: 2px solid var(--sv-blue-btn);
  transform: rotate(-45deg);
}

/* Every dark context, not just .sv-section--dark. The focus panel and
   the lead-form section are also navy, and a checklist inside one was
   rendering at 2.1:1 against it. */
.sv-section--dark .sv-list-check li,
.sv-focus-panel .sv-list-check li,
.sv-leadform .sv-list-check li,
.sv-hero .sv-list-check li {
  color: var(--sv-text-on-dark-mu);
}

.sv-section--dark .sv-list-check li::before,
.sv-focus-panel .sv-list-check li::before,
.sv-leadform .sv-list-check li::before,
.sv-hero .sv-list-check li::before {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--sv-cyan);
}

.sv-section--dark .sv-list-check li::after,
.sv-focus-panel .sv-list-check li::after,
.sv-leadform .sv-list-check li::after,
.sv-hero .sv-list-check li::after {
  border-color: var(--sv-cyan);
}

/* --------------------------------------------------------------------------
   8. IMAGES AND MEDIA
   -------------------------------------------------------------------------- */

.sv-site :where(img, svg, video) {
  max-width: 100%;
  height: auto;
}

/* Reserve the space an image will occupy before it loads, so the page
   does not jump. This is what Google measures as Cumulative Layout Shift. */
.sv-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--sv-radius);
  background: var(--sv-surface-alt);
}

.sv-media--16x9 { aspect-ratio: 16 / 9; }
.sv-media--4x3  { aspect-ratio: 4 / 3; }
.sv-media--1x1  { aspect-ratio: 1 / 1; }
.sv-media--3x4  { aspect-ratio: 3 / 4; }  /* portrait photographs */
.sv-media--4x5  { aspect-ratio: 4 / 5; }  /* portrait, slightly less tall */

.sv-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* A labelled placeholder for photography that has not been supplied yet.
   It looks deliberate rather than broken, and it is obvious in a review
   which slots still need a real image. */
.sv-media--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--sv-border);
  color: var(--sv-text-muted);
  font-size: var(--sv-small);
  text-align: center;
  padding: var(--sv-space-6);
}

/* --------------------------------------------------------------------------
   9. UTILITIES
   -------------------------------------------------------------------------- */

.sv-text-center { text-align: center; }
.sv-mb-0 { margin-bottom: 0 !important; }
.sv-mt-6 { margin-top: var(--sv-space-6); }
.sv-mt-8 { margin-top: var(--sv-space-8); }

/* Fine grid pattern for dark sections */
.sv-grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--sv-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--sv-grid-line) 1px, transparent 1px);
  background-size: var(--sv-grid-size) var(--sv-grid-size);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%);
          mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   10. PRINT
   -------------------------------------------------------------------------- */

@media print {
  .sv-header,
  .sv-footer,
  .sv-cta,
  .sv-skip-link { display: none !important; }

  .sv-site { color: #000; background: #fff; }
}
