/* ============================================
   Mobile Timeline: Tight Stack v31
   Round 31 - Compressed & Interactive
   ============================================ */

@media (min-width: 901px) {
    #mobile-timeline-root {
        display: none !important;
    }
}

@media (max-width: 900px) {

    .timeline-container,
    .timeline-visual,
    .timeline-content {
        display: none !important;
    }

    #mobile-timeline-root {
        display: flex;
        flex-direction: column;
        width: 100%;
        background: var(--color-background);
        padding-bottom: 5vh;
        /* Minimized bottom padding */
    }

    /* === PROJECT CARD === */
    .mobile-project-card {
        position: sticky;
        /* "top" set by JS */

        width: 100%;
        min-height: 65vh;
        background: var(--color-background);

        border-top: 1px solid rgba(0, 0, 0, 0.08);
        /* Divider */
        border-radius: 16px 16px 0 0;
        /* Slightly tighter radius */

        /* Shadow for Depth */
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);

        overflow: hidden;
        margin-bottom: 0;
        /* No gaps */

        cursor: pointer;
        transition: background 0.2s;

        /* Ensure clicks work */
        pointer-events: auto;
    }

    .mobile-project-card:active {
        background: #f7f7f7;
    }

    .card-inner {
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    /* HEADER (Compact) */
    .card-header {
        padding: 0 16px;
        /* Tighter padding */
        background: var(--color-background);
        border-bottom: 1px solid rgba(0, 0, 0, 0.02);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        /* Height set by JS */
    }

    .card-title {
        font-family: var(--font-heading);
        font-size: 0.95rem;
        /* Ensure fit */
        font-weight: 600;
        color: var(--color-text);
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }

    .card-year {
        font-family: var(--font-heading);
        font-size: 0.75rem;
        color: var(--color-text-light);
        font-weight: 500;
        white-space: nowrap;
    }

    /* CONTENT */
    .card-content-wrapper {
        padding: 16px 16px 30px 16px;
        flex: 1;
        background: var(--color-background);
        cursor: default;
        /* Content area not clickable pointer */
    }

    /* Allow clicking header to nav, but content text selection should work */
    .card-content-wrapper p {
        cursor: text;
    }

    .card-image-wrapper {
        width: 100%;
        margin-bottom: 20px;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    }

    .card-image {
        width: 100%;
        height: auto;
        display: block;
        aspect-ratio: 16/10;
        object-fit: cover;
    }

    .card-desc {
        font-size: 0.95rem;
        line-height: 1.6;
        color: var(--color-text-light);
        margin-bottom: 24px;
    }

    .card-cta {
        display: inline-block;
        padding: 10px 24px;
        background: var(--color-text);
        color: white;
        border-radius: 50px;
        text-decoration: none;
        font-weight: 500;
        font-size: 0.9rem;
        cursor: pointer;
    }

    /* SEPARATOR */
    .mobile-project-card.is-separator {
        background: transparent;
        box-shadow: none;
        border: none;
        min-height: auto;
        padding: 30px 0 15px 0;
        pointer-events: none;
    }

    .card-separator-title {
        font-family: var(--font-heading);
        font-size: 1.3rem;
        color: var(--color-text-light);
        text-align: center;
        opacity: 0.6;
    }
}

/* Short screens (iPhone SE, small Android) */
@media (max-height: 667px) and (max-width: 900px) {
    .mobile-project-card {
        min-height: 55vh;
    }

    .card-content-wrapper {
        padding: 12px 12px 24px 12px;
    }

    .card-image-wrapper {
        margin-bottom: 12px;
    }

    .card-desc {
        font-size: 0.88rem;
        margin-bottom: 16px;
    }
}