/* ===== Case Study — Project Preview ===== */
.csd-preview {
    padding: 2.25rem 0 3.25rem 0;
    background: #fff;
}

.csd-preview__inner {
    max-width: 1100px;
    margin: 0 auto;
}

.csd-preview__card {
    overflow: hidden;
}

.csd-preview__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.85rem;
    margin-bottom: 1.5rem;
}

.csd-preview__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: #eef2ff;
    color: var(--dg-primary);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
}

.csd-preview__project {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
}

.csd-preview__meta-sep {
    color: #d1d5db;
    font-size: 0.75rem;
    line-height: 1;
}

.csd-preview__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
}

.csd-preview__meta-item i {
    font-size: 0.85rem;
    color: #9ca3af;
}

.csd-preview__layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: center;
}

.csd-preview__split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
}

.csd-preview__media {
    display: flex;
    align-items: center;
    justify-content: center;
}

.csd-preview__media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.csd-preview__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.csd-preview__layout .csd-preview__content {
    padding: 0;
    margin-bottom: 0;
}

.csd-preview__split .csd-preview__content {
    padding: clamp(1.75rem, 3vw, 2.5rem);
    margin-bottom: 0;
}

.csd-preview__headline {
    margin: 0 0 1rem;
    font-family: var(--dg-font-heading);
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    font-weight: 800;
    color: var(--dg-primary);
    line-height: 1.3;
}

.csd-preview__summary {
    margin: 0;
}

.csd-preview__layout .csd-preview__summary {
    margin-top: 1rem;
}

.csd-preview__content .csd-preview__summary {
    margin-top: 1rem;
}

.csd-preview__summary.p-text {
    color: #475569;
}

.csd-stats-wrap {
    margin-top: 0;
    padding: 1rem;
    background: #fdf8f3;
    border-radius: 12px;
}

.csd-stats {
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(14, 61, 102, 0.1);
}

.csd-stats--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.csd-stats--row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.csd-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: clamp(1.25rem, 2.5vw, 1.75rem) 0.75rem;
    text-align: center;
}

.csd-stats:not(.csd-stats--grid):not(.csd-stats--row) .csd-stat + .csd-stat {
    border-left: 1px dashed #d1d5db;
}

.csd-stats--row .csd-stat + .csd-stat {
    border-left: 1px dashed #d1d5db;
}

.csd-stats--grid .csd-stat:nth-child(odd) {
    border-right: 1px dashed #d1d5db;
}

.csd-stats--grid .csd-stat:nth-child(-n+2) {
    border-bottom: 1px dashed #d1d5db;
}

.csd-stat__value {
    display: block;
    font-family: var(--dg-font-heading);
    font-size: clamp(1.65rem, 2.8vw, 2.15rem);
    font-weight: 800;
    color: #0e3d66;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.csd-stat__label {
    display: block;
    max-width: 9rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #9ca3af;
    line-height: 1.4;
}

@media (max-width: 991.5px) {
    .csd-stats--row {
        grid-template-columns: repeat(2, 1fr);
    }

    .csd-stats--row .csd-stat {
        border-left: none;
    }

    .csd-stats--row .csd-stat:nth-child(odd) {
        border-right: 1px dashed #d1d5db;
    }

    .csd-stats--row .csd-stat:nth-child(-n+2) {
        border-bottom: 1px dashed #d1d5db;
    }
}

@media (max-width: 767.5px) {
    .csd-preview__split,
    .csd-preview__layout {
        grid-template-columns: 1fr;
    }

    .csd-stats:not(.csd-stats--grid):not(.csd-stats--row) {
        flex-direction: column;
    }

    .csd-stats:not(.csd-stats--grid):not(.csd-stats--row) .csd-stat + .csd-stat {
        border-left: none;
        border-top: 1px dashed #d1d5db;
    }

    .csd-stat__label {
        max-width: none;
    }
}

@media (max-width: 575.5px) {
    .csd-stats--row {
        grid-template-columns: 1fr;
    }

    .csd-stats--row .csd-stat {
        border-right: none;
        border-bottom: none;
    }

    .csd-stats--row .csd-stat + .csd-stat {
        border-top: 1px dashed #d1d5db;
    }
}

.csd-testimonial {
    padding: clamp(3rem, 5vw, 4.5rem) 1.25rem;
    background-color: var(--dg-secondary);
    background-image:
        radial-gradient(circle at 15% 80%, rgba(167, 199, 83, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(167, 199, 83, 0.04) 0%, transparent 35%),
        radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 24px 24px, 24px 24px;
    background-position: 0 0, 0 0, 0 0, 12px 12px;
}

.csd-testimonial__card {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
    padding: clamp(1rem, 4vw, 1.25rem);
    background: #fff;
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.csd-testimonial__quote-wrap {
    margin-bottom: 0.5rem;
}

.csd-testimonial__quote-icon {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    color: var(--dg-highlight);
    line-height: 1;
}

.csd-testimonial__quote-icon--close {
    position: absolute;
    right: clamp(1.25rem, 3vw, 2rem);
    bottom: clamp(1.25rem, 3vw, 2rem);
    opacity: 0.35;
}

.csd-testimonial__text {
    margin: 0 0 1.75rem;
    font-family: var(--dg-font-body);
    font-size: clamp(1rem, 2vw, 1.12rem);
    font-style: italic;
    line-height: 1.8;
    color: #334155;
}

.csd-testimonial__author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.csd-testimonial__avatar-wrap {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    padding: 3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dg-highlight), var(--dg-primary));
    box-shadow: 0 6px 20px rgba(14, 61, 102, 0.15);
}

