/* ICP 2032 mockups — shared base.
   Reset, accessibility, and structural utilities common to every design.
   Visual tokens (colour, type, radius) live in each design's tokens.css/theme.css. */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
figure {
  max-width: 100%;
}

figure {
  margin: 0;
}

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

h1,
h2,
h3,
p,
ul,
blockquote {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* Balanced headings, readable prose */
h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* Skip link */
.icp-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 400; /* above sticky header (300) when focused */
  padding: 12px 20px;
}

.icp-skip:focus {
  left: 16px;
  top: 16px;
}

/* Visible focus for keyboard users */
a:focus-visible,
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Shared layout container */
.icp-container {
  width: 100%;
  max-width: var(--page-max-width, 1200px);
  margin-inline: auto;
  padding-inline: 24px;
}

/* Section rhythm — each theme overrides spacing to taste */
.icp-section {
  padding-block: var(--section-block, 72px);
}

/* Footer logo (SPS mark) — structural sizing; each theme sets its own footer bg */
.icp-footer__logo {
  display: block;
  height: auto;
  width: auto;
  max-height: 64px;
  margin-bottom: 24px;
}

/* Hero capsule + SPS mark — structural layout; themes refine */
.icp-hero__capsule {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.icp-hero__capsule-logo {
  display: block;
  flex-shrink: 0;
  width: auto;
  height: auto;
  max-height: 56px;
  max-width: 140px;
}

.icp-hero__capsule .icp-capsule {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

/* Endorsement SPS logo — structural sizing; design themes may refine */
.icp-endorse__logo {
  display: block;
  height: auto;
  width: auto;
  max-height: 56px;
  max-width: 100%;
  margin: 0 0 16px;
  object-fit: contain;
  object-position: left center;
}

/* Mobile nav toggle — hidden on desktop; themes colour the bars */
.icp-nav {
  position: relative;
}

.icp-nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.icp-nav__toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.icp-nav.is-open .icp-nav__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.icp-nav.is-open .icp-nav__toggle-bar:nth-child(2) {
  opacity: 0;
}

.icp-nav.is-open .icp-nav__toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Menu CTAs — hidden until ≤560px (header CTAs stay for tablet/desktop) */
.icp-nav > .icp-nav__links .icp-nav__menu-cta {
  display: none;
}

@media (max-width: 900px) {
  .icp-nav__toggle {
    display: inline-flex;
  }

  .icp-nav__ctas {
    margin-left: auto;
  }

  .icp-nav > .icp-nav__links {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 120;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0;
    padding: 12px;
    border-radius: 12px;
    background: var(--color-bg, #fff);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  }

  .icp-nav.is-open > .icp-nav__links {
    display: flex;
  }

  /* Hide header Get updates while the hamburger sheet is open */
  .icp-nav.is-open .icp-nav__ctas {
    display: none;
  }

  .icp-nav > .icp-nav__links .icp-nav__link {
    display: block;
    padding: 14px 12px;
    border-radius: 8px;
    text-align: center;
  }

  /* Keep menu CTAs hidden at tablet even when dropdown is open */
  .icp-nav > .icp-nav__links .icp-nav__menu-cta {
    display: none;
  }
}

@media (max-width: 560px) {
  /* Enquire only in hamburger; Get updates stays in header */
  .icp-nav__ctas .icp-nav__cta.icp-btn--secondary {
    display: none;
  }

  .icp-nav {
    justify-content: space-between;
  }

  .icp-nav__toggle {
    margin-left: 0;
    flex-shrink: 0;
  }

  /*
   * Open-menu sheet is position:fixed in theme.css so backdrop-filter can
   * sample the page (not trapped by a filtered sticky header).
   */
  .icp-nav > .icp-nav__links {
    border-radius: 0;
    border: none;
  }

  .icp-brand,
  .icp-nav__toggle {
    position: relative;
    z-index: 130;
  }

  .icp-nav.is-open > .icp-nav__links .icp-nav__menu-cta {
    display: flex;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
