/* ==========================================================================
   Brenko Ghost Theme Core Stylesheet (Substack Style)
   ========================================================================== */

/* Imports */
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Lora:ital,wght@0,400;0,600;0,700;1,400&family=Playfair+Display:ital,wght@0,700;1,700&display=swap');

/* CSS Variables */
:root {
    --bg-color: #fff9f0;
    --header-footer-bg: #141417;
    --card-bg: #ffffff;
    --accent-color: #cc3333;
    --accent-hover: #a62828;
    --text-color: #1d1d1d;
    --text-secondary: #6b6b6b;
    --text-muted: #999999;
    --border-color: #e5e5e5;
    --border-light: #f0f0f0;
    
    --font-body: 'Libre Baskerville', Georgia, serif;
    --font-heading: 'Lora', Georgia, serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    --max-width-content: 720px;
    --max-width-site: 1120px;
}

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

html {
    background-color: var(--bg-color);
}
body {
    margin: 0;
    padding: 0;
    background-color: transparent;
    color: var(--text-color);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-color);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 1rem 0;
    color: var(--text-color);
}

p {
    margin: 0 0 1.5rem 0;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* Site-wide background video overlay */
.site-video-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.site-video-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: screen;
}

/* Disable background video on mobile to save bandwidth and battery */
@media (max-width: 768px) {
    .site-video-backdrop {
        display: none;
    }
}

/* Layout Wrapper */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Header (Stacked Substack style) */
.site-header {
    background-color: var(--header-footer-bg);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 100;
    color: #ffffff;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: var(--max-width-site);
    margin-bottom: 1.25rem;
}

/* Center stacked brand logo/text */
.header-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.header-logo-image {
    max-height: 55px;
    display: block;
    margin: 0 auto;
}

.header-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.75rem;
    margin: 0;
    letter-spacing: -0.5px;
    white-space: nowrap;
    color: #ffffff;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left {
    z-index: 10;
}

.header-right {
    z-index: 10;
}

