/* FUNDII case pages */

:root {
    --case-bg: #fff8ef;
    --case-surface: #fffdf9;
    --case-primary: #f27a5e;
    --case-primary-dark: #d95f46;
    --case-primary-soft: #ffe1d6;
    --case-accent: #f6b26b;
    --case-accent-soft: #fff0df;
    --case-text: #3f3530;
    --case-muted: #7b706a;
    --case-border: #eedfd5;
    --case-shadow: 0 18px 45px rgba(124, 73, 53, 0.12);
    --case-shadow-soft: 0 12px 32px rgba(97, 72, 53, 0.08);
}

body {
    background:
        linear-gradient(120deg, rgba(255, 225, 214, 0.58), rgba(255, 240, 223, 0.7) 48%, rgba(255, 248, 239, 0.96)),
        var(--case-bg);
    color: var(--case-text);
}

body > .case-section,
#main.wrapper {
    width: min(1180px, calc(100% - 40px));
    max-width: 1180px !important;
    margin: 0 auto;
    padding: 76px 0 !important;
}

#main.wrapper {
    background: transparent;
}

#main.wrapper .inner {
    width: 100%;
}

.case-section {
    position: relative;
    overflow: hidden;
    background: transparent;
    border-radius: 8px;
    animation: casePageIn 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.case-section > header,
.case-section header.major {
    margin: 0 0 30px;
    text-align: center;
}

.case-section > header::before,
.case-section header.major::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-bottom: 18px;
    background: var(--case-accent);
    border-radius: 999px;
    box-shadow: 18px 0 0 var(--case-primary), -18px 0 0 var(--case-primary-soft);
}

.section-title,
.case-section h2 {
    margin: 0 0 12px;
    color: var(--case-text);
    font-size: clamp(1.9rem, 3vw, 2.75rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.22;
    text-align: center;
    word-break: keep-all;
}

.section-desc,
.case-section > header p,
.case-section header.major p {
    max-width: 620px;
    margin: 0 auto;
    color: var(--case-muted);
    font-size: 1rem;
    line-height: 1.75;
    text-align: center;
    word-break: keep-all;
}

.spotlights {
    display: grid;
    gap: 22px;
}

.spotlights section {
    display: grid;
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1fr);
    align-items: center;
    gap: 0;
    min-height: 300px;
    margin: 0;
    overflow: hidden;
    background: var(--case-surface);
    border: 1px solid rgba(238, 223, 213, 0.95);
    border-radius: 8px;
    box-shadow: var(--case-shadow-soft);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    animation: caseCardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.spotlights section:nth-child(2) { animation-delay: 0.08s; }
.spotlights section:nth-child(3) { animation-delay: 0.16s; }
.spotlights section:nth-child(4) { animation-delay: 0.24s; }

.spotlights section:hover {
    transform: translateY(-5px);
    border-color: rgba(242, 122, 94, 0.32);
    box-shadow: var(--case-shadow);
}

.spotlights .image {
    position: relative;
    height: 100%;
    min-height: 300px;
    overflow: hidden;
}

.spotlights .image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(63, 53, 48, 0) 36%, rgba(63, 53, 48, 0.34));
    pointer-events: none;
}

.spotlights .image img {
    width: 100%;
    height: 100%;
    min-height: 300px;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    transition: transform 0.55s ease;
}

.spotlights section:hover .image img {
    transform: scale(1.045);
}

.spotlights .content {
    padding: 30px;
}

.spotlights .content h3 {
    margin: 0 0 14px;
    color: var(--case-text);
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.35;
    word-break: keep-all;
}

.spotlights .content p {
    margin: 0;
    color: var(--case-muted);
    font-size: 0.98rem;
    line-height: 1.85;
    word-break: keep-all;
}

.spotlights .content strong {
    color: var(--case-primary-dark);
    font-weight: 800;
}

.posts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin: 0;
    padding: 0;
}

.post {
    position: relative;
    min-height: 210px;
    padding: 28px;
    overflow: hidden;
    background: var(--case-surface);
    border: 1px solid var(--case-border);
    border-radius: 8px;
    box-shadow: var(--case-shadow-soft);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    animation: caseCardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.post:nth-child(2) {
    animation-delay: 0.09s;
}

.post::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--case-primary), var(--case-accent));
}

.post:hover {
    transform: translateY(-5px);
    border-color: rgba(242, 122, 94, 0.32);
    box-shadow: var(--case-shadow);
}

.post h3 {
    margin: 0 0 13px;
    color: var(--case-text);
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.4;
    word-break: keep-all;
}

.post p {
    margin: 0;
    color: var(--case-muted);
    font-size: 0.95rem;
    line-height: 1.8;
    word-break: keep-all;
}

.case-section > div:has(> button) {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 0 0 26px;
}

.case-section button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-height: 0;
    padding: 0 14px;
    background: #fff;
    border: 1px solid var(--case-border);
    border-radius: 8px;
    color: var(--case-text);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.case-section button:hover,
.case-section button:focus {
    background: var(--case-primary);
    color: #fff;
    box-shadow: 0 12px 22px rgba(242, 122, 94, 0.24);
    transform: translateY(-2px);
}

#individual,
#organization {
    max-width: 760px;
    margin: 0 auto;
    padding: 30px;
    background: var(--case-surface);
    border: 1px solid var(--case-border);
    border-radius: 8px;
    box-shadow: var(--case-shadow-soft);
    animation: caseCardIn 0.58s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#individual h3,
#organization h3 {
    margin: 0 0 18px;
    color: var(--case-text);
    font-size: 1.3rem;
    font-weight: 800;
    text-align: center;
}

#individual ol,
#organization ol {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: case-rank;
}

#individual li,
#organization li {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 14px 18px 14px 62px;
    background: #fff8ef;
    border: 1px solid rgba(238, 223, 213, 0.82);
    border-radius: 8px;
    color: var(--case-text);
    font-weight: 700;
    line-height: 1.5;
}

#individual li::before,
#organization li::before {
    counter-increment: case-rank;
    content: counter(case-rank);
    position: absolute;
    left: 16px;
    top: 50%;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    background: linear-gradient(135deg, var(--case-primary), var(--case-accent));
    border-radius: 8px;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 800;
    transform: translateY(-50%);
}

@keyframes casePageIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes caseCardIn {
    from {
        opacity: 0;
        transform: translateY(26px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .case-section,
    .spotlights section,
    .post,
    #individual,
    #organization {
        animation: none;
    }

    .spotlights section,
    .post,
    .spotlights .image img,
    .case-section button {
        transition: none;
    }
}

@media screen and (max-width: 980px) {
    body > .case-section,
    #main.wrapper {
        width: min(100% - 32px, 1180px);
        padding: 56px 0 !important;
    }

    .spotlights section {
        grid-template-columns: 1fr;
    }

    .spotlights .image,
    .spotlights .image img {
        min-height: 240px;
    }

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

@media screen and (max-width: 640px) {
    body > .case-section,
    #main.wrapper {
        width: min(100% - 28px, 1180px);
        padding: 42px 0 !important;
    }

    .case-section > header,
    .case-section header.major {
        margin-bottom: 22px;
    }

    .spotlights {
        gap: 16px;
    }

    .spotlights .content,
    .post,
    #individual,
    #organization {
        padding: 22px 18px;
    }

    .spotlights .image,
    .spotlights .image img {
        min-height: 210px;
    }

    .case-section > div:has(> button) {
        align-items: stretch;
        flex-direction: column;
    }

    .case-section button {
        height: 34px;
    }
}
