/* ==========================================================================
   Partner detail pages (Assess, Edara, WowDesk, NES)
   Everything is scoped under .pd-page so it cannot leak into the site CSS.
   Direction is controlled by the dir attribute on .pd-page (logical properties).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Base: tokens, page shell
   -------------------------------------------------------------------------- */
.pd-page {
    /* design tokens */
    --pd-ink: #0f2742;
    --pd-muted: #566879;
    --pd-blue: #337ab7;
    --pd-deep: #2e6da4;
    --pd-cyan: #36c3e0;
    --pd-card: #ffffff;
    --pd-line: rgba(51, 122, 183, .16);
    --pd-radius: 22px;

    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(32px, 6vw, 72px) 16px clamp(56px, 8vw, 110px);
    color: var(--pd-ink);
    line-height: 1.9;
    background:
        radial-gradient(1100px 480px at 50% -8%, rgba(51, 122, 183, .15), transparent 60%),
        linear-gradient(180deg, #f4f8fc 0%, #ffffff 65%);
}

.pd-page *,
.pd-page *::before,
.pd-page *::after {
    box-sizing: border-box;
}

.pd-wrap {
    position: relative;
    max-width: 1040px;
    margin: 0 auto;
}

/* reading progress bar (width set by JS) */
.pd-progress {
    position: fixed;
    top: 0;
    inset-inline: 0;
    z-index: 1031;
    height: 3px;
    transform-origin: 0 50%;
    transform: scaleX(var(--pd-p, 0));
    background: linear-gradient(90deg, var(--pd-blue), var(--pd-cyan));
    pointer-events: none;
}

[dir="rtl"] .pd-progress {
    transform-origin: 100% 50%;
}

/* --------------------------------------------------------------------------
   2. Aurora background (drifting blobs + grain)
   -------------------------------------------------------------------------- */
.pd-aurora {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.pd-aurora i {
    position: absolute;
    width: 42vmax;
    height: 42vmax;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .33;
    will-change: transform;
}

.pd-aurora i:nth-child(1) {
    top: -20vmax;
    inset-inline-start: -10vmax;
    background: radial-gradient(circle, #6fb3e6, transparent 65%);
    animation: pd-drift-a 26s ease-in-out infinite alternate;
}

.pd-aurora i:nth-child(2) {
    top: 12vmax;
    inset-inline-end: -16vmax;
    background: radial-gradient(circle, #8fe0f0, transparent 65%);
    animation: pd-drift-b 32s ease-in-out infinite alternate;
}

.pd-aurora::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .05;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

@keyframes pd-drift-a {
    to { transform: translate3d(8vmax, 6vmax, 0) scale(1.15); }
}

@keyframes pd-drift-b {
    to { transform: translate3d(-9vmax, 4vmax, 0) scale(1.1); }
}

/* --------------------------------------------------------------------------
   3. Back link / eyebrow
   -------------------------------------------------------------------------- */
.pd-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border: 1px solid var(--pd-line);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
    color: var(--pd-deep);
    text-decoration: none;
    background: rgba(255, 255, 255, .7);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: background .3s, color .3s, gap .3s, border-color .3s;
}

.pd-back svg {
    width: 16px;
    height: 16px;
    transition: transform .3s;
}

/* arrow points "back": left in LTR, right in RTL */
.pd-back svg {
    transform: scaleX(-1);
}

[dir="rtl"] .pd-back svg {
    transform: none;
}

.pd-back:hover,
.pd-back:focus-visible {
    gap: 14px;
    color: #fff;
    text-decoration: none;
    border-color: var(--pd-deep);
    background: var(--pd-deep);
}

.pd-back:focus-visible {
    outline: 3px solid var(--pd-cyan);
    outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   4. Hero (logo tile + title)
   -------------------------------------------------------------------------- */
/* logo centred on top, title centred underneath */
.pd-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(18px, 3vw, 28px);
    margin-top: 28px;
    text-align: center;
}

.pd-logo {
    --rx: 0deg;
    --ry: 0deg;

    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: clamp(150px, 22vw, 230px);
    height: clamp(120px, 17vw, 170px);
    padding: 18px;
    border: 1px solid var(--pd-line);
    border-radius: 26px;
    background: #fff;
    box-shadow:
        0 1px 2px rgba(15, 39, 66, .04),
        0 24px 50px rgba(51, 122, 183, .20);
    transform: perspective(800px) rotateX(var(--rx)) rotateY(var(--ry));
    transition: transform .25s ease;
    will-change: transform;
}

.pd-logo img {
    max-width: 100%;
    /* tile height minus its padding, so tall logos (e.g. VQT with tagline) never spill out */
    max-height: calc(clamp(120px, 17vw, 170px) - 44px);
    object-fit: contain;
}

.pd-titles h1 {
    margin: 0;
    font-size: clamp(34px, 6vw, 64px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.01em;
    color: transparent;
    background: linear-gradient(90deg, var(--pd-ink), var(--pd-deep) 60%, var(--pd-cyan));
    -webkit-background-clip: text;
    background-clip: text;
}

.pd-rule {
    display: block;
    width: min(220px, 60%);
    height: 3px;
    margin: 18px auto 0;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, var(--pd-blue), var(--pd-cyan), transparent);
    transform-origin: 50% 50%;
    animation: pd-rule 1.1s .3s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes pd-rule {
    from { transform: scaleX(0); }
}

/* --------------------------------------------------------------------------
   5. Lead paragraph
   -------------------------------------------------------------------------- */
.pd-lead {
    max-width: 860px;
    margin: clamp(28px, 4vw, 48px) 0 0;
    font-size: clamp(17px, 2vw, 21px);
    line-height: 2;
    color: var(--pd-ink);
}

.pd-lead + .pd-lead {
    margin-top: 16px;
    color: var(--pd-muted);
}

/* --------------------------------------------------------------------------
   6. Section titles + card grid
   -------------------------------------------------------------------------- */
.pd-section-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: clamp(36px, 5vw, 60px) 0 18px;
    font-size: clamp(18px, 2.2vw, 22px);
    font-weight: 700;
    line-height: 1.5;
    color: var(--pd-ink);
}

.pd-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--pd-line), transparent);
}

