/* ============================================================
   Splitano — Blog styles
   Extends css/styles.css (tokens, .container, .btn, .navbar, .footer).
   Load AFTER styles.css.
   ============================================================ */

.blog-body { background: var(--bg); }

.blog-main { padding-top: 92px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-faint);
    margin: 28px 0 20px;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }

.nav-links a.nav-current { color: var(--text); }

/* ---------- Blog hero ---------- */
.blog-hero {
    padding: 72px 0 40px;
    text-align: center;
    position: relative;
}
.blog-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 14px 0 16px;
}
.blog-hero p {
    color: var(--text-muted);
    font-size: 1.08rem;
    max-width: 640px;
    margin: 0 auto;
}

.blog-listing { padding-top: 40px; }
.listing-title {
    font-size: 1.35rem;
    margin: 56px 0 24px;
    font-family: var(--font-display);
}
.blog-empty { color: var(--text-muted); text-align: center; padding: 40px 0; }

/* ---------- Featured post ---------- */
.post-featured {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.post-featured-link {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    text-decoration: none;
    color: inherit;
}
/* Covers are authored at 1200x630. Let the grid column set the width and the
   ratio set the height — do NOT stretch, or the ratio forces a 1200px width
   and the image spills over the text column. min-width:0 stops grid blowout. */
.post-featured-media {
    overflow: hidden;
    aspect-ratio: 1200 / 630;
    min-width: 0;
    width: 100%;
}
.post-featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.post-featured:hover .post-featured-media img { transform: scale(1.03); }
.post-featured-body {
    min-width: 0;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: center;
    align-items: flex-start;
}
.post-featured-body h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.post-featured-body p { color: var(--text-muted); }
.post-featured-body .btn { margin-top: 8px; }

/* ---------- Post grid ---------- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 26px;
}

.post-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease;
}
.post-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.16);
}
.post-card-link { text-decoration: none; color: inherit; display: block; height: 100%; }
.post-card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; }
.post-chip {
    position: absolute;
    left: 14px;
    bottom: 14px;
    background: rgba(15, 15, 22, 0.82);
    backdrop-filter: blur(8px);
    border: 1px solid var(--card-border);
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 11px;
    border-radius: 999px;
}
.post-card-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.post-card-body h3 { font-size: 1.16rem; line-height: 1.3; }
.post-card-body p {
    color: var(--text-muted);
    font-size: 0.94rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card-meta {
    display: flex;
    gap: 14px;
    font-size: 0.82rem;
    color: var(--text-faint);
    margin-top: auto;
    padding-top: 6px;
}

/* ---------- Article ---------- */
.container-article { max-width: 1080px; }

.post-header { max-width: 760px; margin: 0 auto 32px; text-align: center; }
.post-header h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.6vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 14px 0 18px;
}
.post-lede { color: var(--text-muted); font-size: 1.12rem; }
.post-meta {
    margin-top: 20px;
    font-size: 0.86rem;
    color: var(--text-faint);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.post-hero {
    margin: 0 0 48px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-card);
}
.post-hero img { width: 100%; height: auto; }

.post-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
    padding-bottom: 80px;
}
.post-layout:not(:has(.post-toc)) { grid-template-columns: minmax(0, 1fr); max-width: 760px; margin: 0 auto; }

/* ---------- Table of contents ---------- */
.post-toc {
    position: sticky;
    top: 108px;
    border-left: 1px solid var(--card-border);
    padding-left: 20px;
}
.post-toc h2 {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-faint);
    margin-bottom: 14px;
    font-weight: 600;
}
.post-toc ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.post-toc a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    line-height: 1.4;
    transition: color 0.2s ease;
}
.post-toc a:hover { color: var(--text); }
.post-toc li.toc-h3 { padding-left: 14px; font-size: 0.84rem; }
.post-toc a.active { color: var(--pink-soft); font-weight: 600; }

/* ---------- Article body ---------- */
.post-content { max-width: 720px; font-size: 1.06rem; line-height: 1.78; }
.post-content > * + * { margin-top: 1.15em; }

