/* ============================================================
   CERSAIE Exhibition Slider v3.0
   Fixed active position — slides animate in/out with 3D flip
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;600&display=swap');

/* ── Variables ── */
.cersaie-slider-wrap {
    --cs-arrow:      #2E86C1;
    --cs-title:      #555555;
    --cs-bg-strip:   #e8e8e8;
    --cs-img-w:      260px;
    --cs-img-h:      380px;
    --cs-strip-h:    260px; /* ύψος γκρι λωρίδας — εικόνα ξεπερνά πάνω/κάτω */
}

/* ── Outer wrap ── */
.cersaie-slider-wrap {
    position: relative;
    width: 100%;
    background: #ffffff;
    font-family: 'Raleway', sans-serif;
    box-sizing: border-box;
    /* perspective για το 3D flip */
    perspective: 1200px;
}

/* ══════════════════════════════════════════
   ΤΙΤΛΟΣ — πάνω από τη γκρι λωρίδα
   Offset = peek-left(120px) + margin-left active(40px) + img width + gap(40px)
   ══════════════════════════════════════════ */
.cs-header {
    text-align: left;
    padding: 0 40px 18px calc(120px + 40px + var(--cs-img-w) + 40px);
}

/* ══════════════════════════════════════════
   GREY STRIP
   overflow-x: clip — κρατά το κείμενο εντός οριζόντια
   overflow-y: visible — αφήνει την εικόνα να ξεπερνά κατακόρυφα
   ══════════════════════════════════════════ */
.cs-strip {
    position: relative;
    width: 100%;
    background: var(--cs-bg-strip);
    height: var(--cs-strip-h);
    box-sizing: border-box;
    overflow-x: clip;
    overflow-y: visible;
    display: flex;
    align-items: center;
}

/* ══════════════════════════════════════════
   INNER LAYOUT
   [inactive-left] [active-img] [content] [inactive-right x2]
   ══════════════════════════════════════════ */
.cs-inner {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
}

/* ══════════════════════════════════════════
   ACTIVE IMAGE — ξεπερνά strip πάνω/κάτω
   ══════════════════════════════════════════ */
.cs-active-img {
    width: var(--cs-img-w);
    height: var(--cs-img-h);
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 55px rgba(0,0,0,.22);
    position: relative;
    z-index: 10;
    margin-left: 40px;
    margin-top: calc((var(--cs-img-h) - var(--cs-strip-h)) / -2);
    margin-bottom: calc((var(--cs-img-h) - var(--cs-strip-h)) / -2);
    align-self: center;
}

.cs-active-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 3D flip animation */
.cs-active-img.cs-flip-in-right {
    animation: flipInRight .5s cubic-bezier(.4,0,.2,1) both;
}
.cs-active-img.cs-flip-in-left {
    animation: flipInLeft .5s cubic-bezier(.4,0,.2,1) both;
}

@keyframes flipInRight {
    from {
        transform: rotateY(-60deg) translateX(60px);
        opacity: 0;
    }
    to {
        transform: rotateY(0deg) translateX(0);
        opacity: 1;
    }
}

@keyframes flipInLeft {
    from {
        transform: rotateY(60deg) translateX(-60px);
        opacity: 0;
    }
    to {
        transform: rotateY(0deg) translateX(0);
        opacity: 1;
    }
}

/* ══════════════════════════════════════════
   CONTENT — δεξιά του active image
   Ο τίτλος ΔΕΝ εμφανίζεται εδώ — μόνο στο cs-header
   ══════════════════════════════════════════ */
.cs-content {
    flex: 1;
    padding: 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 5;
}

/* Κρύψε τον τίτλο μέσα στο content — εμφανίζεται μόνο στο header */
.cs-content .cs-title {
    display: none;
}

.cs-desc {
    font-size: .88rem;
    line-height: 1.9;
    color: #888;
    margin: 0 0 28px;
    max-width: 100%;
}

/* Τίτλος στο header */
.cs-header-title {
    font-size: 1.9rem;
    font-weight: 300;
    color: var(--cs-title);
    letter-spacing: .03em;
    margin: 0;
    line-height: 1.2;
}

.cs-header-title strong {
    font-weight: 600;
}

/* content fade animation */
.cs-content.cs-fade-in {
    animation: contentFadeIn .4s ease .15s both;
}

@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0);   }
}

/* ══════════════════════════════════════════
   ΚΟΥΜΠΙ
   ══════════════════════════════════════════ */
.cs-btn {
    appearance: none;
    -webkit-appearance: none;
    background-image: none;
    outline: none;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 28px;
    padding: 0 14px;
    border-radius: 999px;
    background: transparent;
    border: 1.8px solid #333D49;
    color: #2c2c2c;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    transition:
        width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
        padding 0.35s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.cs-btn .label {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-6px);
    transition:
    opacity 0.25s ease 0.15s,
    transform 0.30s ease 0.15s,
    visibility 0s ease 0.15s;
    pointer-events: none;
}

