:root {
    color-scheme: light;
    --surface: #f7f7fb;
    --surface-alt: #ffffff;
    --surface-dark: #101827;
    --surface-card: rgba(255, 255, 255, 0.85);
    --text: #0f172a;
    --text-muted: #475569;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.12);
    --border: #e2e8f0;
    --border-dark: rgba(255, 255, 255, 0.08);
    --shadow: 0 25px 50px rgba(15, 23, 42, 0.05);
}

*, *::before, *::after {
    box-sizing: border-box;
}

.site-logo {
    display: flex;
    align-items: center;
}

.site-logo img {
    height: auto;
    width: auto;
    max-height: 80px;
    max-width: 140px;
    display: block;
}

@media (max-width: 720px) {
    .site-logo img {
        max-height: 52px;
    }
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--surface);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.theme-dark {
    background: #050810;
    color: #f4f6fb;
    color-scheme: dark;
}

header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background-color: #e0e0ff; /* Adjust color to match your design */
    padding: 10px 20px;
}

main {
    flex: 1 0 auto;
    width: 100%;
    display: block;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-left: auto;
    min-width: 0;
}

.header-utilities {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.nav-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a {
    text-decoration: none;
    color: black;
    font-size: 20px;
}

.nav-links a:hover {
    color:darkcyan;
}

@media (max-width: 720px) {
    header {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        align-items: start;
        column-gap: 0.75rem;
        row-gap: 0.5rem;
    }

    .site-logo {
        grid-row: 1 / span 2;
    }

    .nav-actions {
        grid-column: 2;
        grid-row: 1 / span 2;
        flex-direction: column;
        align-items: flex-end;
        justify-content: flex-start;
        gap: 0.65rem;
        margin-left: 0;
        width: auto;
        justify-self: end;
        text-align: right;
    }

    .nav-links {
        width: auto;
        justify-content: flex-end;
        gap: 0.65rem;
    }

    .nav-links a {
        font-size: 1rem;
        line-height: 1.4;
    }

    .header-utilities {
        width: auto;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.5rem 0.75rem;
    }

    .header-search {
        flex: 0 0 auto;
    }

    .header-search__panel,
    .header-search.is-open .header-search__panel {
        max-width: 100%;
        width: 100%;
    }
}

.theme-toggle {
    border: 1px solid #d1d5db;
    background: #fff;
    color: inherit;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    background: #0f172a;
    color: #fff;
    border-color: transparent;
}

body.theme-dark header {
    background-color: #141c2f;
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.05);
}

body.theme-dark .nav-links a {
    color: #e2e8f0;
}

body.theme-dark .nav-links a:hover {
    color: #93c5fd;
}

body.theme-dark a {
    color: #86c1ff;
}

body.theme-dark a:hover {
    color: #cbd5f5;
}

.theme-toggle {
    border: 1px solid #d1d5db;
    background: #fff;
    color: inherit;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    background: #0f172a;
    color: #fff;
    border-color: transparent;
}

body.theme-dark .theme-toggle {
    background: #0f172a;
    border-color: #1f2940;
    color: #e2e8f0;
}

body.theme-dark .theme-toggle:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.page {
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.page h1 {
    font-size: 32px;
    margin-bottom: 20px;
}
  
.page img {
    width: 100%;
    height: auto;
    margin-top: 20px;
}

.page--wiki {
    max-width: 1200px;
}

body.theme-dark .page {
    background: transparent;
}

.page--blog {
    max-width: 1200px;
    padding: 3.5rem 1.5rem 5rem;
    width: 100%;
}

.page--blog .page {
    padding: 0;
}

.wiki-sidebox {
    float: right;
    width: 300px;
    background: #f8f9fa;
    border: 1px solid #ccc;
    padding: 10px;
    margin: 10px;
    font-size: 0.9em;
  }
  
  .wiki-sidebox h3 {
    margin-top: 0;
    font-size: 1.1em;
  }

body.theme-dark .wiki-sidebox h3 {
    color: #f3f4f6;
}
  
  .wiki-sidebox table {
    width: 100%;
    border-collapse: collapse;
  }
  
  .wiki-sidebox th {
    text-align: left;
    background: #e9ecef;
    padding: 5px;
  }

body.theme-dark .wiki-sidebox th {
    background: #1e2744;
    color: #f3f4f6;
}

/* Blog layout */
.blog-page {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

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

.lead {
    font-size: 1.2rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 48ch;
}

.pill-link {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    padding: 0.25rem 0.9rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.blog-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 2rem;
    padding: 2.5rem;
    border-radius: 30px;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.1), transparent 45%), var(--surface-alt);
    box-shadow: var(--shadow);
    align-items: center;
    min-height: 200px;
}

