/*-- -------------------------------------------------- -->
<---            Case Study / Portfolio Detail            -->
<--- -------------------------------------------------- -*/
/* Follows the site's CodeStitch conventions: scoped section IDs,
   mobile-first media queries, shared design tokens, dark-mode blocks. */

/*-- -------------------------- -->
<---            Hero            -->
<--- -------------------------- -*/
/* Mobile */
@media only screen and (min-width: 0rem) {
    #case-hero {
        /* follows the breadcrumb banner, so standard section padding */
        padding: clamp(3.75rem, 7vw, 5.5rem) 1rem;
        background: linear-gradient(115deg, #06152b 0%, #0d2647 45%, #12305a 100%);
        position: relative;
        z-index: 1;
        overflow: hidden;
    }
    #case-hero .cs-container {
        width: 100%;
        max-width: 80rem;
        margin: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: clamp(1.5rem, 5vw, 4rem);
    }
    #case-hero .cs-flex-left {
        width: 100%;
        max-width: 39rem;
        text-align: left;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    #case-hero .cs-title {
        font-size: clamp(2.5rem, 7vw, 4.5rem);
        font-weight: 900;
        line-height: 1.05em;
        text-transform: uppercase;
        max-width: 100%;
        margin: 0 0 1.5rem 0;
        color: #fff;
        font-family: 'Inter', 'Arial', sans-serif;
    }
    #case-hero .cs-subtitle {
        font-size: clamp(1.125rem, 2.4vw, 1.5rem);
        font-weight: 700;
        line-height: 1.35em;
        margin: 0 0 1.5rem 0;
        color: #fff;
        font-family: 'Inter', 'Arial', sans-serif;
    }
    #case-hero .cs-text {
        font-size: 1rem;
        line-height: 1.6em;
        max-width: 34rem;
        margin: 0 0 2rem 0;
        color: rgba(255, 255, 255, 0.75);
    }
    #case-hero .cs-button {
        font-size: 1rem;
        font-weight: 700;
        line-height: 1.5em;
        text-decoration: none;
        margin: 0;
        /* mobile: button sits directly under the laptop, centered */
        order: -1;
        align-self: center;
        padding: 0.9375rem 1.75rem;
        color: #fff;
        background-color: transparent;
        border: 1px solid rgba(255, 255, 255, 0.4);
        border-radius: 0.5rem;
        display: inline-flex;
        align-items: center;
        gap: 0.625rem;
        position: relative;
        z-index: 1;
        overflow: hidden;
        transition: color 0.3s, border-color 0.3s;
        margin-bottom: 1.5rem;
    }
    #case-hero .cs-button:before {
        content: "";
        width: 0%;
        height: 100%;
        background-color: #fff;
        opacity: 1;
        position: absolute;
        top: 0;
        left: 0;
        z-index: -1;
        border-radius: 0.5rem;
        transition: width 0.3s;
    }
    #case-hero .cs-button:hover {
        color: var(--primary);
        border-color: #fff;
    }
    #case-hero .cs-button:hover:before {
        width: 100%;
    }
    #case-hero .cs-button-icon {
        width: 1rem;
        height: 1rem;
        display: block;
    }
    /* Device / laptop mockup wrapper — swap the <img> for your laptop SVG */
    #case-hero .cs-device {
        width: 100%;
        max-width: 39rem;
        margin: 0;
        /* mobile: show the laptop first, above the text */
        order: -1;
        display: block;
        position: relative;
    }
    #case-hero .cs-device img,
    #case-hero .cs-device svg {
        width: 100%;
        height: auto;
        display: block;
        filter: drop-shadow(0 30px 45px rgba(0, 0, 0, 0.45));
    }
    #case-hero .cs-glow {
        width: 70%;
        height: 60%;
        background: var(--primary);
        opacity: 0.35;
        filter: blur(90px);
        border-radius: 50%;
        position: absolute;
        top: 20%;
        right: -5%;
        z-index: -1;
    }
}
/* Tablet - 768px */
@media only screen and (min-width: 48rem) {
    #case-hero .cs-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    #case-hero .cs-flex-left {
        width: 44%;
        flex: none;
    }
    #case-hero .cs-device {
        width: 54%;
        flex: none;
        /* restore the side-by-side order on tablet and up */
        order: 0;
    }
    #case-hero .cs-button {
        order: 0;
        align-self: flex-start;
    }
}
/* Desktop - 1024px: oversized laptop that bleeds off the right edge */
@media only screen and (min-width: 64rem) {
    #case-hero .cs-container {
        position: relative;
        min-height: 36rem;
    }
    #case-hero .cs-flex-left {
        width: 40%;
    }
    #case-hero .cs-device {
        width: clamp(46rem, 62vw, 70rem);
        max-width: none;
        margin: 0;
        position: absolute;
        top: 50%;
        left: 39%;
        transform: translateY(-50%);
    }
}

