/* ═════════════════════════════════════════════════════════════════
   Part pages — image + text sections for individual part groups

   Part pages live in docs/parts/ and reuse the docs chrome
   (purple super-category sections from css/docs/cards.css).
   This file styles the back link, the image+text sections,
   and the parameter/code blocks.
   ═════════════════════════════════════════════════════════════════ */

/* ── Back link ─────────────────────────────────────── */
.part-page__back {
    margin: 0 0 1rem;
    font-size: clamp(13px, 1vw, 15px);
}

.part-page__back a {
    color: var(--purple-dark);
    font-weight: 700;
    text-decoration: none;
}

.part-page__back a:hover {
    color: var(--purple-light);
}

.part-page__back-icon {
    width: 0.9em;
    height: 0.9em;
    vertical-align: -0.1em;
    margin-right: 0.35rem;
}

/* ── Image + text section ────────────────────────────
   Two-column row: image card on the left, text on the
   right.  Stacks on narrow screens.                    */
.part-section {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 2fr;
    gap: 1.5rem;
    align-items: start;
    margin-top: 1.5rem;
}

/* ── Image column: stackable image blocks ───────────── */
.part-section__imgs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.part-section__img {
    background: #f0eaf0;
    border: 1px solid var(--purple-white);
    border-radius: 10px;
    padding: 0.75rem;
    overflow: hidden;   /* clips the caption bar to the rounded corners */
}

/* Composite of part thumbnails, each with its name */
.part-thumb-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    background: #f0eaf0;
    border: 1px solid var(--purple-white);
    border-radius: 10px;
    padding: 0.5rem;
}

.part-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: #fff;
    border: 1px solid var(--purple-white);
    border-radius: 6px;
    padding: 0.35rem;
}

.part-thumb img {
    display: block;
    width: 100%;
    height: auto;
}

.part-thumb__name {
    font-size: clamp(10px, 0.9vw, 13px);
    font-weight: 700;
    color: var(--purple-mid);
}

.part-section__img img {
    display: block;
    width: 100%;
    height: auto;
}

.part-section__img video {
    display: block;
    width: 100%;
    height: auto;
}

/* Caption bar — flush with the image box edges, separated
   from the image by a hairline. */
.part-section__caption {
    margin: 0.75rem -0.75rem -0.75rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border-top: 1px solid var(--purple-light);
    font-size: clamp(11px, 1vw, 14px);
    color: var(--purple-dark);
    text-align: center;
}

.part-section__caption code {
    background: none;
    padding: 0;
}

.part-section__body {
    color: var(--purple-dark);
    min-width: 0;
}

.part-section__body h2 {
    font-size: clamp(15px, 1.3vw, 21px);
    font-weight: 800;
    color: var(--purple-mid);
    margin: 0 0 0.75rem;
}

.part-section__body p {
    font-size: clamp(13px, 1.1vw, 17px);
    line-height: 1.5;
    margin: 0 0 0.75rem;
}

.part-section__body p:last-child {
    margin-bottom: 0;
}

/* ── Parameter table ──────────────────────────────── */
.part-section__params {
    border-collapse: collapse;
    width: 100%;
    margin: 0 0 0.75rem;
    font-size: clamp(13px, 1.1vw, 17px);
    line-height: 1.5;
}

.part-section__params td {
    vertical-align: top;
    padding: 0.35rem 0.75rem 0.35rem 0;
    border-bottom: 1px solid var(--purple-white);
}

.part-section__params td:first-child {
    font-weight: 700;
    white-space: nowrap;
}

.part-section__params tr:last-child td {
    border-bottom: none;
}

/* ── Inline + block code ─────────────────────────────
   Inline code is plain text, no pill highlight: the whole
   page is already monospace, and highlighted words inside
   paragraphs looked jarring.  Only pre blocks get a box.  */
.part-section code {
    color: var(--purple-dark);
}

/* ── Code blocks (div, no <pre> allowed) ─────────── */
.part-section__code {
    background: var(--purple-white);
    border: 1px solid var(--purple-light);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 0 0 0.75rem;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.6;
    color: var(--purple-dark);
}

/* ── Blue themed sections ────────────────────────────
   Section text and code boxes follow the blue palette. */
.docs-super-category-blue .part-section__body {
    color: var(--blue-dark);
}

.docs-super-category-blue .part-section__code {
    background: var(--blue-white);
    border-color: var(--blue-light);
    color: var(--blue-dark);
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1000px) {
    .part-section {
        grid-template-columns: minmax(0, 1fr);
    }

    .part-section__img,
    .part-thumb-grid {
        max-width: 22rem;
    }
}
