@import url("../vendor/marinos/marinos.css");

/* Widen the whole docs-shell (header, page, footer) on guide pages only —
   this stylesheet is never loaded by sop/ or brand/ pages, so this can't leak
   there. Three sidebar-flanked columns need more room than the standard
   --docs-max-width (1180px) gives, and widening only .page while leaving the
   header/footer at the old width would reintroduce a header/content
   misalignment bug fixed elsewhere in this codebase. */
.header-inner,
.footer-inner,
.page {
  max-width: 1440px;
}

.guide-layout {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr) 15.5rem;
  gap: 2.5rem;
  align-items: start;
}

.guide-outline {
  position: sticky;
  top: 1rem;
  align-self: start;
  font-size: 0.9rem;
}

.guide-outline h2 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--app-text);
}

.guide-outline > div + div {
  margin-top: 1.25rem;
}

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

.guide-outline li {
  margin: 0;
  padding: 0;
}

.guide-outline a {
  display: block;
  padding: 0.15rem 0;
  color: var(--app-muted);
  text-decoration: none;
}

.guide-outline a:hover {
  color: var(--app-accent);
  text-decoration: underline;
}

.guide-outline a[aria-current="page"] {
  color: var(--app-accent);
  font-weight: 700;
}

.guide-callout {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--app-border);
  border-left: 0.375rem solid var(--app-border);
  border-radius: var(--pico-border-radius);
  background: var(--app-surface);
}

.guide-callout__label {
  display: block;
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.guide-callout p:last-child,
.guide-callout ul:last-child {
  margin-bottom: 0;
}

.guide-callout--required {
  border-left-color: var(--app-danger);
}

.guide-callout--required .guide-callout__label {
  color: var(--app-danger-text);
}

.guide-callout--best-practice {
  border-left-color: var(--app-success);
}

.guide-callout--best-practice .guide-callout__label {
  color: var(--app-success);
}

.original-subsection {
  margin: 1.75rem 0;
}

.original-subsection h2 {
  font-size: 1.05rem;
}

.rules-permitted {
  margin: 1.5rem 0;
}

.rules-filter-toolbar {
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1rem 0 1.5rem;
}

.rules-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.guide-example {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--app-border);
  border-radius: var(--pico-border-radius);
  background: var(--app-surface);
}

.guide-example p:last-child {
  margin-bottom: 0;
}

.guide-example__label {
  display: block;
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--app-muted);
}

/* The engagement lifecycle: a way around the guide, drawn above the page (outside the content box) as numbered
   steps ("1. Plan"). The step(s) the page belongs to carry aria-current="step": bold, with a thick blue line under it. */
.guide-lifecycle {
  margin: 0 0 1.5rem;
}

.guide-lifecycle ol,
nav.guide-lifecycle ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
  counter-reset: step;
  border-bottom: 1px solid var(--app-border);
}

.guide-lifecycle li {
  margin: 0 0 -1px;
  padding: 0;
  counter-increment: step;
}

.guide-lifecycle a,
nav.guide-lifecycle a,
.guide-lifecycle li > span {
  display: block;
  margin: 0;
  padding: 0.4rem 0.1rem;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--app-text);
  font-size: 0.9rem;
  text-decoration: none;
}

.guide-lifecycle a::before,
.guide-lifecycle li > span::before {
  content: counter(step) ". ";
}

.guide-lifecycle a:hover {
  border-bottom-color: var(--app-border);
  color: var(--app-accent-on-tint);
}

.guide-lifecycle [aria-current="step"],
.guide-lifecycle a[aria-current="step"]:hover {
  border-bottom-color: var(--app-accent);
  font-weight: 700;
}

.guide-checklist {
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.guide-checklist li {
  margin: 0.5rem 0;
  list-style: none;
}

.guide-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.guide-quick-links {
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.guide-quick-links li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-quick-links a {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid var(--app-border);
  border-radius: var(--pico-border-radius);
  background: var(--app-surface);
  color: var(--app-text);
  text-decoration: none;
}

.guide-quick-links a:hover {
  border-color: var(--app-accent);
}

.guide-quick-links .guide-quick-links__question {
  display: block;
  font-weight: 700;
}

.guide-quick-links .guide-quick-links__text {
  display: block;
  margin-top: 0.15rem;
  color: var(--app-muted);
  font-size: 0.9rem;
}

.guide-quick-links .guide-quick-links__answer {
  display: block;
  margin-top: 0.15rem;
  color: var(--app-accent);
  font-size: 0.9rem;
}

.guide-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--app-border);
}

.guide-pager a {
  display: block;
  max-width: 48%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--app-border);
  border-radius: var(--pico-border-radius);
  color: var(--app-text);
  text-decoration: none;
}

.guide-pager a:hover {
  border-color: var(--app-accent);
}

.guide-pager__next {
  margin-left: auto;
  text-align: right;
}

.guide-pager__direction {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--app-muted);
  font-size: 0.8rem;
}

.guide-pager__next .guide-pager__direction {
  justify-content: flex-end;
}

.guide-pager__arrow {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.guide-glossary {
  margin: 0;
}

.guide-glossary dt {
  margin-top: 1rem;
  font-weight: 700;
}

.guide-glossary dd {
  margin: 0.15rem 0 0;
  color: var(--app-muted);
}

@media (max-width: 850px) {
  .guide-layout {
    grid-template-columns: 1fr;
  }

  .guide-outline,
  .toc {
    position: static;
    order: -1;
    padding: 1rem;
    border: 1px solid var(--app-border);
    border-radius: var(--pico-border-radius);
    background: var(--app-surface);
  }
}