[dir="rtl"] .pd-section-title::after {
    background: linear-gradient(270deg, var(--pd-line), transparent);
}

.pd-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: pd-n;
}

.pd-grid--1 {
    grid-template-columns: 1fr;
}

.pd-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

/* compact, non-interactive tiles (e.g. a list of standards): 4 per row */
.pd-grid--4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.pd-grid--4 .pd-card {
    gap: 4px;
    padding: 16px 16px 14px;
    border-radius: 16px;
}

.pd-grid--4 .pd-card h3 {
    padding-inline-end: 28px;
    font-size: 16px;
    line-height: 1.4;
}

.pd-grid--4 .pd-card p {
    font-size: 13.5px;
    line-height: 1.6;
}

.pd-grid--4 .pd-card--n::after {
    top: 8px;
    inset-inline-end: 12px;
    font-size: 26px;
}

/* tiles that are not links: no hover lift or glow */
.pd-card--static,
.pd-card--static:hover {
    transform: none;
    cursor: default;
    border-color: var(--pd-line);
    box-shadow:
        0 1px 2px rgba(15, 39, 66, .04),
        0 8px 20px rgba(15, 39, 66, .05);
}

.pd-card--static:hover::before {
    opacity: 0;
}

.pd-card--static:hover::after {
    color: rgba(51, 122, 183, .09);
}

/* --------------------------------------------------------------------------
   7. Card
   -------------------------------------------------------------------------- */
.pd-card {
    --mx: 50%;
    --my: 50%;

    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 26px 24px 24px;
    overflow: hidden;
    border: 1px solid var(--pd-line);
    border-radius: var(--pd-radius);
    background: var(--pd-card);
    box-shadow:
        0 1px 2px rgba(15, 39, 66, .04),
        0 12px 30px rgba(15, 39, 66, .06);
    counter-increment: pd-n;
    transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s, border-color .35s;
}

/* spotlight that follows the pointer */
.pd-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(340px circle at var(--mx) var(--my), rgba(54, 195, 224, .18), transparent 60%);
    transition: opacity .35s;
}

.pd-card:hover {
    transform: translateY(-4px);
    border-color: rgba(51, 122, 183, .42);
    box-shadow:
        0 2px 4px rgba(15, 39, 66, .05),
        0 24px 56px rgba(51, 122, 183, .22);
}

.pd-card:hover::before {
    opacity: 1;
}

/* numbered badge */
.pd-card--n::after {
    content: counter(pd-n, decimal-leading-zero);
    position: absolute;
    top: 14px;
    inset-inline-end: 20px;
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
    color: rgba(51, 122, 183, .09);
    transition: color .35s;
}

.pd-card--n:hover::after {
    color: rgba(54, 195, 224, .30);
}

.pd-card h3 {
    margin: 0;
    padding-inline-end: 56px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--pd-ink);
}

.pd-card p {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.9;
    color: var(--pd-muted);
}

