/* ===========================================================
   MTL Electric - Blog index (/blog)
   Implements the "Blog Index Page" design (Claude Design).

   Loaded after css/shared.css and css/service.css (design
   tokens, base reset, buttons, .svc-crumbs, .svc-eyebrow and
   the .svc-cta closing band). The page's featured post, cards,
   category chips and article count are generated by build.js
   from content/blog/.
   =========================================================== */

/* -----------------------------------------------------------
   Page header
   ----------------------------------------------------------- */
.bi-head {
    padding: 72px 0 40px;
}

.bi-head .wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bi-head__title {
    font: 700 clamp(44px, 4.6vw + 10px, 74px)/.95 var(--font-display);
    color: var(--navy);
    text-transform: uppercase;
    text-wrap: pretty;
    max-width: 900px;
}

.bi-head__lead {
    font: 400 19px/1.55 var(--font-body);
    color: var(--body);
    max-width: 620px;
    text-wrap: pretty;
}

@media (max-width: 1024px) {
    .bi-head { padding: 48px 0 32px; }
}

@media (max-width: 768px) {
    .bi-head { padding: 40px 0 24px; }
    .bi-head .wrap { gap: 14px; }
    .bi-head__lead { font-size: 16px; line-height: 1.5; }
}

/* -----------------------------------------------------------
   Category filters
   ----------------------------------------------------------- */
.bi-filters {
    padding-bottom: 40px;
    border-bottom: 1px solid var(--line-soft);
}

.bi-filters .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.bi-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bi-chip {
    border: 1px solid #cfd3dc;
    background: #fff;
    padding: 10px 16px;
    font: 600 12px/1 var(--font-body);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--navy);
    cursor: pointer;
    transition: border-color .15s, background-color .15s, color .15s;
}
.bi-chip:hover { border-color: var(--navy); }
.bi-chip.is-active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.bi-count {
    flex: none;
    font: 500 14px/1 var(--font-body);
    color: var(--muted);
}

@media (max-width: 1024px) {
    .bi-filters { padding-bottom: 32px; }
}

@media (max-width: 768px) {
    /* Chips scroll sideways rather than wrapping onto four rows */
    .bi-filters { padding-bottom: 24px; }
    .bi-filters .wrap {
        display: block;
        padding-right: 0;
    }
    .bi-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-right: var(--gutter);
        scrollbar-width: none;
    }
    .bi-chips::-webkit-scrollbar { display: none; }
    .bi-chip {
        flex: none;
        min-height: 44px;
        padding: 12px 16px;
        display: inline-flex;
        align-items: center;
    }
    .bi-count { display: none; }
}

/* -----------------------------------------------------------
   Featured post
   ----------------------------------------------------------- */
.bi-featured {
    padding-top: 64px;
}

.bi-feature {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    align-items: stretch;
    min-height: 460px;
    background: var(--navy);
    color: #fff;
    overflow: hidden;
}
.bi-feature:hover { color: #fff; }

/* The photo fills its cell rather than sizing the row */
.bi-feature__media {
    position: relative;
    min-height: 460px;
    overflow: hidden;
}
.bi-feature__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bi-feature__body {
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

.bi-feature__tags {
    display: flex;
    align-items: center;
    gap: 12px;
}
.bi-badge {
    background: var(--orange);
    color: #fff;
    padding: 7px 10px;
    font: 600 11px/1 var(--font-body);
    letter-spacing: .12em;
    text-transform: uppercase;
}
.bi-feature__cat {
    font: 600 12px/1 var(--font-body);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--peach);
}

.bi-feature__body h2 {
    font: 700 46px/.98 var(--font-display);
    color: #fff;
    text-transform: uppercase;
    text-wrap: pretty;
}
.bi-feature__body > p {
    font: 400 16px/1.55 var(--font-body);
    color: rgba(255, 255, 255, .82);
}

.bi-feature__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding-top: 6px;
    font: 500 13px/1 var(--font-body);
    color: rgba(255, 255, 255, .7);
}
.bi-dot { color: var(--peach); }

.bi-feature__more {
    align-self: flex-start;
    margin-top: 6px;
    padding-bottom: 6px;
    font: 600 13px/1 var(--font-body);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
    border-bottom: 2px solid var(--orange);
}

@media (max-width: 1024px) {
    .bi-featured { padding-top: 48px; }
    .bi-feature {
        grid-template-columns: 1fr 1fr;
        min-height: 380px;
    }
    .bi-feature__media { min-height: 380px; }
    .bi-feature__body { padding: 32px; gap: 14px; }
    .bi-feature__body h2 { font-size: 36px; }
}

