/* ===== Layout ===== */

.page-header,
.guide-content {
    max-width: var(--prose);
}

/* Only the very first chapter heading sits right under the page title —
   every later chapter keeps the theme's normal 56px top margin so chapters
   stay visually separated. (Each heading is the first child of its own
   <section>, so a plain :first-child selector would match all of them.) */
.guide-body > section:first-child > .section-title {
    margin-top: 8px;
}

/* ===== Chapter numbering (1, 2, 3 ... on each section heading) ===== */

.guide-body {
    counter-reset: chapter;
}

.guide-body .section-title {
    counter-increment: chapter;
}

.guide-body .section-title::before {
    content: counter(chapter);
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 700;
}

/* ===== Steps (number badge inline with the step's own text,
   never indenting the screenshot that follows it) ===== */

.guide-body .step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--text-soft);
    font-size: 15.5px;
    font-weight: 400;
    line-height: 1.85;
}

section.steps {
    counter-reset: stepnum;
}

section.steps .step {
    counter-increment: stepnum;
}

section.steps .step::before {
    content: counter(chapter) "." counter(stepnum);
    flex: 0 0 auto;
    margin-top: 3px;
    box-sizing: border-box;
    min-width: 30px;
    padding: 2px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-soft);
    color: var(--text-soft);
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
}

/* ===== Code / note ===== */

.guide-body .code {
    margin-bottom: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.guide-body .code + .step {
    margin-top: 24px;
}

.guide-body .note {
    position: relative;
    margin: 0 0 20px;
    padding: 14px 16px 14px 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.75;
}

.guide-body .note::before {
    content: "i";
    position: absolute;
    top: 14px;
    left: 14px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand);
    color: var(--on-accent);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    line-height: 1;
}

/* ===== Screenshots ===== */

.guide-body .shot {
    margin-bottom: 28px;
}

.guide-body .shot > img {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 420px;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.guide-body .shot > img ~ img {
    margin-top: 16px;
}

.guide-body > br,
.guide-body .shot > br {
    display: none;
}

/* ===== Video link ===== */

.video-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    height: 52px;
    margin-bottom: 8px;
    padding: 0 20px 0 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--text);
    font-size: 14.5px;
    font-weight: 550;
    text-decoration: none;
    transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease), transform 200ms var(--ease), background-color 200ms var(--ease);
}

.video-link:hover {
    border-color: var(--border-strong);
    background: var(--surface-hover);
    box-shadow: var(--shadow-md);
    color: var(--text);
    transform: translateY(-1px);
}

.video-link .play-btn {
    display: block;
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    padding: 11px;
    border-radius: 50%;
    background: var(--accent-soft);
}

/* ===== Parameter reference ===== */

.ref-section .param-group {
    margin-bottom: 20px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.ref-section .param-title {
    margin-bottom: 12px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.ref-section .param-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ref-section .param-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    line-height: 1.6;
}

.ref-section .param-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.ref-section .param-row dt {
    flex: 0 0 auto;
    padding: 1px 8px;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 600;
}

.ref-section .param-row dd {
    margin: 0;
    color: var(--muted);
}

.ref-section .param-example {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin: 12px 0 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}

.ref-section .param-group:has(> .param-example:first-of-type:last-child) .param-example {
    margin-top: 0;
}

.ref-section .example-label {
    flex: 0 0 auto;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 11px;
    font-weight: 650;
}

.ref-section .param-example code {
    flex: 1 1 220px;
    min-width: 0;
    color: var(--text-soft);
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .ref-section .param-group {
        padding: 16px;
    }
}
