/* Tutorial-specific styling shared across notebook tutorials and the landing page. */

/* "Download notebook" link injected by nbsphinx_prolog */
.idtrack-notebook-meta {
    margin: 0 0 1rem 0;
    text-align: right;
}

.idtrack-notebook-download {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.03);
    font-size: 0.9em;
    text-decoration: none;
}

.idtrack-notebook-download:hover {
    background: rgba(0, 0, 0, 0.06);
    text-decoration: none;
}

/* Tutorial callouts: notebooks use Markdown blockquotes for Tip/Warning style guidance. */
.rst-content blockquote {
    margin: 1rem 0;
    padding: 0.85rem 1rem;
    border-left: 4px solid #2980b9; /* RTD blue */
    background: rgba(41, 128, 185, 0.08);
    border-radius: 6px;
}

.rst-content blockquote p {
    margin: 0.25rem 0;
}

.rst-content blockquote p strong {
    font-weight: 700;
}

/* Tutorial landing tables */
table.idtrack-tutorials-table {
    max-width: 72rem;
    width: 100%;
    table-layout: fixed;
    margin: 0.5rem auto 1.25rem auto;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    overflow: hidden;
}

table.idtrack-tutorials-table th {
    background: rgba(0, 0, 0, 0.03);
}

table.idtrack-tutorials-table td {
    vertical-align: top;
}

/* RTD theme forces `white-space: nowrap` inside responsive tables; override for our tutorials table. */
.wy-table-responsive table.idtrack-tutorials-table th,
.wy-table-responsive table.idtrack-tutorials-table td {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
}

/* Balanced column widths: Part (narrow), Description (wide), Start here (medium) */
table.idtrack-tutorials-table th:nth-child(1),
table.idtrack-tutorials-table td:nth-child(1) {
    width: 7rem;
}

table.idtrack-tutorials-table th:nth-child(3),
table.idtrack-tutorials-table td:nth-child(3) {
    width: 14rem;
}

table.idtrack-tutorials-table tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.015);
}

/* Sidebar: avoid horizontal “jitter” from long titles and keep clicks predictable. */
.wy-side-scroll {
    overflow-x: hidden;
}

.wy-menu-vertical a {
    white-space: normal;
}

/* Sphinx-design cards used on tutorial part pages */
.sd-card {
    border-radius: 10px;
}

.sd-card .sd-card-title {
    font-weight: 700;
}

/* Collapsible output blocks (%%collapse magic) */
details.idtrack-collapse {
    margin: 0.75rem 0;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    background: #fafafa;
}

details.idtrack-collapse summary {
    cursor: pointer;
    padding: 0.5rem 0.85rem;
    font-weight: 600;
    color: #2980b9;
    user-select: none;
    list-style: none;
}

details.idtrack-collapse summary::-webkit-details-marker {
    display: none;
}

details.idtrack-collapse summary::before {
    content: "▶ ";
    font-size: 0.75em;
    margin-right: 0.3rem;
}

details.idtrack-collapse[open] summary::before {
    content: "▼ ";
}

details.idtrack-collapse summary:hover {
    background: rgba(41, 128, 185, 0.06);
}

/* Explicitly hide content when collapsed (some themes interfere with default <details> behavior) */
details.idtrack-collapse:not([open]) > pre.idtrack-collapse-content {
    display: none;
}

pre.idtrack-collapse-content {
    margin: 0;
    padding: 0.75rem 1rem;
    max-height: 400px;
    overflow-x: auto;
    overflow-y: auto;
    background: #f5f5f5;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.7em;
    line-height: 1.3;
    white-space: pre;
}

pre.idtrack-collapse-content .stderr {
    color: #c0392b;
}

/* Dark mode support (Sphinx RTD dark-mode toggles). */
html[data-theme="dark"] details.idtrack-collapse,
body[data-theme="dark"] details.idtrack-collapse,
body.dark-mode details.idtrack-collapse {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] details.idtrack-collapse summary,
body[data-theme="dark"] details.idtrack-collapse summary,
body.dark-mode details.idtrack-collapse summary {
    color: #4aa3ff;
}

html[data-theme="dark"] details.idtrack-collapse summary:hover,
body[data-theme="dark"] details.idtrack-collapse summary:hover,
body.dark-mode details.idtrack-collapse summary:hover {
    background: rgba(74, 163, 255, 0.08);
}

html[data-theme="dark"] pre.idtrack-collapse-content,
body[data-theme="dark"] pre.idtrack-collapse-content,
body.dark-mode pre.idtrack-collapse-content {
    background: rgba(0, 0, 0, 0.25);
    border-top-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] pre.idtrack-collapse-content .stderr,
body[data-theme="dark"] pre.idtrack-collapse-content .stderr,
body.dark-mode pre.idtrack-collapse-content .stderr {
    color: #ff6b6b;
}
