
body {
    overflow-x: hidden;
}

/* Post card structure */
.post-card {
    padding: 20px;
    margin: 0 0 20px 20px;
    border-left: 0.5px solid grey;
    border-bottom: 0.5px solid grey;
    border-radius: 5px;
}

.post-card-body {
    padding: 10px;
    border-right: 1px dotted grey;
    border-bottom: 1px dotted grey;
}

.post-card-footer {
    padding: 10px;
}

/* Sidebar */
.sidebar {
    background-color: rgba(5, 102, 141, 1) !important;
}

.sidebar-img {
    width: 100%;
}

.sidebar-img-class {
    display: block;
    margin: 0 auto;
    width: 50%;
}

.sidebar-body {
    padding-right: 20px;
}

.sidebar-list-link,
.sidebar-item {
    color: white;
    font-size: 20px;
    list-style-type: square;
}

.sidebar-list-link:hover {
    font-weight: bold;
    color: red;
    text-decoration: none;
}

.sidebar-search-form {
    display: block;
}

.sidebar-tag {
    padding-left: 10px;
    padding-top: 10px;
}

.sidebar-list-tag {
    color: white;
    font-size: 15px;
}

.sidebar-list-tag:hover,
.card-donation-link:hover {
    font-weight: bold;
    color: red;
    text-decoration: none;
}

/* Titoli e link */
.article-title-link,
.category-title,
.category-title-link,
.attachment-link,
.blog-category-title,
.card-donation-link {
    color: rgba(2, 128, 144, 1) !important;
}

.article-title-link:hover,
.category-title-link:hover,
.attachment-link:hover {
    color: red !important;
    text-decoration: none !important;
}

/* Immagini */
.image-card {
    background-color: transparent !important;
    border: 0 !important;
}

.image-css {
    max-width: 100% !important;
    height: auto !important;
    padding: 5px;
    box-shadow: 2px 2px 5px grey;
    background-color: white;
    display: block;
    margin: 0 auto;
    border-radius: 5px;
}

/* Card base */
.card {
    margin-left: 0 !important;
    background-color: transparent !important;
}

.card-highlighted {
    border: 1px solid rgba(166, 16, 34, 1.0) !important;
}

/* Responsive font-size blogpost */
.blogpost-title {
    font-size: 50px !important;
}

@media (min-width: 768px) {
    .blogpost-title {
        font-size: 65px !important;
    }
}

.blog-article-body {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.blog-article-body img,
.blog-article-body video,
.blog-article-body canvas,
.blog-article-body svg,
.blog-article-body iframe {
    display: block;
    max-width: 100% !important;
    height: auto !important;
    margin: 1.5rem auto;
}

.blog-article-body img {
    width: auto;
    border-radius: 0.65rem;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
    background: #ffffff;
}

.blog-article-body img.shared-library-image {
    width: min(100%, auto);
}

.blog-article-body figure {
    margin: 1.5rem auto;
    max-width: 100%;
}

.blog-article-body figure img {
    margin: 0 auto;
}

.blog-article-body table {
    display: block;
    width: 100%;
    overflow-x: auto;
}

.blog-article-body * {
    max-width: 100%;
}

.related-reading {
    margin-top: 3rem;
}

.related-reading__shell {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 249, 252, 0.98) 100%);
    border: 1px solid rgba(2, 128, 144, 0.16);
    border-radius: 1.25rem;
    padding: clamp(1.25rem, 2.4vw, 2rem);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.12);
}

