/* ============================================================
 * Tresl Blog Archive (Blog Index + Category archives)
 *
 *   - Header banner (dark teal + yellow crescent on the right).
 *   - "Browse by topic" filter pills.
 *   - 3-col grid of post cards.
 *   - Native WP pagination.
 * ============================================================ */

/* Local aliases that pull from the global brand tokens in style.css
   (:root --tresl-color-*). To recolor the blog header globally, edit
   the values in style.css under "TRESL BRAND TOKENS". */
.tresl-blog-archive {
    --tresl-blue:   var(--tresl-color-primary, #1A6DB6);
    --tresl-dark:   var(--tresl-color-dark, #003844);
    --tresl-accent: var(--tresl-color-accent, #FAB041);
    --tresl-text:   var(--tresl-color-dark, #003844);
    --tresl-muted:  #5a6772;

    color: var(--tresl-text);
}

/* ============================
 * HEADER BANNER
 * ============================ */
.tresl-blog-archive__header {
    --header-h: 360px;
    --container-max: 1440px;
    --container-overflow: max(0px, calc((100vw - var(--container-max)) / 2));
    --accent-size: clamp(440px, 50vw, 760px);
    --accent-cx: calc(100% - var(--container-overflow));

    position: relative;
    width: 100%;
    min-height: var(--header-h);
    background: var(--tresl-dark);
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}

.tresl-blog-archive__header::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: var(--accent-cx);
    right: 0;
    background: var(--tresl-accent);
    z-index: 1;
}

.tresl-blog-archive__header-accent {
    position: absolute;
    top: 50%;
    left: var(--accent-cx);
    width: var(--accent-size);
    height: var(--accent-size);
    transform: translate(-50%, -50%);
    background: var(--tresl-accent);
    border-radius: 50%;
    z-index: 1;
}

.tresl-blog-archive__header-content {
    position: relative;
    z-index: 3;
    min-height: var(--header-h);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 110px 32px 80px;
    gap: 16px;
    max-width: 100%;
}

/* TRESL-CTA */
.tresl-blog-archive__header-eyebrow {
    margin: 0;
    color: #FFF;
    text-align: center;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 15px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    text-transform: uppercase;
}

/* TRESL-H1 — wide enough so "Insights from Tresl®" fits on one line. */
.tresl-blog-archive__header-title {
    margin: 0;
    max-width: 1100px;
    color: #FFF;
    text-align: center;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 56px;
    font-style: normal;
    font-weight: 700;
    line-height: 57px; /* 101.786% */
}

/* Allow the <br> stored in the page title to control where the title
   breaks (e.g. "Auto Finance" / "Insights from Tresl®"). */
.tresl-blog-archive__header-title br { display: inline; }

/* TRESL-Body */
.tresl-blog-archive__header-desc {
    margin: 4px 0 0;
    max-width: 540px;
    color: #FFF;
    text-align: center;
    font-family: 'Lato', system-ui, sans-serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
}

/* ============================
 * FILTERS: "Browse by topic"
 * ============================ */
.tresl-blog-archive__filters {
    padding: 56px 24px 0;
}

.tresl-blog-archive__filters-inner {
    max-width: 1140px;
    margin: 0 auto;
}

/* TRESL-H3 */
.tresl-blog-archive__filters-title {
    margin: 0 0 22px;
    color: var(--TRESL---Primary-Blue, #1A6DB6);
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 28px;
    font-style: normal;
    font-weight: 700;
    line-height: 28px; /* 100% */
}

.tresl-blog-archive__pills {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

/* Filter pill: outlined version of the post card pill. The color comes
   from each item's inline --pill-color so each category keeps its own hue. */
.tresl-blog-archive__pill {
    display: inline-flex;
    align-items: center;
    height: 33px;
    padding: 0 20px;
    border: 1.5px solid var(--pill-color, var(--tresl-blue));
    border-radius: 999px;
    background: transparent;
    color: var(--pill-color, var(--tresl-blue));
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease;
}

.tresl-blog-archive__pill:hover,
.tresl-blog-archive__pill.is-active {
    background: var(--pill-color, var(--tresl-blue));
    color: #fff;
}

/* ============================
 * GRID OF POST CARDS
 * ============================ */
.tresl-blog-archive__grid-wrap {
    padding: 32px 24px 80px;
}

.tresl-blog-archive__grid-inner {
    max-width: 1140px;
    margin: 0 auto;
}

.tresl-blog-archive__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 24px;
}

.tresl-blog-archive__card {
    background: #fff;
    border: 1px solid #E6EEF6;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s ease, transform .2s ease;
}

.tresl-blog-archive__card:hover {
    box-shadow: 0 10px 24px rgba(13, 44, 62, .12);
    transform: translateY(-2px);
}

.tresl-blog-archive__card-image-link {
    display: block;
    line-height: 0;
}

.tresl-blog-archive__card-image {
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    background-color: #E6EEF6;
}

.tresl-blog-archive__card-image--placeholder {
    background-color: var(--tresl-blue);
}

.tresl-blog-archive__card-body {
    flex: 1 1 auto;
    padding: 22px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Card pill: filled with the category color. Smaller than the filter pills. */
.tresl-blog-archive__card-pill {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 12px;
    background: var(--pill-color, var(--tresl-blue));
    border-radius: 999px;
    color: #fff;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1;
}

/* TRESL-H3 */
.tresl-blog-archive__card-title {
    margin: 2px 0 0;
    color: var(--TRESL---Dark-Blue-Accent, #445463);
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 28px;
    font-style: normal;
    font-weight: 700;
    line-height: 28px; /* 100% */
}

.tresl-blog-archive__card-title a {
    color: inherit;
    text-decoration: none;
}

.tresl-blog-archive__card-title a:hover { color: var(--tresl-blue); }

.tresl-blog-archive__card-excerpt {
    margin: 0;
    font-family: 'Lato', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--tresl-muted);
    flex: 1 1 auto;
}

/* TRESL-CTA */
.tresl-blog-archive__card-cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 33px;
    padding: 0 22px;
    margin-top: 6px;
    border: 1.5px solid var(--TRESL---Primary-Blue, #1A6DB6);
    border-radius: 999px;
    color: var(--TRESL---Primary-Blue, #1A6DB6);
    text-align: center;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 15px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease;
}

.tresl-blog-archive__card-cta:hover {
    background: var(--TRESL---Primary-Blue, #1A6DB6);
    color: #fff;
}

.tresl-blog-archive__empty {
    margin: 40px 0;
    text-align: center;
    color: var(--tresl-muted);
}

/* ============================
 * PAGINATION
 * ============================ */
.tresl-blog-archive__pagination {
    margin: 48px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.tresl-blog-archive__pagination a,
.tresl-blog-archive__pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    font-family: 'Lato', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    color: var(--tresl-dark);
    border: 1px solid #d6dde3;
    background: #fff;
}

.tresl-blog-archive__pagination .current {
    background: var(--tresl-blue);
    color: #fff;
    border-color: var(--tresl-blue);
}

.tresl-blog-archive__pagination a:hover { background: #f0f5f9; }

/* ============================
 * RESPONSIVE
 * ============================ */
@media (max-width: 1024px) {
    .tresl-blog-archive__header { --header-h: 320px; }
    .tresl-blog-archive__header-content { padding: 100px 28px 64px; }
    .tresl-blog-archive__header-title { font-size: 44px; }

    .tresl-blog-archive__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }
}

@media (max-width: 720px) {
    .tresl-blog-archive__header { --header-h: 280px; }
    .tresl-blog-archive__header-content { padding: 100px 22px 48px; gap: 12px; }
    .tresl-blog-archive__header-title { font-size: 32px; }
    .tresl-blog-archive__header-desc  { font-size: 15px; }

    .tresl-blog-archive__filters { padding-top: 40px; }
    .tresl-blog-archive__filters-title { font-size: 22px; }

    .tresl-blog-archive__grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    /* On small screens, bump the title down slightly so the card body
       still fits comfortably; TRESL-H3 stays the same in tablet+. */
    .tresl-blog-archive__card-title { font-size: 22px; line-height: 1.15; }
}

@media (max-width: 480px) {
    .tresl-blog-archive__header-title { font-size: 26px; }
}
