/* ===========================================================
   MTL Electric - Blog posts
   Implements the "Blog Post Template" design (Claude Design).
   Loaded after css/shared.css and css/service.css (which
   provide the design tokens, base reset, buttons, .svc-toc,
   .svc-quote-card, .svc-eyebrow/.svc-h2/.svc-more and the
   closing CTA section).
   =========================================================== */

/* -----------------------------------------------------------
   Article header
   ----------------------------------------------------------- */
.post-header { padding: 64px 0 48px; }

.post-header__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: end;
}

.post-header__text {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.post-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font: 500 13px/1 var(--font-body);
    letter-spacing: .04em;
    color: var(--muted);
}
.post-crumbs a { color: var(--muted); }
.post-crumbs a:hover { color: var(--orange); }
.post-crumbs span:last-child { color: var(--ink); }

.post-chip {
    align-self: flex-start;
    background: var(--navy);
    color: #fff;
    padding: 8px 12px;
    font: 600 12px/1 var(--font-body);
    letter-spacing: .12em;
    text-transform: uppercase;
}

.post-title {
    font: 700 clamp(40px, 3.9vw + 12px, 64px)/.95 var(--font-display);
    color: var(--navy);
    text-transform: uppercase;
    text-wrap: pretty;
}

.post-dek {
    font: 400 19px/1.55 var(--font-body);
    color: var(--body);
    text-wrap: pretty;
}

