/* ========================================================================
   REVENLI — Blog (light institutional)
   Long-form reading typography. Loaded only on /blog pages, on top of
   styles.css. Measure is capped near 68 characters: the main site's 1120px
   container is far too wide to read a 2,000-word article in.
   ======================================================================== */



/* ---- Topic filters -------------------------------------------------- */

.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.blog-filter {
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-2);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-full);
    padding: 8px 15px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}

.blog-filter span {
    color: var(--ink-3);
    margin-left: 4px;
    font-variant-numeric: tabular-nums;
}

.blog-filter:hover {
    border-color: var(--rule-strong);
    color: var(--ink);
}

.blog-filter.is-active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.blog-filter.is-active span {
    color: rgba(255,255,255,0.6);
}

.blog-empty {
    color: var(--ink-2);
    padding: 32px 0;
}

/* ---- Subscribe ------------------------------------------------------ */

.blog-sub {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 26px 30px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--brand-orange);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.blog-sub h3 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.blog-sub p {
    font-size: 0.9375rem;
    margin: 0;
}

.blog-sub-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---- Index ---------------------------------------------------------- */

.blog-list {
    max-width: 980px;
}

.blog-featured,
.blog-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    transition: border-color 0.2s;
}

.blog-featured:hover,
.blog-card:hover {
    border-color: var(--rule-strong);
}

.blog-featured {
    position: relative;
    padding: 40px 44px;
    margin-bottom: 20px;
    border-left: 3px solid var(--brand-orange);
}

.blog-featured-flag {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--brand-orange);
    margin-bottom: 12px;
}

.blog-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent);
}

.blog-more i {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.blog-featured:hover .blog-more i {
    transform: translateX(3px);
}

.blog-featured h2 {
    font-family: var(--display);
    font-weight: 400;
    font-size: 1.9rem;
    margin-bottom: 12px;
}

.blog-featured p {
    font-size: 1rem;
    margin-bottom: 18px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.blog-card {
    padding: 28px 30px;
}

.blog-card h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    line-height: 1.35;
}

.blog-card p {
    font-size: 0.92rem;
    margin-bottom: 16px;
}

/* ---- Tags & meta ---------------------------------------------------- */

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.post-tag {
    font-family: var(--mono);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    background: var(--accent-wash);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.post-meta {
    font-family: var(--mono);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--ink-3);
}

.post-meta-dot {
    opacity: 0.5;
}

/* ---- Reading progress ----------------------------------------------- */

.post-progress {
    position: fixed;
    top: 66px;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 999;
    pointer-events: none;
}

.post-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--brand-orange);
}

/* ---- Contents panel -------------------------------------------------- */

.post-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 48px;
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 24px;
}

.post-toc-inner {
    position: sticky;
    top: 110px;
    padding-right: 8px;
}

.post-toc-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-3);
    margin-bottom: 14px;
}

.post-toc nav {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--rule);
}

.post-toc a {
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--ink-2);
    padding: 7px 0 7px 14px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.post-toc a:hover {
    color: var(--ink);
    border-left-color: var(--brand-orange);
}

/* The panel lives in the left margin; below this width there is no margin. */
@media (max-width: 1000px) {
    .post-shell {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        max-width: 760px;
    }

    .post-toc {
        display: none;
    }
}

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

.post {
    padding: 130px 0 80px;
}

.post-container {
    /* ~68 characters at this font size — the readable measure for long text. */
    max-width: 720px;
    min-width: 0;
}

.post-back {
    font-family: var(--mono);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--ink-3);
    margin-bottom: 32px;
    transition: color 0.2s;
}

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

.post-header {
    padding-bottom: 32px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--rule);
}

.post-header h1 {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(2.1rem, 4.2vw, 3rem);
    line-height: 1.15;
    margin-bottom: 16px;
}

.post-lede {
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--ink-2);
    margin-bottom: 20px;
}

/* ---- Byline --------------------------------------------------------- */

.post-byline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-wash);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--display);
    font-size: 0.95rem;
    font-weight: 700;
    flex-shrink: 0;
}

.post-author {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink);
}

/* ---- Article body --------------------------------------------------- */

.post-body {
    font-size: 1.0625rem;
    line-height: 1.78;
    color: #33363B;
}

.post-body > * + * {
    margin-top: 24px;
}

.post-body h2 {
    scroll-margin-top: 96px;
    font-family: var(--display);
    font-weight: 400;
    font-size: 1.75rem;
    line-height: 1.25;
    margin-top: 52px;
    color: var(--ink);
}

.post-body h3 {
    font-size: 1.2rem;
    line-height: 1.3;
    margin-top: 40px;
    color: var(--ink);
}

.post-body h4 {
    font-size: 1.02rem;
    margin-top: 32px;
    color: var(--ink);
}

.post-body p {
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.post-body strong {
    color: var(--ink);
    font-weight: 600;
}

.post-body em {
    color: var(--ink);
}

.post-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(180, 69, 31, 0.35);
    transition: text-decoration-color 0.2s;
}

.post-body a:hover {
    text-decoration-color: var(--accent);
}

.post-body ul,
.post-body ol {
    padding-left: 24px;
}

.post-body li + li {
    margin-top: 10px;
}

.post-body li::marker {
    color: var(--ink-3);
}

.post-body blockquote {
    border-left: 2px solid var(--accent);
    background: var(--paper-2);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 20px 26px;
    font-style: italic;
}

.post-body blockquote p {
    color: var(--ink);
}

.post-body blockquote > * + * {
    margin-top: 14px;
}

.post-body hr {
    border: 0;
    border-top: 1px solid var(--rule);
    margin: 48px 0;
}

.post-body img {
    border-radius: var(--radius-sm);
    border: 1px solid var(--rule);
}

.post-body code {
    background: var(--paper-2);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    font-size: 0.88em;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--ink);
}

.post-body pre {
    background: var(--paper-2);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    padding: 20px;
    overflow-x: auto;
}

.post-body pre code {
    background: none;
    border: 0;
    padding: 0;
}

/* Wide tables must scroll inside themselves, never widen the page. */
.post-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    display: block;
    overflow-x: auto;
}

.post-body th,
.post-body td {
    border: 1px solid var(--rule);
    padding: 10px 14px;
    text-align: left;
}

.post-body th {
    background: var(--paper-2);
    color: var(--ink);
    font-weight: 600;
}

/* ---- End-of-post CTA ------------------------------------------------ */

.post-cta {
    margin-top: 64px;
    padding: 36px 38px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    text-align: center;
}

.post-cta h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.post-cta p {
    font-size: 0.95rem;
    margin-bottom: 24px;
}

/* ---- Prev / next ---------------------------------------------------- */

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--rule);
}

.post-nav-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s;
}

.post-nav-link:hover {
    border-color: var(--rule-strong);
}

.post-nav-next {
    text-align: right;
    align-items: flex-end;
}

.post-nav-label {
    font-family: var(--mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-3);
}

.post-nav-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.4;
}

/* ---- Responsive ----------------------------------------------------- */

@media (max-width: 768px) {
    .blog-hero {
        padding: 110px 0 24px;
    }

    .blog-grid,
    .post-nav {
        grid-template-columns: 1fr;
    }

    .blog-featured {
        padding: 28px 24px;
    }

    .blog-featured h2 {
        font-size: 1.35rem;
    }

    .post {
        padding: 100px 0 60px;
    }

    .post-body {
        font-size: 1rem;
    }

    .post-cta {
        padding: 28px 22px;
    }

    .post-nav-next {
        text-align: left;
        align-items: flex-start;
    }
}
