/* ═══════════════════════════════════════════════════════
   CASE STUDIES PAGE — LAYOUT
   ═══════════════════════════════════════════════════════ */
.cs-main {
    position: relative;
    z-index: 10;
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--s4) var(--s3) var(--s6);
    display: flex;
    flex-direction: column;
    gap: var(--s5);
}

/* ── Page Hero ──────────────────────────────────────── */
.cs-hero {
    text-align: center;
    padding: var(--s4) 0 0;
    animation: fadeSlideDown 0.8s var(--ease-out-expo) both;
}

.cs-hero__h1 {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--white) 20%, rgba(var(--blue-rgb), 0.85) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--s2);
}

.cs-hero__sub {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.03em;
}

/* ── Tag Chips ──────────────────────────────────────── */
.cs-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 40px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(var(--blue-rgb), 0.95);
    background: rgba(var(--blue-rgb), 0.1);
    border: 1px solid rgba(var(--blue-rgb), 0.25);
}

.cs-tag--purple {
    color: rgba(var(--accent-rgb), 0.95);
    background: rgba(var(--accent-rgb), 0.1);
    border-color: rgba(var(--accent-rgb), 0.25);
}

.cs-tag--teal {
    color: rgba(0, 220, 200, 0.95);
    background: rgba(0, 220, 200, 0.08);
    border-color: rgba(0, 220, 200, 0.25);
}

/* ── Read Button ────────────────────────────────────── */
.cs-read-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: 40px;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--white);
    background: linear-gradient(135deg, rgba(var(--purple-rgb), 0.7), rgba(var(--accent-rgb), 0.6));
    border: 1px solid rgba(var(--blue-rgb), 0.3);
    cursor: pointer;
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.cs-read-btn:hover {
    transform: translateY(-2px) translateX(2px);
    box-shadow: 0 6px 24px rgba(var(--accent-rgb), 0.3);
    border-color: rgba(var(--blue-rgb), 0.55);
}

.cs-read-btn--sm {
    padding: 8px 18px;
    font-size: 0.78rem;
    background: rgba(var(--blue-rgb), 0.08);
    color: rgba(var(--blue-rgb), 0.9);
    border-color: rgba(var(--blue-rgb), 0.2);
}

.cs-read-btn--sm:hover {
    background: rgba(var(--blue-rgb), 0.18);
    color: var(--white);
    border-color: rgba(var(--blue-rgb), 0.5);
    box-shadow: 0 4px 16px rgba(var(--blue-rgb), 0.18);
}

/* ═══════════════════════════════════════════════════════
   FEATURED POST
   ═══════════════════════════════════════════════════════ */
.cs-featured {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: rgba(var(--purple-rgb), 0.15);
    border: 1px solid rgba(var(--blue-rgb), 0.2);
    display: grid;
    grid-template-rows: auto 1fr;
    animation: fadeSlideUp 0.8s var(--ease-out-expo) both 0.1s;
    transition: border-color 300ms ease, box-shadow 300ms ease;
}

.cs-featured:hover {
    border-color: rgba(var(--blue-rgb), 0.4);
    box-shadow: 0 16px 60px rgba(var(--purple-rgb), 0.35);
}

.cs-featured__image-wrap {
    position: relative;
    height: 360px;
    overflow: hidden;
}

.cs-featured__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms var(--ease-out-expo);
}

.cs-featured:hover .cs-featured__image {
    transform: scale(1.04);
}

.cs-featured__image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            transparent 30%,
            rgba(7, 1, 15, 0.8) 100%);
}

.cs-featured__body {
    padding: var(--s4);
    display: flex;
    flex-direction: column;
    gap: var(--s2);
}

.cs-featured__title {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--white);
}

.cs-featured__meta {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.38);
    letter-spacing: 0.05em;
}

.cs-featured__excerpt {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.62);
    line-height: 1.7;
    flex: 1;
}

/* ═══════════════════════════════════════════════════════
   ARTICLE GRID
   ═══════════════════════════════════════════════════════ */
.cs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--s4);
}

/* ── Article Card ───────────────────────────────────── */
.cs-card {
    border-radius: 20px;
    overflow: hidden;
    background: rgba(var(--purple-rgb), 0.13);
    border: 1px solid rgba(var(--blue-rgb), 0.15);
    display: flex;
    flex-direction: column;
    transition: transform 300ms var(--ease-out-expo),
        border-color 300ms ease,
        box-shadow 300ms ease;
    animation: fadeSlideUp 0.7s var(--ease-out-expo) both;
}