/*-- -------------------------- -->
<---      Project Snapshot      -->
<--- -------------------------- -*/
/* Mobile */
@media only screen and (min-width: 0rem) {
    #case-snapshot {
        /* transparent so the card can float over the hero above and the
           transformation below. On mobile it sits below the hero with a gap;
           the floating (negative-margin) overlap kicks in at tablet and up. */
        padding: 0 1rem;
        margin-top: clamp(2rem, 6vw, 3rem);
        background-color: transparent;
        position: relative;
        z-index: 20;
    }
    #case-snapshot .cs-container {
        width: 100%;
        max-width: 80rem;
        margin: auto;
    }
    #case-snapshot .cs-card {
        width: 100%;
        padding: clamp(1.5rem, 3.5vw, 2.75rem);
        box-sizing: border-box;
        background-color: #fff;
        border: 1px solid #e3e6ec;
        border-radius: 1.25rem;
        box-shadow: 0 12px 40px -18px rgba(6, 21, 43, 0.18);
    }
    #case-snapshot .cs-topper {
        text-align: left;
        margin-bottom: 1.75rem;
    }
    #case-snapshot .cs-grid {
        margin: 0;
        padding: 0;
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.75rem 1.25rem;
    }
    #case-snapshot .cs-item {
        list-style: none;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.625rem;
    }
    #case-snapshot .cs-icon-wrapper {
        color: var(--primary);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    #case-snapshot .cs-icon {
        width: 1.5rem;
        height: 1.5rem;
        display: block;
    }
    #case-snapshot .cs-label {
        font-size: 0.8125rem;
        font-weight: 700;
        letter-spacing: 0.03em;
        line-height: 1.2em;
        text-transform: uppercase;
        margin: 0;
        color: var(--headerColor);
    }
    #case-snapshot .cs-value {
        font-size: 0.9375rem;
        line-height: 1.4em;
        margin: 0;
        color: var(--bodyTextColor);
    }
    #case-snapshot .cs-value.cs-live {
        font-weight: 700;
        color: #1fa971;
    }
}
/* Tablet - 768px */
@media only screen and (min-width: 48rem) {
    #case-snapshot {
        /* float the card up onto the hero/transformation seam */
        margin-top: clamp(-6rem, -6vw, -3rem);
    }
    #case-snapshot .cs-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
/* Desktop - 1024px */
@media only screen and (min-width: 64rem) {
    #case-snapshot .cs-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 1.25rem;
    }
}

/*-- -------------------------- -->
<---      The Transformation    -->
<--- -------------------------- -*/
/* Mobile */
@media only screen and (min-width: 0rem) {
    #case-transform {
        padding: var(--sectionPadding);
        background-color: #fff;
        position: relative;
        z-index: 1;
    }
    #case-transform .cs-container {
        width: 100%;
        max-width: 80rem;
        margin: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: clamp(2.5rem, 5vw, 3.5rem);
    }
    #case-transform .cs-content {
        text-align: center;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    #case-transform .cs-title {
        text-transform: uppercase;
        text-align: center;
        max-width: 100%;
        margin-bottom: 0.5rem;
    }
    #case-transform .cs-text {
        text-align: center;
        max-width: 34rem;
    }
    #case-transform .cs-grid {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
        position: relative;
    }
    #case-transform .cs-card {
        width: 100%;
        padding: clamp(1.25rem, 3vw, 2rem);
        box-sizing: border-box;
        border-radius: 1.25rem;
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
    }
    #case-transform .cs-before {
        background-color: #f4f5f7;
        border: 1px solid #e3e6ec;
    }
    #case-transform .cs-after {
        background-color: #f2f8ff;
        border: 1px solid #d5e6fb;
    }
    #case-transform .cs-card-label {
        font-size: 0.8125rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        margin: 0;
        color: var(--bodyTextColor);
    }
    #case-transform .cs-after .cs-card-label {
        color: var(--primary);
    }
    /* Before / after site screenshots */
    #case-transform .cs-picture {
        width: 100%;
        aspect-ratio: 16 / 10;
        border-radius: 0.75rem;
        overflow: hidden;
        display: block;
    }
    #case-transform .cs-picture img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        /* anchor to the top so the site's nav stays visible; the bottom is
           the part that gets cropped */
        object-position: top;
        display: block;
    }
    /* the old site reads as "past" in grayscale */
    #case-transform .cs-before .cs-picture img {
        filter: grayscale(1);
    }
    #case-transform .cs-ul {
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    #case-transform .cs-li {
        font-size: 0.9375rem;
        line-height: 1.4em;
        list-style: none;
        margin: 0;
        color: var(--bodyTextColor);
        display: flex;
        align-items: flex-start;
        gap: 0.625rem;
    }
    #case-transform .cs-li-icon {
        width: 1.25rem;
        height: 1.25rem;
        margin-top: 0.0625rem;
        flex: none;
        display: block;
    }
    /* Arrow between the two cards */
    #case-transform .cs-arrow {
        width: 2.75rem;
        height: 2.75rem;
        margin: -0.25rem auto;
        background-color: var(--primary);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 2;
    }
    #case-transform .cs-arrow img {
        width: 2.125rem;
        height: auto;
        display: block;
        transform: rotate(90deg);
        filter: brightness(0) invert(1);
    }
}
/* Tablet - 768px */
@media only screen and (min-width: 48rem) {
    #case-transform .cs-grid {
        flex-direction: row;
        align-items: stretch;
    }
    #case-transform .cs-card {
        width: 50%;
        flex: none;
    }
    #case-transform .cs-arrow {
        width: 3rem;
        height: 3rem;
        margin: 0;
        position: absolute;
        top: 50%;
        left: 51%;
        transform: translate(-50%, -50%);
    }
    #case-transform .cs-arrow img {
        transform: none;
    }
}

