/* Technical book typography & table styling for mdBook (all themes compatible) */

.content p,
.content li {
    line-height: 1.75;
}

.course-meta {
    text-align: right;
    font-size: 0.92em;
    color: color-mix(in srgb, var(--fg) 72%, transparent);
    margin-top: -0.4em;
}

.table-wrapper {
    margin: 1.4em 0 1.8em;
    overflow-x: auto;
}

table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 0.92em;
    line-height: 1.65;
    border-top: 2px solid color-mix(in srgb, var(--fg) 30%, transparent);
    border-bottom: 2px solid color-mix(in srgb, var(--fg) 30%, transparent);
}

table thead {
    background: color-mix(in srgb, var(--fg) 4%, transparent);
}

table thead tr {
    border: none;
    border-bottom: 1.5px solid color-mix(in srgb, var(--fg) 26%, transparent);
}

table thead th {
    padding: 0.65em 0.9em;
    font-weight: 600;
    text-align: left;
    vertical-align: bottom;
    white-space: nowrap;
    border: none;
    color: var(--fg);
}

table tbody tr {
    background: transparent;
    transition: background-color 0.12s ease;
}

table tbody tr:nth-child(2n) {
    background: transparent;
}

table tbody tr:hover {
    background: color-mix(in srgb, var(--fg) 3.5%, transparent);
}

table td {
    padding: 0.65em 0.9em;
    vertical-align: top;
    border: none;
    border-bottom: 1px solid color-mix(in srgb, var(--fg) 13%, transparent);
}

table tbody tr:last-child td {
    border-bottom: none;
}

table th[style*="text-align: right"],
table td[style*="text-align: right"] {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

table td code,
table th code {
    font-size: 0.88em;
    word-break: normal;
    overflow-wrap: break-word;
}

/* Header field tables: keep field name & struct member columns on a single line */
.field-table th:nth-child(1),
.field-table td:nth-child(1),
.field-table th:nth-child(2),
.field-table td:nth-child(2) {
    white-space: nowrap;
}

/* Callout boxes (Note / Tip / Important / Warning / Caution) */
.blockquote-tag {
    margin: 1.4em 0;
    padding: 0.8em 1.15em;
    border-radius: 0 6px 6px 0;
}

.blockquote-tag p:last-child {
    margin-bottom: 0;
}

.blockquote-tag-note {
    background-color: color-mix(in srgb, var(--blockquote-note-color) 7%, transparent);
}

.blockquote-tag-tip {
    background-color: color-mix(in srgb, var(--blockquote-tip-color) 7%, transparent);
}

.blockquote-tag-important {
    background-color: color-mix(in srgb, var(--blockquote-important-color) 7%, transparent);
}

.blockquote-tag-warning {
    background-color: color-mix(in srgb, var(--blockquote-warning-color) 8%, transparent);
}

.blockquote-tag-caution {
    background-color: color-mix(in srgb, var(--blockquote-caution-color) 8%, transparent);
}

/* Collapsible skeleton code explanations */
details.skeleton-details {
    margin: 1.2em 0 1.6em;
    border: 1px solid color-mix(in srgb, var(--fg) 18%, transparent);
    border-radius: 6px;
    background: color-mix(in srgb, var(--fg) 2.5%, transparent);
    padding: 0.2em 1.1em;
}

details.skeleton-details[open] {
    padding-bottom: 0.9em;
}

details.skeleton-details > summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.55em 0;
    color: var(--fg);
    user-select: none;
}

details.skeleton-details[open] > summary {
    border-bottom: 1px solid color-mix(in srgb, var(--fg) 13%, transparent);
    margin-bottom: 0.9em;
}

details.skeleton-details > :last-child {
    margin-bottom: 0;
}
