.ti-frames-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.ti-frame-card {
    flex: 1 1 300px;
    max-width: 400px;
    box-sizing: border-box;
    border: 1px solid #575757;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    display: block;
    /* make the <a> a block */
    text-decoration: none;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: transform .2s;
}

.ti-frame-card:hover {
    transform: translateY(-4px);
}

.frame-image {
    width: 100%;
    aspect-ratio: 2 / 1;
    display: flex;
    overflow: hidden;
    position: relative;
    background-color: #121212;
    /* fallback dark color */
    background-image: url('assets/film-background.png');
    background-size: cover;
    background-position: center center;
}

.frame-image.movies-1 .scene {
    flex: 2;
    background-size: cover;
    background-position: center;
}

.frame-image.movies-1 .poster {
    flex: 1;
    object-fit: cover;
    height: 100%;
}

.frame-image.movies-2,
.frame-image.movies-3 {
    display: flex;
    gap: 2px;
}

.frame-image.movies-2 .poster,
.frame-image.movies-3 .poster {
    flex: 1;
    object-fit: cover;
    height: 100%;
}

/* Ensure posters render on top */
.frame-image .poster,
.frame-image .scene {
    position: relative;
    z-index: 1;
}

/* Two-poster: show full height posters and evenly distribute whitespace */
.frame-image.movies-2 {
    display: flex;
    justify-content: space-evenly;
    /* equal space on left, right, and between */
    align-items: center;
    /* vertically center contained images */
    gap: 2px;
    /* tiny gap in case the posters grow */
}

.frame-image.movies-2 .poster {
    flex: 0 0 auto;
    /* size to intrinsic width at full height */
    height: 100%;
    width: auto;
    /* maintain aspect ratio */
    object-fit: contain;
    /* no cropping, show whole poster */
}

/* Single poster with no scene: show full poster centered with even side padding */
.frame-image.movies-1.no-scene {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}

.frame-image.movies-1.no-scene .poster {
    flex: 0 0 auto;
    height: 100%;
    width: auto;
    object-fit: contain;
}

.ti-frames-header {
    margin-bottom: 1em;
    color: var(--text-color);
    font-size: var(--text-3xl);
    margin-bottom: 2rem;
    font-family: var(--roboto-condensed-regular) !important;
    display: flex;
    align-items: baseline;
    flex-direction: row;
    margin-bottom: 26px;
}

.ti-frames-header .font-bold {
    font-weight: bold;
    margin: 0;
}

.ti-frames-header .stroke {
    margin-left: 12px;
    height: 2px;
    flex: 1;
    background-color: var(--dark-card-backgroundcolor);
}

.frame-name {
    font-size: 1.1rem;
    margin: 0.5em 1em 0;
}

.frame-description {
    font-size: 0.9rem;
    margin: 0.3em 1em 1em;
    color: #555;
}

.poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* ensures full coverage with cropping */
}

.frame-label {
    position: absolute;
    bottom: 0px;
    left: 0px;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    /* opacity 0.8 now */
    padding: 8px;
    border-radius: 4px;
    box-sizing: border-box;
    /* ensure padding doesn’t overflow */
    color: var(--text-color);
    font-size: 1.1rem;
    z-index: 2;
}

.ti-frames-container:not(:last-child) {
    margin-bottom: 50px;
}

/* Mobile: stack images vertically */
@media (max-width: 600px) {
    .ti-frame-card {
        /* make the card itself full-width but keep its internal layout */
        flex: 1 1 100%;
        max-width: 100%;
    }

    .frame-image {
        /* remove the column override so posters stay side-by-side */
        flex-direction: row;
        aspect-ratio: 2 / 1;
        /* keeps the 2:1 ratio */
        height: auto;
        /* height will be based on width * 1/2 */
    }

    .frame-image .scene,
    .frame-image .poster {
        /* let them shrink evenly */
        flex: 1 1 0;
        height: auto;
    }
}