/* 
  case_study.css
  Consolidated styles for Case Study pages (cs_*.html)
*/

dl.cs-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    margin-bottom: 0;
}

.cs-meta-col dt {
    font-family: var(--font-outfit);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: normal;
}

.cs-meta-col dd {
    font-size: 1rem;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
}

.cs-hero-image {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 2rem 0;
    box-sizing: border-box;
}

.cs-section {
    padding: 5rem 0;
    overflow-x: hidden; /* Prevent horizontal spill on mobile */
}

.cs-section-inner {
    margin: 0 14rem;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    line-height: 1.2;
}

.cs-section h3 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin: 0 0 1.5rem;
    color: var(--text-color);
    line-height: 1.3;
}

.cs-section h4 {
    font-family: var(--font-outfit);
    font-size: 1.3rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
}

.cs-section p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.content-flex {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.cs-list {
    list-style: disc;
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.7;
}

.cs-list li {
    margin-bottom: 0.5rem;
}

.cs-list li b {
    color: var(--text-color);
}

figure.image-block {
    margin: 0;
}

.content-img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease, box-shadow 0.4s ease;
    display: block;
}

.lightbox-link {
    display: block;
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .lightbox-link:hover .content-img {
        transform: translateY(-4px) scale(1.02);
        border-color: var(--text-muted);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    }
}

figcaption.caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    font-family: var(--font-outfit);
    margin-top: 1rem;
    margin-bottom: 0;
}

.next-proj-link {
    font-family: var(--font-serif);
    font-size: 3rem;
    color: var(--text-color);
    text-decoration: none;
    display: inline-block;
    transition: color 0.3s ease, transform 0.3s ease;
    line-height: 1.1;
}

@media (hover: hover) and (pointer: fine) {
    .next-proj-link:hover {
        color: var(--text-muted);
        transform: translateX(8px);
    }
}

.cs-quote {
    border-left: 4px solid var(--text-muted);
    padding-left: 1.5rem;
    margin: 2.5rem 0;
    font-style: italic;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--text-color);
    line-height: 1.6;
}

/* Feedback Grid (from cs_ericsson) */
.feedback-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.feedback-item {
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-outfit);
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.6;
}

.feedback-item strong {
    display: block;
    color: var(--text-color);
    font-style: normal;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

video.content-img {
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: #000;
}

#lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
}

#lightbox.active {
    display: flex;
}

#lightbox-img {
    max-width: 90%;
    max-height: 90svh;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: max(1rem, env(safe-area-inset-top));
    right: max(1.5rem, env(safe-area-inset-right));
    color: #fff;
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 1001;
}

@media (hover: hover) and (pointer: fine) {
    .close:hover {
        color: var(--text-muted);
    }
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: none;
    cursor: pointer;
    padding: 1.5rem 1rem;
    font-size: 2rem;
    transition: background 0.3s;
    border-radius: 4px;
    z-index: 1001;
}

@media (hover: hover) and (pointer: fine) {
    .lightbox-nav:hover {
        background: rgba(255, 255, 255, 0.15);
    }
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

/* ── Responsive ── */
@media (min-width: 1200px) {
    .cs-section-inner {
        display: grid;
        grid-template-columns: 280px 1fr;
        column-gap: 5rem;
        row-gap: 4rem;
        align-items: start;
    }

    .section-title {
        grid-column: 1 / 2;
        margin-top: -0.25rem;
        margin-bottom: 0;
    }

    .content-flex {
        display: contents;
    }

    .content-text {
        grid-column: 2 / 3;
    }

    .image-block {
        grid-column: 1 / -1;
        width: 100%;
    }

    .feedback-grid {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1200px) {
    .cs-hero-inner,
    .cs-section-inner {
        margin: 0 2rem;
        padding: 0;
    }

    dl.cs-meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .image-block {
        margin-top: 2rem;
    }

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

@media (max-width: 768px) {
    .cs-hero {
        overflow-x: hidden; /* Prevent horizontal spill */
    }

    .cs-hero-inner,
    .cs-section-inner {
        margin: 0 1.25rem !important; 
        padding: 0 !important;
    }

    .cs-hero-image {
        padding: 1.5rem 1rem 0;
    }

    .cs-title {
        font-size: clamp(2rem, 8vw, 2.5rem);
        word-break: break-word; /* Ensure titles wrap */
    }

    .section-title {
        font-size: 2rem;
    }

    .cs-section h3 {
        font-size: 1.5rem;
    }

    .cs-section h4 {
        font-size: 1.2rem;
    }

    .cs-quote {
        font-size: 1.25rem;
    }

    dl.cs-meta-grid {
        gap: 1.5rem;
        grid-template-columns: 1fr;
    }

    /* Make Lightbox buttons less intrusive on small screens */
    .lightbox-nav {
        padding: 1rem 0.5rem;
        font-size: 1.5rem;
    }

    .lightbox-prev {
        left: 0.5rem;
    }
    .lightbox-next {
        right: 0.5rem;
    }
}

@media (max-width: 480px) {
    .cs-meta-grid {
        grid-template-columns: 1fr; /* Stack meta items on narrow screens */
    }
    
    .next-proj-link {
        font-size: 2rem; /* Scale down next project link */
    }
}

/* Video Wrapper (from cs_vindome) */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
