/* Irwin release notes. Colours and type follow @the-platform-group/component-library
   (src/Color/lightMode.js, src/theme/typography.js). */

:root {
  --font: Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --irwin-blue: #0663b9;
  --irwin-blue-dark: #054f94;
  --irwin-navy: #1d2f49;

  --bg: #f4f4f6;
  --surface: #ffffff;
  --surface-muted: #fafafa;
  --border: #ebeced;
  --border-strong: #d2d3d4;
  --text: #21252b;
  --text-secondary: #505254;
  --text-muted: #6c6e70;
  --link: var(--irwin-blue);
  --link-hover: var(--irwin-blue-dark);
  --focus: #52a9fa;
  --header-bg: var(--irwin-navy);
  --header-text: #ffffff;

  --features-bg: #e1f0ff;
  --features-text: #023564;
  --fixes-bg: #ffebeb;
  --fixes-text: #700200;
  --improvements-bg: #e5f6ec;
  --improvements-text: #12542d;
  --general-bg: #ebeced;
  --general-text: #404245;

  --radius: 8px;
  --shadow: 0 1px 2px rgba(33, 37, 43, 0.06), 0 1px 3px rgba(33, 37, 43, 0.08);
  --header-height: 64px;
  --sidebar-width: 280px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171a1f;
    --surface: #21252b;
    --surface-muted: #262a31;
    --border: #2d3034;
    --border-strong: #404245;
    --text: #f4f4f6;
    --text-secondary: #d2d3d4;
    --text-muted: #b7b7b8;
    --link: #8cc4fb;
    --link-hover: #b4dafd;
    --header-bg: #11192a;

    --features-bg: #0f2c4d;
    --features-text: #b4dafd;
    --fixes-bg: #4a1414;
    --fixes-text: #ffc9c8;
    --improvements-bg: #133622;
    --improvements-text: #bfe5cd;
    --general-bg: #2d3034;
    --general-text: #d2d3d4;

    --shadow: none;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--link-hover);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  margin: 0;
  font-weight: 600;
}

.muted {
  color: var(--text-muted);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--surface);
  color: var(--link);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.skip-link:focus {
  top: 0.75rem;
}

/* ------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  color: var(--header-text);
}

.site-header-inner {
  max-width: 1200px;
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  color: inherit;
}

.brand img {
  display: block;
  height: 26px;
  width: auto;
}

.brand-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.35);
}

.brand-title {
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
}

.nav-toggle[hidden] {
  display: none;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }

/* --------------------------------------------------------------- layout */

