/* 7.41.0: the patch notes page (/howtochangelog.html, site/changelog_page.js). A release list in one stone window:
   each version a row (the version on a gold thread that runs down the left like a quest path, the title and date
   beside it); a row opens on its notes and its release picture. The newest row is open. */

.notes > .crumbs + * { margin-top: 18px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font: 800 14px/1.3 var(--body); color: var(--muted); }
.crumbs a { color: var(--label); text-decoration: none; text-shadow: var(--outline-sm); }
.crumbs a:hover { color: var(--rim-hi); }
.crumbs [aria-current] { color: var(--cream-dim); }

/* ------------------------------------------------------------------ the head: title left, the download right */
.notes-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 22px clamp(24px, 4vw, 56px);
}
.notes-intro { display: grid; gap: 16px; }
.notes-intro .lede { max-width: 54ch; }
.notes-act { display: grid; justify-items: end; gap: 10px; padding-bottom: 4px; }
.notes-act-note { color: var(--muted); font: 700 14px/1.3 var(--body); text-align: right; }

/* ------------------------------------------------------------------ the board */
.notes .notes-board { padding-block: clamp(14px, 2vw, 22px) clamp(8px, 1.4vw, 14px); }
.notes-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 0 4px 14px;
  border-bottom: 1px solid var(--line);
}
.notes-count { font: 900 14px/1.2 var(--body); color: var(--label); text-shadow: var(--outline-sm); }
.notes-all { min-height: 38px; padding: 0 16px 1px; font-size: 14px; }

.notes-list { --side: 172px; --gap: clamp(18px, 2.6vw, 30px); position: relative; list-style: none; margin: 0; padding: 0; }
/* the thread: gold at the newest update, fading into the older ones */
.notes-list::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 34px;
  bottom: 40px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--rim-lo), rgba(168, 138, 5, .35) 60%, rgba(168, 138, 5, 0));
  box-shadow: 0 0 0 1px rgba(10, 10, 12, .6);
}
.rel { position: relative; scroll-margin-top: 104px; }
.rel + .rel { border-top: 1px solid var(--line-soft); }

.rel-sum {
  position: relative;
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr) 30px;
  align-items: start;
  gap: 8px var(--gap);
  padding: 22px 4px 22px 0;
  list-style: none;
  cursor: pointer;
  border-radius: 10px;
}
.rel-sum::-webkit-details-marker { display: none; }
/* the game's arrow button: a small gold-rim square with a slate face (the FAQ's) */
.rel-sum::after {
  content: "";
  grid-column: 3;
  grid-row: 1;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  border: 2px solid var(--rim);
  border-radius: 7px;
  box-shadow: 0 0 0 1.5px var(--keyline), inset 0 1px 0 rgba(255, 255, 255, .2);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%230a0a0c' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%23f6eed3' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat,
    linear-gradient(180deg, #555665, #2f303a);
  transition: transform .26s var(--ease-out), border-color .16s ease;
}
.rel-item[open] > .rel-sum::after { transform: rotate(180deg); }
.rel-sum:hover::after { border-color: var(--rim-hi); }
.rel-sum:hover .rel-title { color: var(--rim-hi); }

/* the version on its node of the thread */
.rel-side { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding-left: 32px; }
.rel-ver {
  position: relative;
  font: 700 clamp(22px, 2.2vw, 27px)/1 var(--display);
  color: var(--cream);
  text-shadow: var(--outline-sm);
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
.rel-ver::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  background: url("/images/game/ui/plate-gold.webp") center / contain no-repeat;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6));
}
.rel:not(:first-child) .rel-ver::before { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)) saturate(.55) brightness(.82); }
.rel:target .rel-ver { color: var(--select); }
.rel-latest {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 5px;
  font: 900 12px/1 var(--body);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ok);
  text-shadow: var(--outline-sm);
  background: var(--inset-2);
  border: 2px solid var(--ok);
  border-radius: 999px;
  box-shadow: 0 0 0 1.5px var(--keyline);
}
.rel-latest::before { content: ""; width: 7px; height: 7px; background: var(--ok); border-radius: 50%; box-shadow: 0 0 0 1.5px var(--keyline); }