.related-reading__kicker {
    color: rgba(166, 16, 34, 1);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.related-reading__title {
    color: #12263a;
    font-size: clamp(1.5rem, 2vw, 2rem);
    line-height: 1.2;
}

.related-reading__description {
    color: #52606d;
    max-width: 48rem;
}

.related-reading__grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.related-reading__card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    padding: 1.1rem;
    border: 1px solid rgba(2, 128, 144, 0.14);
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.related-reading__card--current {
    border-color: rgba(166, 16, 34, 0.26);
    background: linear-gradient(180deg, rgba(255, 248, 248, 0.98) 0%, rgba(255, 255, 255, 1) 100%);
}

.related-reading__card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.related-reading__chip {
    display: inline-flex;
    align-self: flex-start;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    background: rgba(166, 16, 34, 0.12);
    color: rgba(166, 16, 34, 1);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.related-reading__position {
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.related-reading__card-title {
    margin: 0;
    color: #102a43;
    font-size: 1.08rem;
    line-height: 1.35;
}

.related-reading__excerpt {
    margin: 0;
    color: #334e68;
    line-height: 1.6;
}

.related-reading__actions {
    margin-top: 1rem;
}

.related-reading__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.9rem;
    border: 1px solid rgba(2, 128, 144, 0.65);
    border-radius: 0.7rem;
    color: rgba(2, 128, 144, 1);
    background: rgba(2, 128, 144, 0.04);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.related-reading__button:hover {
    color: rgba(166, 16, 34, 1);
    border-color: rgba(166, 16, 34, 0.55);
    background: rgba(166, 16, 34, 0.08);
    text-decoration: none;
    transform: translateY(-1px);
}

.related-reading__button--disabled,
.related-reading__button--disabled:hover {
    cursor: default;
    color: #6b7280;
    border-color: rgba(148, 163, 184, 0.55);
    background: rgba(148, 163, 184, 0.12);
    transform: none;
}

@media (max-width: 767.98px) {
    .blog-article-body img,
    .blog-article-body video,
    .blog-article-body canvas,
    .blog-article-body svg,
    .blog-article-body iframe {
        margin: 1rem auto;
    }

    .related-reading__shell {
        padding: 1.1rem;
    }
}

/* PR-002 notebook fragment readability (scoped) */
.pr002-notebook-fragment {
    margin: 1.5rem 0;
}

.pr002-notebook-fragment .jp-CodeCell,
.pr002-notebook-fragment .jp-OutputArea-child {
    margin: 1rem 0;
}

.pr002-notebook-fragment .jp-Cell + .jp-Cell {
    margin-top: 0.9rem;
}

.pr002-notebook-fragment .jp-InputArea,
.pr002-notebook-fragment .jp-OutputArea-output {
    background: #f6f8fc;
    border: 1px solid #d6deea;
    border-radius: 0.5rem;
    padding: 0.8rem 0.95rem;
    overflow-x: auto;
}

.pr002-notebook-fragment .jp-InputPrompt,
.pr002-notebook-fragment .jp-OutputPrompt {
    color: #5a6572;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
    font-family: "Fira Code", "JetBrains Mono", "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.pr002-notebook-fragment pre,
.pr002-notebook-fragment code {
    font-family: "Fira Code", "JetBrains Mono", "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: #1f2937;
}

.pr002-notebook-fragment pre {
    margin: 0;
    line-height: 1.45;
    white-space: pre;
}

.pr002-notebook-fragment .jp-RenderedText pre {
    white-space: pre-wrap;
    word-break: break-word;
}

.pr002-notebook-fragment .jp-InputArea-editor,
.pr002-notebook-fragment .highlight {
    overflow-x: auto;
    color: #1f2937;
    background: transparent;
}

.pr002-notebook-fragment .jp-RenderedMarkdown,
.pr002-notebook-fragment .jp-RenderedHTML,
.pr002-notebook-fragment .jp-RenderedHTMLCommon,
.pr002-notebook-fragment .jp-RenderedText,
.pr002-notebook-fragment .jp-RenderedMarkdown p,
.pr002-notebook-fragment .jp-RenderedMarkdown li,
.pr002-notebook-fragment .jp-RenderedMarkdown h1,
.pr002-notebook-fragment .jp-RenderedMarkdown h2,
.pr002-notebook-fragment .jp-RenderedMarkdown h3,
.pr002-notebook-fragment .jp-RenderedMarkdown h4,
.pr002-notebook-fragment .jp-RenderedMarkdown h5,
.pr002-notebook-fragment .jp-RenderedMarkdown h6,
.pr002-notebook-fragment .jp-RenderedHTML p,
.pr002-notebook-fragment .jp-RenderedHTML li,
.pr002-notebook-fragment .jp-RenderedHTML td,
.pr002-notebook-fragment .jp-RenderedHTML th {
    color: #1f2937;
}

.pr002-notebook-fragment .jp-RenderedMarkdown a,
.pr002-notebook-fragment .jp-RenderedHTML a {
    color: #c1283d;
}

.pr002-notebook-fragment .jp-RenderedMarkdown a:hover,
.pr002-notebook-fragment .jp-RenderedHTML a:hover {
    color: #9f1f31;
}

.pr002-notebook-fragment .jp-OutputArea-output table,
.pr002-notebook-fragment .jp-RenderedHTML table,
.pr002-notebook-fragment table.dataframe {
    width: 100%;
    color: #1f2937;
    background: #f8fafc;
    border-color: #d6deea;
}

.pr002-notebook-fragment .jp-OutputArea-output table th,
.pr002-notebook-fragment .jp-OutputArea-output table td,
.pr002-notebook-fragment .jp-RenderedHTML table th,
.pr002-notebook-fragment .jp-RenderedHTML table td,
.pr002-notebook-fragment table.dataframe th,
.pr002-notebook-fragment table.dataframe td {
    color: #1f2937;
    background: #f8fafc;
    border-color: #d6deea;
}

.pr002-notebook-fragment .anchor-link {
    display: none;
}

.pr002-notebook-fragment .jp-OutputArea-output img,
.pr002-notebook-fragment .jp-RenderedHTML img,
.pr002-notebook-fragment .jp-RenderedImage img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
}

.pr002-notebook-fragment .jp-RenderedImage,
.pr002-notebook-fragment .jp-RenderedImage.jp-OutputArea-output,
.pr002-notebook-fragment .jp-OutputArea-output.jp-RenderedImage {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.pr002-notebook-fragment .highlight .k,
.pr002-notebook-fragment .highlight .kc,
.pr002-notebook-fragment .highlight .kd,
.pr002-notebook-fragment .highlight .kn,
.pr002-notebook-fragment .highlight .kp,
.pr002-notebook-fragment .highlight .kr,
.pr002-notebook-fragment .highlight .kt {
    color: #0b4f9c;
    font-weight: 600;
}

.pr002-notebook-fragment .highlight .s,
.pr002-notebook-fragment .highlight .sa,
.pr002-notebook-fragment .highlight .sb,
.pr002-notebook-fragment .highlight .sc,
.pr002-notebook-fragment .highlight .sd,
.pr002-notebook-fragment .highlight .s1,
.pr002-notebook-fragment .highlight .s2,
.pr002-notebook-fragment .highlight .se,
.pr002-notebook-fragment .highlight .sh,
.pr002-notebook-fragment .highlight .si,
.pr002-notebook-fragment .highlight .sr,
.pr002-notebook-fragment .highlight .ss {
    color: #0f7a3f;
}

.pr002-notebook-fragment .highlight .c,
.pr002-notebook-fragment .highlight .cm,
.pr002-notebook-fragment .highlight .c1,
.pr002-notebook-fragment .highlight .cs {
    color: #6b7280;
    font-style: italic;
}

.pr002-notebook-fragment .highlight .m,
.pr002-notebook-fragment .highlight .mb,
.pr002-notebook-fragment .highlight .mf,
.pr002-notebook-fragment .highlight .mh,
.pr002-notebook-fragment .highlight .mi,
.pr002-notebook-fragment .highlight .mo {
    color: #7a3ea0;
}

.pr002-notebook-fragment .highlight .nf,
.pr002-notebook-fragment .highlight .na,
.pr002-notebook-fragment .highlight .nb,
.pr002-notebook-fragment .highlight .nc {
    color: #9a3412;
    font-weight: 600;
}

.pr002-notebook-fragment .highlight .o,
.pr002-notebook-fragment .highlight .ow,
.pr002-notebook-fragment .highlight .p {
    color: #334155;
}

[data-theme="dark"] .pr002-notebook-fragment .jp-InputArea,
[data-theme="dark"] .pr002-notebook-fragment .jp-OutputArea-output {
    background: #171b24;
    border-color: #2b3344;
}

[data-theme="dark"] .pr002-notebook-fragment .jp-InputPrompt,
[data-theme="dark"] .pr002-notebook-fragment .jp-OutputPrompt {
    color: #95a3b8;
}

[data-theme="dark"] .pr002-notebook-fragment pre,
[data-theme="dark"] .pr002-notebook-fragment code,
[data-theme="dark"] .pr002-notebook-fragment .jp-InputArea-editor,
[data-theme="dark"] .pr002-notebook-fragment .highlight,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedMarkdown,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedHTML,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedHTMLCommon,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedText,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedMarkdown p,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedMarkdown li,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedMarkdown h1,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedMarkdown h2,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedMarkdown h3,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedMarkdown h4,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedMarkdown h5,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedMarkdown h6,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedHTML p,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedHTML li,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedHTML td,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedHTML th {
    color: #e5e7eb;
}

[data-theme="dark"] .pr002-notebook-fragment .highlight .k,
[data-theme="dark"] .pr002-notebook-fragment .highlight .kc,
[data-theme="dark"] .pr002-notebook-fragment .highlight .kd,
[data-theme="dark"] .pr002-notebook-fragment .highlight .kn,
[data-theme="dark"] .pr002-notebook-fragment .highlight .kp,
[data-theme="dark"] .pr002-notebook-fragment .highlight .kr,
[data-theme="dark"] .pr002-notebook-fragment .highlight .kt {
    color: #8ab4ff;
}

[data-theme="dark"] .pr002-notebook-fragment .highlight .s,
[data-theme="dark"] .pr002-notebook-fragment .highlight .sa,
[data-theme="dark"] .pr002-notebook-fragment .highlight .sb,
[data-theme="dark"] .pr002-notebook-fragment .highlight .sc,
[data-theme="dark"] .pr002-notebook-fragment .highlight .sd,
[data-theme="dark"] .pr002-notebook-fragment .highlight .s1,
[data-theme="dark"] .pr002-notebook-fragment .highlight .s2,
[data-theme="dark"] .pr002-notebook-fragment .highlight .se,
[data-theme="dark"] .pr002-notebook-fragment .highlight .sh,
[data-theme="dark"] .pr002-notebook-fragment .highlight .si,
[data-theme="dark"] .pr002-notebook-fragment .highlight .sr,
[data-theme="dark"] .pr002-notebook-fragment .highlight .ss {
    color: #56d196;
}

[data-theme="dark"] .pr002-notebook-fragment .highlight .c,
[data-theme="dark"] .pr002-notebook-fragment .highlight .cm,
[data-theme="dark"] .pr002-notebook-fragment .highlight .c1,
[data-theme="dark"] .pr002-notebook-fragment .highlight .cs {
    color: #94a3b8;
}

[data-theme="dark"] .pr002-notebook-fragment .highlight .m,
[data-theme="dark"] .pr002-notebook-fragment .highlight .mb,
[data-theme="dark"] .pr002-notebook-fragment .highlight .mf,
[data-theme="dark"] .pr002-notebook-fragment .highlight .mh,
[data-theme="dark"] .pr002-notebook-fragment .highlight .mi,
[data-theme="dark"] .pr002-notebook-fragment .highlight .mo {
    color: #d28bff;
}

[data-theme="dark"] .pr002-notebook-fragment .highlight .nf,
[data-theme="dark"] .pr002-notebook-fragment .highlight .na,
[data-theme="dark"] .pr002-notebook-fragment .highlight .nb,
[data-theme="dark"] .pr002-notebook-fragment .highlight .nc {
    color: #ffb37d;
}

[data-theme="dark"] .pr002-notebook-fragment .highlight .o,
[data-theme="dark"] .pr002-notebook-fragment .highlight .ow,
[data-theme="dark"] .pr002-notebook-fragment .highlight .p {
    color: #cbd5e1;
}

[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedMarkdown a,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedHTML a {
    color: #f06b7e;
}

[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedMarkdown a:hover,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedHTML a:hover {
    color: #ff8fa0;
}

[data-theme="dark"] .pr002-notebook-fragment .jp-OutputArea-output table,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedHTML table,
[data-theme="dark"] .pr002-notebook-fragment table.dataframe {
    color: #e5e7eb;
    background: #171b24;
    border-color: #2b3344;
}

[data-theme="dark"] .pr002-notebook-fragment .jp-OutputArea-output table th,
[data-theme="dark"] .pr002-notebook-fragment .jp-OutputArea-output table td,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedHTML table th,
[data-theme="dark"] .pr002-notebook-fragment .jp-RenderedHTML table td,
[data-theme="dark"] .pr002-notebook-fragment table.dataframe th,
[data-theme="dark"] .pr002-notebook-fragment table.dataframe td {
    color: #e5e7eb;
    background: #171b24;
    border-color: #2b3344;
}

/* PR-020 theme integration overrides */
.blog-article-body {
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--text-color);
    font-size: 1.05rem;
    line-height: 1.82;
}

.blog-article-body a,
.article-title-link,
.category-title,
.category-title-link,
.attachment-link,
.blog-category-title,
.card-donation-link {
    color: var(--link-color) !important;
}

.blog-article-body a:hover,
.article-title-link:hover,
.category-title-link:hover,
.attachment-link:hover {
    color: var(--accent-color) !important;
}

.blog-article-body img {
    width: auto;
    border-radius: 1.1rem;
    box-shadow: var(--shadow-soft);
    background: var(--card-bg-solid);
}

.related-reading__shell {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.related-reading__kicker {
    color: var(--accent-color);
}

.related-reading__title,
.related-reading__card-title,
.related-reading__excerpt,
.related-reading__description {
    color: var(--text-color);
}

.related-reading__position {
    color: var(--muted-color);
}

.related-reading__card {
    border: 1px solid var(--border-color);
    border-radius: 1.2rem;
    background: var(--card-bg-solid);
    box-shadow: 0 14px 34px rgba(23, 32, 51, 0.08);
}

.related-reading__card--current {
    border-color: color-mix(in srgb, var(--link-color) 38%, var(--border-color));
    background: color-mix(in srgb, var(--link-color) 7%, var(--card-bg-solid));
}

.related-reading__chip {
    background: color-mix(in srgb, var(--link-color) 12%, transparent);
    color: var(--link-color);
}

.related-reading__button {
    border-color: var(--border-color);
    color: var(--text-color);
    background: var(--card-bg);
    border-radius: 999px;
}

.related-reading__button:hover {
    color: var(--accent-color);
    border-color: color-mix(in srgb, var(--accent-color) 42%, transparent);
    background: var(--card-bg-solid);
}

.post-card {
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-radius: 1.25rem;
    background: var(--card-bg);
}

@media (max-width: 768px) {
    .pr002-notebook-fragment .jp-InputArea,
    .pr002-notebook-fragment .jp-OutputArea-output {
        padding: 0.65rem 0.75rem;
    }

    .pr002-notebook-fragment pre {
        font-size: 0.86rem;
    }
}
