/* ══════════════════════════════════════════════
   Blog Archive & Category Archive Styles
   Matches Thrivemattic design system:
   Fonts: Oswald (headings), Lato (body), Inter (buttons/forms)
   ══════════════════════════════════════════════ */

.tm-blog-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ── Hero ── */
.tm-blog-hero {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background-color: #000;
    background-size: cover;
    background-position: center;
}

.tm-blog-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.97) 0%, rgba(0,0,0,0.8) 45%, rgba(0,0,0,0.55) 100%);
    pointer-events: none;
}

.tm-blog-hero__link {
    display: block;
    width: 100%;
    text-decoration: none !important;
    color: inherit !important;
}

.tm-blog-hero__content {
    position: relative;
    z-index: 2;
    padding: 60px 15px 64px;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.tm-blog-hero__label {
    display: inline-block;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #fff;
    margin-bottom: 16px;
}

.tm-blog-hero__badge {
    display: inline-block;
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 16px;
    border-radius: 30px;
    margin-bottom: 16px;
    margin-left: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tm-blog-hero__title {
    font-family: 'Oswald', sans-serif !important;
    font-size: 48px !important;
    font-weight: bold !important;
    color: #fff !important;
    line-height: 60px !important;
    margin-bottom: 18px !important;
    max-width: 780px;
    padding: 0 !important;
}

.tm-blog-hero__excerpt {
    font-family: 'Lato', sans-serif;
    font-size: 18px;
    color: #fff;
    line-height: 32px;
    max-width: 620px;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tm-blog-hero__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 28px;
}

.tm-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #F08B63;
    display: inline-block;
}

.tm-blog-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #000;
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 36px;
    border-radius: 30px;
    border: 2px solid #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tm-blog-hero__link:hover .tm-blog-hero__cta {
    background: transparent;
    color: #fff;
    border-color: #fff;
}

/* ── Category Filter Pills ── */
.tm-blog-filters {
    padding: 40px 0 16px;
    background: #F5F5F5;
}

.tm-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.tm-filter-pill {
    display: inline-block;
    padding: 8px 22px;
    border-radius: 30px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #ddd;
    background: #fff;
    color: #454545 !important;
}

.tm-filter-pill:hover {
    border-color: #000;
    color: #000 !important;
    background: #fff;
    text-decoration: none !important;
}

.tm-filter-pill--active,
.tm-filter-pill--active:hover {
    background: #000;
    color: #fff !important;
    border-color: #000;
}

/* ── Blog Grid ── */
.tm-blog-grid-section {
    padding: 32px 0 60px;
    background: #F5F5F5;
}

.tm-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 1024px) {
    .tm-blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .tm-blog-grid { grid-template-columns: 1fr; }
}

.tm-blog-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-decoration: none !important;
    color: inherit !important;
    display: flex;
    flex-direction: column;
}

.tm-blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(0,0,0,0.12);
    text-decoration: none !important;
    color: inherit !important;
}

