/*
 * ============================================================
 * Segment Listing: gmp_gym_type archive (/marketing-for/) and
 * gmp_integration archive (/integrations/)  (v1.0.0)
 * Gym Marketing Pros. Loaded by inc/site-segment-listing.php on
 * the two post type archives only.
 * Sources: GMP-DSM-20261110 (colors as var(--awb-colorN); one local
 * exception, see section 3), GMP-RCM-20261115 (gmp-btn, gmp-eyebrow,
 * gmp-accent and the shared arrow icon are reused, never copied).
 * Designs: GMP Who We Work With, GMP Integrations. One stylesheet
 * for both: the two listings share everything but the card panel
 * (photo on Gym Types, white logo on Integrations) and the number
 * of columns (3 and 4).
 * Breakpoints: Small below 720px, Medium 720px, Large 1024px.
 *
 *  0. Page shell (Avada #main and .fusion-row, flex row rule)
 *  1. Shared pieces (inner wrap, label, arrow, H2)
 *  2. Hero
 *  3. Cards (cream band)
 *  4. Cross link and closing CTA
 *  5. Medium (720px and up)
 *  6. Large (1024px and up)
 *  7. Reduced motion
 *
 * :is(.gmp-segl, #gmp-unused) lifts a rule to ID level (the ID never
 * exists) so it beats Avada's heading, list and link rules without
 * !important. Heading font-size and line-height also carry
 * !important because Avada's responsive typography can write
 * heading sizes inline.
 *
 * Root colors, link underline reset, the small uppercase label and
 * the arrow icon come from the Template Primitives in
 * gmp-components.css (gmp-tpl, gmp-tpl-label, gmp-tpl-arrow) and
 * are not repeated here.
 * ============================================================
 */


/* ============================================================
 * 0. PAGE SHELL
 * ============================================================ */

html body.post-type-archive-gmp_gym_type #main#main,
html body.post-type-archive-gmp_integration #main#main {
    padding-top: 0;
    padding-right: 0;
    padding-bottom: 0;
    padding-left: 0;
}

html body.post-type-archive-gmp_gym_type #main#main > .fusion-row,
html body.post-type-archive-gmp_integration #main#main > .fusion-row {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

/* Avada Flex Row Rule: the root never grows past the row. */
html body.post-type-archive-gmp_gym_type #main#main > .fusion-row > .gmp-segl,
html body.post-type-archive-gmp_integration #main#main > .fusion-row > .gmp-segl {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

:is(.gmp-segl, #gmp-unused) :is(p, h1, h2, h3, ul) {
    margin: 0;
}

:is(.gmp-segl, #gmp-unused) ul {
    padding: 0;
    list-style: none;
}

:is(.gmp-segl, #gmp-unused) ul > li {
    margin: 0;
    padding: 0;
}

:is(.gmp-segl, #gmp-unused) ul > li::before {
    content: none;
}

:is(.gmp-segl, #gmp-unused) p {
    text-wrap: pretty;
}

:is(.gmp-segl, #gmp-unused) :is(h1, h2, h3) {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0;
    text-wrap: balance;
    overflow-wrap: anywhere;
}


/* ============================================================
 * 1. SHARED PIECES
 * ============================================================ */

:is(.gmp-segl, #gmp-unused) .gmp-segl__inner {
    box-sizing: border-box;
    max-width: 1792px;
    margin: 0 auto;
    padding-left: clamp(20px, 4vw, 56px);
    padding-right: clamp(20px, 4vw, 56px);
}

/* Section H2 (design: clamp(min(40px,11vw),4.6vw,76px), 0.9). */
:is(.gmp-segl, #gmp-unused) .gmp-segl-h2 {
    max-width: none;
    color: inherit;
    font-size: clamp(min(40px, 11vw), 4.6vw, 76px) !important;
    line-height: .9 !important;
}


/* ============================================================
 * 2. HERO
 * ============================================================ */

