/* ============================================================
   Cinema Repertoire v3.0 — CSS Variables driven by block attrs
   ============================================================ */

.cinema-rep {
    --crep-bg:             #141414;
    --crep-card-bg:        #1c1c1c;
    --crep-card-border:    #2a2a2a;
    --crep-text:           #f0ece4;
    --crep-text-muted:     #9a958c;
    --crep-accent:         #b8a67e;
    --crep-accent-hover:   #d4c49e;
    --crep-btn-bg:         #b8a67e;
    --crep-btn-text:       #141414;
    --crep-radius:         4px;
    --crep-padding:        48px;
    --crep-card-width:     280px;
    --crep-card-gap:       20px;
    --crep-title-size:     38px;
    --crep-title-color:    #f0ece4;
    --crep-subtitle-color: #9a958c;
    --crep-font:           -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
}

/* ── Section ───────────────────────────────────────────── */

.cinema-rep {
    background: var(--crep-bg);
    color: var(--crep-text);
    font-family: var(--crep-font);
    padding: var(--crep-padding);
    position: relative;
    overflow: hidden;
}

/* ── Header ────────────────────────────────────────────── */

.cinema-rep__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.cinema-rep__title {
    font-size: var(--crep-title-size);
    font-weight: 400;
    letter-spacing: -0.02em;
    margin: 0 0 0.15rem;
    font-style: italic;
    display: inline-block;
    padding-bottom: 2px;
    line-height: 1.2;
    color: var(--crep-title-color);
}

.cinema-rep__subtitle {
    display: block;
    font-size: 0.85rem;
    color: var(--crep-subtitle-color);
    margin-top: 0.25rem;
}

/* ── Date navigation ───────────────────────────────────── */

.cinema-rep__dates {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.cinema-rep__dates-track {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cinema-rep__dates-track::-webkit-scrollbar {
    display: none;
}

.cinema-rep__dates-arrow {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--crep-card-border);
    border-radius: 50%;
    color: var(--crep-text-muted);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.cinema-rep__dates-arrow:hover:not(:disabled) {
    color: var(--crep-text);
    border-color: var(--crep-text);
}

.cinema-rep__dates-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.cinema-rep__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 1rem;
    background: none;
    border: 1px solid transparent;
    color: var(--crep-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 85px;
    font-family: inherit;
}

.cinema-rep__date:hover {
    color: var(--crep-text);
}

.cinema-rep__date--active {
    background: var(--crep-accent);
    color: var(--crep-btn-text);
    border-color: var(--crep-accent);
}

.cinema-rep__date--active .cinema-rep__date-dayname,
.cinema-rep__date--active .cinema-rep__date-month,
.cinema-rep__date--active .cinema-rep__date-upcoming-label {
    color: var(--crep-btn-text);
}

.cinema-rep__date-dayname {
    font-size: 0.7rem;
    text-transform: capitalize;
    letter-spacing: 0.04em;
    color: inherit;
    padding-bottom: 1px;
    margin-bottom: 0.2rem;
}

.cinema-rep__date-num {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
}

.cinema-rep__date-month {
    font-size: 0.7rem;
    color: inherit;
    font-weight: 600;
}

/* "Najbliższe seanse" button */

.cinema-rep__date--upcoming {
    min-width: auto;
    padding: 0.8rem 1.2rem;
    justify-content: center;
    border-right: 1px solid var(--crep-card-border);
    margin-right: 0.25rem;
}

.cinema-rep__date-upcoming-label {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* ── Movies grid ───────────────────────────────────────── */

.cinema-rep__grid-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.cinema-rep__grid {
    display: flex;
    gap: var(--crep-card-gap);
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.5rem 0;
    scroll-snap-type: x mandatory;
}

.cinema-rep__grid::-webkit-scrollbar {
    display: none;
}

.cinema-rep__nav {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(4px);
    border: 1px solid var(--crep-card-border);
    border-radius: 50%;
    color: var(--crep-text);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    z-index: 2;
}

.cinema-rep__nav:hover {
    background: var(--crep-card-bg);
    border-color: var(--crep-accent);
}

.cinema-rep__nav--prev { margin-right: 0.75rem; }
.cinema-rep__nav--next { margin-left: 0.75rem; }

/* ── Movie card ────────────────────────────────────────── */

.cinema-rep__card {
    flex: 0 0 var(--crep-card-width);
    scroll-snap-align: start;
    background: var(--crep-card-bg);
    border: 1px solid var(--crep-card-border);
    border-radius: var(--crep-radius);
    display: flex;
    flex-direction: column;
    transition: border-color 0.25s, box-shadow 0.25s;
    position: relative;
}

.cinema-rep__card:hover {
    border-color: var(--crep-accent);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.cinema-rep__poster {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #0f0f0f;
    border-radius: var(--crep-radius) var(--crep-radius) 0 0;
}

.cinema-rep__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.cinema-rep__card:hover .cinema-rep__poster img {
    transform: scale(1.04);
}

.cinema-rep__poster-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--crep-text-muted);
}

.cinema-rep__info {
    padding: 1rem 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cinema-rep__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.cinema-rep__date-label {
    font-size: 0.78rem;
    color: var(--crep-text-muted);
}

.cinema-rep__date-label::before {
    content: "\1F4C5 ";
    font-size: 0.72rem;
}

.cinema-rep__movie-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 auto;
    padding-bottom: 0.75rem;
    color: var(--crep-text);
}

/* Screenings */

.cinema-rep__screenings {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--crep-card-border);
}

.cinema-rep__time {
    font-size: 0.85rem;
    color: var(--crep-text);
    text-decoration: none;
    padding: 0.25rem 0.15rem;
    transition: color 0.2s;
    font-variant-numeric: tabular-nums;
}

.cinema-rep__time:hover {
    color: var(--crep-accent);
}

.cinema-rep__buy {
    margin-left: auto;
    display: inline-block;
    padding: 0.45rem 1rem;
    background: var(--crep-btn-bg);
    color: var(--crep-btn-text);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--crep-radius);
    transition: background 0.2s;
    white-space: nowrap;
    cursor: pointer;
}

