/*
  InfraredTested shared header and footer.

  Self-contained: every selector starts with .irc- and nothing outside the header,
  the footer and the skip link is styled. Pages load different stylesheets (main.css,
  design.css, editorial.css, large inline <style> blocks), so each element is reset with
  `all` and every property it relies on is set again here. Tokens are the :root values
  of design/previews/option-d/style.css, redeclared on the two roots so page variables
  such as --bg or --text cannot change them.

  Spacing: no old page reserved space for a fixed navigation bar. Every old bar was in
  the page flow (sticky or static), so nothing here compensates for the header.
*/

/* ---------- roots and tokens ---------- */
.irc-header,
.irc-footer {
  all: initial;
  --bg: #101216;
  --surface: #191c22;
  --surface-2: #20242b;
  --line: #2c313a;
  --line-strong: #3d434e;
  --text: #f1f0ee;
  --soft: #d2d3d7;
  --muted: #a9abb1;
  --accent: #f0483a;
  --on-accent: #101216;
  --tile-light: #f4f3f1;
  --r: 16px;
  --pill: 999px;
  --gutter: 20px;
  --maxw: 1240px;
  --section: 56px;
  --display: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  display: block;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--body);
  font-size: 16px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.55;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  text-decoration: none;
  white-space: normal;
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

/* Every element inside gets a clean slate; the rules below set what each one needs. */
.irc-header :where(div, span, p, a, ul, li, nav, button),
.irc-footer :where(div, span, p, a, ul, li, nav, button) {
  all: unset;
  box-sizing: border-box;
}

.irc-header .irc-icon {
  display: block;
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
}

.irc-header .irc-wrap,
.irc-footer .irc-wrap {
  display: block;
  width: min(100% - 2 * var(--gutter), var(--maxw));
  margin-inline: auto;
}

/* ---------- skip link ---------- */
.irc-skip {
  all: unset;
  box-sizing: border-box;
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 1000;
  padding: 13px 20px;
  border-radius: 999px;
  background: #f1f0ee;
  color: #101216;
  font: 700 16px/1.2 "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.irc-skip:link,
.irc-skip:visited,
.irc-skip:hover {
  color: #101216;
  text-decoration: none;
}
.irc-skip:focus,
.irc-skip:focus-visible {
  top: 12px;
  outline: 3px solid #f0483a;
  outline-offset: 3px;
}

/* The link also carries editorial.css's class skip-link, so editorial.js finds it and adds no second skip link. editorial.css styles that
   class too (a slide-in, capitals, another font). These rules are one class more specific and say again what the link looked like
   before: hidden above the page, 12px from the top once focused, no slide. */
.irc-skip.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 1000;
  transform: none;
  transition: 0s;
  padding: 13px 20px;
  background: #f1f0ee;
  color: #101216;
  font: 700 16px/1.2 "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  text-transform: none;
  letter-spacing: normal;
}
.irc-skip.skip-link:focus,
.irc-skip.skip-link:focus-visible {
  top: 12px;
  transform: none;
}

/* Target of the skip link: sits right after the header, takes no space. */
.irc-anchor {
  all: unset;
  display: block;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  outline: none;
}

/* ---------- header ---------- */
.irc-header {
  position: relative;
  z-index: 900;
  min-height: 64px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.irc-header .irc-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
  min-height: 63px;
}
.irc-header .irc-logo,
.irc-footer .irc-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.irc-header .irc-logo-mark,
.irc-footer .irc-logo-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 20px/1 var(--display);
}
.irc-header .irc-logo-word,
.irc-footer .irc-logo-word {
  display: grid;
  color: var(--text);
  font: 700 13px/1.15 var(--display);
  letter-spacing: 0.14em;
}

.irc-header .irc-menu-btn {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--text);
  font: 600 15px/1.2 var(--body);
  cursor: pointer;
}
.irc-header .irc-menu-btn:hover { background: var(--surface-2); }

