/* ============================================================
   MIPB — Tools Grid
   Used by [mipb_tools_grid] shortcode + front-page injection
   Each group passes --mtg-color and --mtg-rgb via inline style.
   ============================================================ */

/* ── Smooth scroll for TOC anchor links ───────────────────── */
html {
    scroll-behavior: smooth;
}

/* ── Suppress injected page title + spacing on /tools/ page ── */
/* body.mipb-tools-page is added by a body_class filter so      */
/* these rules only fire on /tools/ and nowhere else.           */
body.mipb-tools-page .oxy-post-title,
body.mipb-tools-page h1:empty {
    display: none !important;
    margin: 0 !important;
}
body.mipb-tools-page .oxy-post-content,
body.mipb-tools-page .entry-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* ── Section wrapper — clean, neutral ─────────────────────── */
.mtg-section {
    background: #fff;
    padding: 4.5rem 1.5rem 5rem;
    width: 100%;
    box-sizing: border-box;
    border-top: 1px solid #e8e8e8;
}

.mtg-inner {
    max-width: 1140px;
    margin: 0 auto;
}

/* ── Section header — impactful hero treatment ────────────── */
.mtg-header {
    text-align: center;
    margin-bottom: 2.8rem;
}

.mtg-heading {
    font-size: 2.2rem;
    font-weight: 800;
    color: #111;
    margin: 0 0 0.6rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.mtg-subheading {
    font-size: 1.05rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* ── Table of Contents — refined pill navigation ──────────── */
.mtg-toc {
    background: #fafafa;
    border: 1px solid #eaeaea;
    border-radius: 16px;
    padding: 1.2rem 1.8rem 1.3rem;
    margin-bottom: 3.2rem;
    text-align: center;
}

.mtg-toc-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #9ca3af;
    margin: 0 0 .75rem;
}

.mtg-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .55rem;
    justify-content: center;
}

.mtg-toc-list li {
    margin: 0;
}

.mtg-toc-link {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--toc-color, #2e7d32);
    text-decoration: none;
    background: rgba(var(--toc-rgb, 46,125,50), 0.06);
    border: 1px solid rgba(var(--toc-rgb, 46,125,50), 0.15);
    border-radius: 100px;
    padding: .35rem .95rem;
    transition: all .2s ease;
}

.mtg-toc-link:hover {
    background: var(--toc-color, #2e7d32);
    border-color: var(--toc-color, #2e7d32);
    color: #fff;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(var(--toc-rgb, 46,125,50), 0.25);
}

/* ── Featured / priority TOC buttons ─────────────────────────── */
/* Ingredient Lookup, Calorie Calculator, DRI Calculator,
   Glycemic Index, Ingredient Prices — shown larger and bolder    */
.mtg-toc-link--featured {
    font-size: 0.92rem;
    font-weight: 700;
    padding: .5rem 1.3rem;
    border-width: 1.5px;
    border-style: solid;
    background: rgba(var(--toc-rgb, 46,125,50), 0.09);
    letter-spacing: 0.01em;
}
.mtg-toc-link--featured:hover {
    box-shadow: 0 3px 12px rgba(var(--toc-rgb, 46,125,50), 0.32);
    transform: translateY(-1px);
}

/* ── Separator between priority and alphabetical buttons ─────── */
.mtg-toc-sep {
    width: 100%;
    height: 0;
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: .45rem 0 .15rem;
    padding: 0;
    list-style: none;
}

/* ── Group ────────────────────────────────────────────────── */
.mtg-group {
    margin-bottom: 1.4rem;
    scroll-margin-top: 80px;
    padding: 2.4rem 2rem;
    border-radius: 16px;
    background: rgba(var(--mtg-rgb, 46,125,50), 0.03);
}

.mtg-group:last-child {
    margin-bottom: 0;
}

/* ── Single-card groups: let the card stretch wider ───────── */
.mtg-group--solo .mtg-card {
    max-width: 600px;
    flex: 1 1 400px;
}

/* ── Group label — clean, modern ──────────────────────────── */
.mtg-group-label {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--mtg-color, #2e7d32);
    text-align: center;
    margin-bottom: .45rem;
    position: relative;
    padding-bottom: .5rem;
}

.mtg-group-label::after {
    content: '';
    display: block;
    width: 2rem;
    height: 2.5px;
    background: var(--mtg-color, #2e7d32);
    border-radius: 2px;
    margin: .35rem auto 0;
    opacity: 0.7;
}

/* ── Group description ────────────────────────────────────── */
.mtg-group-desc {
    font-size: 0.87rem;
    color: #6b7280;
    margin: 0 auto 1rem;
    line-height: 1.6;
    max-width: 680px;
    text-align: center;
}

/* ── Card grid ────────────────────────────────────────────── */
.mtg-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
    justify-content: center;
}

/* ── Card — elevated, premium feel with left accent bar ──── */
.mtg-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 3px solid rgba(var(--mtg-rgb, 46,125,50), 0.35);
    border-radius: 14px;
    padding: 1.2rem 1.25rem 1.05rem;
    text-decoration: none !important;
    color: inherit !important;
    transition: all .22s ease;
    cursor: pointer;
    flex: 1 1 300px;
    max-width: 460px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.03);
}

.mtg-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,.08), 0 2px 8px rgba(var(--mtg-rgb, 46,125,50), 0.1);
    transform: translateY(-2px);
    border-color: rgba(var(--mtg-rgb, 46,125,50), 0.2);
    border-left-color: var(--mtg-color, #2e7d32);
}

/* ── Icon bubble ──────────────────────────────────────────── */
.mtg-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    background: rgba(var(--mtg-rgb, 46,125,50), 0.08);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    line-height: 1;
    color: var(--mtg-color, #2e7d32);
    transition: background .2s ease, transform .2s ease;
}

.mtg-card:hover .mtg-icon {
    background: rgba(var(--mtg-rgb, 46,125,50), 0.14);
    transform: scale(1.08);
}

/* SVG icon sizing inside the bubble */
.mtg-icon svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

/* ── Card body ────────────────────────────────────────────── */
.mtg-body {
    flex: 1;
    min-width: 0;
}

.mtg-card-title {
    font-size: 0.93rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.3rem;
    line-height: 1.3;
}

.mtg-card-desc {
    font-size: 0.82rem;
    color: #6b7280;
    margin: 0 0 0.6rem;
    line-height: 1.55;
}

.mtg-cta {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--mtg-color, #2e7d32);
    letter-spacing: .01em;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    transition: gap .2s ease;
}

.mtg-card:hover .mtg-cta {
    gap: .4rem;
    text-decoration: none;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 700px) {
    .mtg-section {
        padding: 2.5rem 1rem 3rem;
    }

    .mtg-heading {
        font-size: 1.6rem;
    }

    .mtg-subheading {
        font-size: 0.95rem;
    }

    .mtg-group {
        padding: 1.8rem 1rem;
    }

    .mtg-grid {
        flex-direction: column;
    }

    .mtg-card {
        max-width: 100%;
        flex: 0 1 auto;
    }

    .mtg-group--solo .mtg-card {
        max-width: 100%;
        flex: 0 1 auto;
    }

    .mtg-toc {
        padding: .85rem 1rem 1rem;
    }

    .mtg-toc-list {
        gap: .35rem .5rem;
    }

    .mtg-group-label {
        font-size: 1.05rem;
    }
}
