/**
 * gt-blog.css — Public blog index + single post styles.
 *
 * BEM blocks:
 *   .tt-blog      — index page (/blog/)
 *   .tt-post      — single post page (/blog/[slug]/)
 *
 * Inherits global tokens (cream canvas, oat borders, Roobert font) from
 * gt-tokens.css and gt-base.css. This file only adds blog-specific layout.
 */

/* ============================================================
   Shared — index header
   ============================================================ */

.tt-blog,
.tt-post {
    padding-top: 3rem;
    padding-bottom: 4rem;
}

.tt-blog__header {
    margin-bottom: 3rem;
    text-align: center;
}

.tt-blog__title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

.tt-blog__lede {
    color: var(--color-text-secondary, #55534e);
    font-size: 1.1rem;
    line-height: 1.5;
    max-width: 580px;
    margin: 0 auto;
}

/* ============================================================
   Index — post card list
   ============================================================ */

.tt-blog__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1.5rem;
}

.tt-blog__card {
    background: #fff;
    border: 1px solid var(--color-border, #dad4c8);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: rgba(0, 0, 0, 0.04) 0 1px 2px;
}

.tt-blog__card:hover {
    border-color: var(--color-accent, #166534);
    box-shadow: rgba(0, 0, 0, 0.08) 0 2px 8px;
}

.tt-blog__card-image-link {
    display: block;
    line-height: 0;
    background: var(--color-surface-alt, #eee9df);
}

.tt-blog__card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1.91 / 1;
    /* matches OG image ratio so featured images crop cleanly */
    object-fit: cover;
    display: block;
}

.tt-blog__card-body {
    padding: 1.5rem;
}

.tt-blog__card-title {
    font-size: 1.4rem;
    line-height: 1.3;
    margin: 0 0 0.5rem;
    letter-spacing: -0.01em;
}

.tt-blog__card-title a {
    color: var(--color-text, #1a1a1a);
    text-decoration: none;
}

.tt-blog__card-title a:hover {
    text-decoration: underline;
}

.tt-blog__card-excerpt {
    color: var(--color-text-secondary, #55534e);
    line-height: 1.55;
    margin: 0 0 0.85rem;
}

.tt-blog__card-meta {
    color: var(--color-text-secondary, #9f9b93);
    font-size: 0.85rem;
    margin: 0;
}

.tt-blog__card-meta span {
    margin: 0 0.25rem;
}

/* Empty state */
.tt-blog__empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-secondary, #55534e);
    font-size: 1.05rem;
}

/* ============================================================
   Pagination
   ============================================================ */

.tt-blog__pagination {
    margin-top: 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 2rem;
    border-top: 1px dashed var(--color-border, #dad4c8);
}

.tt-blog__pagination-link {
    color: var(--color-text, #1a1a1a);
    text-decoration: none;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--color-border, #dad4c8);
    border-radius: 999px;
    background: #fff;
    font-weight: 500;
}

.tt-blog__pagination-link:hover {
    background: var(--color-surface-alt, #eee9df);
}

.tt-blog__pagination-current {
    color: var(--color-text-secondary, #9f9b93);
    font-size: 0.9rem;
}

/* ============================================================
   Single post
   ============================================================ */

.tt-post__article {
    background: #fff;
    border: 1px solid var(--color-border, #dad4c8);
    border-radius: 16px;
    padding: 2.5rem 2rem;
}

@media (max-width: 600px) {
    .tt-post__article {
        padding: 1.5rem 1.25rem;
    }
}

.tt-post__header {
    margin-bottom: 1.75rem;
}

.tt-post__breadcrumb {
    font-size: 0.9rem;
    margin: 0 0 1.25rem;
}

.tt-post__breadcrumb a {
    color: var(--color-text-secondary, #55534e);
    text-decoration: none;
}

.tt-post__breadcrumb a:hover {
    text-decoration: underline;
}

.tt-post__title {
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 0.75rem;
}

.tt-post__meta {
    color: var(--color-text-secondary, #9f9b93);
    font-size: 0.92rem;
    margin: 0;
}

.tt-post__meta span {
    margin: 0 0.25rem;
}

.tt-post__featured {
    margin: 0 0 2rem;
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
}

.tt-post__featured img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================================
   Post body — typography for the rendered HTML content
   ============================================================
   The CMS stores arbitrary HTML (from TinyMCE or AI generation). Style every
   tag the editor can produce so the published post reads cleanly. */

.tt-post__body {
    font-size: 1.06rem;
    line-height: 1.7;
    color: var(--color-text, #1a1a1a);
}

.tt-post__body>*+* {
    margin-top: 1.25em;
}

.tt-post__body h2 {
    font-size: 1.6rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-top: 2.2em;
    margin-bottom: 0.5em;
}

.tt-post__body h3 {
    font-size: 1.25rem;
    line-height: 1.3;
    margin-top: 1.8em;
    margin-bottom: 0.4em;
}

.tt-post__body p {
    margin: 0;
}

.tt-post__body a {
    color: #0b4fa2;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.tt-post__body a:hover {
    text-decoration-thickness: 2px;
}

.tt-post__body ul,
.tt-post__body ol {
    padding-left: 1.5rem;
    margin: 0;
}

.tt-post__body li {
    margin-bottom: 0.4em;
    line-height: 1.65;
}

.tt-post__body blockquote {
    border-left: 3px solid var(--color-border, #dad4c8);
    padding: 0.25rem 1.2rem;
    margin: 0;
    color: var(--color-text-secondary, #55534e);
    font-style: italic;
}

.tt-post__body code {
    background: var(--color-surface-alt, #eee9df);
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tt-post__body pre {
    background: #0f1115;
    color: #e6edf3;
    padding: 1rem;
    border-radius: 8px;
    overflow: auto;
    font-size: 0.9rem;
    line-height: 1.45;
}

.tt-post__body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.tt-post__body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 1.5em auto;
}

.tt-post__body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.tt-post__body th,
.tt-post__body td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--color-border, #eee9df);
    text-align: left;
    vertical-align: top;
}

.tt-post__body th {
    background: var(--color-surface-alt, #faf9f7);
    font-weight: 600;
}

.tt-post__body hr {
    border: none;
    border-top: 1px dashed var(--color-border, #dad4c8);
    margin: 2em 0;
}

/* ============================================================
   Footer
   ============================================================ */

.tt-post__footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--color-border, #dad4c8);
}

.tt-post__back-link {
    color: var(--color-text-secondary, #55534e);
    text-decoration: none;
}

.tt-post__back-link:hover {
    text-decoration: underline;
}