/* ============================================================
   case-study.css
   Shared styles for all case study pages (work/*.html).
   Extracted from the inline <style> blocks that were duplicated
   across ai-knowledge-assistant.html, spaceflow.html,
   plant-disease-recognition.html, and easymeals.html.
   Page-specific rules remain as small inline <style> blocks
   inside each respective HTML file.
   ============================================================ */

/* ----- Layout container ----- */
.case-study-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    color: #ababab;
}

.case-study-header {
    margin-bottom: 40px;
}

.case-study-title {
    font-size: 48px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
}

.case-study-subtitle {
    font-size: 20px;
    color: #ababab;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* ----- Navigation ----- */
.back-link {
    display: inline-block;
    color: #ff004f;
    text-decoration: none;
    font-size: 16px;
    margin-bottom: 30px;
    transition: color 0.3s;
}

.back-link:hover {
    color: #fff;
}

/* ----- Live demo / GitHub links (used on pages that have them) ----- */
.case-study-live-link-wrap {
    margin: 0 0 30px;
}

.case-study-link-sep {
    color: #666;
    margin: 0 8px;
}

.case-study-live-link {
    display: inline-block;
    color: #ff004f;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s;
}

.case-study-live-link:hover {
    color: #fff;
}

/* ----- Body sections ----- */
.case-study-section {
    margin-bottom: 50px;
}

.case-study-section h2 {
    font-size: 32px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 20px;
}

.case-study-section p {
    line-height: 1.8;
    margin-bottom: 16px;
    font-size: 16px;
}

.case-study-section strong {
    color: #fff;
    font-weight: 600;
}

/* TL;DR / section lead line */
.tldr {
    font-size: 17px;
    color: #fff;
    font-weight: 500;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #262626;
}

/* ----- Hero image ----- */
.case-study-hero-image {
    width: 100%;
    margin: 40px 0 50px;
    border-radius: 10px;
    overflow: hidden;
}

.case-study-hero-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

/* Clickable / zoomable images */
.hero-image-clickable {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.hero-image-clickable:hover {
    opacity: 0.85;
}

.hero-image-clickable:focus {
    outline: 2px solid #ff004f;
    outline-offset: 4px;
    border-radius: 4px;
}

/* ----- Image grid (multi-screenshot pages) ----- */
.case-study-image-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 30px 0 40px;
}

.case-study-image-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.case-study-image-fig {
    margin: 0;
}

.case-study-image-fig img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.case-study-image-fig .hero-image-clickable {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.case-study-image-fig .hero-image-clickable:hover {
    opacity: 0.9;
}

.case-study-image-fig figcaption {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #888;
}

/* ----- TL;DR callout box ----- */
.case-study-tldr-box {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid #ff004f;
    padding: 24px;
    margin: 40px 0 50px;
    border-radius: 6px;
}

.case-study-tldr-box h3 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
    margin-top: 0;
}

.case-study-tldr-box ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.case-study-tldr-box ul li {
    margin-bottom: 12px;
    line-height: 1.6;
    position: relative;
    padding-left: 20px;
}

.case-study-tldr-box ul li::before {
    content: '▸';
    color: #ff004f;
    position: absolute;
    left: 0;
}

.case-study-tldr-box ul li:last-child {
    margin-bottom: 0;
}

/* ----- Lightbox modal ----- */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.image-lightbox:not([hidden]) {
    display: flex;
    opacity: 1;
    pointer-events: all;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 36px;
    font-weight: 300;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background 0.2s ease;
    font-family: Arial, sans-serif;
}

.lightbox-close:hover,
.lightbox-close:focus {
    background: rgba(255, 255, 255, 0.25);
    outline: 2px solid #ff004f;
    outline-offset: 2px;
}

.lightbox-image {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    z-index: 10001;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .image-lightbox {
        transition: none;
    }

    .hero-image-clickable {
        transition: none;
    }

    .lightbox-close {
        transition: none;
    }
}

/* ----- Mobile overrides (≤ 600px) ----- */
@media only screen and (max-width: 600px) {
    .case-study-container {
        padding: 20px 15px;
    }

    .case-study-title {
        font-size: 32px;
    }

    .case-study-subtitle {
        font-size: 18px;
    }

    .case-study-section h2 {
        font-size: 24px;
    }

    .case-study-section p {
        font-size: 14px;
    }

    .case-study-hero-image {
        margin: 30px 0 40px;
    }

    .case-study-tldr-box {
        padding: 20px;
        margin: 30px 0 40px;
    }

    .case-study-tldr-box h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .case-study-tldr-box ul li {
        font-size: 14px;
        margin-bottom: 10px;
    }

    /* Lightbox at small screens */
    .lightbox-close {
        top: 15px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 32px;
    }

    .lightbox-image {
        max-width: 95%;
        max-height: 85vh;
    }

    /* Image grid: single column on mobile */
    .case-study-image-row,
    .case-study-image-row-3 {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px 0 30px;
    }

    .case-study-image-fig figcaption {
        font-size: 13px;
    }
}

/* ── Architecture diagram container ─────────────────────────
   Houses Mermaid-rendered SVGs. Dark background with a subtle
   border keeps the diagram readable without visual noise.
   ─────────────────────────────────────────────────────────── */
.arch-diagram {
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 32px 24px;
    margin: 28px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.arch-diagram .mermaid {
    display: flex;
    justify-content: center;
    min-width: 480px;
}

.arch-diagram .mermaid svg {
    max-width: 100%;
    height: auto;
    font-family: var(--font-primary, 'Poppins', sans-serif);
}

/* Caption beneath a diagram */
.arch-diagram-caption {
    font-size: 13px;
    color: #6b6b6b;
    text-align: center;
    margin-top: 16px;
    margin-bottom: 0;
    font-style: italic;
}

@media (max-width: 600px) {
    .arch-diagram {
        padding: 20px 12px;
        border-radius: 8px;
    }

    .arch-diagram .mermaid {
        min-width: 360px;
    }
}

/* ── Key Metrics list ────────────────────────────────────────
   Styled bullet list used for the Key Metrics section on each
   case study page. Accent-colored markers keep it on-brand.
   ─────────────────────────────────────────────────────────── */
.case-study-metrics {
    margin-top: 10px;
    margin-bottom: 0;
    padding-left: 18px;
    list-style: none;
}

.case-study-metrics li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: 15px;
    color: #c8c8c8;
    line-height: 1.6;
}

.case-study-metrics li::before {
    content: '▸';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-accent, #ff004f);
    font-size: 13px;
    line-height: 1.8;
}

.case-study-metrics li:last-child {
    margin-bottom: 0;
}

/* Inline code within metric items */
.case-study-metrics li code {
    font-size: 13px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 1px 5px;
    color: #e2e2e2;
}

@media (max-width: 600px) {
    .case-study-metrics li {
        font-size: 14px;
    }
}