/* ====================================================
   Acord Imobiliar - property slider
   Loaded on /anunt only.

   A port of the supplied slider-anunt-imobiliar design: a contained 16/9 card
   with a horizontal thumbnail strip and a photo-count block beneath it. Every
   duration, easing curve, size and breakpoint below is taken from that file.
   Its blue #2ea3e0 is now the site accent (--accent), so the card and the rest
   of the site share one colour.

   The stage itself keeps the file's own near-black (#191713) rather than a
   site token: it is the matte a photograph sits on, not a surface.
   ==================================================== */

@import url("../scripts/photoswipe/photoswipe.css");

.cine{
    --cine-ease:cubic-bezier(.16,.84,.24,1);
    --cine-dur:1050ms;
    --cine-radius:10px;

    margin-bottom:var(--s5);
}

/* ====================================================
   Stage
   ==================================================== */
.cine-stage{
    position:relative;
    aspect-ratio:16 / 9;
    overflow:hidden;
    border-radius:var(--cine-radius);
    background:#191713;
    box-shadow:0 26px 60px -28px rgba(33,31,28,.45);
}

/* ---- slides: the depth transition ----
   enter: opacity 0, translateY(7%) scale(1.18)
   exit : opacity 0, scale(.9)                        */
.cine-slide{
    position:absolute;inset:0;display:block;overflow:hidden;
    opacity:0;z-index:0;
    transform:none;
    will-change:transform,opacity;
    cursor:zoom-in;
    transition:opacity var(--cine-dur) var(--cine-ease),
               transform var(--cine-dur) var(--cine-ease);
}
.cine-slide.is-on{opacity:1;transform:none;z-index:3;}
.cine-slide.is-out{opacity:0;transform:scale(.9);z-index:2;}
/* Pinned with transitions off, then released on the next frame so the entry
   actually plays instead of snapping straight to the end state. */
.cine-slide.is-enter{opacity:0;transform:translateY(7%) scale(1.18);transition:none;}
.cine-slide.is-hold{opacity:1;transform:none;transition:none;z-index:2;}

.cine-img{position:absolute;inset:0;display:block;}
.cine-img picture,.cine-img img{width:100%;height:100%;display:block;}
/* contain, not cover: 45% of the photos are portrait, and cover stretched
   them across the 16:9 stage - a 960px-wide portrait file enlarged to ~1200px
   and cropped to its middle third, visibly pixelated. The whole photo is shown
   now, at its own resolution, with the stage's dark background either side. */
.cine-img img{object-fit:contain;}

.cine-slide:focus-visible{outline:2px solid var(--accent);outline-offset:-4px;}

.cine-scrim{
    position:absolute;inset:0;z-index:5;pointer-events:none;
    background:linear-gradient(to top,
        rgba(16,15,14,.78) 0%,
        rgba(16,15,14,.34) 22%,
        rgba(16,15,14,0)   46%);
}

/* ====================================================
   Overlay: tags, price, address
   ==================================================== */
.cine-meta{
    position:absolute;z-index:12;
    left:clamp(16px,2.4vw,34px);
    bottom:clamp(16px,2.4vw,30px);
    right:180px;                     /* clears the counter and arrows */
    display:flex;flex-direction:column;justify-content:flex-end;
    min-height:132px;
    text-shadow:0 1px 22px rgba(16,15,14,.7);
}

