/* Blog-only styles, layered on top of site.css.
   The Quarto project renders with `theme: none`, so there is no Bootstrap to
   fight with - these rules style Quarto's own structural classes to match the
   rest of the site.

   .blog-shell is opened/closed by the generated quarto/_includes partials
   (see build.mjs); Quarto's own output has no wrapper element to hook into. */

.blog-shell {
    /* Same box as .container, so the article shares the site's left edge;
       the reading column itself is capped below. */
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    /* The intro band (.case-hero) clears the fixed header. */
    padding: 55px 20px 80px;
}

.blog-shell > * {
    max-width: 800px;
}

/* ---- Title block ---- */

#title-block-header {
    /* Neutralise the site header rules, which target the element name. */
    position: static;
    background: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 35px;
}

#title-block-header h1.title {
    font-size: 2.2rem;
    line-height: 1.25;
    margin-bottom: 12px;
}

#title-block-header p.subtitle {
    font-size: 1.15rem;
    color: var(--muted);
    margin-bottom: 25px;
}

#title-block-header .author,
#title-block-header .date,
#title-block-header .quarto-title-meta {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 4px;
}

#title-block-header .quarto-title-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.quarto-title-meta-heading {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.quarto-title-meta-contents {
    font-weight: 500;
    color: var(--ink);
}

/* ---- Article typography ---- */

.blog-shell h2 {
    text-align: left;
    font-size: 1.5rem;
    margin-top: 45px;
}

.blog-shell h3 {
    font-size: 1.2rem;
    margin-top: 32px;
}

.blog-shell p,
.blog-shell li {
    line-height: 1.75;
}

.blog-shell ul,
.blog-shell ol {
    margin: 0 0 18px 22px;
}

.blog-shell li {
    margin-bottom: 8px;
}

/* The footer sitemap lives outside .blog-shell, but guard anyway. */
.blog-shell blockquote {
    border-left: 3px solid var(--secondary-color);
    padding: 6px 0 6px 20px;
    margin: 25px 0;
    color: var(--muted);
    font-style: italic;
}

.blog-shell img {
    border-radius: 8px;
    border: 1px solid var(--line);
}

.blog-shell figcaption {
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: 10px;
}

.blog-shell hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 45px 0;
}

.blog-shell a {
    color: var(--primary-color);
}

/* Quarto's heading anchor links. The first three rules are the ones AnchorJS
   would inject itself; post-render.mjs stops it doing so, because the same
   injection registers a data: icon font that the CSP blocks. */
.anchorjs-link {
    opacity: 0;
    text-decoration: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:hover > .anchorjs-link,
.anchorjs-link:focus {
    opacity: 1;
}

[data-anchorjs-icon]::after {
    content: attr(data-anchorjs-icon);
}

.blog-shell .anchorjs-link {
    color: var(--secondary-color);
}

/* ---- Code ---- */

.blog-shell div.sourceCode,
.blog-shell pre {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px 18px;
    overflow-x: auto;
    margin: 22px 0;
}

.blog-shell div.sourceCode pre {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

.blog-shell pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 0.88rem;
    line-height: 1.6;
}

/* ---- Listing ---- */

.quarto-listing {
    margin-top: 20px;
}

.quarto-post {
    display: block;
    padding: 28px 0;
    border-bottom: 1px solid var(--line);
}

/* The listing title is an <h2> so the page keeps a valid heading hierarchy
   (h1 "Blog" -> post titles); sized as a post headline, not a section heading. */
.quarto-post .listing-title {
    font-size: 1.35rem;
    text-align: left;
    margin-bottom: 8px;
}

.quarto-post .listing-title a {
    color: var(--primary-color);
    text-decoration: none;
}

.quarto-post .listing-title a:hover {
    color: var(--secondary-color);
}

/* Quarto wraps the description and the metadata block in <a> elements so the
   whole card is clickable - they must not look like inline links. */
.quarto-post .listing-description a,
.quarto-post .metadata a {
    color: inherit;
    text-decoration: none;
}

.quarto-post .listing-description {
    color: var(--muted);
    margin-bottom: 12px;
}

.quarto-post .listing-description p {
    margin-bottom: 0;
}

.quarto-post .metadata {
    margin-top: 12px;
}

.quarto-post .metadata,
.quarto-post .listing-date,
.quarto-post .listing-reading-time {
    font-size: 0.9rem;
    color: var(--muted);
}

.quarto-post .listing-date,
.quarto-post .listing-reading-time {
    display: inline-block;
    margin-right: 16px;
}

/* Shown on the index until the first post exists; post-render.mjs removes it
   from the output once the listing has entries. */
.blog-empty {
    padding: 28px 0;
}

/* "No matching items" belongs to the filter UI, which this blog does not use.
   With zero posts Quarto may reveal it next to the .blog-empty note. */
.listing-no-matching {
    display: none !important;
}

/* Bootstrap utility class Quarto emits; there is no Bootstrap here. */
.d-none {
    display: none !important;
}

.listing-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.listing-category,
.quarto-category,
.category {
    display: inline-block;
    background-color: var(--tint);
    color: var(--dark-color);
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.listing-category:hover,
.quarto-category:hover,
.category:hover {
    background-color: #d3e2dd;
}

/* Category filter list rendered by `categories: true` */
.quarto-listing-category {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.quarto-listing-category .category.active {
    background-color: var(--primary-color);
    color: white;
}

@media (max-width: 768px) {
    .blog-shell {
        padding-top: 40px;
        padding-bottom: 60px;
    }

    #title-block-header h1.title {
        font-size: 1.7rem;
    }
}

/* Author and date under a post title, inside the intro band. */
.post-meta {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 0.9rem;
    color: var(--muted);
}

.post-meta span + span::before {
    content: '·';
    margin: 0 10px;
    color: var(--secondary-color);
}