@media (max-width: 768px) {
    .bi-featured { padding-top: 32px; }
    .bi-feature {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    .bi-feature__media {
        height: 220px;
        min-height: 0;
        flex: none;
    }
    .bi-feature__body {
        padding: 24px 22px 28px;
        gap: 12px;
    }
    .bi-feature__tags { gap: 10px; }
    .bi-badge { padding: 6px 9px; }
    .bi-feature__cat { font-size: 11px; }
    .bi-feature__body h2 { font-size: 30px; line-height: 1; }
    .bi-feature__body > p { font-size: 15px; line-height: 1.5; }
    .bi-feature__meta { font-size: 12px; gap: 8px; }
    /* The whole card is the link on a phone */
    .bi-feature__more { display: none; }
}

/* -----------------------------------------------------------
   Article grid
   ----------------------------------------------------------- */
.bi-list {
    padding: 64px 0 var(--sec-y);
}

.bi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.bi-card {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow .15s;
}
.bi-card:hover {
    box-shadow: 0 12px 30px -16px rgba(15, 42, 99, .35);
    color: var(--ink);
}

.bi-card__media {
    position: relative;
    height: 220px;
    flex: none;
    overflow: hidden;
}
.bi-card__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bi-card__body {
    padding: 24px 26px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}
.bi-card__cat {
    font: 600 12px/1 var(--font-body);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--orange);
}
.bi-card h3 {
    font: 700 26px/1.05 var(--font-display);
    color: var(--navy);
    text-transform: uppercase;
}
/* Clamped to 3 lines so excerpts of different lengths don't skew
   the row. The box must NOT also flex-grow, or the clamp ellipsis
   lands on line 3 while line 4 still renders below it. */
.bi-card__body > p {
    font: 400 15px/1.55 var(--font-body);
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bi-card__meta {
    margin-top: auto;
    padding-top: 2px;
    font: 500 13px/1 var(--font-body);
    color: #7a8290;
}

/* Hidden by the category filter */
.bi-card[hidden],
.bi-featured[hidden] { display: none !important; }

@media (max-width: 1024px) {
    .bi-list { padding: 48px 0 var(--sec-y); }
    .bi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .bi-card__body { padding: 20px 22px 24px; }
    .bi-card h3 { font-size: 23px; }
}

@media (max-width: 768px) {
    /* Thumbnail rows, as in the design */
    .bi-list { padding: 32px 0 56px; }
    .bi-grid {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }
    .bi-card {
        display: grid;
        grid-template-columns: 120px 1fr;
        gap: 14px;
        align-items: center;
        padding-right: 14px;
    }
    .bi-card__media { height: 120px; }
    .bi-card__body {
        padding: 12px 0;
        gap: 6px;
    }
    .bi-card__cat { font-size: 11px; }
    .bi-card h3 { font-size: 19px; line-height: 1.1; }
    .bi-card__body > p { display: none; }
    .bi-card__meta { font-size: 12px; }
}

/* -----------------------------------------------------------
   Ask an electrician
   ----------------------------------------------------------- */
.bi-ask {
    background: var(--paper);
    padding: 72px 0;
}

.bi-ask .wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.bi-ask__text {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.bi-ask__text h2 {
    font: 700 46px/1 var(--font-display);
    color: var(--navy);
    text-transform: uppercase;
    text-wrap: pretty;
}
.bi-ask__text p {
    font: 400 16px/1.55 var(--font-body);
    color: var(--muted);
    text-wrap: pretty;
}

.bi-ask__buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.bi-ask__buttons .btn { padding: 16px 28px; }

@media (max-width: 1024px) {
    .bi-ask { padding: var(--sec-y) 0; }
    .bi-ask .wrap {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .bi-ask__buttons { justify-content: flex-start; }
    .bi-ask__text h2 { font-size: 40px; }
}

@media (max-width: 768px) {
    .bi-ask { padding: 48px 0; }
    .bi-ask .wrap { gap: 16px; }
    .bi-ask__text { gap: 12px; }
    .bi-ask__text h2 { font-size: 36px; line-height: .98; }
    .bi-ask__text p { font-size: 15px; line-height: 1.5; }
    .bi-ask__buttons {
        flex-direction: column;
        gap: 10px;
    }
    .bi-ask__buttons .btn { width: 100%; padding: 16px; }
    /* Texting is the ask on a phone */
    .bi-ask__buttons .btn--outline-navy { display: none; }
}