.blog-hero__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.65rem;
    height: 100%;
}

.blog-hero__content h1 {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    margin: 0.2rem 0 1rem;
    line-height: 1;
}

.blog-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.blog-hero__cta {
    padding: 2rem;
    border-radius: 20px;
    background: linear-gradient(130deg, #eef2ff, #fdfbff);
    color: var(--text);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
}

.blog-hero__cta h2 {
    margin: 0;
    font-size: 1.5rem;
}

.blog-hero__cta p {
    margin: 0.5rem 0 0;
    color: var(--text-muted);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    border: none;
    background: var(--accent);
    color: white;
    font-weight: 600;
    text-decoration: none;
}

.button.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.button.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}

.feature-link {
    font-weight: 600;
    text-decoration: none;
    color: var(--accent);
}

.blog-featured {
    padding: 2.5rem;
    border-radius: 24px;
    background: var(--surface-alt);
    box-shadow: var(--shadow);
}

.featured-card header time {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.featured-card h2 {
    margin: 0.8rem 0 0.5rem;
}

.tag-list,
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tag,
.tag-cloud a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    background: rgba(148, 163, 184, 0.15);
    color: inherit;
    text-decoration: none;
}

.blog-content {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 0.95fr);
    gap: 2rem;
    align-items: start;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    column-gap: clamp(1.2rem, 2vw, 1.2rem);
    row-gap: clamp(1.2rem, 2vw, 1.2rem);
    grid-auto-rows: 1fr;
    align-items: stretch;
}