.cine-tags{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:16px;}
.cine-tag{
    font:600 12px/1 var(--sans);letter-spacing:.02em;
    padding:7px 14px;border-radius:999px;white-space:nowrap;
    border:1px solid transparent;
    background:#f7f4ef;color:#211f1c;
    text-shadow:none;
}
/* White on #2EA3E0 is 2.8:1, so the filled pill takes the darker step. */
.cine-tag-accent{background:var(--accent-strong);color:#fff;}

.cine-price{
    margin:0 0 12px;
    font-family:var(--display);
    font-size:clamp(24px,2.6vw,38px);
    line-height:1.04;letter-spacing:-.025em;font-weight:600;
    color:#f7f4ef;text-wrap:pretty;
}

.cine-addr{
    display:flex;align-items:center;gap:8px;
    font-size:15px;color:rgba(244,241,236,.86);
}
.cine-pin{
    width:13px;height:13px;flex:none;display:block;
    background:var(--accent);
    border-radius:50% 50% 50% 0;
    transform:rotate(-45deg);
}

/* ====================================================
   Counter + arrows
   ==================================================== */
.cine-nav{
    position:absolute;z-index:12;
    right:clamp(16px,2vw,30px);
    bottom:clamp(16px,2vw,30px);
    display:flex;align-items:center;gap:12px;
}
.cine-count{
    display:flex;align-items:baseline;gap:4px;
    font-family:var(--mono);color:#f7f4ef;
    font-variant-numeric:tabular-nums;
    text-shadow:0 1px 12px rgba(0,0,0,.5);
}
.cine-count [data-cine-current]{font-size:24px;letter-spacing:-.02em;line-height:1;}
.cine-total{font-size:12px;color:rgba(244,241,236,.58);}

.cine-arrows{display:flex;gap:7px;}
.cine-btn{
    width:40px;height:40px;border-radius:50%;cursor:pointer;
    background:rgba(18,17,15,.42);color:#f4f1ec;
    font:inherit;font-size:14px;line-height:1;
    border:1px solid rgba(244,241,236,.3);
    backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
    display:inline-flex;align-items:center;justify-content:center;
    transition:all 260ms var(--cine-ease);
}
.cine-btn:hover{background:rgba(18,17,15,.72);border-color:rgba(244,241,236,.55);color:#fff;}
.cine-btn:focus-visible{outline:2px solid var(--accent);outline-offset:3px;}

/* ====================================================
   Progress
   ==================================================== */
.cine-progress{
    position:absolute;z-index:14;left:0;right:0;bottom:0;height:2px;
    background:rgba(244,241,236,.14);
}
.cine-progress > div{
    height:100%;width:0;background:var(--accent);
    transition:width 90ms linear;
}
.cine-progress > div.is-reset{transition:width 360ms ease;}

/* ====================================================
   Strip + count block
   ==================================================== */
.cine-strip-row{
    display:flex;align-items:center;
    gap:clamp(14px,2vw,28px);
    margin-top:clamp(14px,1.8vw,24px);
}

.cine-strip{
    flex:1 1 auto;min-width:0;
    display:flex;gap:10px;
    overflow-x:auto;overflow-y:hidden;
    padding-bottom:8px;
    scrollbar-width:thin;
}
.cine-strip::-webkit-scrollbar{height:6px;}
.cine-strip::-webkit-scrollbar-thumb{background:var(--line-strong);border-radius:99px;}
.cine-strip::-webkit-scrollbar-track{background:transparent;}

.cine-thumb{
    position:relative;flex:none;padding:0;border:0;
    background:var(--surface-2);
    width:132px;height:88px;
    cursor:pointer;overflow:hidden;
    border-radius:var(--cine-radius);
    outline:1px solid rgba(33,31,28,.12);outline-offset:0;
    transition:outline-color 280ms ease,outline-offset 280ms ease;
}
.cine-thumb.is-active{outline:2px solid var(--accent);outline-offset:2px;}
.cine-thumb:focus-visible{outline:2px solid var(--accent-strong);outline-offset:2px;}

.cine-thumb img{
    position:absolute;inset:0;width:100%;height:100%;
    object-fit:cover;display:block;
    filter:grayscale(.3) brightness(.9);
    transform:scale(1);
    transition:filter 380ms ease,transform 520ms var(--cine-ease);
}
.cine-thumb.is-active img{filter:none;transform:scale(1.02);}
.cine-thumb:hover img{filter:grayscale(.1) brightness(.97);}

.cine-total-box{
    flex:none;
    display:flex;flex-direction:column;align-items:center;gap:5px;
    padding-left:clamp(12px,2vw,24px);
    border-left:1px solid var(--line-strong);
}
.cine-cam{
    width:20px;height:15px;display:block;position:relative;
    border:2px solid var(--text);border-radius:3px;
    background:radial-gradient(circle at 50% 55%, var(--text) 0 3px, transparent 3.5px);
}
.cine-total-n{
    font-size:26px;font-weight:600;line-height:1;letter-spacing:-.02em;
    color:var(--text);
}
.cine-total-label{
    font-family:var(--mono);font-size:10px;letter-spacing:.18em;
    text-transform:uppercase;color:var(--text-2);
}

/* ====================================================
   Narrow: the file's breakpoint is 760px
   ==================================================== */
@media (max-width:759px){
    .cine-stage{aspect-ratio:4 / 3;}
    .cine-meta{
        right:clamp(16px,2.4vw,34px);
        min-height:0;
        bottom:52px;                 /* clears the counter row beneath it */
    }
    .cine-price{font-size:clamp(20px,5vw,26px);}
    .cine-tags{margin-bottom:12px;}
    .cine-nav{left:clamp(16px,2.4vw,34px);justify-content:space-between;}
    .cine-thumb{width:104px;height:72px;}
}

@media (prefers-reduced-motion:reduce){
    .cine-slide,.cine-thumb,.cine-thumb img,.cine-btn,.cine-progress > div{
        transition:none !important;
    }
}

/* ====================================================
   PhotoSwipe theme
   Kept for pinch and double-tap zoom behind the slider.
   ==================================================== */
.pswp{
    --pswp-bg:#0d0c0b;
    --pswp-placeholder-bg:#191713;
    --pswp-icon-color:#fff;
    --pswp-icon-color-secondary:#191713;
    --pswp-icon-stroke-color:transparent;
    --pswp-icon-stroke-width:0;
    --pswp-error-text-color:#c9c2b6;
}
.pswp__bg{backdrop-filter:saturate(1.1);}

.pswp__button{
    transition:opacity .2s var(--ease),transform .2s var(--ease);
    opacity:.75;
}
.pswp__button:hover{opacity:1;transform:translateY(-1px);}

.pswp__top-bar{
    height:60px;
    background:linear-gradient(rgba(13,12,11,.85),transparent);
}

.pswp-caption{
    position:absolute;left:0;top:0;
    display:flex;align-items:center;height:60px;
    padding:0 20px;
    max-width:calc(100% - 260px);
    color:#fff;font:600 14px/1.3 var(--sans);
    pointer-events:none;
}
.pswp-caption span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.pswp-caption b{
    font:500 11px/1 var(--mono);letter-spacing:.12em;text-transform:uppercase;
    color:var(--accent);display:block;margin-bottom:4px;font-weight:500;
}

.pswp__counter{
    position:absolute;right:104px;top:0;
    margin:0;
    font:500 12px/60px var(--mono);
    letter-spacing:.1em;font-variant-numeric:tabular-nums;
    color:#fff;opacity:.85;
    height:60px;
}

.pswp__button--arrow{
    width:56px;height:56px;
    background:rgba(18,17,15,.55);
    border:1px solid rgba(255,255,255,.14);
    border-radius:50%;
    margin:0 14px;
}
.pswp__button--arrow:hover{background:rgba(46,163,224,.9);border-color:transparent;}
.pswp__button--arrow .pswp__icn{width:56px;height:56px;inset:0;margin:0;}

.pswp-strip{
    position:absolute;left:0;right:0;bottom:0;z-index:10;
    display:flex;gap:8px;
    padding:14px 16px 16px;
    overflow-x:auto;
    background:linear-gradient(transparent,rgba(13,12,11,.9) 42%);
    scrollbar-width:thin;
    scrollbar-color:rgba(255,255,255,.25) transparent;
}
.pswp-strip::-webkit-scrollbar{height:6px;}
.pswp-strip::-webkit-scrollbar-thumb{background:rgba(255,255,255,.25);border-radius:3px;}
.pswp-strip-item{
    flex:0 0 84px;height:60px;
    border:0;padding:0;cursor:pointer;
    border-radius:var(--radius-sm);overflow:hidden;
    background:#191713;
    opacity:.5;
    box-shadow:0 0 0 2px transparent;
    transition:opacity .2s var(--ease),box-shadow .2s var(--ease),transform .2s var(--ease);
}
.pswp-strip-item img{width:100%;height:100%;object-fit:cover;display:block;}
.pswp-strip-item:hover{opacity:.85;transform:translateY(-2px);}
.pswp-strip-item.is-active{opacity:1;box-shadow:0 0 0 2px var(--accent);}
.pswp-strip-item:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}

@media (max-width:640px){
    .pswp-strip{display:none;}
    .pswp-caption{max-width:calc(100% - 110px);font-size:13px;padding:0 14px;}
    .pswp__counter{right:96px;font-size:11px;}
    .pswp__button--arrow{display:none;}
}

@media (prefers-reduced-motion:reduce){
    .pswp-strip-item{transition:none;}
}