.cinema-rep__buy:hover {
    background: var(--crep-accent-hover);
    color: var(--crep-btn-text);
}

/* ── Time picker popup ─────────────────────────────────── */

.cinema-rep__popup {
    position: fixed;
    background: #252525;
    border: 1px solid #b8a67e;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    z-index: 999999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s, transform 0.2s;
    min-width: 160px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
}

.cinema-rep__popup--visible {
    opacity: 1;
    transform: translateY(0);
}

.cinema-rep__popup-title {
    font-size: 0.78rem;
    color: #9a958c;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cinema-rep__popup-times {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.cinema-rep__popup-time {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    background: #b8a67e;
    color: #141414;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
    font-variant-numeric: tabular-nums;
}

.cinema-rep__popup-time:hover {
    background: #d4c49e;
    color: #141414;
}

/* ── Empty / loading states ────────────────────────────── */

.cinema-rep__empty {
    width: 100%;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--crep-text-muted);
    font-size: 1.05rem;
}

.cinema-rep__grid--loading {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cinema-rep__grid--loading::after {
    content: '';
    width: 36px;
    height: 36px;
    border: 3px solid var(--crep-card-border);
    border-top-color: var(--crep-accent);
    border-radius: 50%;
    animation: crep-spin 0.7s linear infinite;
}

@keyframes crep-spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 768px) {
    .cinema-rep {
        padding: calc(var(--crep-padding) * 0.5) !important;
    }

    .cinema-rep__header {
        flex-direction: column;
        gap: 1rem;
    }

    .cinema-rep__dates {
        width: 100%;
    }

    .cinema-rep__date {
        min-width: 68px;
        padding: 0.5rem 0.6rem;
    }

    .cinema-rep__date-num {
        font-size: 1.3rem;
    }

    .cinema-rep__card {
        flex: 0 0 240px;
    }
}

@media (max-width: 480px) {
    .cinema-rep__card {
        flex: 0 0 85vw;
    }

    .cinema-rep__title {
        font-size: calc(var(--crep-title-size) * 0.7);
    }
}
