/* ==========================================================================
   Project (case study) details page (pd-*)
   Images are uploaded in every shape, so each frame has a fixed ratio and shows the picture
   whole (contain) over a blurred, zoomed copy of itself: nothing is cropped, no empty bars.
   ========================================================================== */

.pd {
    --pd-primary: #421f61;
    --pd-deep: #2a1140;
    --pd-accent: #dea8e4;
    --pd-text: #56465f;
    --pd-soft: #f7f2fa;
    --pd-line: #ece3f1;
    padding: 56px 0 90px;
    background: var(--pd-soft);
}

.pd-flip {
    display: inline-block;
}

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

/* ---------- hero tags ---------- */

.pd-hero__tags {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.pd-hero__tags a {
    display: inline-block;
    padding: 7px 15px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(222, 168, 228, 0.35);
    transition: background 0.2s ease;
}

.pd-hero__tags a:hover {
    background: rgba(222, 168, 228, 0.25);
}

/* ---------- image frames ---------- */

.pd-frame {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 24px;
    background: var(--pd-deep);
    isolation: isolate;
}

.pd-frame__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(26px) saturate(1.2) brightness(0.8);
    transform: scale(1.25);
    z-index: -1;
}

.pd-frame__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.pd-frame:hover .pd-frame__img {
    transform: scale(1.03);
}

