/* Network Automation components over the unchanged OSPF lesson shell. */
.network-automation-python-series-page,
.network-automation-python-hub-page {
    --python-blue: var(--primary-color);
    --python-blue-strong: var(--secondary-color);
    --python-sky: var(--primary-hover);
    --python-gold: var(--accent-color);
    --python-section-gap: 2rem;
}

/* Keep the hero, outline, and every lesson card on one shared vertical rhythm. */
.network-automation-python-series-page .python-article > :is(.welcome-section, .content-card):not(:last-child) {
    margin-bottom: var(--python-section-gap);
}

.network-automation-python-series-page .python-article > :is(.welcome-section, .content-card):last-child {
    margin-bottom: 0;
}

.network-automation-python-series-page .python-article > .content-card > h2:first-child {
    margin: 0 0 1.25rem;
}

.network-automation-python-series-page .python-article > .content-card > :last-child {
    margin-bottom: 0;
}

/* Components own their top gap; restore that same gap before copy that follows them. */
.network-automation-python-series-page .python-lesson-card > :is(div, figure, blockquote, pre, table) + p {
    margin-top: 1.25rem;
}

.network-automation-python-series-page .lesson-outline-card .toc-list {
    column-gap: 2rem;
    columns: 2 18rem;
    margin-bottom: 0;
}

.network-automation-python-series-page .main-content :is(section, h2, h3)[id] {
    scroll-margin-top: 6.25rem;
}

/* Keep ordinary lesson bullets inside the card content boundary. */
.network-automation-python-series-page .python-lesson-card > :is(ul, ol):not([class]) {
    padding-inline-start: 1.35rem;
}

.network-automation-python-series-page .python-infographic {
    background: color-mix(in srgb, var(--python-blue) 4%, var(--bg-secondary));
    border: 1px solid color-mix(in srgb, var(--python-blue) 28%, var(--border-color));
    border-radius: 1rem;
    margin: 1.25rem 0 0;
    overflow: hidden;
    padding: .6rem;
}

.network-automation-python-series-page .python-infographic img {
    border-radius: .7rem;
    display: block;
    height: auto;
    width: 100%;
}

.network-automation-python-series-page .python-infographic figcaption {
    color: var(--text-muted);
    font-size: .82rem;
    line-height: 1.55;
    padding: .75rem .35rem .15rem;
}

.network-automation-python-series-page .python-operator-list {
    counter-reset: python-operator;
    display: grid;
    gap: .75rem;
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
}

.network-automation-python-series-page .python-operator-list > li {
    background: color-mix(in srgb, var(--python-blue) 5%, var(--bg-secondary));
    border: 1px solid color-mix(in srgb, var(--python-blue) 24%, var(--border-color));
    border-radius: .8rem;
    color: var(--text-secondary);
    counter-increment: python-operator;
    line-height: 1.65;
    min-width: 0;
    padding: .9rem 1rem .9rem 3.65rem;
    position: relative;
}

.network-automation-python-series-page .python-operator-list > li::before {
    align-items: center;
    background: var(--primary-gradient);
    border-radius: 50%;
    color: #fff;
    content: counter(python-operator);
    display: inline-flex;
    font-size: .8rem;
    font-weight: 900;
    height: 2rem;
    justify-content: center;
    left: 1rem;
    position: absolute;
    top: .8rem;
    width: 2rem;
}

.network-automation-python-series-page .python-operator-list a,
.network-automation-python-series-page .python-operator-list a:visited {
    color: var(--primary-color);
    font-weight: 800;
    text-decoration: none;
}

.network-automation-python-series-page .python-operator-list a:hover,
.network-automation-python-series-page .python-operator-list a:focus-visible {
    color: var(--accent-color);
    text-decoration: underline;
    text-underline-offset: .2em;
}

.network-automation-python-series-page .python-operator-next-step {
    background: color-mix(in srgb, var(--accent-color) 8%, var(--bg-secondary));
    border: 1px solid color-mix(in srgb, var(--accent-color) 30%, var(--border-color));
    border-left: 4px solid var(--accent-color);
    border-radius: .7rem;
    color: var(--text-secondary);
    margin: 1rem 0 0;
    padding: .9rem 1rem;
}

.network-automation-python-series-page .python-operator-next-step strong {
    color: var(--text-primary);
}

.network-automation-python-series-page .python-learning-grid,
.network-automation-python-series-page .python-install-flow {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    margin-top: 1.25rem;
}

.network-automation-python-series-page .python-use-grid {
    align-items: stretch;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
}

.network-automation-python-series-page .python-use-grid > .python-use-card {
    flex: 1 1 18rem;
}

.network-automation-python-series-page .python-use-grid + h3 {
    margin-bottom: 0;
    margin-top: 2rem;
}

.network-automation-python-series-page .python-use-card,
.network-automation-python-series-page .python-learning-step,
.network-automation-python-series-page .python-install-flow article,
.network-automation-python-series-page .python-platforms > div {
    background: color-mix(in srgb, var(--python-blue) 5%, var(--bg-secondary));
    border: 1px solid color-mix(in srgb, var(--python-blue) 28%, var(--border-color));
    border-radius: .8rem;
    min-width: 0;
    padding: 1rem;
}

.network-automation-python-series-page .python-use-card {
    border-left: 4px solid var(--python-blue);
}