.rel-head { display: grid; gap: 9px; min-width: 0; }
.rel-title {
  font: 700 clamp(21px, 2.1vw, 26px)/1.18 var(--display);
  text-shadow: var(--outline-sm);
  transition: color .16s ease;
}
.rel-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rel-meta time { font: 800 14px/1.3 var(--body); color: var(--muted); font-variant-numeric: lining-nums; }
.rel-kind {
  padding: 3px 10px 4px;
  font: 900 12px/1.17 var(--body);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--cream);
  text-shadow: var(--outline-sm);
  background: var(--inset-2);
  border: 2px solid var(--stone-hi);
  border-radius: 999px;
  box-shadow: 0 0 0 1.5px var(--keyline);
}
.rel-kind-client { border-color: var(--rim-lo); }

/* the notes under the title */
.rel-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; justify-items: start; padding: 0 34px 30px calc(var(--side) + var(--gap)); }
.rel-body > * { min-width: 0; max-width: 100%; }
.rel-changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: min(72ch, 100%); }
/* a long address in a note wraps instead of pushing the page sideways on a phone */
.rel-changes li, .rel-get, .rel-title { overflow-wrap: anywhere; }
.rel-changes li {
  position: relative;
  padding-left: 28px;
  color: var(--cream-dim);
  font-size: 16.5px;
  line-height: 1.62;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.rel-changes li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: .42em;
  width: 15px;
  height: 15px;
  background: url("/images/game/ui/plate-gold.webp") center / contain no-repeat;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6));
}
.rel-card { width: 100%; max-width: 720px; }
.rel-get { display: flex; align-items: flex-start; gap: 10px; max-width: min(72ch, 100%); color: var(--muted); font: 700 15px/1.45 var(--body); }
.rel-get svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--rim); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }
.rel-empty { color: var(--cream-dim); }

/* opening a row: the notes come in under the title (only after a click, not on the first paint) */
@supports (interpolate-size: allow-keywords) {
  .notes.is-live { interpolate-size: allow-keywords; }
  .notes.is-live .rel-item::details-content {
    block-size: 0;
    overflow: clip;
    transition: block-size .46s var(--ease-out), content-visibility .46s allow-discrete;
  }
  .notes.is-live .rel-item[open]::details-content { block-size: auto; }
}
.rel-item.is-opening[open] .rel-body > * { animation: rel-in .56s var(--ease-out) both; }
.rel-item.is-opening[open] .rel-body > :nth-child(2) { animation-delay: .07s; }
.rel-item.is-opening[open] .rel-body > :nth-child(3) { animation-delay: .13s; }
@keyframes rel-in {
  from { opacity: 0; transform: translateY(8px); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* ------------------------------------------------------------------ closing window */
.notes-close p { max-width: 64ch; color: var(--cream-dim); }
.notes-close .btn-row { margin-top: 20px; }

/* ------------------------------------------------------------------ smaller screens */
@media (max-width: 900px) {
  .notes-head { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .notes-act { justify-items: start; }
  .notes-act-note { text-align: left; }
  .notes-list { --side: 140px; }
}
@media (max-width: 720px) {
  .notes > .crumbs + * { margin-top: 10px; }
  .notes-list::before { left: 8px; top: 30px; }
  .rel-sum { grid-template-columns: minmax(0, 1fr) 30px; gap: 12px 14px; padding: 18px 0 18px 0; }
  .rel-side { grid-column: 1; grid-row: 1; flex-direction: row; align-items: center; gap: 12px; padding-left: 30px; }
  .rel-ver::before { left: -30px; }
  .rel-head { grid-column: 1 / -1; grid-row: 2; padding-left: 30px; }
  .rel-body { padding: 0 0 24px 30px; gap: 18px; }
  .rel-changes li { font-size: 16px; }
}
@media (max-width: 440px) {
  .notes-act .btn { width: 100%; }
  .notes-act { justify-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .rel-item.is-opening[open] .rel-body > * { animation: none; }
  .notes.is-live .rel-item::details-content { transition: none; }
  .rel-sum::after, .rel-title { transition: none; }
}