.csd-testimonial__avatar {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #e8f0f8;
}

.csd-testimonial__info {
    min-width: 0;
}

.csd-testimonial__name {
    display: block;
    font-family: var(--dg-font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    font-style: normal;
    color: var(--dg-primary);
}

.csd-testimonial__role {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #64748b;
}

.csd-testimonial__stars {
    display: flex;
    gap: 0.2rem;
    margin-top: 0.5rem;
    color: #f59e0b;
    font-size: 0.85rem;
}

@media (max-width: 575.5px) {
    .csd-testimonial__author {
        flex-direction: column;
        align-items: flex-start;
    }

    .csd-testimonial__quote-icon--close {
        display: none;
    }
}

/* ===== Brief Introduction ===== */
.csd-overview {
    padding:0 0 4.25rem 0;
    /* background: #f8fafc; */
}

.csd-overview__title {
    margin: 0 0 1.25rem;
    font-family: var(--dg-font-heading);
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 700;
    color: var(--dg-primary);
}

.csd-overview__inner .p-text {
    margin: 0 0 1rem;
    color: #475569;
}

.csd-overview__inner .p-text:last-child {
    margin-bottom: 0;
}

/* ===== Demo layout: content left + sticky testimonial ===== */
.csd-body {
    padding: 0 0 clamp(2.5rem, 5vw, 4rem);
    background: #fff;
}

.csd-body__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: clamp(1.75rem, 3vw, 2.75rem);
    align-items: start;
}

.csd-body__main {
    min-width: 0;
}

.csd-body__main .csd-overview {
    padding: 0 0 2.5rem;
}

.csd-body__main .csd-overview--final {
    padding: 2rem 0 0;
}

.csd-body__main .csd-content {
    padding: 0 0 2.5rem;
    background: transparent;
}

.csd-body__main .csd-content__split {
    margin-top: 1.5rem;
    grid-template-columns: 1fr;
}

.csd-body__main .csd-middle-image {
    padding: 0 0 2.5rem;
    background: transparent;
}

.csd-body__main .csd-results {
    padding: 0;
    background: transparent;
}

.csd-body__main .csd-results__grid {
    grid-template-columns: repeat(2, 1fr);
}

.csd-body__main .csd-results__layout {
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.5rem, 2.5vw, 2rem);
}

.csd-body__aside {
    min-width: 0;
    position: sticky;
    top: calc(var(--dg-header-h, 72px) + 1rem);
}


.csd-testimonial__card--sticky {
    max-width: none;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: var(--dg-secondary);
    background-image:
        radial-gradient(circle at 15% 80%, rgba(167, 199, 83, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(167, 199, 83, 0.04) 0%, transparent 35%),
        radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 24px 24px, 24px 24px;
    background-position: 0 0, 0 0, 0 0, 12px 12px;
    box-shadow: 0 16px 40px rgba(14, 61, 102, 0.2);
}

.csd-testimonial__card--sticky .csd-testimonial__text {
    color: rgba(255, 255, 255, 0.92);
}

.csd-testimonial__card--sticky .csd-testimonial__name {
    color: #fff;
}

.csd-testimonial__card--sticky .csd-testimonial__role {
    color: rgba(255, 255, 255, 0.72);
}

.csd-testimonial__card--sticky .csd-testimonial__quote-icon {
    color: var(--dg-highlight);
}

.csd-testimonial__card--sticky .csd-testimonial__quote-icon--close {
    color: rgba(255, 255, 255, 0.35);
}

.csd-testimonial__card--sticky .csd-testimonial__stars {
    color: #fbbf24;
}

@media (max-width: 991.5px) {
    .csd-body__layout {
        grid-template-columns: 1fr;
    }

    .csd-body__aside {
        position: static;
        top: auto;
        order: -1;
    }

    .csd-body__aside-sticky {
        position: static;
    }

    .csd-body__main .csd-results__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 575.5px) {
    .csd-body__main .csd-results__grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Two-column content ===== */
.csd-content {
    padding: clamp(2.5rem, 5vw, 4rem) 1.25rem;
    background: #fff;
}

.csd-content__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 4vw, 3rem);
}

.csd-content__heading {
    margin: 0 0 1rem;
    font-family: var(--dg-font-heading);
    /* font-size: 1.25rem; */
    font-weight: 700;
    color: var(--dg-primary);
}