.cs-btn:hover {
    width: 210px;
    padding: 0 18px;
    border-color: #9a9490;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.cs-btn:hover .label {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* ══════════════════════════════════════════
   INACTIVE SLIDES POOL
   Αριστερά: 1 slide (skew δεξιά)
   Δεξιά: 2 slides (skew αριστερά)
   ══════════════════════════════════════════ */
.cs-peek-left,
.cs-peek-right {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 3;
    flex-shrink: 0;
}

/* Αριστερά — 1 inactive */
.cs-peek-left {
    margin-left: 16px;
    order: -1; /* εμφανίζεται πριν το active */
}

/* Δεξιά — 2 inactive */
.cs-peek-right {
    gap: 10px;
    margin-right: 16px;
}

.cs-peek-item {
    width: 110px;
    height: calc(var(--cs-strip-h) * 0.85);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    filter: blur(2px);
    opacity: 0.5;
    transition: filter .4s ease, opacity .4s ease, transform .4s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.cs-peek-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Skew: αριστερό slide κλίνει αριστερά — 3D perspective */
.cs-peek-left .cs-peek-item {
    transform: perspective(400px) rotateY(-25deg) scaleX(0.9);
    transform-origin: right center;
}

/* Skew: δεξιά slides κλίνουν δεξιά — 3D perspective */
.cs-peek-right .cs-peek-item {
    transform: perspective(400px) rotateY(25deg) scaleX(0.9);
    transform-origin: left center;
}

/* Το δεύτερο δεξί slide είναι πιο μικρό/faded */
.cs-peek-right .cs-peek-item:nth-child(2) {
    width: 80px;
    opacity: 0.3;
    filter: blur(3px);
}

/* ══════════════════════════════════════════
   NAVIGATION — SVG βελάκια
   ══════════════════════════════════════════ */
.cs-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 24px 0 20px;
    background: #ffffff;
}

.cs-prev,
.cs-next {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: var(--cs-arrow);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(46,134,193,.3);
    transition: background .2s, transform .2s;
    padding: 0;
}

.cs-prev svg,
.cs-next svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.cs-prev:hover,
.cs-next:hover {
    background: #1a6fa0;
    transform: scale(1.08);
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 1023px) {
    .cersaie-slider-wrap {
        --cs-img-w:    200px;
        --cs-img-h:    300px;
        --cs-strip-h:  220px;
    }
    .cs-peek-item { width: 80px; }
    .cs-peek-right .cs-peek-item:nth-child(2) { width: 55px; }
    .cs-title { font-size: 1.5rem; }
    .cs-content { padding: 16px 24px; }
}

@media (max-width: 767px) {
    .cersaie-slider-wrap {
        --cs-img-w:    150px;
        --cs-img-h:    230px;
        --cs-strip-h:  180px;
    }
    .cs-peek-item { width: 55px; }
    .cs-peek-right .cs-peek-item:nth-child(2) { display: none; }
    .cs-title { font-size: 1.2rem; }
    .cs-desc  { font-size: .8rem; }
    .cs-content { padding: 12px 16px; }
    .cs-active-img { margin-left: 16px; }
    .cs-header { padding-left: calc(var(--cs-img-w) + 30px); }
}

@media (max-width: 479px) {
    .cersaie-slider-wrap {
        --cs-img-w:    120px;
        --cs-img-h:    190px;
        --cs-strip-h:  160px;
    }
    .cs-peek-left { display: none; }
    .cs-peek-item { width: 45px; }
    .cs-title { font-size: 1rem; }
    .cs-prev, .cs-next { width: 38px; height: 38px; font-size: 1.3rem; }
    .cs-header { padding-left: 16px; text-align: center; }
}

.cs-btn .label {
    color: #333D49;
}

/* Μεγαλύτερες εικόνες */
.cersaie-slider-wrap {
    --cs-img-w:   320px;
    --cs-img-h:   460px;
    --cs-strip-h: 300px;
}

/* Τίτλος πιο κεντρικά — μειώνουμε το padding-left */
.cs-header {
    text-align: center;
    padding: 0 150px 18px calc(0px + 40px + var(--cs-img-w) - 40px);
}
.cs-peek-item {
    width: 210px;
    height: calc(var(--cs-strip-h) * 0.95);
}

.cs-peek-right .cs-peek-item:nth-child(2) {
    width: 170px;
}

/*Mobile tweaks*/
@media (max-width: 767px) {

    /* Κρύψε τα inactive slides εντελώς */
    .cs-peek-left,
    .cs-peek-right {
        display: none;
    }

    .cersaie-slider-wrap {
        --cs-img-w:   85%;
        --cs-img-h:   auto;
        --cs-strip-h: auto;
        background: #fff;
    }

    /* Strip — κατακόρυφη διάταξη */
    .cs-strip {
        height: auto;
        overflow: visible;
        padding: 40px 0 30px;
        background: var(--cs-bg-strip);
    }

    .cs-inner {
        flex-direction: column;
        align-items: center;
    }

    /* Active image — centered, με rounded corners και shadow όπως desktop */
    .cs-active-img {
        width: var(--cs-img-w);
        height: auto;
        margin: -60px auto 0;
        border-radius: 14px;
        box-shadow: 0 20px 55px rgba(0,0,0,.22);
        position: relative;
        z-index: 10;
    }

    .cs-active-img img {
        width: 100%;
        height: auto;
        object-fit: contain; /* ολόκληρη η εικόνα, χωρίς crop */
    }

    /* Content — κάτω από την εικόνα μέσα στο strip */
    .cs-content {
        padding: 24px 24px 8px;
        align-items: center;
        width: 100%;
    }

    .cs-desc {
        font-size: .85rem;
        line-height: 1.75;
        text-align: center;
    }

    /* Τίτλος — κεντραρισμένος πάνω από το strip */
    .cs-header {
        padding: 0 20px 20px;
        text-align: center;
    }

    .cs-header-title {
        font-size: 1.3rem;
    }

    /* Nav */
    .cs-nav {
        padding: 20px 0;
    }

    .cs-prev,
    .cs-next {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 479px) {
    .cersaie-slider-wrap {
        --cs-img-w: 90%;
    }

    .cs-header-title {
        font-size: 1.1rem;
    }

    .cs-desc {
        font-size: .8rem;
    }
}

.cs-header {
    position: relative;
    z-index: 20;
}