/* Guides page (/guides/, guides.js + guide-page.js). The guide styles moved here from the explorer when the guides got
   their own page. */

.guides-main {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
  color: var(--text);
}

.guides-head h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.guides-head p {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.guides-back {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.guides-back::before {
  content: "← ";
}

.guides-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.guides-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(var(--panel-rgb), 0.75);
  color: var(--text);
  padding: 16px 18px;
  text-decoration: none;
}

.guides-card:hover,
.guides-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.guides-card h2 {
  margin: 0;
  font-size: 1.15rem;
}

.guides-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* The list's groups: AniiLogs' own guides, guides hosted elsewhere (linked-guides.js), and ended event guides. */
.guides-group + .guides-group {
  margin-top: 2rem;
}

.guides-group-title {
  margin: 0 0 0.2rem;
  font-size: 1.35rem;
}

.guides-group-line {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.guides-card.is-linked {
  grid-template-rows: auto 1fr auto;
}

.guides-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.guides-card-host {
  overflow-wrap: anywhere;
}

.guides-event {
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 1px 8px;
  white-space: nowrap;
}

.guides-card.is-archived h2 {
  color: var(--muted);
}

.guides-card.is-archived .guides-event {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.guide-page {
  container-type: inline-size;
  font-size: 15px;
  line-height: 1.6;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(200px, 250px) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.guide-toc {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(var(--panel-rgb), 0.7);
  padding: 12px 14px;
}

.guide-toc-title {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-toc ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
}

.guide-toc a {
  display: block;
  border-radius: 6px;
  color: var(--text);
  padding: 3px 6px;
  text-decoration: none;
}

.guide-toc a:hover,
.guide-toc a[aria-current] {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
}

details.guide-toc {
  position: static;
  display: none;
  margin-bottom: 14px;
}

details.guide-toc summary {
  cursor: pointer;
  list-style: revert;
}

.guide-article {
  display: grid;
  gap: 18px;
  min-width: 0;
  max-width: 820px;
}

.guide-intro {
  margin: 0;
  color: var(--muted);
}

.guide-section {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(var(--panel-rgb), 0.55);
  padding: 14px 18px;
  scroll-margin-top: 16px;
}

.guide-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
}

.guide-section h2 {
  margin: 0;
  font-size: clamp(18px, 1.7vw, 22px);
}

.guide-anchor {
  color: var(--muted);
  font-size: 0.8em;
  text-decoration: none;
  opacity: 0;
}

.guide-section-head:hover .guide-anchor,
.guide-anchor:focus-visible {
  opacity: 1;
}

.guide-basis {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 1px 8px;
}

.guide-basis.is-inferred,
.guide-basis.is-by-name {
  border-color: #6c5aa8;
  color: #b9a4f5;
}

.guide-section p {
  margin: 0;
}

.guide-note {
  color: var(--muted);
  font-size: 14px;
}

.guide-table-wrap {
  overflow-x: auto;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.4;
}

.guide-table th,
.guide-table td {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.guide-table thead th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.guide-back {
  justify-self: start;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.guide-back::before {
  content: "\2191  ";
}

.guide-tests {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.guide-tests li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(var(--background-rgb), 0.4);
  padding: 8px 10px;
}

.guide-test-box {
  width: 16px;
  height: 16px;
  margin-top: 4px;
  border: 2px solid #f2a93b;
  border-radius: 4px;
}

.guide-basis.is-inferred,
.guide-basis.is-by-name {
  border-color: #f2a93b;
  background: rgba(242, 169, 59, 0.12);
  color: #f2a93b;
}

/* Interlink guide: worked out on the game's server (not in the files), and measured from real results. */
.guide-basis.is-server {
  border-color: #e0697a;
  background: rgba(224, 105, 122, 0.12);
  color: #f0909c;
}

.guide-basis.is-measured {
  border-color: #4fb6d8;
  background: rgba(79, 182, 216, 0.12);
  color: #7fd0ea;
}

@container (max-width: 760px) {
  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  nav.guide-toc {
    display: none;
  }

  details.guide-toc {
    display: grid;
  }

  .guide-section {
    padding: 12px 14px;
  }
}