.pd-frame__zoom {
    position: absolute;
    bottom: 14px;
    inset-inline-end: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 15px;
    color: var(--pd-primary);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.pd-frame:hover .pd-frame__zoom,
.pd-frame:focus-visible .pd-frame__zoom {
    opacity: 1;
    transform: none;
}

@media (hover: none) {
    .pd-frame__zoom {
        opacity: 1;
        transform: none;
    }
}

.pd-cover {
    aspect-ratio: 16 / 9;
    max-height: 640px;
    width: 100%;
    margin-inline: auto;
    box-shadow: 0 30px 60px -30px rgba(42, 17, 64, 0.55);
}

/* ---------- layout: summary + story ---------- */

.pd-layout {
    margin-top: 40px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
}

@media (min-width: 992px) {
    .pd-layout {
        margin-top: 56px;
        grid-template-columns: 330px 1fr;
        gap: 40px;
    }

    .pd-summary {
        position: sticky;
        top: 110px;
    }
}

/* sticky needs the page not to clip overflow */
body:has(.pd-summary) {
    overflow-x: clip !important;
    overflow-y: visible !important;
}

.pd-summary__card {
    padding: 26px;
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(120% 70% at 100% 0%, rgba(222, 168, 228, 0.22), rgba(222, 168, 228, 0) 60%),
        linear-gradient(160deg, #4a1f6e 0%, var(--pd-deep) 100%);
    box-shadow: 0 24px 50px -26px rgba(42, 17, 64, 0.7);
}

.pd-summary__eyebrow {
    display: inline-block;
    margin-bottom: 18px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.4px;
    color: var(--pd-accent);
}

.pd-facts {
    margin: 0 0 22px;
    display: grid;
    gap: 16px;
}

.pd-fact {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pd-fact:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.pd-fact__icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 15px;
    color: var(--pd-accent);
    background: rgba(222, 168, 228, 0.14);
}

.pd-fact dt {
    margin-bottom: 4px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: rgba(255, 255, 255, 0.6);
}

.pd-fact dd {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    color: #fff;
}

/* ---------- buttons ---------- */

.pd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 24px;
    border-radius: 14px;
    font-size: 15.5px;
    font-weight: 800;
    text-decoration: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.pd-btn i.fa-whatsapp {
    font-size: 20px;
}

.pd-btn--primary {
    color: #fff !important;
    background: linear-gradient(135deg, #2fe07a, #25d366 45%, #128c4b);
    box-shadow: 0 12px 26px -12px rgba(18, 140, 75, 0.7);
}

.pd-summary .pd-btn {
    width: 100%;
}

.pd-btn--primary:hover {
    transform: translateY(-2px);
}

.pd-btn--ghost {
    color: var(--pd-primary) !important;
    background: #fff;
    border: 1px solid var(--pd-line);
}

.pd-btn--ghost:hover {
    border-color: var(--pd-accent);
}

/* ---------- story blocks ---------- */

.pd-story {
    display: grid;
    gap: 24px;
    min-width: 0;
}

.pd-block {
    padding: 30px 32px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid var(--pd-line);
    box-shadow: 0 10px 30px -20px rgba(66, 31, 97, 0.3);
}

.pd-block__head,
.pd-results__head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.pd-block__head h2,
.pd-results__head h2 {
    margin: 0;
    font-size: clamp(24px, 2.6vw, 32px);
    font-weight: 800;
    color: var(--pd-primary);
}

.pd-block__icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 19px;
    color: #fff;
    background: linear-gradient(135deg, #7a3f99, var(--pd-primary));
    box-shadow: 0 10px 20px -10px rgba(66, 31, 97, 0.7);
}

.pd-block__icon--challenge {
    background: linear-gradient(135deg, #e0739a, #9b3f79);
}

/* dashboard rich text: normalise pasted colours / alignment / fonts */
.pd-rich,
.pd-rich * {
    color: var(--pd-text) !important;
    font-family: inherit !important;
    background: transparent !important;
    text-align: start !important;
}

.pd-rich {
    font-size: 16.5px;
    line-height: 2;
    overflow-wrap: break-word;
}

.pd-rich p {
    margin: 0 0 14px;
}

.pd-rich p:last-child {
    margin-bottom: 0;
}

.pd-rich strong,
.pd-rich b,
.pd-rich h3,
.pd-rich h4 {
    color: var(--pd-primary) !important;
    font-weight: 800;
}

.pd-rich h3,
.pd-rich h4 {
    margin: 22px 0 8px;
    font-size: 19px;
}

.pd-rich ul,
.pd-rich ol {
    margin: 0 0 14px;
    padding-inline-start: 0;
    list-style: none;
}

.pd-rich li {
    position: relative;
    padding-inline-start: 28px;
    margin-bottom: 8px;
}

.pd-rich li::before {
    content: "";
    position: absolute;
    top: 0.85em;
    inset-inline-start: 6px;
    width: 9px;
    height: 9px;
    border-radius: 3px;
    background: var(--pd-accent);
    transform: rotate(45deg);
}

.pd-rich img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
}

/* ---------- gallery ---------- */

.pd-gallery {
    display: grid;
    gap: 18px;
}

.pd-gallery__item {
    aspect-ratio: 4 / 3;
}

@media (min-width: 640px) {
    .pd-gallery--2 {
        grid-template-columns: 1fr 1fr;
    }

    .pd-gallery--1 .pd-gallery__item {
        aspect-ratio: 16 / 9;
    }
}

/* ---------- results ---------- */

.pd-results {
    margin-top: 64px;
}

.pd-results__head {
    justify-content: center;
    margin-bottom: 28px;
}

.pd-results__grid {
    display: grid;
    gap: 22px;
}

@media (min-width: 768px) {
    .pd-results__grid--2,
    .pd-results__grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1100px) {
    .pd-results__grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.pd-results__grid--1 {
    max-width: 760px;
    margin-inline: auto;
}

.pd-result {
    position: relative;
    padding: 28px 26px 26px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid var(--pd-line);
    box-shadow: 0 10px 30px -20px rgba(66, 31, 97, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pd-result:hover {
    transform: translateY(-5px);
    box-shadow: 0 24px 44px -22px rgba(66, 31, 97, 0.4);
}

.pd-result__num {
    display: inline-grid;
    place-items: center;
    width: 50px;
    height: 50px;
    margin-bottom: 16px;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 800;
    color: var(--pd-primary);
    background: linear-gradient(135deg, #f3dcf6, var(--pd-accent));
}

.pd-result h3 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.5;
    color: var(--pd-primary);
}

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

.pd-results__cta {
    margin-top: 36px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

/* ---------- phones ---------- */

@media (max-width: 575px) {
    .pd {
        padding: 32px 0 64px;
    }

    .pd-cover {
        border-radius: 18px;
        aspect-ratio: 4 / 3;
    }

    .pd-block {
        padding: 22px 20px;
    }

    .pd-rich {
        font-size: 15.5px;
        line-height: 1.95;
    }

    .pd-results {
        margin-top: 48px;
    }

    .pd-results__cta .pd-btn {
        width: 100%;
    }
}