.post-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding-top: 8px;
    border-top: 1px solid var(--line-soft);
    font: 500 14px/1 var(--font-body);
    color: var(--muted);
}
.post-byline__name { color: var(--ink); font-weight: 600; }
.post-byline__sep { color: #cfd3dc; }

.post-avatar {
    width: 40px;
    height: 40px;
    flex: none;
    background: var(--navy);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: 700 15px/1 var(--font-display);
}

.post-header__img {
    width: 100%;
    height: 440px;
    object-fit: cover;
}

@media (max-width: 1024px) {
    .post-header { padding: 0 0 8px; }
    .post-header__grid {
        display: flex;
        flex-direction: column-reverse;
        gap: 28px;
        align-items: stretch;
    }
    .post-header__img {
        height: 240px;
        margin: 0 calc(-1 * var(--gutter));
        width: auto;
    }
    .post-title { line-height: .95; }
    .post-dek { font-size: 17px; }
    .post-byline {
        padding: 14px 0;
        border-bottom: 1px solid var(--line-soft);
        font-size: 13px;
    }
    .post-avatar { width: 32px; height: 32px; font-size: 13px; }
}

/* -----------------------------------------------------------
   Body layout: TOC | article | share
   ----------------------------------------------------------- */
.post-columns {
    display: grid;
    grid-template-columns: 280px minmax(0, 720px) 1fr;
    gap: 64px;
    align-items: start;
    padding-top: 48px;
    padding-bottom: var(--sec-y);
}

.post-aside {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* "In this article" — active item gets the orange bar */
.post-toc a { padding-left: 15px; font-weight: 500; }
.post-toc a.is-active {
    border-left: 3px solid var(--orange);
    padding-left: 12px;
    font-weight: 600;
    color: var(--navy);
}

/* Mobile inline TOC */
.post-toc-mobile {
    display: none;
    flex-direction: column;
    gap: 8px;
    background: var(--paper);
    padding: 18px 20px;
    margin-bottom: 24px;
}
.post-toc-mobile > span {
    font: 600 11px/1 var(--font-body);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}
.post-toc-mobile a {
    font: 600 15px/1.3 var(--font-body);
    color: var(--navy);
}
.post-toc-mobile a:hover { color: var(--orange); }

/* Share buttons */
.post-share--desktop {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}
.post-share__label {
    font: 600 12px/1 var(--font-body);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 6px;
}
.post-share a {
    border: 1px solid var(--line);
    padding: 10px 14px;
    font: 600 12px/1 var(--font-body);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--navy);
    transition: border-color .15s;
}
.post-share a:hover { border-color: var(--navy); color: var(--navy); }

.post-share--mobile {
    display: none;
    gap: 8px;
    padding-top: 24px;
}
.post-share--mobile a {
    flex: 1;
    padding: 14px 8px;
    text-align: center;
}

@media (max-width: 1024px) {
    .post-columns {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding-top: 20px;
        padding-bottom: 56px;
    }
    .post-aside,
    .post-share--desktop { display: none; }
    .post-toc-mobile { display: flex; }
    .post-share--mobile { display: flex; }
    .post-article { width: 100%; }
}

/* -----------------------------------------------------------
   Article typography
   ----------------------------------------------------------- */
.post-body {
    font: 400 18px/1.75 var(--font-body);
    color: #2a3140;
}
.post-body p { margin: 0 0 22px; }
.post-body strong { color: var(--ink); }
.post-body a { color: var(--orange); font-weight: 600; }
.post-body a:hover { color: var(--orange-dark); }

.post-body .lead-text {
    font: 500 21px/1.6 var(--font-body);
    color: var(--ink);
}

.post-body h2 {
    font: 700 36px/1 var(--font-display);
    color: var(--navy);
    text-transform: uppercase;
    margin: 44px 0 18px;
    text-wrap: pretty;
}
.post-num {
    color: var(--orange);
    margin-right: 16px;
}
.post-body h3 {
    font: 700 26px/1.1 var(--font-display);
    color: var(--navy);
    text-transform: uppercase;
    margin: 32px 0 12px;
}

/* Em-dash bullet lists */
.post-body ul {
    margin: 0 0 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.post-body ul > li {
    display: flex;
    gap: 14px;
}
.post-body ul > li::before {
    content: '\2014';
    color: var(--orange);
    font-weight: 700;
    flex: none;
}

/* Numbered steps */
.post-body ol {
    margin: 0 0 22px;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--line);
    counter-reset: post-steps;
}
.post-body ol > li {
    counter-increment: post-steps;
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}
.post-body ol > li::before {
    content: counter(post-steps);
    font: 700 26px/1 var(--font-display);
    color: var(--orange);
}

/* "Good to know" callout */
.post-body .post-note {
    border-left: 3px solid var(--orange);
    background: var(--paper);
    padding: 22px 26px;
    margin: 0 0 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.post-body .post-note > span {
    font: 600 12px/1 var(--font-body);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--orange);
}
.post-body .post-note p {
    margin: 0;
    font: 400 16px/1.6 var(--font-body);
    color: var(--ink);
}

/* In-article figures */
.post-body figure {
    margin: 8px 0 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.post-body figure img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}
.post-body figcaption {
    font: 500 14px/1.4 var(--font-body);
    color: var(--muted);
}

/* Mid-article CTA */
.post-cta {
    background: var(--navy);
    padding: 40px;
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.post-cta > span {
    font: 600 12px/1 var(--font-body);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--peach);
}
.post-cta h3 {
    font: 700 34px/1 var(--font-display);
    color: #fff;
    text-transform: uppercase;
    margin: 0;
}
.post-cta p {
    font: 400 16px/1.55 var(--font-body);
    color: rgba(255, 255, 255, .82);
    margin: 0;
}
.post-cta .btn-row { margin-top: 4px; }

@media (max-width: 768px) {
    .post-body { font-size: 17px; line-height: 1.7; }
    .post-body p { margin-bottom: 18px; }
    .post-body .lead-text { font-size: 19px; line-height: 1.55; }
    .post-body h2 { font-size: 30px; margin: 36px 0 14px; }
    .post-num { margin-right: 12px; }
    .post-body h3 { font-size: 23px; }
    .post-body figure { margin: 4px calc(-1 * var(--gutter)) 18px; }
    .post-body figure img { height: 240px; }
    .post-body figcaption { padding: 0 var(--gutter); font-size: 13px; }
    .post-body ol > li { grid-template-columns: 36px 1fr; gap: 12px; padding: 12px 0; }
    .post-body ol > li::before { font-size: 22px; }
    .post-cta {
        padding: 28px 22px;
        margin: 24px calc(-1 * var(--gutter));
    }
    .post-cta h3 { font-size: 30px; }
    .post-cta p { font-size: 15px; }
}

/* -----------------------------------------------------------
   Author box
   ----------------------------------------------------------- */
.post-author {
    margin-top: 24px;
    border-top: 2px solid var(--navy);
    padding-top: 24px;
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 20px;
    align-items: start;
}
.post-avatar--lg {
    width: 80px;
    height: 80px;
    font-size: 30px;
}
.post-author__text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.post-author__text strong {
    font: 700 24px/1 var(--font-display);
    color: var(--navy);
    text-transform: uppercase;
}
.post-author__text p {
    margin: 0;
    font: 400 15px/1.6 var(--font-body);
    color: var(--muted);
}
.post-author .svc-more { font-size: 13px; }

@media (max-width: 768px) {
    .post-author { display: flex; flex-direction: column; gap: 8px; padding-top: 20px; margin-top: 16px; }
    .post-avatar--lg { display: none; }
    .post-author__text strong { font-size: 22px; }
}

/* -----------------------------------------------------------
   Related posts
   ----------------------------------------------------------- */
.post-related {
    background: var(--paper);
    padding: 80px 0;
}
.post-related .wrap {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.post-related__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 40px;
}
.post-related__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.post-card {
    background: #fff;
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow .15s;
}
.post-card:hover { box-shadow: 0 12px 30px -16px rgba(15, 42, 99, .35); }
.post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.post-card__body {
    padding: 22px 24px 26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.post-card__cat {
    font: 600 12px/1 var(--font-body);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--orange);
}
.post-card h3 {
    font: 700 24px/1.1 var(--font-display);
    color: var(--navy);
    text-transform: uppercase;
}
.post-card__time {
    font: 500 13px/1 var(--font-body);
    color: var(--muted);
}

.post-related__more-mobile {
    display: none;
    align-items: flex-end;
    min-height: 44px;
    padding: 14px 0 6px;
}

@media (max-width: 768px) {
    .post-related { padding: 56px 0; }
    .post-related .wrap { gap: 20px; }
    .post-related__head .svc-more { display: none; }
    .post-related__grid { display: flex; flex-direction: column; gap: 14px; }
    .post-card {
        display: grid;
        grid-template-columns: 110px 1fr;
        gap: 14px;
        align-items: center;
        padding-right: 14px;
    }
    .post-card img { width: 110px; height: 100px; }
    .post-card__body { padding: 0; gap: 6px; }
    .post-card__cat { font-size: 11px; }
    .post-card h3 { font-size: 19px; }
    .post-card__time { display: none; }
    .post-related__more-mobile { display: inline-flex; align-self: flex-start; }
}
