/* ============================================================
   BLOG – shared article styles
   Each page sets --accent, --accent-soft and --bg on :root.
   ============================================================ */

:root {
    --bg: #f7f7f5;
    --surface: #ffffff;
    --text-dark: #14161a;
    --text-body: #2e333b;
    --text-muted: #6b7280;
    --accent: #4f46e5;
    --accent-soft: #e0e7ff;
    --card-dark: #15171c;
    --line: rgba(20, 22, 26, 0.08);
    --radius: 20px;
    --radius-lg: 28px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-body);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
}

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

/* --- Nav ----------------------------------------------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 40px;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.nav-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: cover;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links a:hover {
    opacity: 0.7;
}

.nav-cta {
    background: var(--text-dark);
    color: #fff !important;
    padding: 9px 20px;
    border-radius: 50px;
    font-weight: 600 !important;
}

/* --- Article header ------------------------------------ */
.wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
}

.post-hero {
    padding: 64px 0 40px;
}

.crumbs {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.crumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

.crumbs a:hover {
    color: var(--text-dark);
}

.post-tag {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 4px 12px;
    border-radius: 50px;
    margin-bottom: 20px;
}

.post-title {
    font-size: clamp(2.3rem, 5.4vw, 3.8rem);
    font-weight: 900;
    line-height: 1.06;
    letter-spacing: -0.035em;
    color: var(--text-dark);
    max-width: 900px;
    margin-bottom: 20px;
}

.post-lead {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 720px;
    line-height: 1.6;
    margin-bottom: 28px;
}

.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.post-meta strong {
    color: var(--text-dark);
    font-weight: 600;
}

.post-cover {
    margin-top: 40px;
    border-radius: var(--radius-lg);
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    font-size: 4.5rem;
    overflow: hidden;
    position: relative;
}

/* --- Layout -------------------------------------------- */
.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 64px;
    padding: 24px 0 64px;
    align-items: start;
}

.toc {
    position: sticky;
    top: 96px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
}

.toc-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.toc ol {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    counter-reset: toc;
}

.toc li {
    counter-increment: toc;
    font-size: 0.9rem;
    line-height: 1.4;
}

.toc li a {
    color: var(--text-body);
    text-decoration: none;
    display: flex;
    gap: 10px;
}

.toc li a::before {
    content: counter(toc, decimal-leading-zero);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.8rem;
    padding-top: 1px;
}

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

.toc-app {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-dark);
}

.toc-app img {
    width: 44px;
    height: 44px;
    border-radius: 11px;
}

.toc-app span {
    font-size: 0.85rem;
    line-height: 1.35;
}

.toc-app strong {
    display: block;
}

/* --- Prose --------------------------------------------- */
.prose {
    max-width: 720px;
    font-size: 1.1rem;
}

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

.prose h2 {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--text-dark);
    margin-top: 2.2em;
    scroll-margin-top: 96px;
}

.prose h3 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
    color: var(--text-dark);
    margin-top: 1.8em;
}

.prose strong {
    color: var(--text-dark);
}

.prose ul,
.prose ol {
    padding-left: 1.3em;
}

.prose li+li {
    margin-top: 0.5em;
}

.prose li::marker {
    color: var(--accent);
    font-weight: 700;
}

.prose blockquote {
    border-left: 4px solid var(--accent);
    padding: 4px 0 4px 20px;
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: 600;
}

/* Table */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 520px;
}

.prose th,
.prose td {
    text-align: left;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.prose th {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg);
}

.prose tr:last-child td {
    border-bottom: 0;
}

/* Callouts */
.callout {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    display: flex;
    gap: 16px;
    font-size: 1rem;
}

