/*
 * changelog.godoo.app: godoo's light palette, the console's tokens. Light only.
 * Every rule lives in this file: the page is served with style-src 'self', so no element carries a style
 * attribute and there is no <style> element.
 */

/* Plus Jakarta Sans, self-hosted (OFL, fonts/OFL.txt): the variable latin subset, as the console ships it. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations"),
       url("fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;

  /* surfaces */
  --page: #f4f6f9;
  --surface: #ffffff;
  --inset: #f7f9fb;           /* the technical details, behind code */
  --rule: #dfe4e8;
  --rule-soft: #e9edf1;       /* between the entries of a month */

  /* ink: each at least 4.5:1 on white and on the page */
  --ink: #11273b;             /* headings, 15:1 */
  --text: #1b2b3a;
  --text-2: #3d4e60;          /* body copy, 8.5:1 */
  --muted: #5a6b7d;           /* dates, captions, 5.1:1 on the page */

  /* godoo. The magenta of the logo's dot stays in the logo: brand only, never a status. */
  --blue: #00629d;            /* primary: links, controls, focus */
  --blue-hover: #00527f;
  --blue-soft: rgba(0, 98, 157, .08);
  --navy: #0a4f7a;            /* the logo's wordmark */
  --focus: #00629d;

  /* kinds: text 5.3:1 or more on its own tint */
  --new: #00629d;      --new-bg: #e6f0f7;
  --improved: #0d6b66; --improved-bg: #e3f2f0;
  --fixed: #17703a;    --fixed-bg: #e4f2e9;
  --security: #6537b3; --security-bg: #eee8f8;
  --update: #4d5d6e;   --update-bg: #edf1f5;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 0 0 1px rgba(16, 42, 67, .02), 0 1px 2px rgba(16, 42, 67, .05), 0 14px 32px -20px rgba(16, 42, 67, .2);

  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;

  --column: 768px;
  --gutter: 24px;
}

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

/* An element with its own display rule still hides when the page sets `hidden` on it. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 480px at 88% -12%, rgba(0, 98, 157, .075), transparent 70%) no-repeat,
    radial-gradient(760px 360px at -8% 0%, rgba(10, 79, 122, .04), transparent 70%) no-repeat,
    var(--page);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }

::selection { background: rgba(0, 98, 157, .16); }

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

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.site-header { padding-top: 32px; }

.brand {
  display: inline-block;
  border-radius: 8px;
}
.brand img {
  display: block;
  width: auto;
  height: 32px;
}

/* The title and, beside it, the switch; the switch drops below the title when the row is too narrow. */
.intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 40px;
  padding: 56px 0 28px;
  border-bottom: 1px solid var(--rule);
}
.intro-text { flex: 1 1 320px; min-width: 0; }
.intro .switch { flex: none; }

h1 {
  margin: 0;
  color: var(--ink);
  font-size: 46px;
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -.03em;
}

.lede {
  margin: 12px 0 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
  text-wrap: balance;
}

