/*
 * Partners redesign: hub (page-partners-new.php) and single partner (single-partners.php).
 * Figma "Partners" page 23224:40733 (file TtcElVBB8zSMtMk2WR2VFf).
 * Text sizes come from the global sd-type-* classes; this file holds layout, colours and the
 * few one-off styles with no global token (15px category tabs, rich text of partner content).
 * Breakpoints: 1023px (tablet step), 767px (phones, Figma 390 frames).
 */

.ptn-page {
    --ptn-text: #262626;
    --ptn-secondary: rgba(0, 0, 0, .75);
    --ptn-tertiary: rgba(0, 0, 0, .55);
    --ptn-border: rgba(0, 0, 0, .1);
    --ptn-sand: #faf7f5;
    --ptn-header: 80px;
    background: #fff;
    color: var(--ptn-text);
}

.ptn-page p,
.ptn-page h1,
.ptn-page h2,
.ptn-page h3 {
    margin: 0;
}

/* Hero (hub) */

.ptn-page .ptn-hero {
    padding: 24px 64px;
}

.ptn-hero__card {
    position: relative;
    display: flex;
    align-items: flex-end;
    box-sizing: border-box;
    max-width: 1200px;
    min-height: 480px;
    margin: 0 auto;
    padding: 48px;
    overflow: hidden;
    border-radius: 12px;
    background: #1a1a1a;
}

.ptn-hero__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Figma: linear gradient #1a1a1a 0 -> 100%, layer opacity 80%, top-centre to bottom-left. */
.ptn-hero__card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(233.1deg, rgba(26, 26, 26, 0) 38.452%, rgba(26, 26, 26, .8) 100%);
    pointer-events: none;
}

.ptn-hero__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    max-width: 560px;
}

.ptn-hero__eyebrow.ptn-hero__eyebrow {
    color: rgba(255, 255, 255, .8) !important;
}

.ptn-hero__copy {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ptn-hero__title.ptn-hero__title {
    color: #fff;
}

.ptn-hero__text.ptn-hero__text {
    max-width: 420px;
    color: #e5e5e5;
}

/* Directory (hub): sticky category tabs + 2-column card grid */

.ptn-page .ptn-directory {
    padding: 24px 64px 80px;
}

.ptn-directory__container {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    column-gap: 80px;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

/* Category tabs = the global tabs component (.sd-tabs / .sd-tab in css/style.min.css,
   behaviour in js/sd-tabs.js). Only layout lives here, never tab colours/padding/type. */
.ptn-directory .ptn-tabs {
    position: sticky;
    top: calc(var(--ptn-header) + 24px);
    padding-top: 24px;
}

.ptn-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    padding-top: 24px;
}

/* Cards = the global resource card (template-parts/components/resource-card), cover
   variant. Only the grids live here, never card colours/borders/type. */

/* Single partner: breadcrumbs */

.ptn-breadcrumbs {
    padding: 32px 64px;
}

.ptn-breadcrumbs__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    max-width: 1200px;
    margin: 0 auto;
    color: var(--ptn-secondary);
}

.ptn-breadcrumbs__link {
    color: var(--ptn-secondary);
    text-decoration: none;
}

.ptn-breadcrumbs__link:hover {
    color: var(--ptn-text);
    text-decoration: underline;
}

.ptn-breadcrumbs__sep {
    color: var(--ptn-tertiary);
}

/* Single partner: profile card + About */

.ptn-page .ptn-article {
    padding: 16px 64px 80px;
}

.ptn-article__layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    column-gap: 64px;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

.ptn-profile {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    background: #fff;
}

.ptn-profile__cover {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: var(--ptn-sand);
}

.ptn-profile__cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Fallback when a partner has no Figma cover yet: its own logo centred on sand. */
.ptn-profile__cover--logo img {
    width: auto;
    height: auto;
    max-width: 62%;
    max-height: 55%;
    object-fit: contain;
}

.ptn-profile__copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ptn-profile__title.ptn-profile__title {
    color: var(--ptn-text);
}

.ptn-profile__desc,
.ptn-profile__value {
    color: var(--ptn-secondary);
}

.ptn-profile__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ptn-profile__label {
    color: var(--ptn-tertiary);
}

/* Rich text from the partner's ACF "partner_content" (no classes possible on its tags):
   h2 = Figma Heading/lg (32/40, -0.67, 600), paragraphs = Body/lg (18/26, 0.14). */
.ptn-article__body {
    color: var(--ptn-secondary);
    font-size: 18px;
    line-height: 26px;
    letter-spacing: .135px;
    font-weight: 400;
}

.ptn-article__body > :first-child {
    margin-top: 0;
}

.ptn-article__body h2,
.ptn-article__body h3 {
    margin: 0 0 24px;
    padding-top: 16px;
    color: var(--ptn-text);
    font-size: 32px;
    line-height: 40px;
    letter-spacing: -.672px;
    font-weight: 600;
}

.ptn-article__body h2:not(:first-child),
.ptn-article__body h3:not(:first-child) {
    margin-top: 16px;
}

.ptn-article__body h3 {
    font-size: 24px;
    line-height: 32px;
    letter-spacing: -.24px;
    margin-bottom: 16px;
}

