/* blog.html — the Trading Education Library (hand-built: templates/pages/blog.html).
   Loaded after v3.css, v3-content.css and v3-blog.css. Every rule is scoped to the page. */

:root.page-blog body { --bl-forex: #1766C3; --bl-ta: #102A43; --bl-basics: #1F7A5C; --bl-psych: #8D6626;
    --bl-stocks: #3B5B8C; --bl-crypto: #5A4E8C; --bl-comm: #7A5A2E; --bl-auto: #2E6A75; }
:root.page-blog body .bl-c-forex { --c: var(--bl-forex); }
:root.page-blog body .bl-c-technical-analysis { --c: var(--bl-ta); }
:root.page-blog body .bl-c-trading-basics { --c: var(--bl-basics); }
:root.page-blog body .bl-c-trading-psychology { --c: var(--bl-psych); }
:root.page-blog body .bl-c-stocks { --c: var(--bl-stocks); }
:root.page-blog body .bl-c-crypto { --c: var(--bl-crypto); }
:root.page-blog body .bl-c-commodities { --c: var(--bl-comm); }
:root.page-blog body .bl-c-automation { --c: var(--bl-auto); }

/* ---------- top ---------- */
:root.page-blog body .bl-top {
    position: relative; overflow: hidden; padding: 56px 0 88px;
    background: linear-gradient(180deg, #fff, var(--paper));
    border-bottom: 1px solid var(--rule);
}
:root.page-blog body .bl-top::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(rgba(7,24,39,.045) 1px, transparent 1px) 0 0 / 100% 64px;
}
:root.page-blog body .bl-top-in { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; }
:root.page-blog body .bl-title { font-size: clamp(40px, 5vw, 64px); line-height: 1.05; margin: 18px 0 18px; }
:root.page-blog body .bl-title em, :root.page-blog body .bl-lib-head h2 em, :root.page-blog body .bl-cats-head h2 em { font-style: italic; color: var(--blue); }
:root.page-blog body .bl-facts { list-style: none; padding: 22px 0 0; margin: 32px 0 0; display: flex; gap: 40px; border-top: 1px solid var(--rule); }
:root.page-blog body .bl-facts li { display: flex; flex-direction: column; }
:root.page-blog body .bl-facts b { font-size: 30px; font-weight: 700; color: var(--navy); letter-spacing: -.02em; line-height: 1.1; }
:root.page-blog body .bl-facts span { font-size: 13px; color: var(--ink-3); }

/* featured guide: a navy panel, the one dark block above the fold */
:root.page-blog body .bl-feature {
    position: relative; overflow: hidden; background: var(--navy); color: #fff;
    padding: 40px 36px 36px; border-left: 3px solid var(--gold);
    box-shadow: 0 40px 70px -40px rgba(7,24,39,.7);
}
:root.page-blog body .bl-feature-meta { display: flex; gap: 14px; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--blue-light); margin-bottom: 16px; }
:root.page-blog body .bl-feature-meta span + span { color: #9FB0C2; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.2); }
:root.page-blog body .bl-feature h2 { color: #fff; font-size: clamp(26px, 2.6vw, 34px); margin: 0 0 14px; position: relative; }
:root.page-blog body .bl-feature h2 em { font-style: italic; color: var(--blue-light); }
:root.page-blog body .bl-feature p { color: #C7D6E2; font-size: 16px; margin: 0 0 26px; position: relative; }
:root.page-blog body .bl-feature .btn { position: relative; background: #fff; color: var(--navy); border-color: #fff; }
:root.page-blog body .bl-feature .btn:hover { background: var(--blue-light); border-color: var(--blue-light); color: var(--navy); }
:root.page-blog body .bl-feature-chart { position: absolute; right: 0; bottom: 0; width: 70%; height: 46%; color: var(--blue); opacity: .35; pointer-events: none; }

/* ---------- library ---------- */
:root.page-blog body .bl-lib { padding: 88px 0 96px; }
:root.page-blog body .bl-lib-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; margin-bottom: 36px; padding-bottom: 24px; border-bottom: 1px solid var(--rule); }
:root.page-blog body .bl-lib-head h2, :root.page-blog body .bl-cats-head h2 { font-size: clamp(30px, 3.4vw, 44px); margin: 14px 0 0; }
:root.page-blog body .bl-filters { margin: 0; gap: 8px; }
:root.page-blog body .bl-filters .filter-btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
    padding: 10px 16px; border: 1px solid var(--rule); border-radius: 999px; background: #fff;
    font: 600 14px/1 var(--sans); color: var(--ink); cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}
:root.page-blog body .bl-filters .filter-btn .count { font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--cloud); border-radius: 999px; padding: 3px 8px; }
:root.page-blog body .bl-filters .filter-btn:hover { border-color: var(--navy); background: #fff; color: var(--navy); }
:root.page-blog body .bl-filters .filter-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }
:root.page-blog body .bl-filters .filter-btn.active .count { background: rgba(255,255,255,.14); color: #fff; }
:root.page-blog body .bl-filters .filter-btn:focus-visible,
:root.page-blog body .pagination-btn:focus-visible,
:root.page-blog body .bl-post:focus-visible,
:root.page-blog body .bl-cat:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

:root.page-blog body .bl-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; min-height: 200px; }
:root.page-blog body .bl-post {
    --c: var(--blue-text);
    position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--rule);
    padding: 26px 26px 22px; color: var(--ink);
    transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s;
}
:root.page-blog body .bl-post::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; background: var(--c); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
:root.page-blog body .bl-post:hover { transform: translateY(-4px); box-shadow: 0 26px 44px -28px rgba(7,24,39,.45); border-color: transparent; color: var(--ink); }
:root.page-blog body .bl-post:hover::before { transform: scaleX(1); }
:root.page-blog body .bl-post-cat { align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--c); margin-bottom: 14px; display: inline-flex; align-items: center; gap: 8px; }
:root.page-blog body .bl-post-cat::before { content: ""; width: 18px; height: 2px; background: currentColor; }
:root.page-blog body .bl-post h3 { font-size: 21px; line-height: 1.28; margin: 0 0 10px; color: var(--navy); }
:root.page-blog body .bl-post:hover h3 { color: var(--blue-text); }
:root.page-blog body .bl-post p { font-size: 15px; line-height: 1.6; color: var(--ink-2); margin: 0 0 20px; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
:root.page-blog body .bl-post-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-3); }
:root.page-blog body .bl-post-time { display: inline-flex; gap: 6px; align-items: center; }
:root.page-blog body .bl-post-time svg { width: 14px; height: 14px; }
:root.page-blog body .bl-post-more { font-weight: 600; color: var(--blue-text); display: inline-flex; gap: 6px; }
:root.page-blog body .bl-post-more::after { content: "\2192"; transition: transform .25s var(--ease); }
:root.page-blog body .bl-post:hover .bl-post-more::after { transform: translateX(4px); }
:root.page-blog body .bl-post.bl-c-forex, :root.page-blog body .bl-post[data-category="forex"] { --c: var(--bl-forex); }
:root.page-blog body .bl-post[data-category="technical-analysis"] { --c: var(--bl-ta); }
:root.page-blog body .bl-post[data-category="trading-basics"] { --c: var(--bl-basics); }
:root.page-blog body .bl-post[data-category="trading-psychology"] { --c: var(--bl-psych); }
:root.page-blog body .bl-post[data-category="commodities"] { --c: var(--bl-comm); }

