/* =========================================================
   Transformer Blog — blog-specific layer (loaded after style.css)
   Reuses the industrial-blue / amber tokens defined in style.css :root
   ========================================================= */

/* ---------- Layout: content + sidebar ---------- */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 44px;
    align-items: start;
}
.content-main { min-width: 0; }

/* ---------- Blog hero (home) ---------- */
.blog-hero {
    background: linear-gradient(160deg, var(--c-brand) 0%, var(--c-brand-dark) 100%);
    color: #fff;
    padding: 64px 0 56px;
    text-align: center;
}
.blog-hero__title { color: #fff; font-size: clamp(28px, 4vw, 44px); margin: 0 0 10px; }
.blog-hero__sub { color: #c9d6e8; max-width: 640px; margin: 0 auto 22px; font-size: 17px; }
.blog-hero form { max-width: 520px; margin: 0 auto; display: flex; gap: 8px; }
.blog-hero input[type="search"] {
    flex: 1; padding: 12px 16px; border: 0; border-radius: 6px; font-size: 15px;
}

/* ---------- Reading time ---------- */
.reading-time { color: var(--c-muted); font-size: 14px; margin: 4px 0 18px; }

/* ---------- Post grid + cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.post-card {
    background: #fff; border: 1px solid var(--c-line); border-radius: 12px; overflow: hidden;
    transition: box-shadow .2s, transform .2s; display: flex;
}
.post-card:hover { box-shadow: 0 10px 30px rgba(11,46,89,.12); transform: translateY(-2px); }
.post-card__inner { display: flex; flex-direction: column; width: 100%; color: inherit; text-decoration: none; }
.post-card__media { aspect-ratio: 3 / 2; overflow: hidden; background: #eef2f7; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card__body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card__cat {
    align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: .03em;
    text-transform: uppercase; color: var(--c-accent-dark); background: #fff3e9; padding: 3px 9px; border-radius: 999px;
}
.post-card__title { font-size: 19px; line-height: 1.3; margin: 0; color: var(--c-ink); }
.post-card__excerpt { color: var(--c-body); font-size: 14.5px; margin: 0; flex: 1; }
.post-card__meta { color: var(--c-muted); font-size: 13px; }

/* ---------- Single post hero image ---------- */
.post-hero { margin: 0 0 26px; border-radius: 12px; overflow: hidden; }
.post-hero img { width: 100%; height: auto; display: block; }

/* ---------- Sticky TOC (scroll-spy target) ---------- */
@media (min-width: 1024px) {
    .layout .toc { position: sticky; top: 92px; }
}
.toc {
    background: #f6f9fc; border: 1px solid var(--c-line); border-radius: 10px;
    padding: 16px 18px; margin: 0 0 26px;
}
.toc__title { margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--c-brand); }
.toc__list, .toc__sub { list-style: none; margin: 0; padding: 0; }
.toc__list { display: flex; flex-direction: column; gap: 6px; }
.toc__sub { padding-left: 14px; margin-top: 4px; }
.toc a { color: var(--c-body); text-decoration: none; font-size: 14.5px; display: block; border-left: 2px solid transparent; padding-left: 10px; }
.toc a:hover { color: var(--c-brand); }
.toc a.is-active { color: var(--c-brand); border-left-color: var(--c-accent); font-weight: 600; }

/* ---------- Author box (E-E-A-T) ---------- */
.author-box {
    display: flex; gap: 18px; align-items: flex-start; margin: 34px 0;
    background: #f6f9fc; border: 1px solid var(--c-line); border-left: 4px solid var(--c-accent);
    border-radius: 10px; padding: 20px 22px;
}
.author-box__avatar img { border-radius: 50%; display: block; }
.author-box__name { font-size: 17px; font-weight: 700; margin: 0 0 4px; color: var(--c-ink); }
.author-box__title { color: var(--c-accent-dark); font-weight: 600; font-size: 14px; }
.author-box__bio { margin: 6px 0 8px; color: var(--c-body); font-size: 14.5px; }
.author-box__links a { color: var(--c-brand); font-size: 14px; text-decoration: none; }

/* ---------- CTA boxes (funnel to main product site) ---------- */
.cta-box {
    border-radius: 12px; padding: 24px 24px; margin: 30px 0;
    background: linear-gradient(160deg, var(--c-brand) 0%, var(--c-brand-dark) 100%); color: #fff;
}
.cta-box h3 { color: #fff; margin: 0 0 8px; font-size: 20px; }
.cta-box p { color: #d6e2f1; margin: 0 0 16px; }
.cta-box--newsletter { background: #fff; border: 1px solid var(--c-line); color: var(--c-ink); }
.cta-box--newsletter h3, .cta-box--lead h3 { color: var(--c-brand); }
.cta-box--newsletter p, .cta-box--lead p { color: var(--c-body); }
.cta-box--lead { background: #fff7f0; border: 1px solid #ffd9bd; }
.cta-form { display: flex; gap: 8px; flex-wrap: wrap; }
.cta-form input[type="email"] { flex: 1; min-width: 200px; padding: 11px 14px; border: 1px solid var(--c-line); border-radius: 6px; font-size: 15px; }
.cta-note { font-size: 12.5px; color: var(--c-muted); margin: 10px 0 0; }

/* ---------- Sidebar widgets ---------- */
.sidebar { font-size: 15px; }
.widget { margin-bottom: 28px; }
.widget-title { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--c-brand); margin: 0 0 12px; border-bottom: 2px solid var(--c-line); padding-bottom: 8px; }
.popular-list, .cat-list { list-style: none; margin: 0; padding: 0; }
.popular-list li, .cat-list li { padding: 7px 0; border-bottom: 1px solid var(--c-line); }
.popular-list a, .cat-list a { color: var(--c-ink); text-decoration: none; }
.popular-list a:hover, .cat-list a:hover { color: var(--c-brand); }
.widget-empty { color: var(--c-muted); font-size: 14px; }

/* ---------- Reading progress + back-to-top + cookie consent ---------- */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: transparent; z-index: 60; }
.reading-progress__bar { display: block; height: 100%; background: var(--c-accent); transform: scaleX(0); transform-origin: left; }

.back-to-top {
    position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%;
    border: 0; background: var(--c-brand); color: #fff; font-size: 20px; cursor: pointer; opacity: 0;
    pointer-events: none; transition: opacity .2s; z-index: 55; box-shadow: 0 6px 18px rgba(11,46,89,.3);
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }

.cookie-consent {
    position: fixed; left: 0; right: 0; bottom: 0; background: #071f3d; color: #e6eef8; z-index: 70;
    padding: 14px 0; box-shadow: 0 -6px 24px rgba(0,0,0,.25);
}
.cookie-consent[hidden] { display: none; }
.cookie-consent__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cookie-consent__inner p { margin: 0; font-size: 14px; }
.cookie-consent__inner a { color: #ffb37a; }
.cookie-consent__actions { display: flex; gap: 8px; }

/* ---------- Author archive header ---------- */
.author-head { display: flex; gap: 22px; align-items: center; }
.author-head__avatar img { border-radius: 50%; }
.author-head__title { color: var(--c-accent); font-weight: 600; margin: 4px 0; }
.author-head__bio { color: var(--c-body); max-width: 640px; margin: 4px 0; }

/* ---------- Footer ---------- */
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; padding: 44px 0 24px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 0 30px; border-top: 1px solid var(--c-line); color: var(--c-muted); font-size: 13.5px; }
.footer-nav a { color: var(--c-muted); margin-left: 16px; text-decoration: none; }
.footer-nav a:hover { color: var(--c-brand); }

/* ---------- Pagination ---------- */
.page-links, .nav-links { margin: 30px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.nav-links a, .nav-links span, .page-links a, .page-links > span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px;
    padding: 0 12px; border: 1px solid var(--c-line); border-radius: 6px; color: var(--c-brand); text-decoration: none; font-size: 14px;
}
.nav-links .current, .page-links .current { background: var(--c-brand); color: #fff; border-color: var(--c-brand); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .post-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .main-nav { display: none; }
    .main-nav.is-open { display: block; position: absolute; top: 100%; left: 0; right: 0; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 12px 0; }
    .main-nav.is-open ul { display: flex; flex-direction: column; }
}
