/* ============================================================
   VALUE PILLARS — CLEAN, GLOBAL-COMPATIBLE VERSION
============================================================ */

.value-pillars {
    width: 100%;
    padding-top: var(--section-padding-y);
    padding-bottom: var(--section-padding-y);
    background: var(--color-grey-light);
}

.value-pillars__inner {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding-left: var(--section-padding-x);
    padding-right: var(--section-padding-x);
    text-align: center;
}

/* ============================================================
   HEADING (Overrides global h2)
============================================================ */

.value-pillars h2.value-pillars__heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--font-h2);        /* global clamp */
    line-height: var(--lh-tight);
    color: var(--color-gold);
    margin-bottom: var(--space-md);
    text-align: center;
}

/* Optional: Slightly larger on large screens */
@media (min-width: 1500px) {
    .value-pillars h2.value-pillars__heading {
        font-size: 42px;
    }
}

/* ============================================================
   INTRO TEXT
============================================================ */

.value-pillars__intro p {
    max-width: var(--container-narrow);
    font-family: var(--font-body-family);
    font-size: var(--font-body);
    line-height: var(--lh-relaxed);
    color: var(--color-black);
    margin: 0 auto var(--space-lg);
    text-align: center;
}

/* ============================================================
   GRID — 5 columns desktop
============================================================ */

.value-pillars__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-lg);
    justify-items: center;
}

/* ============================================================
   ITEM
============================================================ */

.value-pillars__item {
    max-width: 240px;
    text-align: center;
}

/* ============================================================
   ICON
============================================================ */

.value-pillars__icon img {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-sm);
}

/* ============================================================
   PILLAR TITLE (Overrides global h3)
============================================================ */

.value-pillars h3.value-pillars__title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--font-h4);
    color: var(--color-purple);
    margin-bottom: var(--space-xs);
    text-align: center;
}

/* ============================================================
   PILLAR DESCRIPTION
============================================================ */

.value-pillars__desc p {
    font-family: var(--font-body-family);
    font-size: var(--font-small);
    line-height: var(--lh-normal);
    color: var(--color-black);
    max-width: 240px;
    margin: 0 auto;
    text-align: center;
}

/* ============================================================
   MOBILE + TABLET
============================================================ */

@media (max-width: 900px) {

    .value-pillars__grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .value-pillars__item {
        max-width: 260px;
    }

    .value-pillars h2.value-pillars__heading {
        font-size: var(--font-h3); /* clean mobile scale */
    }

    .value-pillars__icon img {
        width: 56px;
        height: 56px;
    }

    .value-pillars {
        padding-top: var(--space-lg);
        padding-bottom: var(--space-lg);
    }
}

/* ============================================================
   COLOR VARIANTS (ACF)
============================================================ */

.value-pillars--bg-purple {
    background: var(--color-purple);
}

.value-pillars--text-white h2.value-pillars__heading,
.value-pillars--text-white .value-pillars__intro p,
.value-pillars--text-white h3.value-pillars__title,
.value-pillars--text-white .value-pillars__desc p {
    color: var(--color-white);
}

.value-pillars--text-white .value-pillars__icon img {
    filter: brightness(0) invert(1);
}

/* ============================================================
   DESKTOP HOVER EFFECT
============================================================ */

@media (min-width: 901px) {
    .value-pillars__icon {
        transition: transform 0.3s ease;
    }
    .value-pillars__icon:hover {
        transform: translateY(-8px);
    }
}

/* ============================================================
   VALUE PILLARS — GLOBAL-COMPATIBLE UPGRADE
   (Icons, alignment, animation, typography sync)
============================================================ */