.post-content h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.6vw, 1.9rem);
    font-weight: 700;
    margin-top: 2.2em;
    scroll-margin-top: 110px;
}
.post-content h3 {
    font-family: var(--font-display);
    font-size: 1.22rem;
    font-weight: 600;
    margin-top: 1.8em;
    scroll-margin-top: 110px;
}
.post-content p { color: #d8d8e4; }
.post-content strong { color: var(--text); font-weight: 600; }
.post-content a { color: var(--pink-soft); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { color: var(--pink); }

.post-content ul, .post-content ol { padding-left: 1.35em; color: #d8d8e4; }
.post-content li { margin-top: 0.45em; }
.post-content li > ul, .post-content li > ol { margin-top: 0.45em; }

.post-content blockquote {
    border-left: 3px solid var(--pink);
    background: var(--bg-elevated);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 18px 24px;
    color: var(--text-muted);
    font-style: italic;
}
.post-content blockquote p { color: var(--text-muted); }

.post-content pre {
    background: var(--bg-elevated);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    overflow-x: auto;
    font-size: 0.9rem;
}
.post-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88em;
    background: rgba(255, 255, 255, 0.07);
    padding: 2px 6px;
    border-radius: 5px;
}
.post-content pre code { background: none; padding: 0; }

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

.post-content hr { border: none; border-top: 1px solid var(--card-border); margin: 2.4em 0; }

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--card-border); }
.post-content table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.post-content th, .post-content td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}
.post-content th {
    background: var(--bg-elevated);
    font-weight: 600;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.post-content tbody tr:last-child td { border-bottom: none; }

/* ---------- Tags, share, CTA ---------- */
.post-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding: 0;
    margin-top: 2.4em;
}
.post-tags li {
    font-size: 0.8rem;
    color: var(--text-faint);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 5px 12px;
    margin: 0;
}

.post-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 2em;
    padding-top: 1.6em;
    border-top: 1px solid var(--card-border);
    font-size: 0.88rem;
    color: var(--text-faint);
}
.post-share a {
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 6px 14px;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.post-share a:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.22); }

.blog-cta {
    margin-top: 3em;
    background: linear-gradient(140deg, rgba(255, 59, 95, 0.11), rgba(167, 139, 250, 0.11));
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 38px 34px;
    text-align: center;
}
.blog-cta h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin: 0 0 12px;
}
.blog-cta p { color: var(--text-muted); margin: 0 auto 22px; max-width: 460px; font-size: 0.98rem; }
.blog-cta .store-badge { display: inline-block; }
.blog-cta img { margin: 0 auto; }

.back-link {
    display: inline-block;
    margin-top: 2.4em;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
}
.back-link:hover { color: var(--text); }

/* ---------- Related ---------- */
.blog-related {
    background: var(--bg-elevated);
    border-top: 1px solid var(--card-border);
    padding: 72px 0 88px;
}
.blog-related h2 { font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 28px; }

/* ---------- Language dropdown links (anchors, not buttons) ---------- */
.language-dropdown a.language-option {
    display: block;
    text-decoration: none;
}
.language-dropdown a.language-option.active { color: var(--pink-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .post-layout { grid-template-columns: minmax(0, 1fr); gap: 0; max-width: 760px; margin: 0 auto; }
    .post-toc {
        position: static;
        border-left: none;
        border: 1px solid var(--card-border);
        border-radius: var(--radius-sm);
        padding: 20px;
        margin-bottom: 36px;
        background: var(--bg-elevated);
    }
    .post-featured-link { grid-template-columns: 1fr; }
    .post-featured-media { aspect-ratio: 16 / 9; }
    .post-featured-body { padding: 30px 26px; }
}

@media (max-width: 560px) {
    .blog-main { padding-top: 76px; }
    .blog-hero { padding: 48px 0 24px; }
    .post-content { font-size: 1.02rem; }
    .blog-cta { padding: 30px 22px; }
}