.cs-card:nth-child(2) {
    animation-delay: 0.05s;
}

.cs-card:nth-child(4) {
    animation-delay: 0.1s;
}

.cs-card:nth-child(6) {
    animation-delay: 0.15s;
}

.cs-card:hover {
    transform: translateY(-6px);
    border-color: rgba(var(--blue-rgb), 0.38);
    box-shadow: 0 12px 40px rgba(var(--purple-rgb), 0.3);
}

.cs-card__image-wrap {
    height: 200px;
    overflow: hidden;
}

.cs-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms var(--ease-out-expo);
}

.cs-card:hover .cs-card__image {
    transform: scale(1.06);
}

.cs-card__body {
    padding: var(--s3);
    display: flex;
    flex-direction: column;
    gap: var(--s2);
    flex: 1;
}

.cs-card__title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--white);
}

.cs-card__meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.05em;
}

.cs-card__excerpt {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.65;
    flex: 1;
}

/* ═══════════════════════════════════════════════════════
   POST MODAL
   ═══════════════════════════════════════════════════════ */
.cs-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 1, 15, 0.75);
    backdrop-filter: blur(6px);
    z-index: 200;
    animation: fadeIn 300ms ease both;
}

.cs-post-modal {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s3);
    pointer-events: none;
}

.cs-post-modal.is-open {
    pointer-events: auto;
    animation: modalIn 350ms var(--ease-out-expo) both;
}

.cs-post-modal.is-closing {
    animation: modalOut 280ms ease both;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.cs-post-modal__inner {
    position: relative;
    background: linear-gradient(160deg, #0d0320 0%, #07010f 100%);
    border: 1px solid rgba(var(--blue-rgb), 0.25);
    border-radius: 24px;
    padding: var(--s5) var(--s5) var(--s4);
    max-width: 720px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--s2);
    box-shadow:
        0 0 0 1px rgba(var(--blue-rgb), 0.08),
        0 32px 80px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(var(--blue-rgb), 0.08);
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--blue-rgb), 0.25) transparent;
}

.cs-post-modal__inner::-webkit-scrollbar {
    width: 4px;
}

.cs-post-modal__inner::-webkit-scrollbar-thumb {
    background: rgba(var(--blue-rgb), 0.25);
    border-radius: 4px;
}

/* Glow edge at top */
.cs-post-modal__inner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg,
            rgba(var(--blue-rgb), 0.04) 0%,
            transparent 50%);
    pointer-events: none;
}

.cs-post-modal__close {
    position: absolute;
    top: var(--s3);
    right: var(--s3);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
    z-index: 1;
}

.cs-post-modal__close:hover {
    color: var(--white);
    background: rgba(var(--blue-rgb), 0.15);
    border-color: rgba(var(--blue-rgb), 0.4);
}

.cs-post-modal__title {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--white);
}

.cs-post-modal__meta {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.04em;
    margin-bottom: var(--s2);
}

.cs-post-modal__content {
    display: flex;
    flex-direction: column;
    gap: var(--s3);
}

.cs-post-modal__content p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.72);
}

.cs-post-modal__content h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(var(--blue-rgb), 0.9);
    margin-top: var(--s2);
}

.cs-post-modal__content em {
    color: rgba(var(--blue-rgb), 0.85);
    font-style: normal;
}

/* ── More Coming ────────────────────────────────────── */
.cs-more-coming {
    display: flex;
    justify-content: center;
}

.cs-more-coming__inner {
    display: flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s2) var(--s4);
    border-radius: 40px;
    border: 1px solid rgba(var(--blue-rgb), 0.15);
    background: rgba(var(--purple-rgb), 0.08);
}

.cs-more-coming__icon {
    color: rgba(var(--blue-rgb), 0.5);
    font-size: 0.85rem;
}

.cs-more-coming__text {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .cs-featured__image-wrap {
        height: 240px;
    }

    .cs-featured__body {
        padding: var(--s3);
    }

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

    .cs-post-modal__inner {
        padding: var(--s4) var(--s3);
        max-height: 92vh;
    }
}

@media (max-width: 480px) {
    .cs-hero__h1 {
        font-size: 2rem;
    }

    .cs-main {
        gap: var(--s4);
    }
}