.ptn-article__body h2 strong,
.ptn-article__body h3 strong {
    font-weight: inherit;
}

.ptn-article__body p,
.ptn-article__body ul,
.ptn-article__body ol {
    margin: 0 0 16px;
    color: var(--ptn-secondary);
    font-size: inherit;
    line-height: inherit;
    letter-spacing: inherit;
}

.ptn-article__body ul,
.ptn-article__body ol {
    padding-left: 24px;
}

.ptn-article__body ul {
    list-style: disc;
}

.ptn-article__body ol {
    list-style: decimal;
}

.ptn-article__body li {
    margin-bottom: 8px;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.ptn-article__body a {
    color: var(--ptn-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ptn-article__body strong,
.ptn-article__body b {
    color: var(--ptn-text);
    font-weight: 500;
}

.ptn-article__body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* Single partner: Explore more partners */

.ptn-page .ptn-related {
    padding: 80px 64px;
}

.ptn-related__container {
    display: flex;
    flex-direction: column;
    gap: 48px;
    max-width: 1200px;
    margin: 0 auto;
}

.ptn-related__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.ptn-related__title.ptn-related__title {
    color: var(--ptn-text);
}

.ptn-related__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

/* Tablet step */

@media (max-width: 1023px) {
    .ptn-page .ptn-hero,
    .ptn-page .ptn-directory,
    .ptn-page .ptn-article,
    .ptn-page .ptn-related,
    .ptn-breadcrumbs {
        padding-left: 32px;
        padding-right: 32px;
    }

    .ptn-directory__container {
        grid-template-columns: 200px minmax(0, 1fr);
        column-gap: 32px;
    }

    .ptn-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ptn-article__layout {
        grid-template-columns: 280px minmax(0, 1fr);
        column-gap: 40px;
    }

    .ptn-related__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ptn-related__grid > :nth-child(3) {
        display: none;
    }
}

/* Phones (Figma 390 frames) */

@media (max-width: 767px) {
    .ptn-page {
        --ptn-header: 64px;
    }

    /* Hero: full-bleed dark block, photo on top fading into the copy. */
    .ptn-page .ptn-hero {
        padding: 0;
        background: #141414;
    }

    .ptn-hero__card {
        display: block;
        min-height: 0;
        padding: 0;
        border-radius: 0;
        background: #141414;
    }

    .ptn-hero__image {
        position: relative;
        inset: auto;
        display: block;
        height: auto;
        aspect-ratio: 390 / 303;
        object-position: 91% 50%;
    }

    .ptn-hero__card::after {
        inset: 0 0 auto;
        height: auto;
        aspect-ratio: 390 / 303;
        background: linear-gradient(180deg, rgba(20, 20, 20, 0) 0%, #141414 100%);
        /* The photo height is fractional (e.g. 391.56px); photo and overlay round
           differently, so the last photo row could peek out as a light 1px line under
           the eyebrow. Shifting the overlay 2px down covers it (its top is transparent). */
        transform: translateY(2px);
    }

    .ptn-hero__content {
        gap: 16px;
        max-width: none;
        margin-top: -24px;
        padding: 0 20px 32px;
    }

    .ptn-hero__text.ptn-hero__text {
        max-width: none;
    }

    /* Category tabs become a horizontally scrolling row. */
    .ptn-page .ptn-directory {
        padding: 32px 20px 48px;
    }

    .ptn-directory__container {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
    }

    /* Phones: the global tabs turn into a horizontal strip that re-centres the selected
       tab (sd-tabs.js), bleeding to the screen edges like /solutions/. */
    .ptn-directory .ptn-tabs {
        position: static;
        width: auto;
        max-width: none;
        margin: 0 -20px;
        padding-top: 0;
    }

    .ptn-directory .ptn-tabs .sd-tabs__list {
        box-sizing: border-box;
        padding: 0 20px;
    }

    .ptn-grid {
        padding-top: 0;
    }

    .ptn-breadcrumbs {
        padding: 24px 20px;
    }

    .ptn-page .ptn-article {
        padding: 0 20px;
    }

    .ptn-article__layout {
        display: flex;
        flex-direction: column;
        gap: 32px;
    }

    .ptn-profile {
        width: 100%;
        padding: 0;
        border: 0;
        border-radius: 0;
    }

    .ptn-article__body {
        width: 100%;
        font-size: 16px;
        line-height: 24px;
        letter-spacing: .12px;
    }

    .ptn-article__body h2,
    .ptn-article__body h3 {
        margin-bottom: 16px;
        padding-top: 24px;
        font-size: 24px;
        line-height: 32px;
        letter-spacing: -.24px;
    }

    .ptn-article__body h3 {
        font-size: 20px;
        line-height: 28px;
        letter-spacing: -.2px;
    }

    .ptn-article__body p,
    .ptn-article__body ul,
    .ptn-article__body ol {
        margin-bottom: 12px;
    }

    .ptn-page .ptn-related {
        padding: 48px 20px;
    }

    .ptn-related__container {
        gap: 24px;
    }

    /* The "View all partners" button moves under the cards, full width. */
    .ptn-related__head {
        display: contents;
    }

    .ptn-related__all {
        order: 3;
        width: 100%;
    }

    .ptn-related__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ptn-related__grid > :nth-child(3) {
        display: flex;
    }
}
