@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.8rem;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

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

.guide-outline li {
  margin: 0.3rem 0;
}

.guide-outline a {
  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);
}

/* Generic tab-toggle chrome, ported as-is from sop/styles.css's
   .view-toggle (its BPMN-specific rules, e.g. .docs-layout--wide, are not
   included - this guide's two views are the same width). */
.view-toggle {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface);
}

.view-toggle button {
  padding: 0.35rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--app-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.view-toggle button:hover {
  color: var(--app-text);
}

.view-toggle button[aria-selected="true"] {
  background: var(--app-accent);
  color: var(--app-bg);
}

.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;
}

.rules-filter {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--app-border);
  border-radius: var(--pico-border-radius);
  background: none;
  color: var(--app-text);
  font-size: 0.85rem;
  cursor: pointer;
}

.rules-filter:hover {
  border-color: var(--app-accent);
}

.rules-filter[aria-pressed="true"] {
  border-color: var(--app-accent);
  background: color-mix(in srgb, var(--app-accent) 14%, transparent);
  color: var(--app-accent);
}

.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__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);
}

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

.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__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: block;
  color: var(--app-muted);
  font-size: 0.8rem;
}

.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);
  }
}
