/* ============================================================
 * user_ui — Blog pages (index + post).
 * ============================================================
 *
 * Section-local stylesheet of the public blog: `blog/blog_index.html`
 * (hero, game filter chips, post cards, pager) and `blog/blog_post.html`
 * (article header, rendered Steam body, source line). Loaded only by
 * those two templates through the base shell's {% block extra_css %}.
 * Everything is scoped under `.blog-page`; colours, radii and type come
 * from shared/tokens.css (documentation/user/DESIGN_SYSTEM.md). The hero
 * band and the hero mascot are the shared ones (shared/decorations.css
 * lists `.blog-page`).
 *
 * The post body is HTML written by SteamMarkupRenderer
 * (ui/user/services/blog/steam_markup_renderer.py): plain elements
 * (h2-h4, p, strong, em, u, s, ul, ol, li, blockquote, pre, code, hr,
 * table, a, img) plus `.blog-img`, `.blog-video`, `.blog-table` and
 * `.blog-quote-author`, all styled under `.blog-body` below.
 *
 * Images come from Steam's and YouTube's CDNs, so their size is not known
 * when the page is written (DESIGN_SYSTEM.md §11, "CDN-sourced
 * thumbnails"): a card's art box reserves its space with `aspect-ratio`,
 * and body images are fluid (`max-width: 100%`).
 *
 * Located at ui/user/static/user_ui/css/blog/blog.css
 * ============================================================ */

/* ---------- HERO ---------- */
.blog-page .blog-hero {
    position: relative;
    z-index: 1;
    padding: 56px 0 48px;
}
.blog-page .blog-hero .copy {
    max-width: 640px;
    padding-bottom: 18px;
}
.blog-page .blog-hero h1 {
    font-family: var(--font-head);
    font-size: clamp(40px, 5vw, 64px);
    line-height: 1;
    font-weight: 700;
    margin: 0 0 18px;
    letter-spacing: -.005em;
    text-wrap: balance;
}
.blog-page .blog-hero .lead {
    color: var(--text-dim);
    font-size: clamp(16px, 1.3vw, 18px);
    line-height: 1.55;
    max-width: 560px;
    margin: 0;
}

/* ---------- LIST (filter, cards, pager) ---------- */
.blog-page .blog-list {
    position: relative;
    z-index: 2;
    padding: 0 0 100px;
}

.blog-page .blog-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 24px;
}
.blog-page .blog-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    background: var(--bg-2);
    color: var(--text);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background .12s ease-out, color .12s ease-out;
}
.blog-page .blog-chip:hover { background: var(--chip); }
.blog-page .blog-chip.is-active {
    background: var(--orange);
    color: #fff;
}
.blog-page .blog-chip:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}
/* The active chip carries a check mark, so its state is not shown by
   colour alone. */
.blog-page .blog-chip-check {
    width: 12px;
    height: 12px;
    flex: none;
}
.blog-page .blog-chip-ico {
    width: 16px;
    height: 16px;
    flex: none;
}

.blog-page .blog-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.blog-page .blog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .12s ease-out;
}
.blog-page .blog-card:hover { border-color: var(--orange-3); }
.blog-page .blog-card:focus-within {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

/* The art box reserves its space before the CDN image arrives. */
.blog-page .blog-card-art {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-2);
    display: grid;
    place-items: center;
}
.blog-page .blog-card-art .blog-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.blog-page .blog-card-art .blog-card-placeholder {
    width: 48px;
    height: 48px;
    opacity: .6;
}

.blog-page .blog-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
}

.blog-page .blog-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: .04em;
    color: var(--text-mute);
}
.blog-page .blog-game {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px 6px;
    border-radius: var(--radius-pill);
    background: var(--chip);
    color: var(--text);
    font-family: var(--font-head);
    font-weight: 600;
    text-transform: uppercase;
}
.blog-page .blog-game-ico {
    width: 16px;
    height: 16px;
    flex: none;
}

.blog-page .blog-card-title {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    text-wrap: balance;
}
/* The title link covers the whole card: one link per card, the whole
   card clickable. */
.blog-page .blog-card-link {
    color: var(--text);
    text-decoration: none;
}
.blog-page .blog-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
}
.blog-page .blog-card-link:focus-visible { outline: none; }
.blog-page .blog-card:hover .blog-card-link { color: var(--orange); }

.blog-page .blog-card-excerpt {
    margin: 0;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.blog-page .blog-empty {
    padding: 56px 40px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}
.blog-page .blog-empty p {
    margin: 0;
    color: var(--text-dim);
    font-size: 16px;
}

.blog-page .blog-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 32px;
}
.blog-page .blog-pager-status {
    color: var(--text-mute);
    font-family: var(--font-mono);
    font-size: 12px;
}
.blog-page .blog-pager-link {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--radius-btn);
    border: 1.5px solid var(--line);
    color: var(--text);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .04em;
    text-decoration: none;
    transition: border-color .12s ease-out, color .12s ease-out;
}
.blog-page .blog-pager-link:hover {
    border-color: var(--orange);
    color: var(--orange);
}
.blog-page .blog-pager-link:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}
/* Keeps "Older posts" on the right on the first page. */
.blog-page .blog-pager-spacer { width: 1px; }