/* ---- the "Show technical details" switch: a native checkbox, drawn by its sibling track ------------------ */

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 560;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.switch-input {
  position: absolute;
  top: 50%;
  left: 0;
  width: 36px;
  height: 20px;
  margin: -10px 0 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #7d8b9b;        /* 3.2:1 on the page */
  transition: background-color .18s ease;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 42, 67, .3);
  transition: transform .18s ease;
}
.switch:hover .switch-track { background: #6b7a8b; }
.switch-input:checked + .switch-track { background: var(--blue); }
.switch:hover .switch-input:checked + .switch-track { background: var(--blue-hover); }
.switch-input:checked + .switch-track::after { transform: translateX(16px); }
.switch-input:focus-visible + .switch-track {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---- the feed ------------------------------------------------------------------------------------------ */

.feed { padding-bottom: 8px; }

.month { margin-top: 44px; }

.month-title {
  margin: 0 0 14px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .09em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.entries {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.entry-item + .entry-item { border-top: 1px solid var(--rule-soft); }

.entry {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 12px;
  padding: 26px 30px 22px 26px;
  scroll-margin-top: 24px;
  transition: background-color .3s ease, box-shadow .3s ease;
}
.entry:focus { outline: none; } /* focused only when a link lands on it: .is-target shows it */

/* the entry a link points at */
.entry.is-target {
  background: linear-gradient(90deg, rgba(0, 98, 157, .06), rgba(0, 98, 157, 0) 70%);
  box-shadow: inset 3px 0 0 var(--blue);
}

.entry-emoji {
  font-family: var(--emoji);
  font-size: 21px;
  line-height: 26px;
  text-align: center;
}

.entry-main { min-width: 0; }

.entry-title {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 680;
  line-height: 26px;
  letter-spacing: -.012em;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.entry-summary {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.65;
}

/* Kind, date and copy-link on the left, "Technical details" on the right; on a narrow screen the button
   wraps under them, at the start of the line. */
.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.entry-facts {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  min-width: 0;
}

.kind {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .01em;
}
.kind-new { color: var(--new); background: var(--new-bg); }
.kind-improved { color: var(--improved); background: var(--improved-bg); }
.kind-fixed { color: var(--fixed); background: var(--fixed-bg); }
.kind-security { color: var(--security); background: var(--security-bg); }
.kind-update { color: var(--update); background: var(--update-bg); }

.entry-date { white-space: nowrap; }

.permalink {
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
}
.permalink:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.icon {
  display: block;
  flex: none;
}

.copy-link,
.details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.copy-link {
  height: 28px;
  margin: 0 -6px;
  padding: 0 6px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  transition: color .15s ease, background-color .15s ease, opacity .15s ease;
}
.copy-link:hover { color: var(--blue); background: var(--blue-soft); }
.copy-link .icon-check { display: none; }
.copy-link.is-copied { color: var(--fixed); }
.copy-link.is-copied .icon-link { display: none; }
.copy-link.is-copied .icon-check { display: block; }

/* With a mouse, the copy-link button waits for the entry to be pointed at, so a row reads as the date and
   its details; the keyboard and touch screens always have it. */
@media (hover: hover) and (pointer: fine) {
  .copy-link { opacity: 0; }
  .entry:hover .copy-link,
  .entry:focus-within .copy-link,
  .copy-link.is-copied { opacity: 1; }
}

.details-toggle {
  height: 32px;
  margin: -4px -10px -4px 0;  /* the padding hangs into the entry's own, so the words end at the column */
  padding: 0 10px 0 12px;
  border-radius: 999px;
  color: var(--blue);
  font-size: 13.5px;
  font-weight: 620;
  transition: background-color .15s ease;
}
.details-toggle:hover,
.details-toggle[aria-expanded="true"] { background: var(--blue-soft); }
.chevron { transition: transform .2s ease; }
.details-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.entry-details {
  margin: 16px 0 4px -14px;
  padding: 16px 18px 16px 14px;
  background: var(--inset);
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.65;
  animation: reveal .22s ease-out;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* ---- the Markdown subset ------------------------------------------------------------------------------- */

.prose > * { margin: 0; }
.prose > * + * { margin-top: .7em; }
.prose ul,
.prose ol { padding-left: 1.3em; }
/* the entries are an <ol> themselves: without these, the browser marks a list inside one as nested */
.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }
.prose li + li { margin-top: .3em; }
.prose li::marker { color: #8494a5; }
.prose strong { color: var(--text); font-weight: 680; }
.prose h4 {
  color: var(--ink);
  font-size: 1em;
  font-weight: 700;
}
.prose a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.prose a:hover {
  color: var(--blue-hover);
  text-decoration-thickness: 2px;
}
.prose code {
  padding: .12em .38em;
  border: 1px solid rgba(16, 42, 67, .09);
  border-radius: 6px;
  background: rgba(16, 42, 67, .045);
  color: var(--text);
  font-family: var(--mono);
  font-size: .86em;
  overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;  /* a code span that wraps keeps its box on both lines */
}
.prose pre {
  overflow-x: auto;
  padding: 12px 14px;
  border: 1px solid rgba(16, 42, 67, .09);
  border-radius: var(--radius-sm);
  background: var(--surface);
  line-height: 1.55;
}
.entry-summary pre { background: var(--inset); }
.prose pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  white-space: pre;
  overflow-wrap: normal;
}

/* ---- loading, empty, error ----------------------------------------------------------------------------- */

.state { margin-top: 44px; }

.state-message {
  padding: 48px 28px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.noscript {
  color: var(--text-2);
  font-size: 15px;
}

.state-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
}
.state-error .state-icon { background: rgba(209, 36, 47, .08); color: #b01f29; }

.state-title {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 680;
  line-height: 1.35;
}

.state-text {
  margin: 8px auto 0;
  max-width: 44ch;
  color: var(--muted);
  font-size: 15px;
  text-wrap: balance;
}

.button {
  display: inline-flex;
  align-items: center;
  height: 38px;
  margin-top: 20px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #ffffff;
  font: 620 14px/1 var(--font);
  cursor: pointer;
  transition: background-color .15s ease;
}
.button:hover { background: var(--blue-hover); }

.sk {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e7ebf0 0%, #f1f4f7 50%, #e7ebf0 100%) 0 0 / 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.sk-month { width: 120px; margin-bottom: 18px; }
.sk-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.sk-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 12px;
  padding: 28px 30px 28px 26px;
}
.sk-row + .sk-row { border-top: 1px solid var(--rule-soft); }
.sk-emoji { grid-row: span 3; width: 22px; height: 22px; border-radius: 7px; }
.sk-row .sk { grid-column: 2; }
.sk-row .sk-emoji { grid-column: 1; }
.sk-title { width: 62%; height: 16px; }
.sk-narrow { width: 48%; }
.sk-line { width: 92%; }
.sk-short { width: 54%; }

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

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

.site-footer { margin-top: 64px; }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  padding: 22px 0 44px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.footer-inner p { margin: 0; }

/* ---- small screens ------------------------------------------------------------------------------------- */

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .site-header { padding-top: 22px; }
  .brand img { height: 28px; }
  .intro { padding: 36px 0 22px; gap: 18px; }
  h1 { font-size: 36px; }
  .lede { font-size: 16px; }
  .month { margin-top: 32px; }
  .entry {
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 10px;
    padding: 20px 18px 18px 14px;
  }
  .entry-emoji { font-size: 18px; }
  .entry-title { font-size: 17px; line-height: 24px; }
  .entry-emoji { line-height: 24px; }
  .entry-summary { font-size: 15px; }
  /* the icon alone; the words stay the button's name */
  .copy-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  /* under the kind and the date, its words in line with theirs */
  .details-toggle { margin: -2px 0 -4px -12px; }
  /* the details take the whole row, under the emoji too */
  .entry-details { margin-left: -34px; padding: 14px; }
  .sk-row { grid-template-columns: 24px minmax(0, 1fr); column-gap: 10px; padding: 22px 18px 22px 14px; }
  .state-message { padding: 40px 20px; }
}

/* ---- preferences and media ----------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .switch-track { border: 1px solid CanvasText; background: Canvas; }
  .switch-track::after { background: CanvasText; }
  .switch-input:checked + .switch-track { background: Highlight; }
  .switch-input:checked + .switch-track::after { background: HighlightText; }
  .kind, .entries, .entry-details, .state-message { border: 1px solid CanvasText; }
  .entry.is-target { outline: 2px solid Highlight; outline-offset: -2px; }
}

@media print {
  body { background: #ffffff; }
  .switch, .copy-link, .details-toggle { display: none !important; }
  .entry-details[hidden] { display: block !important; }
  .entries, .state-message { box-shadow: none; }
  .entry-details { animation: none; }
}