/* Stay fully centered and responsive */
.value-pillars__item {
    max-width: 240px;
    text-align: center;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ============================================================
   ICONS — MATCH FEATURES BLOCK EXACTLY
============================================================ */

.value-pillars__icon {
    width: 85px;        /* same as features block desktop */
    height: 85px;
    margin: 0 auto var(--space-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.25s ease; /* allows hover pop */
}

.value-pillars__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Desktop hover animation */
@media (min-width: 1025px) {
    .value-pillars__icon:hover {
        transform: scale(1.08);
    }
}

/* Tablet sizes */
@media (max-width: 1024px) {
    .value-pillars__icon {
        width: 70px;
        height: 70px;
    }
}

/* Mobile sizes */
@media (max-width: 768px) {
    .value-pillars__icon {
        width: 60px;
        height: 60px;
    }
}

/* ============================================================
   TYPOGRAPHY — FORCE GLOBAL FONT VARIABLES
============================================================ */

.value-pillars__heading {
    font-family: var(--font-heading);
    font-size: var(--font-h2);
    line-height: var(--lh-tight);
    font-weight: 700;
    color: var(--color-gold);
    margin-bottom: var(--space-md);
    text-align: center;
}

@media (max-width: 1024px) {
    .value-pillars__heading {
        font-size: var(--font-h3);
    }
}

/* Pillar item title */
.value-pillars__title {
    font-family: var(--font-heading);
    font-size: var(--font-h4);
    font-weight: 700;
    line-height: var(--lh-normal);
    color: var(--color-purple);
    margin-bottom: var(--space-xs);
    text-align: center;
}

/* Pillar description */
.value-pillars__desc p {
    font-family: var(--font-body-family);
    font-size: var(--font-small);
    line-height: var(--lh-relaxed);
    color: var(--color-black);
    max-width: 240px;
    margin: 0 auto;
    text-align: center;
}

/* ============================================================
   GRID LAYOUT — UPDATED FOR PERFECT RESPONSIVENESS
============================================================ */

.value-pillars__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-lg);
    justify-items: center;
    width: 100%;
}

/* Tablet — 3 columns */
@media (max-width: 1100px) {
    .value-pillars__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile — 1 column */
@media (max-width: 768px) {
    .value-pillars__grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   COLOR MODES (unchanged, cleaned)
============================================================ */

.value-pillars--text-white .value-pillars__heading,
.value-pillars--text-white .value-pillars__intro p,
.value-pillars--text-white .value-pillars__title,
.value-pillars--text-white .value-pillars__desc p {
    color: var(--color-white);
}

.value-pillars--text-white .value-pillars__icon img {
    filter: brightness(0) invert(1);
}

/* VALUE PILLARS — UPGRADED HEADING SIZE */
.value-pillars__heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 42px;           /* Larger desktop size (same as Features block) */
    line-height: 1.2;
    color: var(--color-gold);
    margin-bottom: var(--space-md);
    text-align: center;
}

/* Tablet */
@media (max-width: 1024px) {
    .value-pillars__heading {
        font-size: 34px;       /* matches Features h2 tablet scale */
    }
}

/* Mobile */
@media (max-width: 768px) {
    .value-pillars__heading {
        font-size: 28px;       /* matches Features mobile scale */
    }
}

/* VALUE PILLARS — MATCH DESCRIPTION FONT TO INTRO TEXT */
.value-pillars__desc p {
    font-family: var(--font-body-family);
    font-size: var(--font-body);          /* match intro paragraph */
    line-height: var(--lh-relaxed);       /* match intro paragraph */
    color: var(--color-black);
    max-width: 240px;                     /* keep pillar width */
    margin: 0 auto;
    text-align: center;
}

/* Tablet & mobile — still match global font sizes */
@media (max-width: 1024px) {
    .value-pillars__desc p {
        font-size: var(--font-body);
    }
}

/* Mobile (bigger heading) */
@media (max-width: 768px) {
    .value-pillars__heading {
        font-size: 32px;   /* was 28px */
        margin-bottom: var(--space-md);
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .value-pillars__heading {
        font-size: 30px;   /* was 28px */
    }
}

/* Base (unchanged) */
.value-pillars h2.value-pillars__heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--font-h2); /* global clamp */
    line-height: var(--lh-tight);
    color: var(--color-gold);
    margin-bottom: var(--space-md);
    text-align: center;
}

/* Optional larger screens (unchanged) */
@media (min-width: 1500px) {
    .value-pillars h2.value-pillars__heading {
        font-size: 42px;
    }
}

/* -------------------------------------------
   TABLET — bump size up slightly
   (matches the visual weight of desktop)
------------------------------------------- */
@media (max-width: 1024px) and (min-width: 769px) {
    .value-pillars h2.value-pillars__heading {
        font-size: 34px; 
    }
}