/*-- -------------------------- -->
<---     Challenge / Approach   -->
<--- -------------------------- -*/
/* Mobile */
@media only screen and (min-width: 0rem) {
    #case-process {
        padding: var(--sectionPadding);
        position: relative;
        z-index: 1;
        padding-top: 0;
    }
    #case-process .cs-container {
        width: 100%;
        max-width: 80rem;
        margin: auto;
        display: flex;
        flex-direction: column;
        gap: clamp(2.5rem, 5vw, 4rem);
    }
    #case-process .cs-col {
        width: 100%;
    }
    #case-process .cs-topper {
        text-align: left;
        margin-bottom: 0.75rem;
    }
    #case-process .cs-col-title {
        font-size: clamp(1.5rem, 3vw, 2rem);
        font-weight: 900;
        line-height: 1.2em;
        margin: 0 0 2rem 0;
        color: var(--headerColor);
        font-family: 'Inter', 'Arial', sans-serif;
    }
    #case-process .cs-ul {
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    #case-process .cs-li {
        list-style: none;
        display: flex;
        align-items: flex-start;
        gap: 1rem;
    }
    #case-process .cs-number {
        font-size: 1.125rem;
        font-weight: 900;
        line-height: 1;
        color: var(--primary);
        flex: none;
        font-family: 'Inter', 'Arial', sans-serif;
    }
    #case-process .cs-badge {
        width: 2.5rem;
        height: 2.5rem;
        background-color: rgba(30, 58, 138, 0.1);
        border-radius: 0.625rem;
        color: var(--primary);
        display: flex;
        align-items: center;
        justify-content: center;
        flex: none;
    }
    #case-process .cs-badge img,
    #case-process .cs-badge svg {
        width: 1.25rem;
        height: 1.25rem;
        display: block;
    }
    #case-process .cs-li-flex {
        display: flex;
        flex-direction: column;
        gap: 0.375rem;
    }
    #case-process .cs-h3 {
        font-size: 1.0625rem;
        font-weight: 700;
        line-height: 1.3em;
        margin: 0;
        color: var(--headerColor);
    }
    #case-process .cs-li-text {
        font-size: 0.9375rem;
        line-height: 1.5em;
        margin: 0;
        color: var(--bodyTextColor);
    }
    /* Approach items carry a number + icon badge */
    #case-process .cs-approach .cs-li {
        align-items: flex-start;
    }
}
/* Tablet - 768px */
@media only screen and (min-width: 48rem) {
    #case-process .cs-container {
        /* flex-direction: row; */
        align-items: center;
        gap: clamp(2.5rem, 5vw, 5rem);

    }
    #case-process .cs-col {
        width: 65%;
        flex: none;

    }
}

/*-- -------------------------- -->
<---          Dark Mode         -->
<--- -------------------------- -*/
@media only screen and (min-width: 0rem) {
    /* Snapshot */
    body.dark-mode #case-snapshot {
        background-color: transparent;
    }
    body.dark-mode #case-snapshot .cs-card {
        background-color: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.12);
        box-shadow: none;
    }
    body.dark-mode #case-snapshot .cs-label {
        color: var(--bodyTextColorWhite);
    }
    body.dark-mode #case-snapshot .cs-value {
        color: #cfd3da;
    }
    body.dark-mode #case-snapshot .cs-icon-wrapper {
        color: #9db3e6;
    }

    /* Transformation */
    body.dark-mode #case-transform {
        background-color: var(--dark);
    }
    body.dark-mode #case-transform .cs-before {
        background-color: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.12);
    }
    body.dark-mode #case-transform .cs-after {
        background-color: rgba(30, 58, 138, 0.15);
        border-color: rgba(30, 58, 138, 0.4);
    }
    body.dark-mode #case-transform .cs-card-label,
    body.dark-mode #case-transform .cs-li {
        color: #cfd3da;
    }
    body.dark-mode #case-transform .cs-after .cs-card-label {
        color: var(--primaryLight);
    }

    /* Process */
    body.dark-mode #case-process {
        background-color: rgba(0, 0, 0, 0.25);
    }
    body.dark-mode #case-process .cs-col-title,
    body.dark-mode #case-process .cs-h3 {
        color: var(--bodyTextColorWhite);
    }
    body.dark-mode #case-process .cs-li-text {
        color: #cfd3da;
    }
    body.dark-mode #case-process .cs-number {
        color: var(--secondaryLight);
    }
    body.dark-mode #case-process .cs-badge {
        background-color: rgba(255, 255, 255, 0.08);
        color: #9db3e6;
    }
}