.callout-icon {
    font-size: 1.5rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.callout p+p {
    margin-top: 0.6em;
}

.callout--accent {
    background: var(--accent-soft);
    border-color: transparent;
}

.steps {
    list-style: none;
    padding: 0 !important;
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.steps li {
    counter-increment: step;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px 20px 16px 64px;
    position: relative;
    margin: 0 !important;
}

.steps li::before {
    content: counter(step);
    position: absolute;
    left: 18px;
    top: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Inline app card */
.app-card {
    background: var(--card-dark);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 2em !important;
    margin-bottom: 0.5em;
}

.app-card img {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    flex-shrink: 0;
}

.app-card-body {
    flex: 1;
    min-width: 0;
}

.app-card strong {
    color: #fff;
    display: block;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.app-card p {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.95rem;
    margin-top: 4px;
}

.app-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn--light {
    background: #fff;
    color: #000;
}

.btn--ghost {
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
}

/* FAQ */
.faq {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0 22px;
}

.faq summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 0;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: '+';
    color: var(--accent);
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1;
    transition: transform 0.25s;
}

.faq details[open] summary::after {
    transform: rotate(45deg);
}

.faq details p {
    padding-bottom: 18px;
    font-size: 1rem;
}

.sources {
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 1px solid var(--line);
    padding-top: 1.5em;
    margin-top: 2.5em !important;
}

.sources a {
    color: var(--text-muted);
}

/* --- More posts ---------------------------------------- */
.more {
    padding: 56px 0 72px;
    border-top: 1px solid var(--line);
}

.more h2 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-dark);
    margin-bottom: 24px;
}

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

.post-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-body);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s, box-shadow 0.25s;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(20, 22, 26, 0.08);
}

.post-card-cover {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.2rem;
}

.post-card-body {
    padding: 22px 24px 26px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.post-card-tag {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.post-card h3 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.3;
    color: var(--text-dark);
}

.post-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.post-card-go {
    margin-top: auto;
    padding-top: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
}

.cover--lens {
    background: linear-gradient(150deg, #60a5fa 0%, #6366f1 55%, #a855f7 100%);
}

.cover--dinner {
    background: linear-gradient(155deg, #fb923c 0%, #ef4444 55%, #be123c 100%);
}

.cover--bday {
    background: radial-gradient(circle at 50% 40%, #33373e 0%, #17191d 75%);
}

/* --- Footer -------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--line);
    padding: 40px 0;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 32px;
    margin-bottom: 16px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--text-dark);
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Responsive ---------------------------------------- */
@media (max-width: 960px) {
    .post-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .toc {
        display: none;
    }

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

@media (max-width: 700px) {
    .nav {
        padding: 12px 20px;
    }

    .nav-links a:not(.nav-cta) {
        display: none;
    }

    .wrapper {
        padding: 0 20px;
    }

    .post-hero {
        padding: 40px 0 24px;
    }

    .post-lead {
        font-size: 1.1rem;
    }

    .post-cover {
        min-height: 200px;
        font-size: 3.2rem;
        margin-top: 28px;
    }

    .prose {
        font-size: 1.04rem;
    }

    .app-card {
        flex-direction: column;
        align-items: flex-start;
    }

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

/* --- Per-app blog index -------------------------------- */
.back-link {
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
}

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

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 48px;
}

.post-card--featured {
    flex-direction: row;
    min-height: 260px;
}

.post-card--featured .post-card-cover {
    width: 42%;
    height: auto;
    font-size: 4.5rem;
    flex-shrink: 0;
}

.post-card--featured .post-card-body {
    padding: 36px 40px;
    justify-content: center;
}

.post-card--featured h3 {
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    letter-spacing: -0.025em;
}

.post-card--featured p {
    font-size: 1.05rem;
}

.blog-cta {
    padding-bottom: 72px;
}

.blog-cta .app-card {
    margin-top: 0 !important;
}

@media (max-width: 700px) {
    .post-card--featured {
        flex-direction: column;
    }

    .post-card--featured .post-card-cover {
        width: 100%;
        height: 180px;
    }

    .post-card--featured .post-card-body {
        padding: 24px;
    }
}
