/* Dominion Labs - the blog at /blog/ and its articles at /blog/<article>/.
   The page frame, colours and fonts come from index.css and chrome.css; this file adds the blog's own
   bar, the story stream on the index, and the article's rail and reading column. The Topics menu uses
   the same data-menu hooks as the site header, so /js/header.js opens it; /js/blog.js keeps the stream
   to one topic and copies an article's address. Nothing here reaches .hdr or .foot. */

/* The site header is fixed, so every blog page starts below it. */
:root { --hdr-h: 72px; }
@media (max-width: 640px) { :root { --hdr-h: 66px; } }
@media (max-width: 440px) { :root { --hdr-h: 62px; } }

body.blog {
    padding-top: var(--hdr-h);
    font-family: var(--chrome-body);
}

/* A blog page's header is the logo and a plain link back to the homepage, where the rest of the site
   carries its menus and the Try Lyric Ai button. */
body.blog .hdr .hdr-home {
    margin-left: auto;
    font-family: var(--chrome-body);
    font-size: 0.9375rem;
    color: var(--text);
    text-decoration: none;
}

body.blog .hdr .hdr-home:hover { color: var(--text-muted); }

/* ── The blog bar: the blog's own name on the left, its topics on the right ───────────── */
.blogbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem clamp(24px, 4vw, 80px);
    border-bottom: 1px solid var(--rule-soft);
}

.blogbar-home {
    font-family: var(--chrome-display);
    font-size: 1.25rem;
    line-height: 1.3;
    color: var(--text);
    text-decoration: none;
}

.blogbar-topics { position: relative; }

.blogbar-topics > button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--chrome-body);
    font-size: 0.9375rem;
    color: var(--text);
    background: none;
    border: 0;
    padding: 0.35rem 0;
    cursor: pointer;
}

.blogbar-topics > button svg {
    width: 10px;
    height: 10px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.blogbar-topics > button.open { color: var(--text-muted); }
.blogbar-topics > button.open svg { transform: rotate(180deg); }

.blogbar .xmenu-pop {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 900;
    padding-top: 10px;
}

.blogbar .xmenu-pop[hidden] { display: none; }

.blogbar .topicmenu {
    width: 230px;
    max-width: calc(100vw - 32px);
    background: var(--menu-card);
    border: 1px solid var(--rule-soft);
    border-radius: 14px;
    box-shadow: var(--menu-card-shadow);
    padding: 1.25rem 1.5rem;
    text-align: left;
}

.blogbar .topicmenu > span {
    display: block;
    font-family: var(--chrome-display);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.blogbar .topicmenu a {
    display: block;
    font-family: var(--chrome-display);
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--text);
    text-decoration: none;
}

.blogbar .topicmenu a:hover { opacity: 0.6; }

/* Phones: the menu drops from the bar at the gutter rather than from the button. */
@media (max-width: 480px) {
    .blogbar { position: relative; }
    .blogbar-topics { position: static; }
    .blogbar .xmenu-pop { right: 16px; }
}

/* ── The index ────────────────────────────────────────────────────────────────────────── */
.blog-main {
    flex: 1;
    display: block;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    gap: 0;
    padding: clamp(3rem, 6vw, 4.5rem) clamp(24px, 4vw, 80px) clamp(4rem, 8vw, 7rem);
}

.blog-head { max-width: 46rem; }

.blog-title {
    font-family: var(--chrome-display);
    font-size: clamp(2.75rem, 6vw, 4rem);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--text);
}