.csd-content__heading:not(:first-child) {
    margin-top: 2rem;
}

.csd-content__subheading {
    margin: 1.5rem 0 0.75rem;
    font-family: var(--dg-font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dg-primary);
}

.csd-content__col .p-text {
    margin: 0 0 0.85rem;
    color: #475569;
}

.csd-content__col ul {
    margin: 0 0 0.85rem;
    padding-left: 1.25rem;
}

.csd-content__col li {
    margin-bottom: 0.35rem;
    font-size: 1.10rem;
    font-weight: 400;
    line-height: 1.7;
    color: #475569;
}

.csd-content__split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 4vw, 3rem);
    align-items: center;
}

.csd-content__split .csd-content__subheading {
    margin-top: 0;
}

.csd-content__media img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 480px;
    max-height: 480px;
    border-radius: 8px;
    border: 1px solid rgba(14, 61, 102, 0.1);
}

@media (max-width: 767.5px) {
    .csd-content__grid,
    .csd-content__split {
        grid-template-columns: 1fr;
    }
}

/* ===== Middle Image ===== */
.csd-middle-image {
    padding: clamp(2rem, 4vw, 3rem) 1.25rem;
    background: #f8fafc;
}

.csd-middle-image__inner {
    margin: 0 auto;
    border-radius: 12px;
    border: 1px solid rgba(14, 61, 102, 0.08);
}

.csd-middle-image__inner img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ===== Results & Achievement ===== */
.csd-results {
    padding: clamp(2.5rem, 5vw, 4rem) 1.25rem;
    background: #fff;
}

.csd-results__title {
    margin: 0 0 2rem;
    font-family: var(--dg-font-heading);
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 700;
    color: var(--dg-primary);
}

.csd-results__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(1.25rem, 2.5vw, 2rem);
}

.csd-results__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 4vw, 3rem);
    align-items: start;
}

.csd-results__stack {
    display: flex;
    flex-direction: column;
    gap: clamp(1.75rem, 2.5vw, 2.25rem);
}

.csd-results__heading {
    margin: 0 0 0.85rem;
    font-family: var(--dg-font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--dg-primary);
    line-height: 1.35;
}

.csd-results__col ul {
    margin: 0;
    padding-left: 1.15rem;
}

.csd-results__col li {
    margin-bottom: 0.4rem;
    font-size: 1.10rem;
    font-weight: 400;
    line-height: 1.7;
    color: #475569;
}

@media (max-width: 991.5px) {
    .csd-results__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .csd-results__layout {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 575.5px) {
    .csd-results__grid {
        grid-template-columns: 1fr;
    }

    .csd-results__layout {
        grid-template-columns: 1fr;
    }
}

/* ===== Case Study Gallery ===== */
.csd-gallery {
    padding: clamp(2.5rem, 5vw, 4rem) 1.25rem;
    background: #f8fafc;
}

.csd-gallery__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.csd-gallery__item {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid rgba(14, 61, 102, 0.1);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.csd-gallery__item:hover,
.csd-gallery__item:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(14, 61, 102, 0.12);
    outline: none;
}

.csd-gallery__item img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.csd-gallery__zoom {
    position: absolute;
    right: 0.65rem;
    bottom: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    font-size: 0.85rem;
    color: rgba(14, 61, 102, 0.75);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.csd-gallery__item:hover .csd-gallery__zoom,
.csd-gallery__item:focus-visible .csd-gallery__zoom {
    opacity: 1;
}

.csd-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.csd-gallery-modal[hidden] {
    display: none;
}

.csd-gallery-modal__overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(8, 35, 60, 0.88);
    cursor: pointer;
}

.csd-gallery-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(1100px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.csd-gallery-modal__figure {
    margin: 0;
    width: 100%;
    text-align: center;
}

.csd-gallery-modal__img {
    display: block;
    max-width: 100%;
    max-height: calc(90vh - 5rem);
    margin: 0 auto;
    border-radius: 8px;
    object-fit: contain;
    background: #0e3d66;
}

.csd-gallery-modal__caption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

.csd-gallery-modal__counter {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.csd-gallery-modal__close,
.csd-gallery-modal__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: background 0.2s ease;
}

.csd-gallery-modal__close {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 3;
}

.csd-gallery-modal__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.csd-gallery-modal__close:hover,
.csd-gallery-modal__nav:hover,
.csd-gallery-modal__close:focus-visible,
.csd-gallery-modal__nav:focus-visible {
    background: rgba(255, 255, 255, 0.22);
    outline: none;
}

.csd-gallery-modal__nav--prev {
    left: -3rem;
}

.csd-gallery-modal__nav--next {
    right: -3rem;
}

.csd-gallery-modal__nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

@media (max-width: 991.5px) {
    .csd-gallery__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .csd-gallery-modal__nav--prev {
        left: 0.25rem;
    }

    .csd-gallery-modal__nav--next {
        right: 0.25rem;
    }
}

@media (max-width: 575.5px) {
    .csd-gallery__grid {
        grid-template-columns: 1fr;
    }
}