/* =========================================================
   cases.html — Case Studies Page
   ========================================================= */

/* ── Industry Ticker ── */
.industry-ticker {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 20px 35px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
}
.ticker-label {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--tech-blue);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    white-space: nowrap;
}
.ticker-tags {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.ticker-tag {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ticker-tag i {
    color: rgba(255,255,255,0.2);
    font-size: 0.6rem;
}

/* ── Case Studies Container ── */
.case-studies-container {
    display: block;
}

/* ── Sidebar Menu ── */
.sidebar-menu {
    position: sticky;
    top: 140px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}
.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 4px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
}
.menu-item:hover {
    color: #fff;
    background: rgba(255,255,255,0.02);
    border-color: var(--border-color);
}
.menu-item.active {
    color: var(--neon-green);
    background: var(--bg-surface);
    border-color: var(--border-color);
    box-shadow: inset 3px 0 0 var(--neon-green);
}
.menu-item .count {
    font-family: monospace;
    font-size: 0.75rem;
    background: #161822;
    padding: 3px 10px;
    border-radius: 2px;
    color: #4a5061;
    border: 1px solid var(--border-color);
}
.menu-item.active .count {
    color: var(--neon-green);
    border-color: rgba(0, 255, 102, 0.2);
    background: rgba(0, 255, 102, 0.05);
}

/* ── Products Grid ── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    min-width: 0;
}
.product-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.product-image-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: radial-gradient(circle at center, #11131c 0%, #08090d 100%);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 40px;
}
.product-image-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0.8;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}
.product-card:hover .product-image-box {
    border-color: rgba(0, 255, 102, 0.25);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}
.product-card:hover .product-image-box img {
    opacity: 1;
    transform: scale(1.04);
}
.card-meta-tag {
    position: absolute;
    top: 20px;
    right: 20px;
    font-family: monospace;
    font-size: 0.7rem;
    background: rgba(5, 6, 8, 0.8);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 2px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}
.product-card:hover .card-meta-tag {
    border-color: rgba(0, 255, 102, 0.3);
    color: var(--neon-green);
}
.product-description {
    padding: 22px 4px 0 4px;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.product-description h4 {
    margin: 0 0 14px 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}

/* ── Story Line ── */
.story-line {
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 8px;
    color: var(--text-muted);
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.story-line span {
    font-family: monospace;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 10px;
    display: inline-block;
    width: 75px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.story-line.challenge span {
    color: #ff4444;
}
.story-line.solution span {
    color: var(--tech-blue);
}
.story-line.result span {
    color: var(--neon-green);
}

/* ── Timeline Section ── */
.timeline-section {
    background: #08090d;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    /* margin-top: 120px; */
}
.timeline-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 35px;
    margin-top: 50px;
}
.timeline-node {
    position: relative;
    padding: 35px;
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    background: var(--bg-deep);
}
.timeline-node h4 {
    font-size: 1.05rem;
    margin: 0 0 12px 0;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}
.timeline-node h4 i {
    color: var(--neon-green);
    font-size: 0.9rem;
}
.timeline-node p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.6;
}
.node-number {
    font-family: monospace;
    font-size: 3.5rem;
    font-weight: 900;
    color: rgba(255,255,255,0.015);
    position: absolute;
    bottom: -5px;
    right: 15px;
    pointer-events: none;
}

/* ── Case Grid (dynamic from DB) ── */
.case-studies-container {
    display: block;
}
.case-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}
.case-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.case-card:hover {
    border-color: rgba(0, 255, 102, 0.3);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}
.case-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: radial-gradient(circle at center, #11131c 0%, #08090d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.case-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s, opacity 0.3s;
}
.case-thumb-placeholder {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.case-card:hover .case-thumb img {
    transform: scale(1.05);
    opacity: 0.9;
}
.case-meta {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.case-meta h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.2px;
}
.case-material {
    font-size: 0.82rem;
    color: #ffa500;
    font-weight: 600;
}
.case-category {
    font-size: 0.78rem;
    color: var(--text-muted);
}

@media (max-width: 1300px) {
    .case-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1000px) {
    .case-studies-container { overflow: visible; }
    .case-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 650px) {
    .case-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .case-meta h3 { font-size: .85rem; }
    .case-meta { padding: 12px 14px; }
}
@media (max-width: 1300px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}
@media (max-width: 1000px) {
    .case-studies-container {
        grid-template-columns: 1fr;
        gap: 40px;
        overflow: hidden;
    }
    .sidebar-menu {
        position: relative;
        top: 0;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    .sidebar-menu .menu-item {
        padding: 8px 12px;
        font-size: 0.78rem;
        white-space: nowrap;
        gap: 6px;
        justify-content: flex-start;
    }
    .sidebar-menu .menu-item .count {
        flex-shrink: 0;
        margin-left: 0;
    }
    .timeline-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 650px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        max-width: 100%;
        overflow: hidden;
    }
    .timeline-grid {
        grid-template-columns: 1fr;
    }
    .industry-ticker {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 18px;
    }
    .ticker-tag {
        font-size: 0.78rem;
    }
    .story-line {
        font-size: 0.82rem;
    }
    .story-line span {
        width: auto;
        display: inline;
        margin-right: 6px;
    }
    .product-image-box {
        padding: 20px;
    }
    .product-description {
        padding: 18px 0 0 0;
    }
    .timeline-node {
        padding: 24px 20px;
    }
    .product-card {
        max-width: 100%;
        overflow: hidden;
    }
    .product-description h4 {
        word-break: break-word;
    }
    .story-line {
        word-break: break-word;
    }
}