.btn-search {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.btn-search:hover {
    color: #ffffff;
}

.btn-subscribe {
    background-color: var(--accent-color);
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-subscribe:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
}

.btn-signin {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-signin:hover {
    color: #ffffff;
}

/* Stacked Navigation Below Logo */
.header-nav {
    width: 100%;
    max-width: var(--max-width-site);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    display: flex;
    justify-content: center;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.nav-menu li a {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.2px;
}

.nav-menu li.nav-current a,
.nav-menu li a:hover {
    color: #ffffff;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 2px;
}

/* Main Content Area */
.site-main {
    flex-grow: 1;
    padding: 3rem 1.5rem;
    max-width: var(--max-width-site);
    width: 100%;
    margin: 0 auto;
}

/* Homepage Hero (Featured Post) - Substack style card with image */
.hero-section {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 2rem;
    transition: box-shadow 0.2s ease;
}

.hero-section:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.hero-image-wrap {
    display: block;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    display: block;
    object-fit: cover;
    max-height: 420px;
    transition: transform 0.3s ease;
}

.hero-image-wrap:hover .hero-image {
    transform: scale(1.02);
}

.hero-content {
    padding: 1.75rem 2rem;
    display: flex;
    flex-direction: column;
}

.hero-tag {
    color: var(--accent-color);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    font-family: var(--font-sans);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.hero-title a {
    color: var(--text-color);
}

.hero-title a:hover {
    color: var(--accent-color);
}

.hero-excerpt {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.hero-meta {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

/* Post Grid / Feed Layout */
.posts-feed-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .posts-feed-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.posts-feed {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .posts-feed {
        grid-template-columns: 1fr;
    }
}

/* ========================================================================== 
   Dark editorial homepage — reference layout
   ========================================================================== */
:root {
    --bg-color: #0d0d0f;
    --header-footer-bg: #121216;
    --card-bg: #121216;
    --accent-color: #941f2b;
    --accent-hover: #b52b39;
    --text-color: #f3f1ef;
    --text-secondary: #bbb8b5;
    --text-muted: #85858c;
    --border-color: #29292e;
    --border-light: #222227;
    --font-body: Georgia, 'Times New Roman', serif;
    --font-heading: Georgia, 'Times New Roman', serif;
    --font-display: Georgia, 'Times New Roman', serif;
    --max-width-site: 1080px;
}

html { background: var(--bg-color); }
body { background: transparent; color: var(--text-color); }
.site-wrapper { background: #0d0d0f; }
.site-header {
    position: relative;
    color: var(--text-color);
    background: #141418;
    border-color: #2a2a2f;
    backdrop-filter: none;
}
.header-top { height: 140px; max-width: 100%; padding: 0 20px; }
.header-brand { width: 720px; max-width: 66%; }
.header-title {
    color: #f8f7f5;
    font-family: var(--font-display);
    font-size: clamp(38px, 4vw, 64px);
    font-weight: 400;
    letter-spacing: -2.5px;
    text-align: center;
    overflow: visible;
}
.header-title::first-letter { font-style: italic; }
.header-tagline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 8px auto 0;
    color: #9b9ba1;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 5px;
    text-transform: uppercase;
    white-space: nowrap;
}
.header-tagline::before,
.header-tagline::after { content: ''; width: 92px; height: 1px; background: #55555b; }
.header-monogram,
.publication-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background: #94202d;
    color: #fff;
    font: 700 22px/1 Georgia, serif;
}
.header-left { position: absolute; left: 18px; }
.header-right { position: absolute; right: 18px; }
.btn-search, .btn-signin { color: #dedee2; }
.btn-subscribe { background: #941f2b; }
.header-nav { border-color: #2a2a2f; background: #141418; }
.nav-menu { min-height: 44px; justify-content: center; gap: 28px; }
.nav-menu li a { color: #e9e8e6; font-size: 12px; font-weight: 700; }
.nav-menu li.nav-current a,
.nav-menu li a:hover { color: #fff; border-color: #fff; }

.site-main { max-width: var(--max-width-site); padding: 20px 0 70px; }
.home-layout h1, .home-layout h2, .home-layout h3,
.home-layout p { color: inherit; }
.home-layout a { color: inherit; }
.home-layout a:hover { color: inherit; opacity: .78; }
.home-meta {
    display: flex;
    gap: 5px;
    color: #8e8e96;
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.lead-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    min-height: 490px;
    border-bottom: 1px solid var(--border-color);
}
.lead-story { padding: 0 14px 18px 0; border-right: 1px solid var(--border-color); }
.lead-image-link { display: block; aspect-ratio: 1.55 / 1; overflow: hidden; background: #17171b; }
.lead-image { width: 100%; height: 100%; object-fit: cover; }
.lead-copy { padding: 24px 26px 0; text-align: center; }
.lead-copy h1 { margin: 0 0 8px; font-size: 27px; line-height: 1.12; }
.lead-copy p { margin: 0 0 10px; color: #eee; font-family: var(--font-sans); font-size: 13px; }
.lead-copy .home-meta { justify-content: center; }

.latest-stack { padding: 0 0 18px 14px; }
.latest-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 138px;
    gap: 18px;
    min-height: 112px;
    padding: 0 0 18px;
}
.latest-item + .latest-item { padding-top: 6px; }
.latest-copy { padding: 2px 0; }
.latest-copy h2 { margin: 0 0 5px; font-size: 18px; line-height: 1.15; }
.latest-copy p {
    display: -webkit-box;
    margin: 0 0 8px;
    overflow: hidden;
    color: #e6e4e2;
    font-family: var(--font-sans);
    font-size: 12px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.latest-thumb-link { width: 138px; height: 92px; overflow: hidden; background: #17171b; }
.latest-thumb { width: 100%; height: 100%; object-fit: cover; }

.popular-section { padding: 20px 0 32px; border-bottom: 1px solid var(--border-color); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; }
.section-heading h2 { margin: 0; font-size: 18px; }
.section-heading a {
    color: #eee;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}
.popular-row { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 20px; }
.popular-empty { grid-column: 1 / -1; margin: 0; color: var(--text-muted); font-size: 12px; }
.popular-card {
    display: flex;
    gap: 14px;
    min-width: 0;
    padding: 0 20px;
    border-right: 1px solid var(--border-color);
}
.popular-card:first-child { padding-left: 0; }
.popular-card:last-child { padding-right: 0; border: 0; }
.popular-copy { flex: 1; min-width: 0; }
.popular-card h3 { margin: 0 0 8px; font-size: 17px; line-height: 1.2; }
.popular-card img { width: 80px; height: 80px; object-fit: cover; }

.lower-home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 28px; padding-top: 28px; }
.glimpses-section { min-width: 0; }
.section-heading-large h2 { font-size: 27px; }
.glimpse-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 26px; margin-top: 16px; }
.glimpse-image-link { display: block; aspect-ratio: 1.48 / 1; overflow: hidden; background: #17171b; }
.glimpse-card img { width: 100%; height: 100%; object-fit: cover; }
.glimpse-card h3 { margin: 10px 0 4px; font-size: 17px; line-height: 1.15; }
.glimpse-card p {
    margin: 0 0 8px;
    overflow: hidden;
    color: #f1f0ee;
    font-family: var(--font-sans);
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.home-sidebar { padding-top: 1px; }
.publication-card { padding: 0 0 28px; border-bottom: 1px solid var(--border-color); }
.publication-card h2 { margin: 10px 0 5px; font-size: 17px; }
.publication-card p { color: #a6a6ad; font-family: var(--font-sans); font-size: 11px; line-height: 1.55; }
.subscribed-button {
    display: inline-block;
    padding: 10px 17px;
    border-radius: 7px;
    background: #351116;
    color: #b72838 !important;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
}
.sidebar-archive { padding-top: 24px; }
.sidebar-story { display: block; padding: 12px 0; border-bottom: 1px solid var(--border-color); font: 700 13px/1.3 Georgia, serif; }
.sidebar-recommendations { padding-top: 24px; }
.recommendations-all {
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-muted);
    font-family: var(--font-byline);
    font-size: var(--byline-font-size);
    font-weight: var(--byline-font-weight);
    text-transform: uppercase;
    cursor: pointer;
}
.recommendations-list { list-style: none; padding: 8px 0 0; margin: 0; }
.recommendation-item { padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.recommendation-item a { display: flex; align-items: center; gap: 11px; }
.recommendation-favicon {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    overflow: hidden;
    border-radius: 7px;
    background: var(--card-bg);
}
.recommendation-favicon img { width: 100%; height: 100%; object-fit: cover; }
.recommendation-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.recommendation-copy strong {
    overflow: hidden;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: var(--heading-font-weight);
    text-overflow: ellipsis;
    white-space: nowrap;
}
.recommendation-copy small {
    overflow: hidden;
    color: var(--text-muted);
    font-family: var(--font-byline);
    font-size: var(--byline-font-size);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-footer { border-color: #29292e; background: #121216; color: #888; }
.footer-nav a, .footer-copyright, .footer-platform { color: #888; }

@media (max-width: 1120px) {
    .site-main { padding-right: 20px; padding-left: 20px; }
}
@media (max-width: 820px) {
    .header-top { height: 110px; }
    .header-tagline { letter-spacing: 2px; }
    .header-tagline::before, .header-tagline::after { width: 35px; }
    .lead-grid { grid-template-columns: 1fr; }
    .lead-story { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--border-color); }
    .latest-stack { padding: 22px 0 0; }
    .popular-row { grid-template-columns: repeat(2, 1fr); gap: 18px 0; }
    .popular-card:nth-child(2n) { border-right: 0; }
    .lower-home-grid { grid-template-columns: 1fr; }
    .home-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; border-top: 1px solid var(--border-color); padding-top: 28px; }
}
@media (max-width: 600px) {
    .header-top { height: 82px; }
    .header-brand { max-width: 68%; }
    .header-title { font-size: 28px; letter-spacing: -1px; }
    .header-tagline { display: none; }
    .header-monogram { width: 28px; height: 28px; font-size: 18px; }
    .header-left { left: 12px; width: auto; }
    .header-right { right: 10px; }
    .btn-search { display: none; }
    .site-main { padding: 15px 14px 50px; }
    .lead-copy { padding: 20px 8px 24px; }
    .lead-copy h1 { font-size: 24px; }
    .latest-item { grid-template-columns: minmax(0, 1fr) 104px; min-height: 90px; gap: 12px; }
    .latest-thumb-link { width: 104px; height: 72px; }
    .latest-copy h2 { font-size: 16px; }
    .latest-copy p { display: none; }
    .popular-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
    .popular-card { flex: 0 0 76%; scroll-snap-align: start; }
    .glimpse-grid { grid-template-columns: 1fr 1fr; gap: 24px 14px; }
    .glimpse-card h3 { font-size: 15px; }
    .home-sidebar { grid-template-columns: 1fr; }
}

/* Hero spans full width above the grid */
.hero-section {
    grid-column: 1 / -1;
}

/* Pagination and empty-state messages span full width */
.posts-feed .pagination,
.posts-feed > p {
    grid-column: 1 / -1;
}

/* Substack-style Post Cards */
.post-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.post-card-image-wrap {
    display: block;
    width: 100%;
    overflow: hidden;
    flex-shrink: 0;
}

.post-card-image {
    width: 100%;
    display: block;
    object-fit: cover;
    max-height: 200px;
    transition: transform 0.3s ease;
}

.post-card:hover .post-card-image {
    transform: scale(1.02);
}

.post-card-content {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin: 0 0 0.4rem 0;
    line-height: 1.3;
}

.post-card-title a {
    color: var(--text-color);
}

.post-card-title a:hover {
    color: var(--accent-color);
}

/* Subtitle / series description below title */
.post-card-subtitle {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-excerpt {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}

.post-card-meta a {
    color: var(--text-color);
    font-weight: 500;
}

.post-card-meta a:hover {
    color: var(--accent-color);
}

/* Sidebar / Secondary Sections */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-widget {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: 6px;
}

.widget-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.5rem;
    color: var(--text-color);
}

/* Top Posts Widget */
.top-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.top-post-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.top-post-number {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
    width: 24px;
    text-align: right;
}

.top-post-detail {
    flex-grow: 1;
}

.top-post-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.top-post-meta {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Reusable Substack-style Subscribe Form */
.subscribe-box {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 600px;
    margin: 3rem auto;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.subscribe-box-headline {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subscribe-box-subline {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.subscribe-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.subscribe-email-wrap {
    width: 100%;
    max-width: 380px;
    display: flex;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--bg-color);
}

.subscribe-input {
    flex-grow: 1;
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    width: 100%;
}

.subscribe-input::placeholder {
    color: var(--text-muted);
}

.subscribe-input:focus {
    outline: none;
}

.subscribe-submit {
    background-color: var(--accent-color);
    color: var(--text-color);
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.subscribe-submit:hover {
    background-color: var(--accent-hover);
}

.subscribe-tos {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1rem;
    line-height: 1.4;
    max-width: 380px;
}

.subscribe-tos a {
    text-decoration: underline;
    color: var(--text-secondary);
}

/* Form States (Ghost Members) */
.form-message {
    display: none;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    line-height: 1.4;
}

.success-message {
    background-color: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

.error-message {
    background-color: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #f87171;
}

.success .success-message {
    display: block;
}

.error .error-message {
    display: block;
}

.loading .subscribe-submit {
    opacity: 0.6;
    pointer-events: none;
}

/* Post Details Page */
.post-header {
    max-width: var(--max-width-content);
    margin: 0 auto 2rem auto;
    text-align: center;
}

.post-tag-link {
    display: inline-block;
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.post-main-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .post-main-title {
        font-size: 2rem;
    }
}

.post-subtitle {
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

/* Author Info Block */
.post-author-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-light);
}

.author-meta-detail {
    text-align: left;
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

.author-meta-name {
    font-weight: 600;
    color: var(--text-color);
}

.author-meta-name a {
    color: var(--text-color);
}

.author-meta-pub {
    color: var(--text-secondary);
}

.post-meta-sub {
    color: var(--text-muted);
}

.post-feature-image-wrap {
    max-width: 1000px;
    margin: 0 auto 3rem auto;
    border-radius: 4px;
    overflow: hidden;
}

.post-feature-image {
    width: 100%;
    display: block;
    max-height: 600px;
    object-fit: cover;
}

.post-feature-video {
    display: block;
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    background: #000;
}

.kg-video-card[hidden] { display: none !important; }

/* Reading content styles */
.post-content-container {
    max-width: var(--max-width-content);
    margin: 0 auto;
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.8;
    color: #363737;
}

@media (max-width: 600px) {
    .post-content-container {
        font-size: 1.05rem;
    }
}

.post-content-container p {
    margin-bottom: 1.75rem;
}

/* Center images in post content */
.post-content-container img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Drop caps on first letter of chapter */
.post-content-container > p:first-of-type::first-letter {
    font-family: var(--font-display);
    font-size: 3.5rem;
    float: left;
    line-height: 0.85;
    margin: 0.2rem 0.5rem 0 0;
    color: var(--accent-color);
    font-weight: 700;
}

/* Blockquotes styled like Substack quotes */
.post-content-container blockquote {
    border-left: 3px solid var(--accent-color);
    margin: 2rem 0;
    padding: 0.25rem 0 0.25rem 1.5rem;
    font-style: italic;
    color: var(--text-secondary);
}

/* Koenig divider / section break card */
.kg-divider-card {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2.5rem 0;
}

.kg-divider-card hr {
    width: 100%;
    max-width: 120px;
    height: 2px;
    margin: 0;
    border: none;
    background-color: var(--border-color);
}

/* Chapter divider */
.post-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 3rem 0;
    border: none;
}

/* Navigation items between chapters */
.chapter-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin: 3rem auto;
    max-width: var(--max-width-content);
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.chapter-nav-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.2s ease;
}

.chapter-nav-link:hover {
    border-color: var(--accent-color);
}

.chapter-nav-label {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.chapter-nav-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chapter-nav-link.nav-prev {
    text-align: left;
}

.chapter-nav-link.nav-next {
    text-align: right;
}

/* Comments block */
.comments-container {
    max-width: var(--max-width-content);
    margin: 3rem auto 0 auto;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

/* Footer Section */
.site-footer {
    background-color: var(--header-footer-bg);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 3rem 1.5rem;
    margin-top: auto;
    color: rgba(255,255,255,0.6);
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

.footer-content {
    max-width: var(--max-width-site);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-nav a {
    color: rgba(255,255,255,0.6);
}

.footer-nav a:hover {
    color: #ffffff;
}

.footer-copyright {
    color: rgba(255,255,255,0.4);
    text-align: center;
}

/* Floating reading progress bar at top of window */
.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: transparent;
    z-index: 1000;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent-color);
    width: 0;
}

/* Ghost Native elements customization */
.gh-canvas {
    max-width: 100% !important;
}

/* Koenig editor styles support */

/* --- Image Cards --- */
.kg-image-card {
    margin: 2rem 0;
}

.kg-image-card figcaption {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Wide and full-width images */
.kg-width-wide {
    width: 100%;
}

.kg-width-wide .kg-image {
    max-width: 100vw;
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}

@media (min-width: 1024px) {
    .kg-width-wide .kg-image {
        max-width: 85vw;
        width: 85vw;
    }
}

.kg-width-full .kg-image {
    max-width: 100vw;
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}

/* --- Gallery Cards --- */
.kg-gallery-card {
    margin: 2rem 0;
}

.kg-gallery-container {
    display: flex;
    flex-direction: column;
}

.kg-gallery-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.kg-gallery-image img {
    display: block;
    margin: 0;
    width: 100%;
    height: 100%;
}

/* --- Embed Cards --- */
.kg-embed-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2rem 0;
}

.kg-embed-card iframe {
    max-width: 100%;
}

/* --- Callout Cards --- */
.kg-callout-card {
    display: flex;
    margin: 2rem 0;
}

.kg-callout-emoji {
    font-size: 1.25rem;
    line-height: 1.4;
    padding-right: 0.75rem;
}

.kg-callout-text {
    font-size: 1.05rem;
    line-height: 1.6;
}

/* --- Toggle Cards --- */
.kg-toggle-card {
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--card-bg);
    overflow: hidden;
}

.kg-toggle-heading {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1rem;
}

.kg-toggle-heading h4 {
    margin: 0;
    font-size: 1rem;
}

.kg-toggle-content {
    padding: 0 1.25rem 1rem;
}

/* --- Header Cards --- */
.kg-header-card {
    margin: 2rem 0;
    padding: 3rem 1.5rem;
    text-align: center;
    border-radius: 4px;
    background-color: var(--card-bg);
}

.kg-header-card h2 {
    font-size: 2rem;
}

.kg-header-card .kg-header-card-subheader {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* --- File Cards --- */
.kg-file-card {
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--card-bg);
    overflow: hidden;
}

.kg-file-card a {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    color: var(--text-color);
}

.kg-file-card .kg-file-card-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.kg-file-card .kg-file-card-title {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
}

.kg-file-card .kg-file-card-caption {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Audio Cards --- */
.kg-audio-card {
    margin: 2rem 0;
}

.kg-audio-card audio {
    width: 100%;
}

/* --- Video Cards --- */
.kg-video-card {
    margin: 2rem 0;
}

.kg-video-card video {
    width: 100%;
}

/* --- Button Cards --- */
.kg-button-card {
    margin: 2rem 0;
    text-align: center;
}

.kg-button-card a {
    display: inline-block;
    background-color: var(--accent-color);
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.kg-button-card a:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
}

/* --- Product Cards --- */
.kg-product-card {
    margin: 2rem 0;
}

/* --- Bookmark Cards --- */
.kg-bookmark-card {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 2rem 0;
    background-color: var(--card-bg);
}

.kg-bookmark-container {
    display: flex;
    color: var(--text-color) !important;
}

.kg-bookmark-content {
    padding: 1.25rem;
    flex-grow: 1;
}

.kg-bookmark-title {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.kg-bookmark-description {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.kg-bookmark-thumbnail {
    flex-shrink: 0;
    width: 30%;
    min-width: 100px;
    overflow: hidden;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 500px) {
    .kg-bookmark-container {
        flex-direction: column-reverse;
    }
    .kg-bookmark-thumbnail {
        width: 100%;
        height: 150px;
    }
}

/* Pagination links */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0 3rem 0;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

.pagination a, .pagination span {
    color: var(--text-secondary);
}

.pagination a:hover {
    color: var(--accent-color);
}

.page-number {
    font-weight: 600;
}

/* ========================================================================== 
   Til Thick & Thorough — Substack-inspired publication skin
   ========================================================================== */
:root {
    --bg-color: #ffffff;
    --header-footer-bg: #ffffff;
    --card-bg: #ffffff;
    --accent-color: #ff6719;
    --accent-hover: #e75b12;
    --text-color: #242424;
    --text-secondary: #6b6b6b;
    --text-muted: #8a8a8a;
    --border-color: #e6e6e6;
    --border-light: #eeeeee;
    --font-body: Georgia, 'Times New Roman', serif;
    --font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --font-display: Georgia, 'Times New Roman', serif;
    --max-width-content: 650px;
    --max-width-site: 1080px;
}

html {
    background: #fff;
}
body {
    background: transparent;
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.45;
    overflow-x: hidden;
}
a { transition: opacity .15s ease, color .15s ease; }
a:hover { color: inherit; opacity: .72; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
    color: var(--text-color);
    background: rgba(255,255,255,.97);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
}

.header-top {
    height: 64px;
    max-width: var(--max-width-site);
    margin: 0 auto;
    padding: 0 20px;
}

.header-brand {
    max-width: 52%;
}

.header-brand a { display: block; }
.header-logo-image { max-height: 40px; max-width: 360px; }
.header-title {
    margin: 0;
    color: #111;
    font-family: var(--font-display);
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -.5px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.publication-home,
.btn-signin {
    color: #555;
    font-size: 14px;
    font-weight: 400;
}

.header-right { gap: 13px; }
.btn-search { color: #555; padding: 6px; }
.btn-subscribe,
.subscribe-submit {
    border-radius: 4px;
    background: var(--accent-color);
    color: #fff;
    font-family: var(--font-sans);
    font-weight: 600;
}
.btn-subscribe { padding: 8px 14px; font-size: 14px; }
.btn-subscribe:hover,
.subscribe-submit:hover { background: var(--accent-hover); color: #fff; opacity: 1; }

.header-nav {
    max-width: none;
    padding: 0 18px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
}
.nav-menu {
    max-width: var(--max-width-site);
    width: 100%;
    min-height: 42px;
    gap: 25px;
    overflow-x: auto;
    flex-wrap: nowrap;
    align-items: center;
    scrollbar-width: none;
}
.nav-menu::-webkit-scrollbar { display: none; }
.nav-menu li { flex: 0 0 auto; }
.nav-menu li a {
    color: #666;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
}
.nav-menu li.nav-current a,
.nav-menu li a:hover {
    padding-bottom: 10px;
    color: #222;
    border-bottom: 2px solid #222;
}

.site-main {
    max-width: var(--max-width-site);
    padding: 40px 20px 70px;
}

.hero-section {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, .8fr);
    min-height: 340px;
    margin: 0 0 42px;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    padding-bottom: 40px;
}
.hero-section:hover { box-shadow: none; }
.hero-image-wrap { min-height: 310px; background: #f4f4f4; }
.hero-image { height: 100%; max-height: 420px; object-fit: cover; }
.hero-image-wrap:hover .hero-image { transform: none; }
.hero-content { justify-content: center; padding: 24px 0 24px 38px; }
.hero-tag {
    margin-bottom: 10px;
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
}
.hero-title { margin-bottom: 12px; font-size: 34px; line-height: 1.1; letter-spacing: -.025em; }
.hero-title a:hover { color: inherit; }
.hero-excerpt {
    margin-bottom: 18px;
    color: #676767;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
}
.hero-meta { color: #888; font-size: 13px; }

.posts-feed-container {
    display: grid;
    grid-template-columns: minmax(0, 680px) 280px;
    justify-content: space-between;
    gap: 64px;
}
.posts-feed { min-width: 0; }
.posts-feed::before {
    content: 'Latest';
    display: block;
    padding-bottom: 11px;
    border-bottom: 1px solid #222;
    color: #222;
    font-size: 14px;
    font-weight: 700;
}
.post-card {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 170px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
}
.post-card-content { flex: 1 1 auto; min-width: 0; }
.post-card-image-wrap {
    order: 2;
    flex: 0 0 190px;
    width: 190px;
    height: 126px;
    border-radius: 2px;
    overflow: hidden;
    background: #f3f3f3;
}
.post-card-image { width: 100%; height: 100%; object-fit: cover; }
.post-card-title { margin: 3px 0 7px; font-size: 21px; line-height: 1.22; letter-spacing: -.012em; }
.post-card-subtitle {
    display: -webkit-box;
    margin: 0 0 12px;
    overflow: hidden;
    color: #6b6b6b;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.42;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.post-card-meta { gap: 6px; color: #8a8a8a; font-size: 12px; }

.sidebar { min-width: 0; }
.sidebar-widget {
    margin: 0 0 34px;
    padding: 0 0 30px;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    background: transparent;
}
.widget-title {
    padding-bottom: 10px;
    border-bottom: 1px solid #222;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
}
.sidebar .subscribe-email-wrap { display: flex; }
.sidebar .subscribe-input { min-width: 0; }
.top-post-item { gap: 13px; padding: 13px 0; }
.top-post-number { color: #aaa; font-family: Georgia, serif; font-size: 22px; }
.top-post-title { font-family: var(--font-sans); font-size: 14px; line-height: 1.35; }

.subscribe-box {
    max-width: 680px;
    margin: 64px auto 0;
    padding: 40px;
    border: 1px solid #dedede;
    border-radius: 4px;
    background: #fff;
    color: var(--text-color);
    text-align: center;
}
.subscribe-box-headline { font-family: var(--font-display); font-size: 27px; }
.subscribe-box-subline { color: #666; font-family: var(--font-sans); font-size: 15px; }
.subscribe-email-wrap { margin: 0 auto; }
.subscribe-input { border-color: #bbb; background: #fff; color: #222; }
.subscribe-tos { margin-right: auto; margin-left: auto; color: #999; }

.post-header { margin-top: 28px; text-align: left; }
.post-tag-link { font-size: 12px; }
.post-main-title { font-size: 40px; line-height: 1.1; letter-spacing: -.025em; }
.post-subtitle { color: #666; font-family: var(--font-sans); font-size: 19px; font-style: normal; }
.post-author-block { justify-content: flex-start; border: 0; padding: 4px 0; }
.post-feature-image-wrap { max-width: var(--max-width-content); margin-bottom: 42px; border-radius: 0; }
.post-content-container { color: #292929; font-size: 19px; line-height: 1.68; }
.post-content-container > p:first-of-type::first-letter { all: unset; }
.post-content-container a { color: inherit; text-decoration: underline; text-decoration-color: #aaa; text-underline-offset: 3px; }
.post-content-container blockquote { border-left-color: #222; color: #555; }
.chapter-nav-link { border-radius: 3px; }

.site-footer {
    padding: 40px 20px;
    border-top: 1px solid var(--border-color);
    background: #f7f7f7;
    color: #777;
}
.footer-content { gap: 12px; }
.footer-nav a, .footer-copyright, .footer-platform { color: #777; }
.footer-platform { font-size: 12px; }
.progress-bar { background: var(--accent-color); }

@media (max-width: 820px) {
    .posts-feed-container { grid-template-columns: minmax(0, 1fr); }
    .sidebar { display: none; }
    .hero-section { grid-template-columns: 1fr; }
    .hero-image-wrap { min-height: 0; }
    .hero-content { padding: 24px 0 30px; }
}

@media (max-width: 600px) {
    .header-top { height: 56px; padding: 0 14px; }
    .header-brand { max-width: 48%; }
    .header-title { font-size: 19px; }
    .header-logo-image { max-height: 34px; max-width: 190px; }
    .publication-home { display: none; }
    .header-left { width: 24px; }
    .header-right { gap: 7px; }
    .btn-signin { display: none; }
    .btn-subscribe { padding: 7px 10px; }
    .site-main { padding: 24px 16px 50px; }
    .hero-section { margin-bottom: 28px; padding-bottom: 28px; }
    .hero-title { font-size: 29px; }
    .post-card { align-items: flex-start; gap: 16px; min-height: 140px; padding: 20px 0; }
    .post-card-image-wrap { flex-basis: 108px; width: 108px; height: 82px; }
    .post-card-title { font-size: 18px; }
    .post-card-subtitle { -webkit-line-clamp: 2; }
    .subscribe-box { padding: 28px 18px; }
    .subscribe-email-wrap { flex-direction: column; }
    .subscribe-submit { width: 100%; }
    .post-main-title { font-size: 34px; }
    .post-content-container { font-size: 18px; }
    .chapter-navigation { flex-direction: column; }
}

/* Keep these final so earlier theme layers cannot override them. */
:root { --max-width-site: 1200px; }

@media (min-width: 821px) {
    .header-top {
        height: 200px;
        max-width: 100%;
    }
    .header-brand {
        width: min(820px, 68vw);
        max-width: none;
    }
    .header-logo-image.masthead-image {
        width: auto;
        max-width: 100%;
        max-height: 130px;
        object-fit: contain;
    }
}

/* Masthead image mode and tag-driven category rows */
.site-header.has-masthead-image .header-brand,
.site-header.has-masthead-image .header-brand > a {
    height: 100%;
}

.site-header.has-masthead-image .header-brand {
    width: min(1000px, 82vw);
}

.site-header.has-masthead-image .header-logo-image.masthead-image {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
}

.category-rows { min-width: 0; }
.category-section {
    padding: 0 0 30px;
    margin: 0 0 30px;
    border-bottom: 1px solid var(--border-color);
}
.category-section:last-child { margin-bottom: 0; }
.category-section .section-heading h2 a {
    color: inherit;
    font-family: var(--font-heading);
    font-size: var(--section-title-size);
    font-weight: var(--heading-font-weight);
    line-height: 1.2;
    text-transform: none;
}
.category-section .section-heading h2 a:hover { color: var(--title-hover-color); opacity: 1; }
.category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 600px) {
    .site-header.has-masthead-image .header-brand { width: min(72vw, 430px); }
    .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .category-grid .glimpse-card:nth-child(3) { display: none; }
}

/* Tag collection landing page */
.tag-collection-hero {
    position: relative;
    min-height: 390px;
    margin-top: -20px;
    overflow: hidden;
    border-radius: 0 0 3px 3px;
    background: #111114;
}

.tag-hero-backdrop {
    position: absolute;
    inset: 0 0 0 auto;
    width: 72%;
    background-position: right center;
    background-size: auto 100%;
    background-repeat: no-repeat;
    filter: saturate(.8) brightness(.78);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,.12) 12%, #000 46%);
    mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,.12) 12%, #000 46%);
}

.tag-hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10,10,12,1) 0%, rgba(10,10,12,.97) 24%, rgba(10,10,12,.48) 58%, rgba(10,10,12,.18) 100%);
}

.tag-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: 390px;
    width: min(540px, 52%);
    padding: 48px 46px;
}

.tag-square-image {
    width: 68px;
    height: 68px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 7px;
    object-fit: cover;
}

.tag-hero-content h1 {
    margin: 0 0 10px;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: var(--section-title-size);
    font-weight: var(--heading-font-weight);
}

.tag-description {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--text-secondary);
    font-family: var(--font-excerpt);
    font-size: var(--excerpt-font-size);
    font-weight: var(--excerpt-font-weight);
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.tag-latest-link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-top: 30px;
}

.tag-latest-arrow {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--text-color);
    color: var(--bg-color);
    font-family: Arial, sans-serif;
    font-size: 20px;
}

.tag-latest-copy { display: flex; flex-direction: column; gap: 2px; }
.tag-latest-copy small {
    color: var(--text-muted);
    font-family: var(--font-byline);
    font-size: var(--byline-font-size);
    font-weight: var(--byline-font-weight);
    text-transform: uppercase;
}
.tag-latest-copy strong {
    color: var(--text-color);
    font-family: var(--font-article-title);
    font-size: var(--article-card-title-size);
    font-weight: var(--article-title-weight);
}

.tag-collection-body { padding: 28px 0 20px; }
.tag-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 42px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border-color);
}
.tag-toolbar-active {
    align-self: stretch;
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--text-color);
    color: var(--text-color);
    font-family: var(--font-navigation);
    font-size: var(--navigation-font-size);
    font-weight: var(--navigation-font-weight);
}
.tag-search-button {
    border: 0;
    background: none;
    color: var(--text-color);
    cursor: pointer;
}

.tag-story-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 42px 28px;
}
.tag-story-card { min-width: 0; }
.tag-story-image-link {
    display: block;
    aspect-ratio: 1.5 / 1;
    margin-bottom: 12px;
    overflow: hidden;
    border-radius: 3px;
    background: var(--card-bg);
}
.tag-story-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease, opacity .25s ease;
}
.tag-story-image-link:hover img { transform: scale(1.025); opacity: .88; }
.tag-story-card h2 {
    margin: 0 0 7px;
    font-family: var(--font-article-title);
    font-size: var(--article-card-title-size);
    font-weight: var(--article-title-weight);
    line-height: 1.2;
}
.tag-story-card h2 a:hover { color: var(--title-hover-color); opacity: 1; }
.tag-story-tags {
    margin: 0 0 8px;
    overflow: hidden;
    color: var(--text-secondary);
    font-family: var(--font-excerpt);
    font-size: var(--excerpt-font-size);
    font-weight: var(--excerpt-font-weight);
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tag-story-tags a { color: inherit; }
.tag-story-meta {
    display: flex;
    gap: 4px;
    color: var(--text-muted);
    font-family: var(--font-byline);
    font-size: var(--byline-font-size);
    font-weight: var(--byline-font-weight);
    text-transform: uppercase;
}
.tag-empty-message { grid-column: 1 / -1; color: var(--text-muted); }

@media (max-width: 900px) {
    .tag-hero-content { width: 64%; }
    .tag-story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .tag-collection-hero { min-height: 440px; margin-top: -24px; }
    .tag-hero-backdrop { inset: 0; width: 100%; opacity: .52; -webkit-mask-image: none; mask-image: none; }
    .tag-hero-shade { background: linear-gradient(0deg, #0d0d0f 4%, rgba(13,13,15,.72) 58%, rgba(13,13,15,.32) 100%); }
    .tag-hero-content { justify-content: flex-end; width: 100%; min-height: 440px; padding: 30px 24px; }
    .tag-square-image { width: 58px; height: 58px; margin-bottom: 14px; }
    .tag-description { -webkit-line-clamp: 2; }
    .tag-latest-link { margin-top: 20px; }
    .tag-story-grid { grid-template-columns: 1fr; gap: 34px; }
}
