/* The blog (/{locale}/blog). Loaded after site.css on blog pages only, and built from its custom
   properties, so both themes come for free. The post bodies are raw HTML files
   (resources/views/blog/posts/) and may use exactly the classes styled here: .lead, .tldr, .callout,
   .cta / .cta-row / .btn / .btn-ghost, .table-wrap, figure, .channel-post. */

/* ---- Breadcrumbs ------------------------------------------------------------------------------ */

.crumbs ol {
    list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px;
    margin: 18px 0 0; padding: 0; font-size: 13.5px; color: var(--muted);
}
.crumbs li:not(:last-child)::after { content: "/"; margin-left: 8px; color: var(--line); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch;
}

/* ---- The index ------------------------------------------------------------------------------- */

.blog-head { max-width: 760px; padding: 28px 0 8px; }
.blog-head h1 { font-size: 40px; line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 12px; }
.blog-head .lead { font-size: 18px; color: var(--muted); margin: 0 0 6px; }
.blog-feed { font-size: 14px; margin: 0; }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 28px 0 8px; }

.post-card {
    position: relative; display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.post-card img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--card); }
.post-card-body { padding: 16px 18px 20px; }
.post-card-meta { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.post-card-meta .p-category { color: var(--accent); font-weight: 700; }
.post-card-title { margin: 0 0 8px; font-size: 18px; line-height: 1.3; letter-spacing: -0.01em; }
.post-card-title a { color: var(--fg); text-decoration: none; }
/* The title's link covers the whole card: one tab stop, one target. */
.post-card-title a::after { content: ""; position: absolute; inset: 0; }
.post-card-title a:focus-visible { outline: none; }
.post-card:has(a:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.post-card .p-summary { margin: 0; font-size: 14.5px; color: var(--muted); }

/* ---- An article -------------------------------------------------------------------------------- */

.post { max-width: 760px; margin: 0 auto; padding: 8px 0 24px; }
.post-head { padding: 22px 0 18px; }
.post-kicker {
    margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--accent);
}
.post-head h1 { font-size: 40px; line-height: 1.12; letter-spacing: -0.03em; margin: 0 0 14px; }
.post-meta { margin: 0; font-size: 14px; color: var(--muted); }
.post-meta a { color: var(--muted); text-decoration: none; }
.post-meta a:hover { color: var(--accent); }

.post-hero {
    display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630;
    border-radius: 20px; background: var(--card); margin: 0 0 24px;
}

.toc {
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    padding: 14px 18px; margin: 0 0 28px; font-size: 15px;
}
.toc-title { margin: 0 0 6px; font-weight: 700; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 3px 0; }
.toc a { color: var(--fg); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

.post-body { font-size: 17px; line-height: 1.7; }
.post-body > :first-child { margin-top: 0; }
.post-body h2 {
    font-size: 26px; line-height: 1.25; letter-spacing: -0.02em; margin: 44px 0 12px;
    scroll-margin-top: 16px;
}
.post-body h3 { font-size: 19px; line-height: 1.35; margin: 28px 0 8px; }
.post-body p { margin: 0 0 16px; }
.post-body ul, .post-body ol { padding-left: 22px; margin: 0 0 16px; }
.post-body li { margin: 6px 0; }
.post-body .lead { font-size: 19px; line-height: 1.6; color: var(--fg); }
.post-body img { max-width: 100%; height: auto; }
.post-body code { background: var(--card); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: 0.9em; }

.tldr {
    background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent);
    border-radius: 14px; padding: 16px 20px; margin: 24px 0 8px; font-size: 16px;
}
.tldr-title {
    margin: 0 0 6px !important; font-size: 12px; font-weight: 700; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--accent);
}
.tldr ul { margin: 0; }

.callout {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: 14px 18px; font-size: 16px;
}

.post-body figure { margin: 28px 0; }
.post-body figure img { display: block; width: 100%; border-radius: 16px; background: var(--card); }
.post-body figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); text-align: center; }

.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 14px; }
.table-wrap table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 15px; }
.table-wrap th, .table-wrap td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table-wrap thead th { background: var(--card); font-weight: 700; }
.table-wrap tbody tr:last-child td, .table-wrap tbody tr:last-child th { border-bottom: 0; }

/* A call to action inside the text: a card with one strong line and two buttons. */
.cta {
    margin: 32px 0; padding: 20px 22px; border-radius: 18px; color: #3d1e6d;
    background: var(--grad);
}
.cta p { margin: 0 0 14px; font-size: 16.5px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 !important; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
    padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 15.5px; line-height: 1.2;
    text-decoration: none; background: #3d1e6d; color: #ffffff; border: 2px solid #3d1e6d;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(26, 18, 38, 0.25); }
.btn-ghost { background: rgba(255, 255, 255, 0.7); color: #3d1e6d; }
.cta a:not(.btn) { color: #3d1e6d; }

/* A channel post as the app draws it (the War Thunder article): who, when, the caption. */
.channel-post {
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
    padding: 12px 16px; margin: 0 0 12px;
}
.channel-post-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); margin: 0 0 4px !important; }
.channel-post-head strong { color: var(--accent); }
.channel-post p:last-child { margin: 0; }
.channel-post img { display: block; width: 100%; height: auto; margin: 6px 0 10px; border-radius: 10px; background: var(--card); }

.faq { margin-top: 48px; padding-top: 8px; border-top: 1px solid var(--line); }
.faq h3 { font-size: 17.5px; }

/* The closing call: the same store buttons as the landing page. */
.post-cta {
    max-width: 760px; margin: 40px auto 8px; padding: 32px 28px; text-align: center;
    background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
}
.post-cta h2 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 8px; }
.post-cta p { color: var(--muted); margin: 0 auto 20px; max-width: 34em; }
.post-cta .stores { margin: 0 auto; }

.related { padding: 40px 0 0; }
.related > h2 { font-size: 26px; letter-spacing: -0.02em; margin: 0; }
.related .post-grid { padding-top: 18px; }
.all-posts { margin: 12px 0 0; font-weight: 600; }

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

@media (max-width: 900px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .post-grid { grid-template-columns: 1fr; }
    .blog-head h1, .post-head h1 { font-size: 30px; }
    .post-body { font-size: 16.5px; }
    .post-body h2 { font-size: 22px; }
    .post-cta { padding: 26px 18px; }
    .crumbs [aria-current] { max-width: 22ch; }
}

@media (prefers-reduced-motion: reduce) {
    .post-card, .btn { transition: none; }
    .post-card:hover, .btn:hover { transform: none; }
}