/* accent card (e.g. "integrated with MOHR") */
.pd-card--accent {
    border-color: transparent;
    color: #fff;
    background:
        radial-gradient(520px 260px at 100% 0%, rgba(54, 195, 224, .45), transparent 60%),
        linear-gradient(135deg, #1f4f80, var(--pd-deep));
    box-shadow: 0 24px 56px rgba(46, 109, 164, .35);
}

[dir="rtl"] .pd-card--accent {
    background:
        radial-gradient(520px 260px at 0% 0%, rgba(54, 195, 224, .45), transparent 60%),
        linear-gradient(225deg, #1f4f80, var(--pd-deep));
}

.pd-card--accent h3,
.pd-card--accent p {
    color: #fff;
}

.pd-card--accent p {
    opacity: .92;
}

.pd-card--accent::after {
    color: rgba(255, 255, 255, .14);
}

.pd-card--span {
    grid-column: 1 / -1;
}

/* small category label above a card title */
.pd-tag {
    align-self: flex-start;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: .02em;
    color: var(--pd-deep);
    background: rgba(51, 122, 183, .10);
}

.pd-card--accent .pd-tag {
    color: #fff;
    background: rgba(255, 255, 255, .18);
}

/* pillar tiles: short, non-interactive, with a coloured top edge */
.pd-card--pillar,
.pd-card--pillar:hover {
    border-top: 3px solid var(--pd-cyan);
}

.pd-card--pillar h3 {
    padding-inline-end: 0;
    font-size: 20px;
}

/* plain text block (one wide card, used for short pages) */
.pd-panel {
    max-width: 860px;
    margin-top: clamp(28px, 4vw, 44px);
    padding: clamp(24px, 4vw, 40px);
    border: 1px solid var(--pd-line);
    border-radius: 26px;
    background: rgba(255, 255, 255, .85);
    box-shadow: 0 16px 44px rgba(15, 39, 66, .08);
}

.pd-panel p {
    margin: 0;
    font-size: clamp(16px, 1.9vw, 19px);
    line-height: 2.05;
    color: var(--pd-muted);
}

/* --------------------------------------------------------------------------
   8. Chips (capability lists)
   -------------------------------------------------------------------------- */
.pd-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pd-chips li {
    padding: 9px 18px;
    border: 1px solid var(--pd-line);
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.6;
    color: var(--pd-deep);
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 39, 66, .05);
    transition: transform .3s, background .3s, color .3s, border-color .3s;
}

.pd-chips li:hover {
    transform: translateY(-3px);
    color: #fff;
    border-color: var(--pd-deep);
    background: linear-gradient(135deg, var(--pd-deep), var(--pd-blue));
}

/* --------------------------------------------------------------------------
   9. Call to action
   -------------------------------------------------------------------------- */
.pd-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 20px;
    margin: clamp(36px, 5vw, 60px) 0 0;
    padding: clamp(20px, 3vw, 30px) clamp(20px, 3vw, 34px);
    border: 1px solid var(--pd-line);
    border-radius: 24px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--pd-muted);
    background: rgba(255, 255, 255, .8);
    box-shadow: 0 16px 44px rgba(15, 39, 66, .07);
}

.pd-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 22px;
    border-radius: 999px;
    font-weight: 700;
    line-height: 1.5;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, var(--pd-deep), var(--pd-blue));
    box-shadow: 0 10px 24px rgba(46, 109, 164, .35);
    transition: transform .3s, box-shadow .3s, gap .3s;
}

.pd-btn svg {
    width: 16px;
    height: 16px;
    flex: none;
    transition: transform .3s;
}

[dir="rtl"] .pd-btn svg {
    transform: scaleX(-1);
}

.pd-btn:hover,
.pd-btn:focus-visible {
    gap: 14px;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(46, 109, 164, .45);
}

.pd-btn:focus-visible {
    outline: 3px solid var(--pd-cyan);
    outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   10. Scroll reveal (".in" is added by partner-detail.js)
   -------------------------------------------------------------------------- */
.pd-js .pd-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity .8s ease,
        transform .8s cubic-bezier(.2, .7, .2, 1);
    transition-delay: calc(var(--i, 0) * 90ms);
}

.pd-js .pd-reveal.in {
    opacity: 1;
    transform: none;
}

/* once revealed, cards use their own hover transition */
.pd-js .pd-card.pd-reveal.in {
    transition:
        opacity .8s ease,
        transform .35s cubic-bezier(.2, .7, .2, 1),
        box-shadow .35s,
        border-color .35s;
    transition-delay: 0s;
}

/* --------------------------------------------------------------------------
   11. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
    .pd-grid--3,
    .pd-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .pd-grid,
    .pd-grid--3 {
        grid-template-columns: 1fr;
    }

    /* compact tiles stay two per row on tablets and phones */
    .pd-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .pd-grid--4 {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   12. Reduced motion: final state, no animation
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .pd-page *,
    .pd-page *::before,
    .pd-page *::after {
        animation: none !important;
        transition: none !important;
    }

    .pd-js .pd-reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    .pd-logo {
        transform: none !important;
    }
}
