/* COCO guide pages. Loaded after site.css (uses its :root tokens). */
.guide-page main {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 16px 72px;
}

/* Never let an image exceed the page width, even before other rules apply. */
.guide-page img {
  max-width: 100%;
  height: auto;
}

.guide-hero h1 {
  margin: 4px 0 12px;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  line-height: 1.25;
}

.guide-lead {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.guide-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px;
  padding: 0;
  counter-reset: flow;
  list-style: none;
}

.guide-flow li {
  position: relative;
  padding: 14px 14px 14px 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-strong);
  counter-increment: flow;
  line-height: 1.6;
}

.guide-flow li::before {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  content: counter(flow);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

.guide-flow strong,
.guide-flow span {
  display: block;
}

.guide-flow span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.guide-toc {
  display: grid;
  gap: 8px;
  margin: 0 0 40px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-strong);
  list-style: none;
}

.guide-toc a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.guide-toc a:hover,
.guide-toc a:focus-visible {
  color: var(--accent-dark);
  text-decoration: underline;
}

.guide-toc span {
  display: inline-block;
  min-width: 2.2em;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}

.guide-step {
  margin: 0 0 48px;
  scroll-margin-top: 80px;
}

.guide-step h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 8px;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  line-height: 1.3;
}

.guide-step h2 .step-no {
  flex: none;
  color: var(--accent);
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
}

.guide-goal {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-left: 4px solid var(--leaf);
  border-radius: 0 10px 10px 0;
  background: rgba(84, 134, 107, 0.1);
  font-weight: 700;
}

.guide-step p,
.guide-step li {
  line-height: 1.85;
}

.guide-step ol,
.guide-step ul {
  padding-left: 1.4em;
}

.guide-step h3 {
  margin: 28px 0 8px;
  font-size: 1.1rem;
}

.guide-shot {
  margin: 16px 0;
}

.guide-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.guide-shot figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Placeholder for a screenshot not yet taken. Hidden on the public page;
   remove the next rule to see where each one goes while editing. */
.guide-shot.is-pending {
  display: none;
}

.guide-shot.is-pending .shot-placeholder {
  display: grid;
  min-height: 200px;
  padding: 20px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: var(--paper-strong);
  color: var(--muted);
  font-size: 0.9rem;
  place-items: center;
  text-align: center;
}

.guide-note {
  margin: 16px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-strong);
  line-height: 1.75;
}

.guide-note strong {
  color: var(--accent-dark);
}

.guide-keys {
  width: 100%;
  margin: 12px 0;
  border-collapse: collapse;
}

.guide-keys th,
.guide-keys td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.guide-keys th {
  width: 40%;
  font-weight: 700;
}

.guide-faq details {
  margin: 8px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-strong);
}

.guide-faq summary {
  cursor: pointer;
  font-weight: 700;
}

.guide-faq details p {
  margin: 8px 0 0;
}

.guide-banner {
  display: flex;
  align-items: stretch;
  margin: 20px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-strong);
  color: var(--ink);
  text-decoration: none;
  transition: box-shadow 120ms ease, transform 120ms ease;
}

.guide-banner:hover,
.guide-banner:focus-visible {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.guide-banner img {
  display: block;
  width: 260px;
  max-width: 44%;
  height: auto;
  flex: none;
  align-self: center;
}

.guide-banner-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 12px 18px;
  line-height: 1.5;
}

.guide-banner-text strong {
  font-size: 1.05rem;
}

.guide-banner-text span {
  color: var(--muted);
  font-size: 0.9rem;
}

.guide-banner-text em {
  align-self: flex-start;
  margin-top: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-style: normal;
  font-weight: 700;
}

.guide-banner:hover .guide-banner-text em,
.guide-banner:focus-visible .guide-banner-text em {
  background: var(--accent-dark);
}

@media (max-width: 480px) {
  .guide-banner {
    flex-direction: column;
  }

  .guide-banner img {
    width: 100%;
    max-width: 100%;
  }
}

.guide-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
}

@media (max-width: 560px) {
  .guide-keys th,
  .guide-keys td {
    display: block;
    width: auto;
  }

  .guide-keys th {
    border-bottom: 0;
    padding-bottom: 0;
  }
}