.page {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.content {
  min-width: 0;
  max-width: 760px;
}

.content:focus {
  outline: none;
}

/* -------------------------------------------------------------- sidebar */

.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow-y: auto;
  padding: 8px 4px 8px 0;
  font-size: 0.9375rem;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-home,
.nav-product-link {
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.nav-home {
  margin-bottom: 12px;
}

.nav-product + .nav-product {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.nav-releases {
  margin: 4px 0 6px;
}

.nav-releases a,
.nav-all {
  display: block;
  padding: 4px 12px 4px 24px;
  border-radius: 6px;
  color: var(--text-secondary);
  text-decoration: none;
}

.nav-all {
  font-size: 0.875rem;
  color: var(--link);
}

.sidebar a:hover {
  background: var(--surface);
  color: var(--link-hover);
}

.sidebar a[aria-current="page"] {
  background: var(--features-bg);
  color: var(--features-text);
  box-shadow: inset 3px 0 0 var(--irwin-blue);
}

/* ---------------------------------------------------------------- hero */

.hero {
  margin-bottom: 32px;
}

.hero h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  letter-spacing: -0.01em;
}

.hero--compact h1 {
  font-size: clamp(1.6rem, 1.35rem + 1vw, 2.125rem);
}

.lead {
  margin: 8px 0 0;
  font-size: 1.125rem;
  color: var(--text-secondary);
}

.section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.notice {
  margin-bottom: 24px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border-left: 4px solid var(--irwin-blue);
  background: var(--features-bg);
  color: var(--features-text);
}

.notice[hidden] {
  display: none;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--irwin-blue);
}

@media (prefers-color-scheme: dark) {
  .eyebrow { color: var(--link); }
}

/* ------------------------------------------------------------- products */

.product-grid {
  list-style: none;
  margin: 0 0 40px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.product-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.product-card h3 {
  font-size: 1.125rem;
}

.product-card h3 a {
  text-decoration: none;
}

.product-card p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.product-card .product-card-meta {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ------------------------------------------------------------- releases */

.release-card,
.release {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.release-card {
  padding: 24px;
  margin-bottom: 16px;
}

.release {
  padding: 32px;
}

.release-card-header h3 {
  font-size: 1.25rem;
}

.release-card-header h3 a {
  color: var(--text);
  text-decoration: none;
}

.release-card-header h3 a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.release-header h1 {
  font-size: clamp(1.6rem, 1.35rem + 1vw, 2.125rem);
}

.release-meta {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
}

.chip {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.chip--features { background: var(--features-bg); color: var(--features-text); }
.chip--fixes { background: var(--fixes-bg); color: var(--fixes-text); }
.chip--improvements { background: var(--improvements-bg); color: var(--improvements-text); }
.chip--general { background: var(--general-bg); color: var(--general-text); }

.release-body {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.release-body > :first-child {
  margin-top: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 8px;
  font-size: 1rem;
  font-weight: 600;
}

.section-heading::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--general-text);
}

.section-heading--features::before { background: var(--irwin-blue); }
.section-heading--fixes::before { background: #e50400; }
.section-heading--improvements::before { background: #2d8b53; }

@media (prefers-color-scheme: dark) {
  .section-heading--features::before { background: #52a9fa; }
  .section-heading--fixes::before { background: #ff5e5c; }
  .section-heading--improvements::before { background: #5eba83; }
}

.release-body ul,
.release-body ol {
  margin: 0;
  padding-left: 1.5rem;
}

.release-body li {
  margin: 4px 0;
  color: var(--text-secondary);
}

.release-body li::marker {
  color: var(--text-muted);
}

.release-body p {
  margin: 8px 0;
}

.release-body code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.release-body pre {
  overflow-x: auto;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.release-body pre code {
  padding: 0;
  border: 0;
  background: none;
}

/* --------------------------------------------------------- product page */

.year {
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.year summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
}

.year summary::-webkit-details-marker {
  display: none;
}

.year summary::before {
  content: "";
  align-self: center;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.year[open] summary::before {
  transform: rotate(45deg);
}

.year summary h2 {
  font-size: 1.25rem;
}

.year .count {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.release-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 8px;
}

.release-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

.release-list .chips {
  margin: 0;
}

.release-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-weight: 500;
  text-decoration: none;
}

.release-row:hover .release-row-title {
  text-decoration: underline;
}

.release-row-date {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 400;
}

/* ---------------------------------------------------------------- pager */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.pager-link {
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
}

.pager-link:hover {
  border-color: var(--irwin-blue);
}

.pager-link--older {
  text-align: right;
}

.pager-label {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* --------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer p {
  margin: 4px 0;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 899px) {
  :root {
    --header-height: 56px;
  }

  .site-header-inner,
  .page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page {
    display: block;
    padding-top: 20px;
  }

  .brand-title {
    font-size: 1rem;
  }

  .brand-divider {
    height: 20px;
  }

  /* without JS the navigation simply sits above the content */
  .sidebar {
    position: static;
    max-height: none;
    margin-bottom: 24px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .js .sidebar {
    display: none;
  }

  .js .nav-open .sidebar {
    display: block;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    margin: 0;
    border-radius: 0;
    border-width: 1px 0 0;
    overflow-y: auto;
    padding: 16px;
  }

  .release,
  .release-card {
    padding: 20px;
  }

  .pager {
    grid-template-columns: 1fr;
  }

  .pager-link--older {
    text-align: left;
  }
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