/* ---------- POST ---------- */
.blog-page .blog-article {
    position: relative;
    z-index: 1;
    padding: 40px 0 100px;
}
/* The article's reading width, on its own element inside the shared
   `.wrap` (which keeps its site-wide width). */
.blog-page .blog-article-inner {
    max-width: 920px;
    margin: 0 auto;
}

.blog-page .blog-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
    font-size: 14px;
    text-decoration: none;
}
.blog-page .blog-back svg { width: 16px; height: 16px; }
.blog-page .blog-back:hover { color: var(--orange); }
.blog-page .blog-back:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
    border-radius: 4px;
}

.blog-page .blog-article-head { margin: 24px 0 28px; }
.blog-page .blog-article-head h1 {
    font-family: var(--font-head);
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.08;
    font-weight: 700;
    margin: 14px 0 0;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.blog-page .blog-article-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.blog-page .blog-source {
    margin: 32px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--line-2);
    color: var(--text-mute);
    font-size: 14px;
}
.blog-page .blog-source a {
    color: var(--orange);
    font-weight: 600;
}
.blog-page .blog-source a:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ---------- RENDERED STEAM BODY ---------- */
.blog-page .blog-body {
    color: var(--text-dim);
    font-size: 15.5px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}
.blog-page .blog-body > :first-child { margin-top: 0; }
.blog-page .blog-body h2,
.blog-page .blog-body h3,
.blog-page .blog-body h4 {
    font-family: var(--font-head);
    color: var(--text);
    line-height: 1.2;
    margin: 32px 0 12px;
    text-wrap: balance;
}
.blog-page .blog-body h2 { font-size: 28px; font-weight: 700; }
.blog-page .blog-body h3 { font-size: 22px; font-weight: 600; }
.blog-page .blog-body h4 { font-size: 18px; font-weight: 600; }
.blog-page .blog-body p { margin: 0 0 18px; }
.blog-page .blog-body strong { color: var(--text); font-weight: 600; }
.blog-page .blog-body a {
    color: var(--orange);
    text-underline-offset: 2px;
}
.blog-page .blog-body a:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
    border-radius: 2px;
}
.blog-page .blog-body ul,
.blog-page .blog-body ol {
    margin: 0 0 18px;
    padding-left: 22px;
}
.blog-page .blog-body li { margin-bottom: 6px; }
.blog-page .blog-body li::marker { color: var(--orange); }
.blog-page .blog-body blockquote {
    margin: 0 0 18px;
    padding: 12px 18px;
    border-left: 3px solid var(--purple);
    background: var(--chip);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.blog-page .blog-body .blog-quote-author {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-style: normal;
    font-weight: 600;
}
.blog-page .blog-body pre {
    margin: 0 0 18px;
    padding: 14px 18px;
    background: var(--bg-2);
    border-radius: var(--radius);
    overflow-x: auto;
}
.blog-page .blog-body code {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
}
.blog-page .blog-body hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 28px 0;
}
.blog-page .blog-body .blog-img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 18px auto;
    border-radius: var(--radius);
}
.blog-page .blog-body .blog-table {
    margin: 0 0 18px;
    overflow-x: auto;
}
.blog-page .blog-body table {
    border-collapse: collapse;
    min-width: 100%;
    font-size: 14px;
}
.blog-page .blog-body th,
.blog-page .blog-body td {
    padding: 8px 12px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
.blog-page .blog-body th {
    color: var(--text);
    background: var(--bg-2);
    font-weight: 600;
}
.blog-page .blog-body .blog-video {
    position: relative;
    display: block;
    max-width: 640px;
    margin: 18px auto;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-2);
    text-decoration: none;
}
.blog-page .blog-body .blog-video-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.blog-page .blog-body .blog-video-label {
    position: absolute;
    left: 14px;
    bottom: 14px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: #1B2330;
    color: #fff;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: .04em;
}
.blog-page .blog-body .blog-video:hover .blog-video-label { background: var(--orange); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 760px) {
    .blog-page .blog-hero { padding: 40px 0 32px; }
    .blog-page .blog-hero h1 { font-size: 38px; margin-bottom: 14px; }
    .blog-page .blog-hero .lead { font-size: 15px; }
    .blog-page .blog-grid { grid-template-columns: 1fr; gap: 18px; }
    .blog-page .blog-article { padding: 24px 0 60px; }
    .blog-page .blog-article-card { padding: 22px 20px; }
    .blog-page .blog-body { font-size: 14.5px; }
    .blog-page .blog-body h2 { font-size: 22px; }
    .blog-page .blog-body h3 { font-size: 19px; }
    .blog-page .blog-body h4 { font-size: 17px; }
}