.network-automation-python-series-page .python-use-card i,
.network-automation-python-series-page .python-learning-step > span,
.network-automation-python-series-page .python-platforms i {
    color: var(--python-blue);
}

.network-automation-python-series-page .python-use-card h3,
.network-automation-python-series-page .python-learning-step h3,
.network-automation-python-series-page .python-install-flow h3 {
    font-size: 1.02rem !important;
    margin: .65rem 0 .45rem;
}

.network-automation-python-series-page .python-use-card p,
.network-automation-python-series-page .python-learning-step p,
.network-automation-python-series-page .python-install-flow p {
    color: var(--text-secondary);
    margin: 0;
}

.network-automation-python-series-page .python-learning-step > span {
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.network-automation-python-series-page .python-install-flow span {
    align-items: center;
    background: var(--primary-gradient);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    font-weight: 900;
    height: 2rem;
    justify-content: center;
    width: 2rem;
}

.network-automation-python-series-page .python-platforms {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1.25rem;
}

.network-automation-python-series-page .python-platforms > div {
    text-align: center;
}

.network-automation-python-series-page .python-platforms i {
    display: block;
    font-size: 1.6rem;
    margin-bottom: .55rem;
}

.network-automation-python-series-page .python-code-panel {
    background: #07192a;
    border: 1px solid color-mix(in srgb, var(--python-blue) 45%, #20384d);
    border-radius: .85rem;
    margin-top: 1.25rem;
    overflow: hidden;
}

.network-automation-python-series-page .blog-article .content-card .python-code-panel h3 {
    -webkit-background-clip: border-box !important;
    -webkit-text-fill-color: #f7fbff !important;
    background: #102a42 !important;
    background-clip: border-box !important;
    border-bottom: 1px solid #294861;
    color: #f7fbff !important;
    font-size: .92rem !important;
    margin: 0 !important;
    padding: .8rem 1rem;
}

.network-automation-python-series-page .python-code-panel pre {
    background: transparent !important;
    border: 0 !important;
    color: #e9f4ff !important;
    margin: 0 !important;
    overflow-x: auto;
    padding: 1rem !important;
}

.network-automation-python-series-page .ospf-cli-grid > .python-code-panel {
    margin-top: 0;
}

.network-automation-python-series-page .python-video {
    background: #07192a;
    border: 1px solid color-mix(in srgb, var(--python-blue) 35%, var(--border-color));
    border-radius: .85rem;
    margin-top: 1.25rem;
    overflow: hidden;
}

.network-automation-python-series-page .python-video iframe {
    aspect-ratio: 16 / 9;
    border: 0;
    display: block;
    height: auto;
    width: 100%;
}

.network-automation-python-series-page .python-video-caption {
    color: var(--text-muted);
    font-size: .82rem;
    line-height: 1.55;
    margin: 0;
    padding: .75rem 1rem;
}

.network-automation-python-series-page .python-type-comparison {
    align-items: stretch;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
}

.network-automation-python-series-page .python-type-comparison > article {
    background: color-mix(in srgb, var(--python-blue) 5%, var(--bg-secondary));
    border: 1px solid color-mix(in srgb, var(--python-blue) 28%, var(--border-color));
    border-radius: .8rem;
    flex: 1 1 16rem;
    min-width: 0;
    padding: 1rem;
}

.network-automation-python-series-page .python-type-comparison > article h3 {
    margin-top: 0;
}

.network-automation-python-hub .content-card > h2 {
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    margin-top: 2rem;
}

.network-automation-python-hub .content-card > h2:first-child {
    margin-top: 0;
}

.network-automation-python-hub .content-card a:not(.btn),
.network-automation-python-hub .content-card a:not(.btn):visited {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
}

.network-automation-python-hub .content-card a:not(.btn):hover,
.network-automation-python-hub .content-card a:not(.btn):focus-visible {
    color: var(--accent-color);
    text-decoration: underline;
    text-underline-offset: .2em;
}

.python-hub-steps,
.python-hub-checks,
.python-hub-links {
    margin: 1rem 0 0 1.25rem;
}

.python-hub-steps li,
.python-hub-checks li,
.python-hub-links li {
    color: var(--text-secondary);
    margin-bottom: .7rem;
}

.python-hub-table-wrap {
    overflow-x: auto;
    width: 100%;
}

.python-hub-table {
    border-collapse: collapse;
    margin: 1rem 0;
    min-width: 680px;
    width: 100%;
}

.python-hub-table th,
.python-hub-table td {
    border: 1px solid var(--border-color);
    padding: .85rem;
    text-align: left;
    vertical-align: top;
}

.python-hub-table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.python-hub-table td {
    color: var(--text-secondary);
}

@media (max-width: 760px) {
    .network-automation-python-series-page { --python-section-gap: 1.25rem; }
    .network-automation-python-series-page .lesson-outline-card .toc-list { columns: 1; }
    .network-automation-python-series-page .python-platforms,
    .network-automation-python-series-page .python-install-flow { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .network-automation-python-series-page .ospf-practice-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .network-automation-python-series-page .ospf-practice-task {
        min-width: 0;
    }

    .network-automation-python-series-page .ospf-practice-task pre {
        max-width: 100%;
        overflow-x: auto;
    }
}