.blog-lede {
    margin-top: 1rem;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* The topic the stream is kept to, and the way back to all of it. */
.blog-scope {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.blog-scope[hidden] { display: none; }

.blog-scope b {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
}

.blog-scope a {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
}

.blog-scope a:hover { color: var(--text); }

/* ── The stream: the newest story at full width, the rest in two columns ──────────────── */
.blog-stream { margin-top: clamp(2.25rem, 4vw, 3rem); }

.post-eyebrow {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.post-lead {
    display: block;
    border-top: 1px solid var(--rule);
    padding-top: clamp(1.75rem, 3vw, 2.25rem);
    text-decoration: none;
    color: inherit;
}

.post-lead h2 {
    margin-top: 0.85rem;
    max-width: 22ch;
    font-family: var(--chrome-display);
    font-size: clamp(1.875rem, 3.6vw, 2.75rem);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--text);
    transition: color 0.15s ease;
}

.post-lead p {
    margin-top: 0.9rem;
    max-width: 56ch;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.post-when {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.post-lead:hover h2 { color: var(--text-muted); }

.blog-more {
    margin-top: clamp(2.75rem, 5vw, 4rem);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(2rem, 4vw, 4rem);
    row-gap: clamp(2rem, 4vw, 3rem);
}

.post-row {
    display: block;
    border-top: 1px solid var(--rule);
    padding-top: 1.5rem;
    text-decoration: none;
    color: inherit;
}

.post-row[hidden] { display: none; }

.post-row h3 {
    margin-top: 0.7rem;
    font-family: var(--chrome-display);
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1.2;
    color: var(--text);
    transition: color 0.15s ease;
}

.post-row p {
    margin-top: 0.6rem;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.post-row:hover h3 { color: var(--text-muted); }

@media (max-width: 760px) {
    .blog-more { grid-template-columns: minmax(0, 1fr); }
}

/* ── An article ───────────────────────────────────────────────────────────────────────── */
.post-main {
    flex: 1;
    display: block;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    gap: 0;
    padding: clamp(3rem, 6vw, 4.5rem) clamp(24px, 4vw, 80px) clamp(4rem, 8vw, 7rem);
}

.post-head {
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
}

.post-title {
    margin-top: 1.1rem;
    font-family: var(--chrome-display);
    font-size: clamp(2.25rem, 5.2vw, 4rem);
    font-weight: 300;
    line-height: 1.08;
    letter-spacing: -0.015em;
    color: var(--text);
}

.post-rule {
    max-width: 960px;
    margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
    border: 0;
    border-top: 1px solid var(--rule);
}

.post-grid {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    column-gap: clamp(2rem, 5vw, 4rem);
    padding-top: clamp(2.5rem, 5vw, 3.5rem);
}

.post-rail {
    position: sticky;
    top: calc(var(--hdr-h) + 2rem);
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.post-by { font-size: 0.9375rem; color: var(--text); }
.post-by span { color: var(--text-muted); }
.post-rail .post-when { margin-top: 0; }

.post-share {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: -10px;
}

.post-share a,
.post-share button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease;
}

.post-share svg { width: 17px; height: 17px; fill: currentColor; }
.post-share button svg { width: 15px; height: 15px; }
.post-share a:hover,
.post-share button:hover { color: var(--text); }
.post-share .copied { display: none; }
.post-share button.done { color: var(--text); }
.post-share button.done .plain { display: none; }
.post-share button.done .copied { display: inline; }

.post-source {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.post-source svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }

.post-source span {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--rule-strong);
    text-underline-offset: 0.2em;
}

.post-source:hover { color: var(--text); }

/* The reading column, set in the serif the rest of the site uses for display. */
.post-body {
    font-family: var(--chrome-display);
    font-size: 1.1875rem;
    line-height: 1.72;
    color: var(--text);
}

.post-body > * + * { margin-top: 1.4rem; }

.post-body h2 {
    margin-top: 2.6rem;
    font-size: 1.625rem;
    font-weight: 400;
    line-height: 1.25;
}

.post-body h3 {
    margin-top: 2.1rem;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.35;
}

.post-body ul,
.post-body ol { padding-left: 1.3rem; }
.post-body li + li { margin-top: 0.6rem; }
.post-body li::marker { color: var(--text-faint); }

.post-body a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--rule-strong);
    text-underline-offset: 0.2em;
}

.post-body a:hover { text-decoration-color: var(--text-faint); }
.post-body strong { font-weight: 600; }
.post-body em { font-style: italic; }

.post-body img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.post-body figcaption {
    margin-top: 0.75rem;
    font-family: var(--chrome-body);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.post-foot {
    max-width: 960px;
    margin: clamp(3rem, 6vw, 4.5rem) auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
}

.post-back {
    font-size: 0.9375rem;
    color: var(--text-muted);
    text-decoration: none;
}

.post-back:hover { color: var(--text); }

@media (max-width: 880px) {
    .post-head { text-align: left; }
    .post-grid {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 2.25rem;
    }
    .post-rail {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.75rem 1.5rem;
    }
    .post-body { font-size: 1.125rem; }
}
