/* BRUKD Insights: article pages and post cards. Uses tokens from /styles.css */

/* ---------- Cards (Insights page + related posts) ---------- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}
.post-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.post-card[hidden] { display: none; }
.post-card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.post-card-image { aspect-ratio: 16 / 9; background: var(--bg-alt); overflow: hidden; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.post-card h3 { font-size: 1.22rem; line-height: 1.3; margin: 0 0 .7rem; }
.post-card p { font-size: .95rem; line-height: 1.6; margin: 0 0 1.1rem; flex: 1; }
.post-meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .78rem; color: var(--muted); margin-bottom: .75rem; }
.post-topic { color: var(--accent-deep); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.read-more { font-weight: 700; font-size: .9rem; color: var(--ink); display: inline-flex; gap: .5rem; align-items: center; }
.post-card:hover .read-more { color: var(--accent-deep); }

/* Featured (latest) post */
.insights-featured { margin-bottom: 40px; }
.post-card.featured .post-card-link { display: grid; grid-template-columns: 1.15fr 1fr; }
.post-card.featured .post-card-image { aspect-ratio: auto; min-height: 320px; }
.post-card.featured .post-card-body { padding: 36px 40px; justify-content: center; }
.post-card.featured h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.post-card.featured p { flex: 0; font-size: 1.02rem; }

/* Topic filter */
.topic-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; }
.chip {
    font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
    padding: .5rem 1rem; border-radius: 999px;
    border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
}
.chip span { color: var(--muted); font-weight: 500; margin-left: .25rem; }
.chip:hover { border-color: var(--accent); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.is-active span { color: rgba(255,255,255,.7); }
.chip:focus-visible, .post-card-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- Article page ---------- */
.post-header { max-width: 760px; padding: 56px 0 28px; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 1.2rem; }
.breadcrumb a { color: var(--accent-deep); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.post-header h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1.12; margin-bottom: 1rem; }
.post-dek { font-size: 1.15rem; line-height: 1.6; color: var(--ink-soft); margin-bottom: 1.4rem; }
.post-byline { display: flex; align-items: center; gap: .8rem; }
.post-byline img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--bg-alt); }
.post-byline strong { display: block; font-size: .95rem; }
.post-byline span { font-size: .85rem; color: var(--muted); }

.post-cover { max-width: 1000px; margin: 8px auto 40px; }
.post-cover img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow-sm); display: block; background: var(--bg-alt); }

.post-layout { max-width: 760px; padding-bottom: 72px; }

.post-toc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 20px; margin-bottom: 36px; }
.post-toc summary { cursor: pointer; font-weight: 700; font-size: .95rem; }
.post-toc ol { margin: .8rem 0 .2rem; padding-left: 1.2rem; }
.post-toc li { margin: .3rem 0; font-size: .93rem; line-height: 1.45; }
.post-toc li.toc-h3 { margin-left: 1rem; list-style: circle; }
.post-toc a { color: var(--ink-soft); text-decoration: none; }
.post-toc a:hover { color: var(--accent-deep); text-decoration: underline; }

.post-content { font-size: 1.12rem; line-height: 1.8; color: var(--ink); }
.post-content p, .post-content li { color: #24364f; }
.post-content p { margin: 0 0 1.35em; }
.post-content h2, .post-content h3, .post-content h4 { scroll-margin-top: 100px; }
.post-content h2 { font-size: clamp(1.55rem, 2.6vw, 1.9rem); line-height: 1.25; margin: 2.2em 0 .7em; }
.post-content h3 { font-size: 1.35rem; line-height: 1.3; margin: 1.9em 0 .6em; }
.post-content h4 { font-family: 'Inter', sans-serif; font-size: 1.05rem; letter-spacing: 0; margin: 1.6em 0 .5em; }
.post-content > :first-child { margin-top: 0; }
.post-content ul, .post-content ol { padding-left: 1.4em; margin: 0 0 1.5em; }
.post-content li { margin: .45em 0; }
.post-content li::marker { color: var(--accent); }
.post-content strong { color: var(--ink); }
.post-content a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { color: var(--ink); }
.post-content hr { border: 0; height: 1px; background: var(--line-strong); margin: 2.6em 0; }
.post-content blockquote { margin: 1.8em 0; padding: .4em 0 .4em 1.2em; border-left: 3px solid var(--accent); font-style: italic; }
.post-content img { height: auto; border-radius: var(--radius-sm); }
.table-wrap { overflow-x: auto; margin: 0 0 1.6em; }
.post-content table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.post-content th, .post-content td { border: 1px solid var(--line-strong); padding: .6em .8em; text-align: left; vertical-align: top; }
.post-content th { background: var(--bg-alt); }

.brukd-view {
    margin: 2.6em 0 0; padding: 28px 30px 10px;
    background: linear-gradient(135deg, rgba(255,122,0,.07), rgba(45,119,255,.05));
    border: 1px solid rgba(255,122,0,.25); border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
}
.brukd-view > :first-child { margin-top: 0; font-size: 1.35rem; }
.brukd-view > :first-child, .brukd-view > p:first-child strong { color: var(--ink); }

.post-share { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 44px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.post-share > span { font-weight: 700; font-size: .9rem; margin-right: 4px; }
.post-share a, .post-share button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-width: 40px; height: 40px; padding: 0 12px; border-radius: 999px;
    border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
    font: inherit; font-size: .88rem; cursor: pointer; text-decoration: none;
}
.post-share a:hover, .post-share button:hover { border-color: var(--accent); color: var(--accent-deep); }

.post-cta { margin: 40px 0 0; padding: 32px 34px; border-radius: var(--radius); background: var(--navy-800); color: #fff; }
.post-cta h2 { color: #fff; font-size: 1.7rem; margin-bottom: .5rem; }
.post-cta p { color: rgba(255,255,255,.8); margin-bottom: 1.3rem; }
.post-cta-actions { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.post-cta .button.secondary-outline { color: #fff; background: transparent; border-color: rgba(255,255,255,.45); box-shadow: none; }
.post-cta .button.secondary-outline:hover { background: rgba(255,255,255,.1); }
.post-cta-book { color: #ffb066; font-weight: 600; text-decoration: none; font-size: .95rem; }
.post-cta-book:hover { text-decoration: underline; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.post-nav a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; text-decoration: none; font-weight: 600; line-height: 1.4; color: var(--ink); }
.post-nav a:hover { border-color: var(--accent); }
.post-nav a span { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-deep); margin-bottom: .3rem; }
.post-nav .next { text-align: right; }

.related { padding-top: 64px; padding-bottom: 80px; }
.related-title { font-size: 2rem; margin-bottom: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .post-card.featured .post-card-link { grid-template-columns: 1fr; }
    .post-card.featured .post-card-image { min-height: 0; aspect-ratio: 16 / 9; }
    .post-card.featured .post-card-body { padding: 26px 26px 28px; }
}
@media (max-width: 640px) {
    .post-grid { grid-template-columns: 1fr; }
    .post-header { padding-top: 36px; }
    .post-content { font-size: 1.05rem; }
    .post-dek { font-size: 1.02rem; }
    .post-cover { margin-bottom: 28px; }
    .post-cover img { border-radius: var(--radius-sm); }
    .brukd-view { padding: 22px 20px 6px; }
    .post-cta { padding: 26px 22px; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav .next { text-align: left; }
}