:root.page-blog body .bl-pager { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 48px; }
:root.page-blog body .bl-page-info { font-size: 14px; color: var(--ink-3); }
:root.page-blog body .pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
:root.page-blog body .pagination-btn {
    min-width: 44px; height: 44px; padding: 0 14px; display: inline-grid; place-items: center;
    border: 1px solid var(--rule); background: #fff; border-radius: 3px;
    font: 600 14px/1 var(--sans); color: var(--navy); cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
:root.page-blog body button.pagination-btn:hover:not(:disabled) { border-color: var(--navy); }
:root.page-blog body .pagination-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }
:root.page-blog body .pagination-btn:disabled, :root.page-blog body span.pagination-btn { color: var(--ink-3); background: transparent; cursor: default; }
:root.page-blog body span.pagination-btn { border-color: transparent; min-width: 24px; padding: 0 4px; }
:root.page-blog body .bl-noscript { text-align: center; color: var(--ink-3); }

/* ---------- categories ---------- */
:root.page-blog body .bl-cats { padding: 100px 0; background: #fff; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
:root.page-blog body .bl-cats-head { max-width: 46em; margin-bottom: 48px; }
:root.page-blog body .bl-cats-head .lede { margin: 14px 0 0; }
:root.page-blog body .bl-cat-list { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
:root.page-blog body .bl-cat {
    position: relative; display: flex; flex-direction: column; padding: 30px 26px 26px;
    border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); color: var(--ink);
    background: #fff; transition: background .3s;
}
:root.page-blog body .bl-cat::before { content: ""; width: 28px; height: 3px; background: var(--c); margin-bottom: 18px; transition: width .4s var(--ease); }
:root.page-blog body .bl-cat:hover { background: var(--paper); color: var(--ink); }
:root.page-blog body .bl-cat:hover::before { width: 56px; }
:root.page-blog body .bl-cat-n { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
:root.page-blog body .bl-cat h3 { font-size: 22px; margin: 0 0 8px; }
:root.page-blog body .bl-cat p { font-size: 14.5px; line-height: 1.55; margin: 0 0 18px; flex: 1; }
:root.page-blog body .bl-cat .link-arrow { font-size: 14px; color: var(--blue-text); }

/* ---------- cta ---------- */
:root.page-blog body section.cta .container { max-width: var(--wrap); }
:root.page-blog body section.cta h2 { font-size: clamp(30px, 3.4vw, 44px); }
:root.page-blog body section.cta .btn-group { margin-top: 26px; }
:root.page-blog body .bl-risk { font-size: 13px; margin: 28px 0 0; max-width: 52em; color: #9FB0C2 !important; }
:root.page-blog body .bl-risk a { color: #fff; text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
    :root.page-blog body .bl-post, :root.page-blog body .bl-post::before { transition: none; }
}
@media (max-width: 1080px) {
    :root.page-blog body .bl-top-in { grid-template-columns: 1fr; gap: 44px; }
    :root.page-blog body .bl-posts { grid-template-columns: repeat(2, 1fr); }
    :root.page-blog body .bl-cat-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
    :root.page-blog body .wrap { padding: 0 16px; }
    :root.page-blog body .bl-top { padding: 36px 0 56px; }
    :root.page-blog body .bl-facts { gap: 28px; }
    :root.page-blog body .bl-feature { padding: 30px 22px 26px; }
    :root.page-blog body .bl-lib, :root.page-blog body .bl-cats { padding: 64px 0; }
    :root.page-blog body .bl-posts, :root.page-blog body .bl-cat-list { grid-template-columns: 1fr; }
    :root.page-blog body .bl-filters { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 6px; margin-right: -16px; scrollbar-width: none; }
    :root.page-blog body .bl-filters::-webkit-scrollbar { display: none; }
    :root.page-blog body .bl-filters .filter-btn { flex: none; }
    :root.page-blog body .pagination-btn { min-width: 40px; padding: 0 10px; }
    :root.page-blog body section.cta .container { padding: 0 16px; }
}