:is(.gmp-segl, #gmp-unused) .gmp-segl-hero__inner {
    padding-top: clamp(128px, 14vh, 160px);
    padding-bottom: clamp(88px, 10vw, 152px);
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-hero__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px clamp(40px, 5vw, 80px);
    align-items: end;
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-hero__title {
    max-width: none;
    color: var(--awb-color1);
    font-size: clamp(min(52px, 13.5vw), 6.6vw, 112px) !important;
    line-height: .88 !important;
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-hero__side {
    display: grid;
    gap: 24px;
    min-width: 0;
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-hero__intro {
    max-width: 68ch;
    font-size: 17px;
    line-height: 1.65;
    color: var(--awb-color11);
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}


/* ============================================================
 * 3. CARDS (cream band)
 * Card border #e4ddd7: DSM Color Inventory local exception for this
 * element ("Integration / niche card border on white cards").
 * ============================================================ */

:is(.gmp-segl, #gmp-unused) .gmp-segl-list {
    background: var(--awb-color3);
    color: var(--awb-color8);
    border-radius: clamp(28px, 4vw, 48px);
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-list__inner {
    padding-top: clamp(88px, 10vw, 152px);
    padding-bottom: clamp(88px, 10vw, 152px);
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-list__title {
    margin-bottom: clamp(40px, 5vw, 64px);
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(16px, 2vw, 24px);
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-grid__item {
    display: grid;
    min-width: 0;
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-card {
    box-sizing: border-box;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 14px;
    min-width: 0;
    padding: 12px 12px clamp(20px, 2.4vw, 28px);
    border: 1px solid #e4ddd7;
    border-radius: 24px;
    background: var(--awb-color1);
    color: var(--awb-color8);
    transition: border-color .2s, transform .25s;
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-card:is(:hover, :focus-visible) {
    border-color: var(--awb-color4);
    color: var(--awb-color8);
    transform: translateY(-3px);
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-card:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

/* Gym Types: photo panel (Image Placeholder Surface shows when there is no photo). */
:is(.gmp-segl, #gmp-unused) .gmp-segl-card__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 18px;
    background: var(--awb-color25);
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-card__img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    border-radius: 0;
    object-fit: cover;
    object-position: center;
}

/* Integrations: logo panel (Dark Card Surface); the logo is painted white. */
:is(.gmp-segl, #gmp-unused) .gmp-segl-card__panel {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 7;
    padding: 0 18%;
    border-radius: 18px;
    background: var(--awb-color7);
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-card__logo {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 56px;
    object-fit: contain;
    object-position: center;
    filter: brightness(0) invert(1);
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-card__title {
    margin: 6px 12px 0;
    padding: 0;
    color: inherit;
    font-size: clamp(28px, 2.6vw, 40px) !important;
    line-height: .92 !important;
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-card__text {
    margin: 0 12px;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--awb-color15);
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-card__p {
    margin: 0;
    font: inherit;
    color: inherit;
}

/* Two or more intro paragraphs keep a gap between them. */
:is(.gmp-segl--gym-type, #gmp-unused) .gmp-segl-card__text {
    display: grid;
    gap: .8em;
}

/* Always the last row, so it stays at the card bottom without intro text. */
:is(.gmp-segl, #gmp-unused) .gmp-segl-card__link {
    grid-row: 4;
    margin: 4px 12px 0;
    color: var(--awb-color9);
    overflow-wrap: anywhere;
}

/* Gym Types: block with an inline arrow. When a long name wraps, the
 * arrow follows the last word instead of sitting at the far edge. */
:is(.gmp-segl--gym-type, #gmp-unused) .gmp-segl-card__link {
    display: block;
}

:is(.gmp-segl--gym-type, #gmp-unused) .gmp-segl-card__link .gmp-tpl-arrow {
    display: inline-block;
    margin-left: 10px;
    vertical-align: -2px;
}

/* Integrations: label and arrow on one line. */
:is(.gmp-segl--integration, #gmp-unused) .gmp-segl-card__link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}


/* ============================================================
 * 4. CROSS LINK AND CLOSING CTA (black)
 * ============================================================ */

:is(.gmp-segl, #gmp-unused) .gmp-segl-close__inner {
    padding-top: clamp(88px, 10vw, 152px);
    padding-bottom: clamp(88px, 10vw, 152px);
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    color: var(--awb-color1);
    transition: color .25s;
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-more:is(:hover, :focus-visible) {
    color: var(--awb-color4);
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-more:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-cta {
    display: grid;
    justify-items: center;
    gap: 24px;
    margin-top: clamp(56px, 7vw, 96px);
    text-align: center;
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-cta--alone {
    margin-top: 0;
}

:is(.gmp-segl, #gmp-unused) .gmp-segl-cta__title {
    max-width: 18ch;
}

/* Full-width buttons below 720px (gmp-btn--full-sm) need their cell to
 * stretch, whatever wrapper Avada prints around the button. */
@media (max-width: 719px) {
    :is(.gmp-segl, #gmp-unused) .gmp-segl-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    :is(.gmp-segl, #gmp-unused) .gmp-segl-cta {
        justify-items: stretch;
    }

    :is(.gmp-segl, #gmp-unused) .gmp-segl-cta__title {
        justify-self: center;
    }
}


/* ============================================================
 * 5. MEDIUM (720px and up)
 * ============================================================ */

@media (min-width: 720px) {
    :is(.gmp-segl, #gmp-unused) .gmp-segl-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* A lone card in the last row fills it (design: span 1 / -1, 21:9). */
    :is(.gmp-segl, #gmp-unused) .gmp-segl-grid__item:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    :is(.gmp-segl, #gmp-unused) .gmp-segl-grid__item:last-child:nth-child(odd) .gmp-segl-card__media {
        aspect-ratio: 21 / 9;
    }

    :is(.gmp-segl, #gmp-unused) .gmp-segl-grid__item:last-child:nth-child(odd) .gmp-segl-card__panel {
        aspect-ratio: 21 / 9;
    }
}


/* ============================================================
 * 6. LARGE (1024px and up)
 * ============================================================ */

@media (min-width: 1024px) {
    :is(.gmp-segl, #gmp-unused) .gmp-segl-hero__row {
        grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
    }

    :is(.gmp-segl, #gmp-unused) .gmp-segl-hero__intro {
        max-width: 52ch;
    }

    :is(.gmp-segl--gym-type, #gmp-unused) .gmp-segl-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    :is(.gmp-segl--integration, #gmp-unused) .gmp-segl-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    :is(.gmp-segl, #gmp-unused) .gmp-segl-grid__item:last-child:nth-child(odd) {
        grid-column: auto;
    }

    :is(.gmp-segl, #gmp-unused) .gmp-segl-grid__item:last-child:nth-child(odd) .gmp-segl-card__media {
        aspect-ratio: 16 / 10;
    }

    /* A lone card after the rows of 3 fills the row (design: 32:9). */
    :is(.gmp-segl--gym-type, #gmp-unused) .gmp-segl-grid__item:last-child:nth-child(3n+1) {
        grid-column: 1 / -1;
    }

    :is(.gmp-segl, #gmp-unused) .gmp-segl-grid__item:last-child:nth-child(3n+1) .gmp-segl-card__media {
        aspect-ratio: 32 / 9;
    }

    :is(.gmp-segl, #gmp-unused) .gmp-segl-grid__item:last-child:nth-child(odd) .gmp-segl-card__panel {
        aspect-ratio: 16 / 7;
    }

    :is(.gmp-segl--integration, #gmp-unused) .gmp-segl-grid__item:last-child:nth-child(4n+1) {
        grid-column: 1 / -1;
    }

    :is(.gmp-segl, #gmp-unused) .gmp-segl-grid__item:last-child:nth-child(4n+1) .gmp-segl-card__panel {
        aspect-ratio: 32 / 9;
    }
}


/* ============================================================
 * 7. REDUCED MOTION
 * ============================================================ */

@media (prefers-reduced-motion: reduce) {
    :is(.gmp-segl, #gmp-unused) :is(.gmp-segl-card, .gmp-segl-more) {
        transition: none;
    }
}