.tm-card-image {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.tm-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tm-card-image__placeholder {
    width: 100%;
    height: 100%;
}

/* Gradient backgrounds for placeholder images */
.tm-gradient--marketing-research { background: linear-gradient(135deg, #1a1a2e 0%, #e94560 100%); }
.tm-gradient--marketing-strategy { background: linear-gradient(135deg, #0f3460 0%, #00d2d3 100%); }
.tm-gradient--campaign-management { background: linear-gradient(135deg, #1a1a2e 0%, #f5a623 100%); }
.tm-gradient--website-optimisation { background: linear-gradient(135deg, #16213e 0%, #8b5cf6 100%); }
.tm-gradient--artificial-intelligence { background: linear-gradient(135deg, #16213e 0%, #3b82f6 100%); }

/* Category badge colors */
.tm-badge--marketing-research { background: #e94560; color: #fff; }
.tm-badge--marketing-strategy { background: #00d2d3; color: #000; }
.tm-badge--campaign-management { background: #f5a623; color: #000; }
.tm-badge--website-optimisation { background: #8b5cf6; color: #fff; }
.tm-badge--artificial-intelligence { background: #3b82f6; color: #fff; }

.tm-card-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    font-family: 'Lato', sans-serif;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 30px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tm-card-body {
    padding: 20px 20px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tm-card-title {
    font-family: 'Oswald', sans-serif !important;
    font-size: 20px !important;
    font-weight: 500 !important;
    color: #000 !important;
    line-height: 1.35 !important;
    margin-bottom: 10px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 0 !important;
}

.tm-card-excerpt {
    font-family: 'Lato', sans-serif;
    font-size: 15px;
    color: #454545;
    line-height: 26px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    margin: 0;
    padding-bottom: 0;
}

.tm-card-footer {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #575760;
    border-top: 1px solid #eee;
    margin-top: 16px;
}

/* ── Pagination ── */
.tm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 20px 0 60px;
    background: #F5F5F5;
}

.tm-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 4px;
    border-radius: 30px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #454545;
    text-decoration: none !important;
    transition: all 0.3s ease;
    border: 2px solid #ddd;
    background: #fff;
    cursor: pointer;
}

.tm-page-btn:hover {
    border-color: #000;
    color: #000;
    text-decoration: none !important;
}

.tm-page-btn--active,
.tm-page-btn--active:hover {
    background: #000;
    color: #fff !important;
    border-color: #000;
    font-weight: 700;
}

.tm-pagination .dots {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #575760;
    font-size: 14px;
    letter-spacing: 2px;
}

/* ── Newsletter CTA ── */
.tm-newsletter {
    background: #000;
    padding: 80px 15px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tm-newsletter h2 {
    font-family: 'Oswald', sans-serif !important;
    font-size: 48px !important;
    font-weight: bold !important;
    color: #fff !important;
    line-height: 60px !important;
    margin-bottom: 16px !important;
    position: relative;
}

.tm-newsletter__sub {
    font-family: 'Lato', sans-serif;
    font-size: 18px;
    color: rgba(255,255,255,0.6);
    max-width: 560px;
    margin: 0 auto 36px;
    line-height: 32px;
    position: relative;
    padding-bottom: 0;
}

.tm-newsletter__form {
    max-width: 480px;
    margin: 0 auto 16px;
    position: relative;
}

/* CF7 form styling within newsletter section */
.tm-newsletter__form .wpcf7-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.tm-newsletter__form .wpcf7-form > p {
    margin: 0 !important;
}

.tm-newsletter__form .wpcf7-form > p:first-child {
    flex: 1;
    min-width: 0;
}

.tm-newsletter__form .wpcf7-form br {
    display: none;
}

.tm-newsletter__form .wpcf7-form input[type="email"],
.tm-newsletter__form .wpcf7-form .wpcf7-email {
    width: 100% !important;
    padding: 14px 20px !important;
    border: 2px solid rgba(255,255,255,0.15) !important;
    border-radius: 30px !important;
    background: rgba(255,255,255,0.06) !important;
    color: #fff !important;
    font-family: 'Lato', sans-serif !important;
    font-size: 16px !important;
    outline: none !important;
    transition: border-color 0.3s;
    box-shadow: none !important;
    height: auto !important;
    line-height: normal !important;
}

.tm-newsletter__form .wpcf7-form input[type="email"]::placeholder {
    color: rgba(255,255,255,0.35);
}

.tm-newsletter__form .wpcf7-form input[type="email"]:focus {
    border-color: #F08B63 !important;
    background: rgba(255,255,255,0.1) !important;
}

.tm-newsletter__form .wpcf7-form input[type="submit"],
.tm-newsletter__form .wpcf7-form .wpcf7-submit,
.tm-newsletter__form .wpcf7-form .cf7-submit {
    padding: 14px 28px !important;
    background: #F08B63 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 30px !important;
    font-family: 'Lato', sans-serif !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    width: auto !important;
    height: auto !important;
    line-height: normal !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tm-newsletter__form .wpcf7-form input[type="submit"]:hover,
.tm-newsletter__form .wpcf7-form .wpcf7-submit:hover {
    background: #e07a53 !important;
    transform: translateY(-1px);
}

/* Hide honeypot */
.tm-newsletter__form .wpcf7-form p[style*="height: 0px"] {
    display: none !important;
}

/* Show recaptcha within newsletter form */
.tm-newsletter__form .wpcf7-form div[style*="margin-top: -20px"] {
    margin-top: 0 !important;
    width: 100%;
    display: flex;
    justify-content: center;
}

.tm-newsletter__form .wpcf7-response-output {
    color: #fff !important;
    border-color: rgba(255,255,255,0.2) !important;
    margin: 12px 0 0 !important;
    font-size: 14px;
    font-family: 'Lato', sans-serif;
    width: 100%;
}

.tm-newsletter__trust {
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    color: rgba(255,255,255,0.35);
    position: relative;
    margin: 0;
    padding-bottom: 0;
}

@media (max-width: 500px) {
    .tm-newsletter__form .wpcf7-form {
        flex-direction: column;
    }
    .tm-newsletter__form .wpcf7-form .cf7_submit_btn,
    .tm-newsletter__form .wpcf7-form .cf7_submit_btn_full_width {
        width: 100% !important;
    }
    .tm-newsletter__form .wpcf7-form input[type="submit"],
    .tm-newsletter__form .wpcf7-form .cf7-submit {
        width: 100% !important;
    }
}

/* ── Project CTA ── */
.tm-project-cta {
    padding: 80px 15px;
    text-align: center;
    background: #F8F7F4;
}

.tm-project-cta h2 {
    font-family: 'Oswald', sans-serif !important;
    font-size: 48px !important;
    font-weight: bold !important;
    color: #000 !important;
    line-height: 60px !important;
    margin-bottom: 14px !important;
}

.tm-project-cta__sub {
    font-family: 'Lato', sans-serif;
    font-size: 18px;
    color: #454545;
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 32px;
    padding-bottom: 0;
}

.tm-project-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 36px;
    background: #000;
    color: #fff !important;
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    font-weight: 500;
    border-radius: 30px;
    border: 2px solid #000;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.tm-project-cta__btn:hover {
    background: transparent;
    color: #000 !important;
    transform: translateY(-2px);
    text-decoration: none !important;
}

/* ── Empty state ── */
.tm-blog-empty {
    text-align: center;
    padding: 80px 0;
}

.tm-blog-empty p {
    font-family: 'Lato', sans-serif;
    font-size: 18px;
    color: #575760;
}

/* ── Responsive ── */
@media (max-width: 980px) {
    .tm-blog-hero { min-height: 440px; }
    .tm-blog-hero__content { padding: 48px 15px 48px; }
    .tm-blog-hero__title {
        font-size: 32px !important;
        line-height: 50px !important;
    }
    .tm-blog-hero__excerpt {
        font-size: 16px;
        line-height: 28px;
    }
    .tm-newsletter h2,
    .tm-project-cta h2 {
        font-size: 25px !important;
        line-height: 45px !important;
    }
    .tm-newsletter__sub,
    .tm-project-cta__sub {
        font-size: 16px;
        line-height: 28px;
    }
    .tm-newsletter { padding: 48px 15px; }
    .tm-project-cta { padding: 48px 15px; }
    .tm-filter-row { gap: 8px; }
    .tm-filter-pill { padding: 6px 16px; font-size: 13px; }
}

@media (max-width: 640px) {
    .tm-blog-hero { min-height: 380px; }
    .tm-blog-hero__content { padding: 36px 15px 40px; }
    .tm-blog-hero__title {
        font-size: 25px !important;
        line-height: 40px !important;
    }
    .tm-blog-hero__excerpt {
        font-size: 15px;
        line-height: 26px;
    }
    .tm-blog-hero__cta {
        font-size: 14px;
        padding: 10px 28px;
    }
    .tm-card-title {
        font-size: 18px !important;
    }
    .tm-blog-grid-section { padding: 24px 0 40px; }
}

/* ── Override GeneratePress/Divi defaults for blog & category pages ── */
.page-template-page-blog .site-content,
.page-template-page-blog #content,
.category .site-content,
.category #content {
    padding: 0 !important;
    margin: 0 !important;
}

.page-template-page-blog .inside-article,
.category .inside-article {
    padding: 0 !important;
    margin: 0 !important;
}

.page-template-page-blog .entry-header,
.page-template-page-blog .page-header,
.category .entry-header,
.category .page-header {
    display: none;
}

.page-template-page-blog #primary,
.category #primary {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

.page-template-page-blog #right-sidebar,
.page-template-page-blog .widget-area,
.page-template-page-blog aside#right-sidebar,
.category #right-sidebar,
.category .widget-area,
.category aside#right-sidebar {
    display: none !important;
}

.page-template-page-blog .site-main > .inside-article > .entry-content,
.category .site-main > .inside-article > .entry-content {
    margin: 0 !important;
    padding: 0 !important;
}

.page-template-page-blog .container.grid-container,
.category .container.grid-container {
    max-width: 100% !important;
    padding: 0 !important;
}

/* Hide Divi builder wrappers */
.page-template-page-blog #et-boc,
.page-template-page-blog .et-l {
    padding: 0 !important;
    margin: 0 !important;
}

.page-template-page-blog .et_pb_section {
    display: none !important;
}

/* Category archive: hide GeneratePress default archive elements */
.category .generate-columns-container,
.category .paging-navigation {
    display: none !important;
}

/* ── Fix Divi injecting et-boc wrappers inside grid ── */
.tm-blog-grid > #et-boc,
.tm-blog-grid > #et-boc > #et_builder_outer_content,
.tm-blog-grid #et-boc,
.tm-blog-grid #et_builder_outer_content {
    display: contents !important;
}

/* ── Grid layout fix: stronger specificity to override GeneratePress ── */
.page-template-page-blog .tm-blog-grid,
.category .tm-blog-grid,
body .tm-blog-grid-section .tm-blog-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px !important;
}

@media (max-width: 1024px) {
    .page-template-page-blog .tm-blog-grid,
    .category .tm-blog-grid,
    body .tm-blog-grid-section .tm-blog-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 640px) {
    .page-template-page-blog .tm-blog-grid,
    .category .tm-blog-grid,
    body .tm-blog-grid-section .tm-blog-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Ensure cards don't stretch full width */
.category .tm-blog-card,
body .tm-blog-grid .tm-blog-card {
    width: auto !important;
    max-width: 100% !important;
    float: none !important;
}


