/* Single Guide Page Styles - Self-Host.it Hugo Theme */

/* Article */
.article {
    padding: 2rem 1.5rem 4rem;
}

.article-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Article Header */
.article-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.article-header-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.article-logo {
    flex-shrink: 0;
}

.article-logo img {
    display: block;
    border-radius: 0.5rem;
    width: 150px;
    height: 150px;
    object-fit: contain;
}

.article-info {
    flex: 1;
    min-width: 0;
}

.article-info .article-meta {
    margin-bottom: 0.5rem;
}

.article-info .article-title {
    margin-bottom: 0.75rem;
}

.article-info .article-description {
    margin-bottom: 1rem;
}

.article-header .article-meta {
    margin-bottom: 1rem;
}

/* Article Level Badge */
.article-level {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: 1rem;
}

.article-level .level-icon {
    display: inline-flex;
    gap: 2px;
    align-items: flex-end;
}

.article-level .level-bar {
    width: 4px;
    background: var(--border-color);
    border-radius: 1px;
}

.article-level .level-bar:nth-child(1) { height: 8px; }
.article-level .level-bar:nth-child(2) { height: 12px; }
.article-level .level-bar:nth-child(3) { height: 16px; }

.article-level.level-beginner .level-bar:nth-child(1) { background: #22c55e; }
.article-level.level-beginner .level-text { color: #22c55e; }

.article-level.level-intermediate .level-bar:nth-child(1),
.article-level.level-intermediate .level-bar:nth-child(2) { background: #f59e0b; }
.article-level.level-intermediate .level-text { color: #f59e0b; }

.article-level.level-advanced .level-bar:nth-child(1),
.article-level.level-advanced .level-bar:nth-child(2),
.article-level.level-advanced .level-bar:nth-child(3) { background: #ef4444; }
.article-level.level-advanced .level-text { color: #ef4444; }

.article-header .article-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.article-header .article-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* Table of Contents */
.toc {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}

.toc-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

/* TOC Header con Toggle */
.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.toc-header .toc-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Pulsante Toggle */
.toc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.toc-toggle:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.toc-toggle:hover .toc-toggle-icon::before,
.toc-toggle:hover .toc-toggle-icon::after {
    background-color: #ffffff;
}

.toc-toggle:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.toc-toggle:focus:not(:focus-visible) {
    outline: none;
}

/* Icona +/- con CSS */
.toc-toggle-icon {
    position: relative;
    width: 0.75rem;
    height: 0.75rem;
}

.toc-toggle-icon::before,
.toc-toggle-icon::after {
    content: '';
    position: absolute;
    background-color: var(--text-secondary);
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.2s ease;
}

/* Barra orizzontale (sempre visibile = -) */
.toc-toggle-icon::before {
    width: 100%;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

/* Barra verticale (visibile quando collassato = +) */
.toc-toggle-icon::after {
    width: 2px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

/* Quando espanso: nascondi la barra verticale (mostra -) */
.toc:not(.collapsed) .toc-toggle-icon::after {
    opacity: 0;
}

/* Animazione contenuto TOC */
.toc-nav {
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    max-height: 1000px;
    opacity: 1;
}

.toc.collapsed .toc-nav {
    max-height: 0;
    opacity: 0;
}

/* Quando collassato, rimuovi margin/padding dal header */
.toc.collapsed .toc-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.toc-nav ul {
    list-style: none;
}

.toc-nav li {
    margin-bottom: 0.5rem;
}

.toc-nav a {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

.toc-nav a:hover {
    color: var(--accent-color);
}

.toc-nav ul ul {
    margin-left: 1.25rem;
    margin-top: 0.5rem;
}

.toc-nav ul ul a {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.toc-nav ul ul a:hover {
    color: var(--accent-color);
}

/* Article Content */
.article-content {
    font-size: 1.125rem;
    line-height: 1.85;
}

.article-content p {
    margin-bottom: 0.75rem;
    text-align: justify;
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.article-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.article-content a {
    color: var(--accent-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-content a:hover {
    color: var(--accent-hover);
}

/* Images */
.article-content img {
    max-height: 500px;
    width: auto;
    height: auto;
    display: block;
    margin: 1.5rem auto;
    border-radius: 0.5rem;
}

/* Blockquotes */
.article-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border-left: 4px solid var(--accent-color);
    border-radius: 0 0.75rem 0.75rem 0;
    font-size: 1.25rem;
    font-style: italic;
    color: var(--text-primary);
    text-align: center;
    box-shadow: var(--card-shadow);
}

.article-content blockquote p {
    margin-bottom: 0;
    text-align: center;
}

.article-content blockquote strong {
    color: var(--accent-color);
    font-weight: 700;
}

/* Content Lists */
.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.75rem;
}

/* Reduce space between paragraph and following list */
.article-content p + ul,
.article-content p + ol {
    margin-top: -0.25rem;
}

.article-content li {
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
    text-align: justify;
}

.article-content li strong {
    color: var(--text-primary);
}

/* Tables */
.article-content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    background-color: var(--bg-card);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.article-content thead {
    background-color: var(--accent-color);
}

.article-content thead th {
    padding: 0.875rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #ffffff;
    text-align: left;
    border-bottom: 2px solid var(--accent-hover);
}

.article-content tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.article-content tbody tr:last-child {
    border-bottom: none;
}

.article-content tbody tr:nth-child(even) {
    background-color: var(--bg-secondary);
}

.article-content tbody tr:hover {
    background-color: var(--bg-secondary);
}

.article-content tbody td {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    text-align: left;
}

.article-content tbody td:first-child {
    font-weight: 500;
    color: var(--text-primary);
}

/* Center-aligned table cells (for comparison tables) */
.article-content th:not(:first-child),
.article-content td:not(:first-child) {
    text-align: center;
}

/* Responsive tables */
@media (max-width: 768px) {
    .article-content table {
        font-size: 0.875rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .article-content thead th,
    .article-content tbody td {
        padding: 0.625rem 1rem;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .article-content thead th,
    .article-content tbody td {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* Inline Code */
.article-content code {
    font-family: 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875em;
    padding: 0.2em 0.4em;
    background-color: var(--inline-code-bg);
    color: var(--inline-code-text);
    border-radius: 0.25rem;
}

/* Code Blocks */
.code-block {
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: var(--code-bg);
    box-shadow: var(--card-shadow);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--code-header-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-language {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent-color);
    letter-spacing: 0.05em;
}

.code-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 0.25rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.code-copy-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.1);
}

.code-copy-btn.copied {
    color: var(--accent-color);
}

.code-content {
    margin: 0;
    padding: 0.75rem 1.25rem 1.25rem;
    overflow-x: auto;
}

.code-content code {
    font-family: 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.35;
    color: var(--code-text);
    background: none;
    padding: 0;
}

/* Hugo highlight shortcode compatibility */
.highlight {
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: var(--code-bg);
    box-shadow: var(--card-shadow);
}

.highlight pre {
    margin: 0;
    padding: 1rem 1.25rem;
    overflow-x: auto;
}

.highlight code {
    font-family: 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.35;
    color: var(--code-text);
    background: none;
    padding: 0;
}

/* Reset .highlight inside .code-block (styles already on parent) */
.code-block .highlight {
    margin-bottom: 0;
    border-radius: 0;
    overflow: visible;
    background-color: transparent;
    box-shadow: none;
}

.code-block .highlight pre {
    padding: 0;
    overflow-x: visible;
}

.code-block .chroma {
    background-color: transparent;
}

/* Figures / Images */
.article-figure {
    margin: 2rem 0;
    text-align: center;
}

.article-image {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.article-caption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Content Divider */
.content-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2.5rem 0;
}

/* Admonitions (Note, Warning, etc.) */
.admonition {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    border-left: 4px solid;
}

.admonition-note {
    background-color: var(--note-bg);
    border-left-color: var(--note-border);
}

.admonition-warning {
    background-color: var(--warning-bg);
    border-left-color: var(--warning-border);
}

.admonition-tip {
    background-color: var(--tip-bg);
    border-left-color: var(--tip-border);
}

.admonition-danger {
    background-color: var(--danger-bg);
    border-left-color: var(--danger-border);
}

.admonition-icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.admonition-note .admonition-icon {
    color: var(--note-icon);
}

.admonition-warning .admonition-icon {
    color: var(--warning-icon);
}

.admonition-tip .admonition-icon {
    color: var(--tip-icon);
}

.admonition-danger .admonition-icon {
    color: var(--danger-icon);
}

.admonition-content {
    flex: 1;
    font-size: inherit;
    color: var(--text-secondary);
    line-height: 1.6;
}

.admonition-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.admonition-content p {
    margin-bottom: 0.5rem;
}

.admonition-content p:last-child {
    margin-bottom: 0;
}

.admonition-content ul {
    margin: 0;
    padding-left: 1.25rem;
}

.admonition-content li {
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

.admonition-content li:last-child {
    margin-bottom: 0;
}

/* Steps/Timeline */
.steps-container {
    counter-reset: step-counter;
    margin: 2rem 0;
    padding: 0;
}

.step-item {
    display: flex;
    gap: 1.25rem;
    counter-increment: step-counter;
    position: relative;
}

.step-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.step-number {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    z-index: 1;
}

.step-number::before {
    content: counter(step-counter);
}

.step-line {
    width: 2px;
    flex-grow: 1;
    background-color: var(--border-color);
    min-height: 1.5rem;
}

.step-item:last-child .step-line {
    display: none;
}

.step-content {
    padding-bottom: 2rem;
    min-width: 0;
    flex: 1;
}

.step-item:last-child .step-content {
    padding-bottom: 0;
}

.step-content .step-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 2.25rem;
}

.step-description {
    color: var(--text-primary);
    font-size: 1.05rem;
    line-height: 1.75;
}

.step-description p:first-child {
    margin-top: 0;
}

.step-description p:last-child {
    margin-bottom: 0;
}

.step-description pre {
    margin: 1rem 0;
}

.step-description ul,
.step-description ol {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

/* Steps responsive */
@media (max-width: 768px) {
    .steps-container {
        margin: 1.5rem 0;
    }

    .step-item {
        gap: 1rem;
    }

    .step-number {
        width: 2rem;
        height: 2rem;
        font-size: 0.8rem;
    }

    .step-title {
        font-size: 1.25rem;
        line-height: 2rem;
    }

    .step-content {
        padding-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .step-item {
        gap: 0.75rem;
    }

    .step-number {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.75rem;
    }

    .step-title {
        font-size: 1.125rem;
        line-height: 1.75rem;
    }
}

/* Substeps */
.step-item {
    counter-reset: substep-counter;
}

.substeps-container {
    margin: 1rem 0 0.5rem;
    padding: 0;
}

.substep-item {
    display: flex;
    gap: 1rem;
    counter-increment: substep-counter;
    position: relative;
}

.substep-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.substep-number {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    flex-shrink: 0;
    z-index: 1;
}

.substep-number::before {
    content: counter(substep-counter);
}

.substep-line {
    width: 1px;
    flex-grow: 1;
    background-color: var(--border-color);
    min-height: 1rem;
}

.substep-item:last-child .substep-line {
    display: none;
}

.substep-content {
    padding-bottom: 1.25rem;
    min-width: 0;
    flex: 1;
}

.substep-item:last-child .substep-content {
    padding-bottom: 0;
}

.substep-content .substep-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5rem;
}

.substep-description {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.7;
}

.substep-description p:first-child {
    margin-top: 0;
}

.substep-description p:last-child {
    margin-bottom: 0;
}

.substep-description pre {
    margin: 1rem 0;
}

.substep-description ul,
.substep-description ol {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

/* Substeps responsive */
@media (max-width: 768px) {
    .substeps-container {
        margin: 0.75rem 0 0.25rem;
    }

    .substep-item {
        gap: 0.75rem;
    }

    .substep-number {
        width: 1.35rem;
        height: 1.35rem;
        font-size: 0.625rem;
    }

    .substep-content .substep-title {
        font-size: 1.05rem;
        line-height: 1.35rem;
    }

    .substep-content {
        padding-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .substep-item {
        gap: 0.5rem;
    }

    .substep-number {
        width: 1.25rem;
        height: 1.25rem;
        font-size: 0.575rem;
    }

    .substep-content .substep-title {
        font-size: 1rem;
        line-height: 1.25rem;
    }
}

/* Article Navigation */
.article-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.nav-prev,
.nav-next {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-prev:hover,
.nav-next:hover {
    border-color: var(--accent-color);
    box-shadow: var(--card-shadow);
}

.nav-next {
    text-align: right;
}

.nav-empty {
    background: transparent;
    border: none;
}

.nav-empty:hover {
    border: none;
    box-shadow: none;
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.nav-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.nav-prev:hover .nav-title,
.nav-next:hover .nav-title {
    color: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .article-header .article-title {
        font-size: 2.5rem;
    }

    .article-header .article-description {
        font-size: 1rem;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }

    .article-content h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .article {
        padding: 1.5rem 1rem 3rem;
    }

    .article-header {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }

    .article-header-container {
        gap: 1.5rem;
    }

    .article-logo img {
        width: 120px;
        height: 120px;
    }

    .article-header .article-title {
        font-size: 2.25rem;
    }

    .article-header .article-description {
        font-size: 0.9375rem;
    }

    .toc {
        padding: 1.25rem;
    }

    .article-content h2 {
        font-size: 1.375rem;
        margin-top: 2.5rem;
    }

    .article-content h3 {
        font-size: 1.25rem;
        margin-top: 1.75rem;
    }

    .code-content {
        padding: 0.625rem 1rem 1rem;
    }

    .code-content code {
        font-size: 0.8125rem;
    }

    .article-navigation {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .nav-next {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .article {
        padding: 1rem 0.75rem 2rem;
    }

    .article-header-container {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        text-align: center;
    }

    .article-logo img {
        width: 100px;
        height: 100px;
    }

    .article-info {
        text-align: center;
    }

    .article-info .article-meta {
        justify-content: center;
    }

    .article-tags {
        justify-content: center;
    }

    .article-header .article-title {
        font-size: 1.75rem;
    }

    .article-header .article-description {
        font-size: 0.875rem;
    }

    .toc {
        padding: 1rem;
    }

    .toc-title {
        font-size: 0.9375rem;
    }

    .toc-nav a {
        font-size: 0.875rem;
    }

    .toc-nav ul ul a {
        font-size: 0.8125rem;
    }

    .article-content {
        font-size: 1rem;
    }

    .article-content h2 {
        font-size: 1.25rem;
        margin-top: 2rem;
    }

    .article-content h3 {
        font-size: 1.15rem;
        margin-top: 1.5rem;
    }

    .article-content ul,
    .article-content ol {
        padding-left: 1.25rem;
    }

    .code-header {
        padding: 0.375rem 0.75rem;
    }

    .code-content {
        padding: 0.5rem 0.75rem 0.75rem;
    }

    .code-content code {
        font-size: 0.75rem;
    }

    .admonition {
        padding: 1rem;
        gap: 0.75rem;
    }

    .admonition-title {
        font-size: 1rem;
    }

    .admonition-content {
        font-size: inherit;
    }

    .nav-prev,
    .nav-next {
        padding: 1rem;
    }

    .nav-title {
        font-size: 0.9375rem;
    }
}

/* Related Articles */
.related-articles {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.related-articles-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .related-articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .related-articles-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .related-articles-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    .toc,
    .article-navigation,
    .related-articles,
    .code-copy-btn {
        display: none;
    }

    .article {
        padding: 0;
    }

    .code-block,
    .highlight {
        border: 1px solid #ccc;
    }
}
/* Syntax Highlighting - Catppuccin Mocha Theme */
/* https://github.com/catppuccin/catppuccin */

/* Catppuccin Mocha Palette */
/* Base: #1e1e2e | Surface0: #313244 | Surface1: #45475a | Surface2: #585b70 */
/* Overlay0: #6c7086 | Overlay1: #7f849c | Overlay2: #9399b2 */
/* Text: #cdd6f4 | Subtext0: #a6adc8 | Subtext1: #bac2de */
/* Lavender: #b4befe | Blue: #89b4fa | Sapphire: #74c7ec | Sky: #89dceb */
/* Teal: #94e2d5 | Green: #a6e3a1 | Yellow: #f9e2af | Peach: #fab387 */
/* Maroon: #eba0ac | Red: #f38ba8 | Mauve: #cba6f7 | Pink: #f5c2e7 */
/* Flamingo: #f2cdcd | Rosewater: #f5e0dc */

/* Background */
.chroma {
    background-color: #0D0D0D;
    color: #cdd6f4;
    line-height: 1.35;
}

/* Line numbers */
.chroma .ln {
    color: #6c7086;
    margin-right: 0.5em;
    padding: 0 0.5em 0 0.5em;
}

.chroma .lnt {
    color: #6c7086;
    margin-right: 0.5em;
    padding: 0 0.5em 0 0.5em;
}

/* Error */
.chroma .err {
    color: #f38ba8;
}

/* CodeLine */
.chroma .cl {
    color: #cdd6f4;
}

/* LineTableTD */
.chroma .lntd {
    vertical-align: top;
    padding: 0;
    margin: 0;
    border: 0;
}

/* LineTable */
.chroma .lntable {
    border-spacing: 0;
    padding: 0;
    margin: 0;
    border: 0;
}

/* LineHighlight */
.chroma .hl {
    background-color: #313244;
    display: block;
    width: 100%;
}

/* Keyword */
.chroma .k {
    color: #cba6f7;
}

/* KeywordConstant */
.chroma .kc {
    color: #fab387;
}

/* KeywordDeclaration */
.chroma .kd {
    color: #cba6f7;
}

/* KeywordNamespace */
.chroma .kn {
    color: #94e2d5;
}

/* KeywordPseudo */
.chroma .kp {
    color: #cba6f7;
}

/* KeywordReserved */
.chroma .kr {
    color: #cba6f7;
}

/* KeywordType */
.chroma .kt {
    color: #f9e2af;
}

/* Name */
.chroma .n {
    color: #cdd6f4;
}

/* NameAttribute */
.chroma .na {
    color: #89b4fa;
}

/* NameBuiltin */
.chroma .nb {
    color: #f5e0dc;
}

/* NameBuiltinPseudo */
.chroma .bp {
    color: #f5e0dc;
}

/* NameClass */
.chroma .nc {
    color: #f9e2af;
}

/* NameConstant */
.chroma .no {
    color: #fab387;
}

/* NameDecorator */
.chroma .nd {
    color: #89b4fa;
}

/* NameEntity */
.chroma .ni {
    color: #f9e2af;
}

/* NameException */
.chroma .ne {
    color: #f38ba8;
}

/* NameFunction */
.chroma .nf {
    color: #89b4fa;
}

/* NameFunctionMagic */
.chroma .fm {
    color: #89b4fa;
}

/* NameLabel */
.chroma .nl {
    color: #74c7ec;
}

/* NameNamespace */
.chroma .nn {
    color: #f9e2af;
}

/* NameOther */
.chroma .nx {
    color: #cdd6f4;
}

/* NameProperty */
.chroma .py {
    color: #cdd6f4;
}

/* NameTag */
.chroma .nt {
    color: #cba6f7;
}

/* NameVariable */
.chroma .nv {
    color: #cdd6f4;
}

/* NameVariableClass */
.chroma .vc {
    color: #cdd6f4;
}

/* NameVariableGlobal */
.chroma .vg {
    color: #cdd6f4;
}

/* NameVariableInstance */
.chroma .vi {
    color: #cdd6f4;
}

/* NameVariableMagic */
.chroma .vm {
    color: #cdd6f4;
}

/* Literal */
.chroma .l {
    color: #fab387;
}

/* LiteralDate */
.chroma .ld {
    color: #a6e3a1;
}

/* LiteralString */
.chroma .s {
    color: #a6e3a1;
}

/* LiteralStringAffix */
.chroma .sa {
    color: #a6e3a1;
}

/* LiteralStringBacktick */
.chroma .sb {
    color: #a6e3a1;
}

/* LiteralStringChar */
.chroma .sc {
    color: #a6e3a1;
}

/* LiteralStringDelimiter */
.chroma .dl {
    color: #a6e3a1;
}

/* LiteralStringDoc */
.chroma .sd {
    color: #6c7086;
    font-style: italic;
}

/* LiteralStringDouble */
.chroma .s2 {
    color: #a6e3a1;
}

/* LiteralStringEscape */
.chroma .se {
    color: #f5c2e7;
}

/* LiteralStringHeredoc */
.chroma .sh {
    color: #a6e3a1;
}

/* LiteralStringInterpol */
.chroma .si {
    color: #a6e3a1;
}

/* LiteralStringOther */
.chroma .sx {
    color: #a6e3a1;
}

/* LiteralStringRegex */
.chroma .sr {
    color: #f5c2e7;
}

/* LiteralStringSingle */
.chroma .s1 {
    color: #a6e3a1;
}

/* LiteralStringSymbol */
.chroma .ss {
    color: #f38ba8;
}

/* LiteralNumber */
.chroma .m {
    color: #fab387;
}

/* LiteralNumberBin */
.chroma .mb {
    color: #fab387;
}

/* LiteralNumberFloat */
.chroma .mf {
    color: #fab387;
}

/* LiteralNumberHex */
.chroma .mh {
    color: #fab387;
}

/* LiteralNumberInteger */
.chroma .mi {
    color: #fab387;
}

/* LiteralNumberIntegerLong */
.chroma .il {
    color: #fab387;
}

/* LiteralNumberOct */
.chroma .mo {
    color: #fab387;
}

/* Operator */
.chroma .o {
    color: #89dceb;
}

/* OperatorWord */
.chroma .ow {
    color: #89dceb;
    font-weight: bold;
}

/* Punctuation */
.chroma .p {
    color: #9399b2;
}

/* Comment */
.chroma .c {
    color: #6c7086;
    font-style: italic;
}

/* CommentHashbang */
.chroma .ch {
    color: #6c7086;
    font-style: italic;
}

/* CommentMultiline */
.chroma .cm {
    color: #6c7086;
    font-style: italic;
}

/* CommentSingle */
.chroma .c1 {
    color: #6c7086;
    font-style: italic;
}

/* CommentSpecial */
.chroma .cs {
    color: #6c7086;
    font-style: italic;
}

/* CommentPreproc */
.chroma .cp {
    color: #f9e2af;
}

/* CommentPreprocFile */
.chroma .cpf {
    color: #a6e3a1;
}

/* Generic */
.chroma .g {
    color: #cdd6f4;
}

/* GenericDeleted */
.chroma .gd {
    color: #f38ba8;
    background-color: rgba(243, 139, 168, 0.1);
}

/* GenericEmph */
.chroma .ge {
    font-style: italic;
}

/* GenericError */
.chroma .gr {
    color: #f38ba8;
}

/* GenericHeading */
.chroma .gh {
    color: #89b4fa;
    font-weight: bold;
}

/* GenericInserted */
.chroma .gi {
    color: #a6e3a1;
    background-color: rgba(166, 227, 161, 0.1);
}

/* GenericOutput */
.chroma .go {
    color: #9399b2;
}

/* GenericPrompt */
.chroma .gp {
    color: #6c7086;
    font-weight: bold;
}

/* GenericStrong */
.chroma .gs {
    font-weight: bold;
}

/* GenericSubheading */
.chroma .gu {
    color: #89b4fa;
}

/* GenericTraceback */
.chroma .gt {
    color: #f38ba8;
}

/* GenericUnderline */
.chroma .gl {
    text-decoration: underline;
}

/* TextWhitespace */
.chroma .w {
    color: #45475a;
}