/* -------------------------------------------
   MOBILE — slightly smaller than before,
   still bigger than the original global h3
------------------------------------------- */
@media (max-width: 768px) {
    .value-pillars h2.value-pillars__heading {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .value-pillars h2.value-pillars__heading {
        font-size: 26px;
    }
}

/* ============================================================
   VALUE PILLARS — GLOBAL HEADING SYSTEM (Final Clean Version)
   Matches Contact Us and Content Split blocks exactly
============================================================ */

.value-pillars h2.value-pillars__heading {
    font-family: var(--font-heading);
    font-size: var(--font-h2);      /* Global heading size */
    font-weight: 700;
    line-height: var(--lh-tight);
    color: var(--color-gold);
    text-align: center;
    margin-bottom: var(--space-md);
}

/* Tablet + Mobile — no size change, only alignment if needed */
@media (max-width: 1024px) {
    .value-pillars h2.value-pillars__heading {
        font-size: var(--font-h2);  /* Stay consistent across screens */
        text-align: center;
    }
}

/* FINAL OVERRIDE — Make Value Pillars intro copy 820px wide */
.value-pillars__intro p {
    max-width: 820px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
}

/* Make all pillar titles the same height to prevent misalignment */
.value-pillars__title {
    min-height: 68px; /* adjust this value depending on your font size */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ============================================================
   VALUE PILLARS — SMALLER ICONS (match Approach + How We Work)
============================================================ */

.value-pillars__icon {
    width: 70px !important;   /* Desktop */
    height: 70px !important;
    margin: 0 auto var(--space-sm) !important;
}

@media (max-width: 1024px) {
    .value-pillars__icon {
        width: 60px !important; 
        height: 60px !important;
    }
}

@media (max-width: 768px) {
    .value-pillars__icon {
        width: 50px !important; 
        height: 50px !important;
    }
}

/* ============================================================
   VALUE PILLARS — SMALLER TITLES (match Approach Block)
============================================================ */

.value-pillars__title {
    font-family: var(--font-heading) !important;
    font-size: 20px !important;   /* Desktop */
    font-weight: 700 !important;
    color: var(--color-purple) !important;
    line-height: 1.3 !important;
    margin-bottom: var(--space-xs) !important;

    /* preserve your equal-height alignment */
    min-height: 68px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

@media (max-width: 1024px) {
    .value-pillars__title {
        font-size: 18px !important;
        min-height: 60px !important;
    }
}

@media (max-width: 768px) {
    .value-pillars__title {
        font-size: 16px !important;
        min-height: 50px !important;
    }
}

/* ============================================================
   VALUE PILLARS — FORCE PYRAMID LAYOUT ON TABLET (768–1024px)
   FINAL OVERRIDE — NOTHING ABOVE CAN OVERRIDE THIS
============================================================ */
@media (min-width: 768px) and (max-width: 1024px) {

    /* Force grid to 3 columns */
    .value-pillars__grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        width: 100% !important;
        justify-items: center !important;
        align-items: start !important;
        row-gap: 60px !important;
        column-gap: 40px !important;
    }

    /* Top row: items 1, 2, 3 */
    .value-pillars__item:nth-child(1),
    .value-pillars__item:nth-child(2),
    .value-pillars__item:nth-child(3) {
        grid-column: auto !important;
        grid-row: 1 !important;
    }

    /* Bottom row: item 4 sits between col 1 & 2 */
    .value-pillars__item:nth-child(4) {
        grid-column: 1 / 3 !important; /* spans from col 1 → 2 */
        justify-self: end !important;
        padding-right: 40px;
    }

    /* Bottom row: item 5 sits between col 2 & 3 */
    .value-pillars__item:nth-child(5) {
        grid-column: 2 / 4 !important; /* spans from col 2 → 3 */
        justify-self: start !important;
        padding-left: 40px;
    }
}

/* ============================================================
   FORCE BOTTOM TWO VALUE PILLARS INTO THE SAME ROW (TABLET ONLY)
============================================================ */
@media (min-width: 768px) and (max-width: 1024px) {

    /* The two bottom items must ALWAYS sit on row 2 */
    .value-pillars__item:nth-child(4),
    .value-pillars__item:nth-child(5) {
        grid-row: 2 !important;
    }

    /* Column alignment for pyramid */
    .value-pillars__item:nth-child(4) {
        grid-column: 1 / 3 !important; /* left + middle gap */
        justify-self: end !important;
    }

    .value-pillars__item:nth-child(5) {
        grid-column: 2 / 4 !important; /* middle gap + right */
        justify-self: start !important;
    }

    /* Ensure top row stays row 1 */
    .value-pillars__item:nth-child(1),
    .value-pillars__item:nth-child(2),
    .value-pillars__item:nth-child(3) {
        grid-row: 1 !important;
    }
}