.irc-header .irc-nav {
  display: block;
  flex: 1 1 100%;
  padding-bottom: 8px;
}
.irc-header .irc-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.irc-header .irc-item {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}
.irc-header .irc-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--pill);
  background: transparent;
  color: var(--muted);
  font: 600 15px/1.2 var(--body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.irc-header .irc-link:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.irc-header .irc-link[aria-current="page"] {
  background: var(--surface-2);
  color: var(--text);
}

/* Focus: a visible ring on every control. */
.irc-header .irc-link:focus-visible,
.irc-header .irc-logo:focus-visible,
.irc-header .irc-menu-btn:focus-visible,
.irc-footer .irc-foot-link:focus-visible,
.irc-footer .irc-logo:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 3px;
}

/* One row: with JavaScript at any width, and without it from 900px up. */
.irc-header.irc-js .irc-bar { flex-wrap: nowrap; height: 63px; }
.irc-header.irc-js .irc-nav { flex: 0 1 auto; padding-bottom: 0; margin-left: auto; }
@media (min-width: 900px) {
  .irc-header { height: 64px; }
  .irc-header .irc-bar { flex-wrap: nowrap; height: 63px; }
  .irc-header .irc-nav { flex: 0 1 auto; padding-bottom: 0; margin-left: auto; }
  .irc-header .irc-list { margin-right: -14px; }
}

/* Menu button and dropdown: only when JavaScript is running, only below 900px. */
@media (max-width: 899.98px) {
  .irc-header.irc-js .irc-menu-btn { display: inline-flex; }
  .irc-header.irc-js .irc-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-left: 0;
    padding: 8px var(--gutter) 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .irc-header.irc-js.irc-open .irc-nav { display: block; }
  .irc-header.irc-js .irc-list {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    width: min(100%, var(--maxw));
    margin-inline: auto;
  }
  .irc-header.irc-js .irc-link {
    width: 100%;
    padding: 0 12px;
    border-radius: 12px;
    color: var(--text);
    font-size: 17px;
  }
  .irc-header.irc-js .irc-link:hover { background: var(--surface-2); }
  .irc-header.irc-js .irc-link[aria-current="page"] { background: var(--surface-2); }
}

/* ---------- footer ---------- */
.irc-footer {
  position: relative;
  z-index: 2;
  width: auto;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 40px 0 28px;
}
.irc-footer .irc-foot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.irc-footer .irc-foot-brand {
  display: grid;
  grid-column: 1 / -1;
  gap: 18px;
  align-content: start;
  justify-items: start;
}
.irc-footer .irc-foot-disclosure {
  display: block;
  max-width: 30em;
  margin: 0;
  color: var(--muted);
  font: 400 16px/1.55 var(--body);
}
.irc-footer .irc-foot-col {
  display: block;
  margin: 0;
  padding: 0;
}
.irc-footer .irc-foot-title {
  display: block;
  margin: 0 0 4px;
  color: var(--text);
  font: 600 16px/1.3 var(--display);
  letter-spacing: 0;
}
.irc-footer .irc-foot-list {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}
.irc-footer .irc-foot-item {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}
.irc-footer .irc-foot-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font: 400 16px/1.55 var(--body);
  text-decoration: none;
  cursor: pointer;
}
.irc-footer .irc-foot-link:hover {
  color: var(--text);
  text-decoration: underline;
}
/* The disclosure link sits inside a sentence: inline, underlined, with a 44px touch area. */
.irc-footer .irc-foot-inline {
  display: inline;
  position: relative;
  min-height: 0;
  color: var(--text);
  text-decoration: underline;
}
.irc-footer .irc-foot-inline::after {
  content: "";
  position: absolute;
  inset: -12px -4px;
}

@media (min-width: 640px) {
  .irc-header,
  .irc-footer { --gutter: 24px; }
  .irc-footer .irc-foot-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 32px 40px; }
  .irc-footer .irc-foot-brand { grid-column: auto; }
}
@media (min-width: 768px) {
  .irc-footer { padding: 48px 0 32px; }
}

/* Reduced motion: the header and footer have no transform, transition or animation in any state. This keeps it so for
 * any hovered or pressed link or button inside them (menu button, links, logo). */
@media (prefers-reduced-motion: reduce) {
  .irc-header :is(a, button):is(:hover, :active),
  .irc-footer :is(a, button):is(:hover, :active) { transform: none; transition: none; }
}