.post-card {
    padding: 1.75rem;
    border-radius: 18px;
    background: var(--surface-alt);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.post-grid > article {
  margin: 0;
}

.post-card header {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.post-card__title {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.35;
}

.post-card.compact {
    gap: 0.5rem;
}

.post-card__meta {
    display: flex;
    gap: 0.65rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.post-card__meta span {
    color: var(--text-muted);
}

.post-card__summary {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.98rem;
    flex-grow: 1;
}

.post-card__tags {
    margin-top: 1rem;
}

.post-card .tag-list {
    justify-content: flex-start;
    margin-top: auto;
}

.pagination {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.sidebar-card {
    padding: 1.5rem;
    border-radius: 16px;
    background: var(--surface-alt);
    box-shadow: var(--shadow);
}

.sidebar-card h3 {
    margin-top: 0;
    margin-bottom: 0.8rem;
}

.tag-cloud {
    flex-direction: column;
    gap: 0.4rem;
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.tag-cloud a {
    justify-content: space-between;
    padding: 0.35rem 0.8rem;
}

.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.timeline time {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
}

.cta-card {
    background: var(--accent);
    color: white;
}

.cta-card p {
    color: rgba(255, 255, 255, 0.84);
}

.button.full-width {
    width: 100%;
}

/* Single article */
.blog-article {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.article-hero {
    background: linear-gradient(120deg, #eef2ff, #f3f6ff);
    color: var(--text);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.article-hero h1 {
    margin: 0.5rem 1rem 1rem;
    font-size: clamp(1.8rem, 5vw, 3.2rem);
}

.article-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.5rem;
    align-items: center;
    color: var(--text-muted);
}

.article-hero__meta .tag-list .tag {
    border-color: rgba(148, 163, 184, 0.35);
    color: inherit;
    background: rgba(148, 163, 184, 0.18);
}

.blog-article__content {
    flex: 1 1 auto;
    min-width: 0;
}

.blog-article__content img {
    border-radius: 20px;
    margin: 2rem 0;
    width: 100%;
    height: auto;
    box-shadow: var(--shadow);
}

.blog-article__content p,
.blog-article__content li {
    line-height: 1.8;
    font-size: 1.05rem;
    color: var(--text);
}

.blog-article__content > :first-child {
    margin-top: 0;
}

.lead-text {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.article-share__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.article-share__list a {
    text-decoration: none;
    color: var(--accent);
    font-weight: 600;
}

.blog-article__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.related-posts .post-grid {
    margin-top: 1rem;
}

/* Dark theme adjustments */
body.theme-dark {
    --surface: #050810;
    --surface-alt: #0f172a;
    --surface-card: rgba(15, 23, 42, 0.88);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.3);
    --shadow: 0 25px 50px rgba(0, 0, 0, 0.45);
}

body.theme-dark .blog-hero,
body.theme-dark .blog-featured,
body.theme-dark .post-card,
body.theme-dark .sidebar-card,
body.theme-dark .blog-article__content img {
    background: var(--surface-alt);
}

body.theme-dark .blog-hero__cta {
    background: rgba(15, 23, 42, 0.9);
    color: white;
}

body.theme-dark .blog-hero__cta p {
    color: rgba(255, 255, 255, 0.7);
}

body.theme-dark .article-hero {
    background: linear-gradient(120deg, rgba(15, 23, 42, 0.95), rgba(37, 99, 235, 0.7));
    color: white;
}

body.theme-dark .article-hero__meta {
    color: rgba(255, 255, 255, 0.75);
}

body.theme-dark .article-hero__meta .tag-list .tag {
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

body.theme-dark .blog-article__content p,
body.theme-dark .blog-article__content li {
    color: var(--text);
}

/* Responsive tweaks */
@media (max-width: 960px) {
    .blog-hero,
    .blog-content {
        grid-template-columns: 1fr;
    }

    .article-layout,
    .wiki-page {
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
    }

    .article-layout__toc,
    .article-layout__rightbar,
    .wiki-page__toc,
    .wiki-page__rightbar {
        display: none;
    }

    .article-layout__main,
    .wiki-page__content {
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
    }

    .article-toc-mobile {
        display: block;
    }

    .blog-article__content,
    .article-layout__main > article,
    .wiki-page article {
        width: 100%;
        max-width: 720px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .page--blog {
        padding: 2rem 1rem 3rem;
    }

    .blog-hero,
    .blog-featured,
    .post-card,
    .sidebar-card,
    .article-hero {
        padding: 1.5rem;
    }

    .blog-hero__meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-card__meta {
        flex-direction: column;
        gap: 0.35rem;
    }

    .post-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .page {
        padding: 2rem 1.25rem;
    }

    .hero {
        height: auto;
        min-height: 55vh;
        padding: 2.5rem 1.25rem;
        text-align: left;
    }

    .hero h1 {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }

    .hero p {
        font-size: 1rem;
    }

    .homepage-updates-wrapper {
        padding: 0 1rem;
    }

    .homepage-updates-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .homepage-updates-item {
        padding: 0.9rem 1rem;
    }
}
  
  .wiki-sidebox td {
    padding: 5px;
  }
  
  .wiki-sidebox ul {
    padding-left: 20px;
  }
  
  .wiki-sidebox img {
    max-width: 100%;
    display: block;
    margin-bottom: 10px;
  }

  .citation {
    font-size: 0.8em;
    vertical-align: super;
    margin-left: 2px;
  }
  
  .references {
    font-size: 0.9em;
    border-top: 1px solid #ccc;
    padding-top: 10px;
    margin-top: 20px;
  }
  
  .references h2 {
    font-size: 1.2em;
    margin-bottom: 5px;
  }
  
  .references ol {
    padding-left: 20px;
  }
  
  .references li {
    margin-bottom: 5px;
  }

  .citation-link {
    position: relative;
    text-decoration: none;
    color: #0645ad; /* Wikipedia-style blue */
  }
  
  .citation-link:hover {
    text-decoration: underline;
  }
  
  /* Tooltip styles */
  .citation-link::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: 150%;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 0.75em;
    padding: 5px 8px;
    border-radius: 5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
  }
  
  .citation-link:hover::after {
    opacity: 1;
  }
  
.citation-link::after {
    white-space: normal;
    width: 200px;
    text-align: center;
  }

.site-footer {
    background: var(--surface-alt);
    border-top: 1px solid var(--border);
    margin-top: auto;
    width: 100%;
}

.site-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    min-height: 110px;
    padding: 0 1rem;
}

.site-footer__col {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.site-footer__brand {
    left: 25%;
    max-width: 240px;
}

.site-footer__links {
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.site-footer__meta {
    left: 75%;
    gap: 0.5rem;
}

.footer-logo img {
    height: 48px;
    width: auto;
    display: block;
}

.footer-link {
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.footer-link:hover {
    color: var(--accent);
}

.site-footer__copyright {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

body.theme-dark .site-footer {
    background: #0b1220;
    border-color: var(--border-dark);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.theme-dark .footer-link:hover {
    color: #93c5fd;
}

@media (max-width: 780px) {
    .site-footer__inner {
        position: static;
        min-height: auto;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .site-footer__col {
        position: static;
        transform: none;
        width: 100%;
    }

    .wiki-sidebox,
    .wiki-image {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 1rem 0;
    }

    .wiki-image,
    .wiki-image.right,
    .wiki-image.left {
        float: none;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
        display: block;
    }

    .wiki-image.right + p,
    .wiki-image.left + p {
        clear: both;
    }

    .gallery-wrapper {
        width: 100%;
        margin-left: 0;
    }
}

.product {
    max-width: 800px;
    margin: auto;
    font-family: sans-serif;
  }

body.theme-dark .product {
    background: #0f172a;
    color: #e2e8f0;
}
  
  .purchase-links ul {
    list-style: none;
    padding: 0;
  }
  
.purchase-links li a {
    background: #0073e6;
    color: white;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 5px;
    display: inline-block;
  }
  
  .purchase-links li a:hover {
    background: #005bb5;
  }

body.theme-dark .purchase-links li a {
    background: #2563eb;
}

body.theme-dark .purchase-links li a:hover {
    background: #1d4ed8;
}

  .gallery-wrapper {
    width: 100vw; /* Full width of the viewport */
    margin-left: calc(-50vw + 50%); /* Center it properly */
    background-color: #f8f8f8; /* Optional: background color for emphasis */
    padding: 20px 0; /* Some breathing room */
  }

  body.theme-dark .gallery-wrapper {
    background-color: #0f192d;
  }

  .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    max-width: 1200px; /* Limit extreme stretching */
    margin: 0 auto; /* Center the grid inside */
    padding: 0 20px;
  }

  .gallery-grid img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  }

  .hero {
    width: 100%;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: url('/images/hero-bg.jpg') center/cover no-repeat;
    color: white;
    padding: 2rem;
  }

  body.theme-dark .hero {
    color: #f3f4f6;
    background-blend-mode: multiply;
    background-color: rgba(7, 13, 26, 0.85);
  }
  
  .hero-content {
    max-width: 800px;
  }
  
  .hero h1 {
    font-size: 2.5rem;
    margin-top: 1rem;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
  }
  
  .hero p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
  }
  
  .cta-button {
    background: #0073e6;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1.2rem;
  }
  
  .cta-button:hover {
    background: #005bb5;
  }

  body.theme-dark .cta-button {
    background: #2563eb;
  }

  body.theme-dark .cta-button:hover {
    background: #1d4ed8;
  }

  .homepage-updates-wrapper {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
  }

  .homepage-updates-heading {
    margin: 0 0 1rem;
    font-size: 1.25rem;
  }

  .homepage-updates-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .homepage-updates-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  }

  .homepage-updates-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
  }

  .homepage-updates-link {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.01em;
    color: inherit;
    text-decoration: none;
  }

  .homepage-updates-link:hover {
    color: #2563eb;
  }

  .homepage-updates-date {
    font-size: 0.82rem;
    line-height: 1;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .homepage-updates-snippet {
    margin: 0.45rem 0 0;
    font-size: 0.92rem;
    line-height: 1.35;
    color: #475569;
    padding-top: 0.5rem;
    border-top: 1px dashed #e2e8f0;
  }

  body.theme-dark .homepage-updates-wrapper {
    padding: 0 1rem;
  }

  body.theme-dark .homepage-updates-item {
    background: #0f172a;
    border-color: #1f2937;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  }

  body.theme-dark .homepage-updates-link:hover {
    color: #60a5fa;
  }

  body.theme-dark .homepage-updates-date {
    color: #94a3b8;
  }

  body.theme-dark .homepage-updates-snippet {
    color: #cbd5f5;
    border-top-color: #2c3c55;
  }
  
.wiki-image {
    max-width: 250px; /* Adjust width as needed */
    border: 1px solid #ccc;
    background: #f8f9fa;
    padding: 5px;
    margin: 10px 0 10px 10px;
    text-align: center;
    font-size: 0.9em;
    clear: right;
  }
  
  .wiki-image img {
    width: 100%;
    height: auto;
    display: block;
  }
  
  .wiki-image.right {
    float: right;
    margin-left: 15px;
  }
  
  .wiki-image.left {
    float: left;
    margin-right: 15px;
  }

  .wiki-image::after {
    content: "";
    display: block;
    clear: both;
  }
  
  details {
    padding: 0.5em;
    margin-bottom: 1em;
    clear: both;
  }

  details summary {
    font-weight: bold;
    cursor: pointer;
    padding: 5px 0; /* Adds spacing above/below the title */
  }
  
  details[open] summary {
    margin-bottom: 10px; /* Increases gap between title and paragraph when expanded */
  }
  
  details > *:not(summary) {
    margin-top: 10px; /* Ensures first paragraph/image doesn't hug the summary */
  }

  :target {
    scroll-margin-top: 1em;
  }

  :target details {
    open: true;
  }

.article-toc-mobile {
    display: none;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-alt);
    padding: 0.75rem 1rem;
    margin: 1rem 0 1.5rem;
    clear: none;
}

.article-toc-mobile summary {
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    list-style: none;
}

.article-toc-mobile summary::-webkit-details-marker {
    display: none;
}

.article-toc-mobile__body {
    margin-top: 0.75rem;
}

body.theme-dark .article-toc-mobile {
    background: #0f172a;
    border-color: #1f2940;
}

  .article-layout,
  .wiki-page {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
    width: 100%;
  }

  .article-layout__main,
  .wiki-page__content {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
  }

  .blog-article__content,
  .wiki-page article,
  .article-layout__main > article {
    max-width: 760px;
  }

  .article-layout__main > article,
  .wiki-page article {
    flex: 1 1 auto;
    min-width: 0;
  }

  .article-layout__toc,
  .wiki-page__toc {
    flex: 0 0 220px;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow: auto;
  }

  .article-toc {
    border-left: 2px solid #eceff3;
    padding-left: 1rem;
    font-size: 0.95rem;
    color: #4a4f5b;
  }

  .article-toc__title {
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: #89909f;
    margin: 0 0 0.6rem;
  }

  .article-toc__list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .article-toc__list ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
  }

  .article-toc__list ul ul {
    border-left: none;
  }

  .article-toc__list li {
    margin: 0;
    padding: 0;
  }

  .article-toc__list a {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0;
    padding-left: 0.75rem;
    border-left: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
  }

  .article-toc__list a:hover {
    color: #111827;
  }

  .article-toc__link.is-active {
    color: #111827;
    border-color: #4c8ef7;
  }

  .article-layout__rightbar,
  .wiki-page__rightbar {
    flex: 0 0 260px;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  .article-rightbar {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 0.92rem;
  }

  .article-rightbar__block {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.75rem;
  }

  .article-rightbar__block:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .article-rightbar__label {
    margin: 0 0 0.4rem;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: #6b7280;
  }

  .article-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .article-legend li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
  }

  .article-legend__swatch {
    width: 28px;
    height: 6px;
    border-radius: 999px;
    display: inline-block;
    flex-shrink: 0;
  }

  .article-legend__swatch--blue { background: #4c8ef7; }
  .article-legend__swatch--green { background: #37b47f; }
  .article-legend__swatch--red { background: #f15f5c; }

  .article-rightbar__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .article-rightbar__list a {
    text-decoration: none;
    color: inherit;
    padding: 0.1rem 0;
    border-left: 2px solid transparent;
    padding-left: 0.5rem;
    transition: border-color 0.2s ease, color 0.2s ease;
    display: inline-block;
  }

  .article-rightbar__list a:hover {
    border-color: #cbd5f5;
  }

  .article-rightbar__list a.is-active {
    border-color: #4c8ef7;
    font-weight: bold;
  }

  .article-rightbar__empty {
    margin: 0;
    color: #6b7280;
    font-size: 0.85rem;
  }

  body.theme-dark .article-toc {
    border-color: #1f2945;
    color: #c1c9e8;
  }

  body.theme-dark .article-toc__list a {
    color: #c1c9e8;
    border-left-color: rgba(96,165,250,0.15);
  }

  body.theme-dark .article-toc__list a:hover {
    color: #f8fafc;
  }

  body.theme-dark .article-toc__link.is-active {
    color: #f8fafc;
    border-color: #60a5fa;
  }

  body.theme-dark .article-rightbar,
  body.theme-dark .wiki-sidebox {
    background: #141c2f;
    border-color: #2b3555;
    color: #e2e8f0;
  }

  body.theme-dark .wiki-image {
    border-color: #2b3555;
    background: #141c2f;
  }

  body.theme-dark details {
    background: transparent;
    border: none;
    color: inherit;
  }

  body.theme-dark .article-rightbar__block {
    border-color: #2b3555;
  }

  body.theme-dark .article-rightbar__label {
    color: #94a3b8;
  }

  body.theme-dark .article-rightbar__list a:hover {
    border-color: #60a5fa;
  }

  body.theme-dark .article-rightbar__list a.is-active {
    border-color: #60a5fa;
  }

.feedback-cta {
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 1.25rem;
    background: var(--surface-alt);
    box-shadow: var(--shadow);
}

.feedback-cta__label {
    margin: 0 0 0.5rem;
    font-weight: 600;
}

.feedback-cta__button {
    width: 100%;
    border: 1px solid var(--border);
    background: rgba(148, 163, 184, 0.12);
    color: inherit;
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
  }
.feedback-cta__button:hover {
    border-color: var(--accent);
    background: rgba(37, 99, 235, 0.12);
}
.feedback-cta__panel {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    line-height: 1.45;
}
  .feedback-cta__panel a {
    font-weight: 600;
  }
  .feedback-cta__hint {
    margin: 0.35rem 0 0;
    color: #6b7280;
    font-size: 0.85rem;
  }
body.theme-dark .feedback-cta,
body.theme-dark .feedback-cta__button {
    border-color: #2b3555;
    background: rgba(15, 23, 42, 0.85);
}
  body.theme-dark .feedback-cta__button:hover {
    border-color: #60a5fa;
  }
  body.theme-dark .feedback-cta__hint {
    color: #94a3b8;
  }

  .material-stub {
    position: relative;
    color: inherit;
    text-decoration-line: underline;
    text-decoration-thickness: 0.14em;
    text-decoration-skip-ink: auto;
    text-underline-offset: 0.22em;
    transition: text-decoration-color 0.2s ease, text-decoration-thickness 0.2s ease;
  }

  .material-stub:hover,
  .material-stub:focus-visible {
    text-decoration-thickness: 0.18em;
  }

  .material-stub:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.25);
    outline-offset: 3px;
  }

  .material-stub::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: 140%;
    transform: translateX(-50%);
    display: block;
    white-space: normal;
    width: min(340px, 80vw);
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(34, 39, 46, 0.9);
    color: #f5f5f5;
    font-size: 0.75em;
    line-height: 1.35;
    letter-spacing: 0.01em;
    word-break: break-word;
    overflow-wrap: break-word;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease-in-out;
    z-index: 4;
    box-shadow: 0 8px 18px rgba(20, 23, 28, 0.18);
  }

  .material-stub:hover::after,
  .material-stub:focus::after,
  .material-stub:focus-visible::after {
    opacity: 1;
  }

  .material-stub--blue {
    text-decoration-color: #4c8ef7;
  }

  .material-stub--green {
    text-decoration-color: #37b47f;
  }

  .material-stub--red {
    text-decoration-color: #f15f5c;
  }

  body.theme-dark .material-stub {
    color: inherit;
  }

/* --- Header Search Layout --- */
.header-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  margin-left: 0;
  flex: 0 0 auto;
  flex-shrink: 0;
}

.header-search__toggle {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  font-size: 1rem; /* match your navbar font scale */
}

.header-search__panel {
  max-width: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-width 180ms ease, max-height 180ms ease;
}

.header-search.is-open .header-search__panel {
  max-width: min(20rem, 80vw);
  max-height: 70vh;
}

/* Remove Pagefind’s built-in magnifier icon in the input */
.pagefind-ui__form::before {
  display: none !important;
}

/* Underline-style input */
.pagefind-ui__search-input {
  height: auto !important;
  padding: 0 0 0.15rem !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid currentColor !important;
  border-radius: 0 !important;
  font: inherit !important;  /* match site font */
  font-weight: 400 !important;
}

/* Optional: subtle placeholder */
.pagefind-ui__search-input::placeholder {
  opacity: 0.4;
}

/* Hide Pagefind’s clear (“×”) button */
.pagefind-ui__search-clear {
  display: none !important;
}

/* Remove Pagefind’s rounded container styling */
.pagefind-ui__form {
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
}

/* Remove Pagefind’s “results box” padding if needed */
.pagefind-ui__results {
  margin-top: 0.5rem !important;
}
