/* ==========================================================================
   effects.css — moderni vizualni sloj Kupreške zajednice Frankfurt
   Učitava se nakon modern.css. Sav pokret je pod klasom html.fx, koju
   effects.js postavlja samo ako posjetitelj nije uključio "smanjeni pokret".
   Bez JavaScripta stranica izgleda i radi kao i prije.
   ========================================================================== */

:root{
  --fx-gold-1:#f3e3b3;
  --fx-gold-2:#dec88b;
  --fx-gold-3:#b8964f;
  --fx-ease:cubic-bezier(.22,1,.36,1);
  --fx-ease-soft:cubic-bezier(.4,0,.2,1);
}

/* ---------- Sitni detalji koji vrijede uvijek ---------- */
::selection{background:#dec88b;color:#17183e}
html{scrollbar-color:#b9b4cf transparent}
::-webkit-scrollbar{width:11px;height:11px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:#c9c5da;border-radius:20px;border:3px solid var(--cream)}
::-webkit-scrollbar-thumb:hover{background:#9c97bd}

/* ---------- Traka napretka čitanja ---------- */
.fx-progress{position:fixed;top:0;left:0;right:0;height:3px;z-index:80;pointer-events:none;transform-origin:0 50%;transform:scaleX(var(--fx-progress,0));background:linear-gradient(90deg,var(--blue),#7c6fd6 45%,var(--fx-gold-2));box-shadow:0 0 12px #dec88b80}

/* ---------- Zaglavlje: sjena kad se stranica pomakne ---------- */
.header{transition:box-shadow .35s var(--fx-ease-soft),background-color .35s}
.header.fx-scrolled{box-shadow:0 10px 34px #17183e14;background:#fffffff5}

/* ---------- Gumbi: odsjaj koji prelazi preko gumba ---------- */
.btn{position:relative;overflow:hidden;isolation:isolate}
.btn:after{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(115deg,transparent 30%,#ffffff55 48%,transparent 66%);transform:translateX(-120%);transition:transform .75s var(--fx-ease)}
.btn:hover:after{transform:translateX(120%)}
.btn.gold,.heritage-actions .btn{background-image:linear-gradient(135deg,var(--fx-gold-1),var(--fx-gold-2) 55%,#d2b670)}
.btn:hover{box-shadow:0 12px 28px #3537a42e}
.btn.gold:hover,.heritage-actions .btn:hover{box-shadow:0 12px 30px #dec88b55}
.text-link .arrow,.heritage-story-link:after,.event-story-link:after{display:inline-block;transition:transform .3s var(--fx-ease)}
.text-link:hover .arrow{transform:translate(3px,-3px)}
.heritage-story-link:hover:after{transform:translate(3px,-3px)}

/* ---------- Okviri fotografija: lagani zoom i zlatni odsjaj ---------- */
.card-image,.event-story-photo,.archive-image{position:relative;overflow:hidden;isolation:isolate}
.card-image:before,.event-story-photo:before,.archive-image:before{content:'';position:absolute;inset:0;z-index:2;pointer-events:none;background:linear-gradient(110deg,transparent 35%,#fff6dc59 50%,transparent 65%);transform:translateX(-130%);transition:transform 1s var(--fx-ease)}
.card:hover .card-image:before,.event-story:hover .event-story-photo:before,.archive-photo:hover .archive-image:before,.archive-photo:focus-visible .archive-image:before{transform:translateX(130%)}
.card-image:after,.event-story-photo:after,.archive-image:after{content:'';position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(180deg,transparent 45%,#17183e8c);opacity:0;transition:opacity .45s var(--fx-ease-soft)}
.card:hover .card-image:after,.event-story:hover .event-story-photo:after,.archive-photo:hover .archive-image:after,.archive-photo:focus-visible .archive-image:after{opacity:1}
.card-image img,.event-story-photo img,.archive-image>img{transition:scale 1.1s var(--fx-ease),filter .6s var(--fx-ease-soft),opacity .6s}
.card:hover .card-image img,.event-story:hover .event-story-photo img,.archive-photo:hover .archive-image>img{transform:none;scale:1.07}
.archive-photo-small .archive-image:after{display:none}

/* Gumb "+" na fotografijama */
.photo-open{z-index:3;transition:opacity .25s,transform .45s var(--fx-ease),background-color .3s,color .3s}
.archive-photo:hover .photo-open,.archive-photo:focus-visible .photo-open{background:var(--fx-gold-2);color:var(--navy);transform:rotate(90deg) scale(1.08)}

/* Naslov ispod fotografije se lagano podigne */
.archive-caption{transition:transform .45s var(--fx-ease)}
.archive-photo:hover .archive-caption{transform:translateY(-3px)}
.archive-caption strong{background:linear-gradient(currentColor,currentColor) 0 100%/0 1px no-repeat;transition:background-size .5s var(--fx-ease)}
.archive-photo:hover .archive-caption strong{background-size:100% 1px}

/* Slobodne fotografije (u tekstu, uvodima, člancima) */
.intro-photo img,.prose img,.two-col>aside>img,.event-detail-photo,.event-materials figure img{transition:transform .9s var(--fx-ease),box-shadow .6s}
.intro-photo:hover img{transform:scale(1.015);box-shadow:0 28px 60px #17183e26}
.event-materials figure a{display:block;position:relative}
.event-materials figure img{transition:transform .9s var(--fx-ease)}
.event-materials figure a:hover img{transform:scale(1.04)}
.photo-note{transition:transform .6s var(--fx-ease)}
.intro-photo:hover .photo-note{transform:translateY(-6px)}

/* ---------- Kartice: podizanje, sjena i 3D nagib (nagib postavlja JS) ---------- */
.card,.event-story,.pillar,.social-card{position:relative;transition:transform .5s var(--fx-ease),box-shadow .5s var(--fx-ease),border-color .4s}
.card:hover,.event-story:hover,.social-card:hover{box-shadow:0 26px 60px #17183e1c;border-color:#d8d4e6}
.pillar{overflow:hidden}
.pillar:before{content:'';position:absolute;left:0;top:0;height:3px;width:100%;background:linear-gradient(90deg,var(--fx-gold-3),var(--fx-gold-1),var(--fx-gold-3));transform:scaleX(0);transform-origin:left;transition:transform .6s var(--fx-ease)}
.pillar:hover{box-shadow:0 22px 48px #17183e14}
.pillar:hover:before{transform:scaleX(1)}
.fx-glare{position:absolute;inset:0;z-index:4;pointer-events:none;border-radius:inherit;opacity:0;transition:opacity .4s;background:radial-gradient(520px circle at var(--fx-mx,50%) var(--fx-my,50%),#ffffff3d,transparent 45%)}
.fx-tilting .fx-glare{opacity:1}

/* ---------- CTA i traka događaja: svjetlo prati pokazivač ---------- */
.cta,.heritage-event{position:relative;overflow:hidden;isolation:isolate}
.fx-spot{position:absolute;inset:0;z-index:-1;pointer-events:none;opacity:0;transition:opacity .5s;background:radial-gradient(420px circle at var(--fx-mx,50%) var(--fx-my,50%),#dec88b2e,transparent 60%)}
.cta:hover .fx-spot,.heritage-event:hover .fx-spot{opacity:1}

/* ---------- Hero: aurora, svjetlucavi naslov, lebdeće fotografije ---------- */
.heritage-hero{isolation:isolate}
.heritage-hero>.wrap{position:relative;z-index:1}
.fx-aurora{position:absolute;inset:0;z-index:0;pointer-events:none;overflow:hidden}
.fx-aurora i{position:absolute;border-radius:50%;filter:blur(70px);opacity:.55;will-change:transform}
.fx-aurora i:nth-child(1){width:46vw;height:46vw;max-width:620px;max-height:620px;left:-12%;top:-30%;background:radial-gradient(circle,#4a4cc0,transparent 65%)}
.fx-aurora i:nth-child(2){width:38vw;height:38vw;max-width:520px;max-height:520px;right:-8%;top:10%;background:radial-gradient(circle,#c9a95a99,transparent 65%);opacity:.35}
.fx-aurora i:nth-child(3){width:30vw;height:30vw;max-width:420px;max-height:420px;left:35%;bottom:-35%;background:radial-gradient(circle,#7c6fd6,transparent 65%);opacity:.3}
.fx-aurora:after{content:'';position:absolute;inset:0;opacity:.05;background-image:radial-gradient(#fff 1px,transparent 1px);background-size:22px 22px;mask-image:linear-gradient(180deg,#000,transparent 85%);-webkit-mask-image:linear-gradient(180deg,#000,transparent 85%)}

.heritage-copy h1 em,.archive-heading h1 em,.album-teaser-heading h2 em{background:linear-gradient(100deg,var(--fx-gold-3) 0%,var(--fx-gold-1) 30%,#fff7df 45%,var(--fx-gold-2) 60%,var(--fx-gold-3) 100%);background-size:250% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;padding-right:.08em}
.archive-heading h1 em,.album-teaser-heading h2 em{background-image:linear-gradient(100deg,#2b2a86 0%,#5b4fc4 35%,#8a74d8 50%,#3537a4 65%,#2b2a86 100%)}

.hometown-photo img,.gathering-photo{transition:box-shadow .6s var(--fx-ease)}
.hometown-photo:hover img{box-shadow:0 30px 60px #0007}
.heritage-photos .hometown-photo,.heritage-photos .gathering-photo{will-change:translate}

/* ---------- Gumb "na vrh" s prstenom napretka ---------- */
.fx-top{position:fixed;right:18px;bottom:calc(max(10px,env(safe-area-inset-bottom)) + 78px);z-index:45;width:50px;height:50px;border-radius:50%;border:0;padding:0;background:#ffffffeb;color:var(--navy);box-shadow:0 10px 30px #17183e26;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);display:grid;place-items:center;opacity:0;visibility:hidden;transform:translateY(14px) scale(.9);transition:opacity .35s,transform .45s var(--fx-ease),visibility .35s,background-color .3s}
.fx-top.is-visible{opacity:1;visibility:visible;transform:none}
.fx-top:hover{background:var(--navy);color:var(--fx-gold-2)}
.fx-top svg{position:absolute;inset:0;width:100%;height:100%;transform:rotate(-90deg)}
.fx-top circle{fill:none;stroke-width:2.5}
.fx-top .fx-ring-bg{stroke:#17183e14}
.fx-top .fx-ring{stroke:var(--fx-gold-3);stroke-linecap:round;stroke-dasharray:138.2;stroke-dashoffset:calc(138.2 * (1 - var(--fx-progress,0)))}
.fx-top b{position:relative;font:600 1.15rem/1 var(--sans);transition:transform .35s var(--fx-ease)}
.fx-top:hover b{transform:translateY(-3px)}
body.menu-open .fx-top,body.viewer-is-open .fx-top,body.input-focused .fx-top{display:none}
@media(min-width:1100px){.fx-top{right:28px;bottom:28px}}

/* ---------- Preglednik fotografija (lightbox) ---------- */
.photo-viewer[open]{animation:fx-viewer-in .45s var(--fx-ease) both}
.photo-viewer .lightbox-img.fx-swap{animation:fx-photo-in .55s var(--fx-ease) both}
.viewer-thumb{transition:opacity .25s,transform .3s var(--fx-ease),border-color .25s;border-radius:6px}
.viewer-thumb:hover{transform:translateY(-2px)}
.viewer-thumb[aria-current=true]{transform:translateY(-2px);box-shadow:0 6px 16px #0006}
.viewer-step{transition:background-color .25s,color .25s,transform .3s var(--fx-ease)}
.viewer-prev:hover{transform:translateX(-3px)}
.viewer-next:hover{transform:translateX(3px)}

/* ---------- Skelet dok se fotografija učitava ---------- */
.fx-loading{background-image:linear-gradient(100deg,#e7e3d9 30%,#f4f1ea 50%,#e7e3d9 70%)!important;background-size:300% 100%!important}
.fx-loading>img{opacity:0}

/* ==========================================================================
   Pokret — samo uz html.fx (JS uključen, bez "smanjenog pokreta")
   ========================================================================== */

/* Skelet "diše" */
html.fx .fx-loading{animation:fx-shimmer 1.4s linear infinite}

/* Hero dolazak: tekst red po red, fotografije s pomakom */
html.fx .heritage-copy,html.fx .heritage-photos{animation:none}
html.fx .heritage-copy>*{animation:fx-rise .9s var(--fx-ease) both}
html.fx .heritage-copy>*:nth-child(1){animation-delay:.05s}
html.fx .heritage-copy>*:nth-child(2){animation-delay:.15s}
html.fx .heritage-copy>*:nth-child(3){animation-delay:.28s}
html.fx .heritage-copy>*:nth-child(4){animation-delay:.38s}
html.fx .heritage-copy>*:nth-child(5){animation-delay:.48s}
html.fx .hometown-photo{animation:fx-curtain 1.2s var(--fx-ease) .2s both}
html.fx .gathering-photo{animation:fx-drop 1.1s var(--fx-ease) .45s both}
html.fx .heritage-event{animation:fx-rise .9s var(--fx-ease) .6s both}
html.fx .hero-edition{animation:fx-fade 1s ease both}
html.fx .fx-aurora i:nth-child(1){animation:fx-float-a 18s ease-in-out infinite alternate}
html.fx .fx-aurora i:nth-child(2){animation:fx-float-b 22s ease-in-out infinite alternate}
html.fx .fx-aurora i:nth-child(3){animation:fx-float-c 26s ease-in-out infinite alternate}
html.fx .heritage-copy h1 em,html.fx .archive-heading h1 em,html.fx .album-teaser-heading h2 em{animation:fx-sheen 7s ease-in-out infinite}

/* Naslovi sekcija: blok po blok, zlatna crtica se iscrta */
html.fx .fx-rev>*{opacity:0;transform:translateY(26px);transition:opacity .9s var(--fx-ease),transform .9s var(--fx-ease)}
html.fx .fx-rev.fx-in>*{opacity:1;transform:none}
html.fx .fx-rev>*:nth-child(2){transition-delay:.12s}
html.fx .fx-rev>*:nth-child(3){transition-delay:.22s}
html.fx .fx-rev>*:nth-child(4){transition-delay:.3s}
html.fx .fx-rev .eyebrow:before{transform:scaleX(0);transform-origin:left;transition:transform .9s var(--fx-ease) .35s}
html.fx .fx-rev.fx-in .eyebrow:before{transform:none}

/* Fotografije u okvirima: izoštravanje iz blagog uvećanja */
html.fx .fx-frame>img{scale:1.16;filter:blur(6px) saturate(.7);opacity:.4}
html.fx .fx-frame.fx-in>img{scale:1.06;filter:none;opacity:1}
html.fx .card:hover .fx-frame.fx-in>img,html.fx .event-story:hover .fx-frame.fx-in>img,html.fx .archive-photo:hover .fx-frame.fx-in>img{scale:1.12}
/* Paralaksa unutar okvira (JS postavlja --fx-py) */
html.fx .fx-parallax>img{translate:0 var(--fx-py,0px)}

/* Slobodne fotografije: otkrivanje "zavjesom" */
html.fx .fx-curtain{clip-path:inset(0 0 100% 0 round 20px);transition:clip-path 1.3s var(--fx-ease),transform .9s var(--fx-ease),box-shadow .6s}
html.fx .fx-curtain.fx-in{clip-path:inset(0 0 0 0 round 20px)}

/* Animacija nakon filtriranja galerije i događaja */
html.fx .fx-pop{animation:fx-pop .6s var(--fx-ease) both;animation-delay:var(--fx-delay,0ms)}

/* Magnetni gumbi (JS postavlja --fx-tx/--fx-ty) */
html.fx .fx-magnet{translate:var(--fx-tx,0) var(--fx-ty,0);transition:translate .35s var(--fx-ease),transform .2s,background .2s,box-shadow .3s}

@keyframes fx-rise{from{opacity:0;transform:translateY(28px)}to{opacity:1;transform:none}}
@keyframes fx-fade{from{opacity:0}to{opacity:1}}
@keyframes fx-curtain{from{clip-path:inset(100% 0 0 0);opacity:.4}to{clip-path:inset(0);opacity:1}}
@keyframes fx-drop{from{opacity:0;transform:translateY(40px) rotate(-12deg) scale(.92)}}
@keyframes fx-float-a{to{transform:translate(12vw,8vh) scale(1.15)}}
@keyframes fx-float-b{to{transform:translate(-10vw,10vh) scale(.9)}}
@keyframes fx-float-c{to{transform:translate(-14vw,-12vh) scale(1.2)}}
@keyframes fx-sheen{0%,100%{background-position:100% 0}50%{background-position:0 0}}
@keyframes fx-shimmer{to{background-position:-150% 0}}
@keyframes fx-viewer-in{from{opacity:0}to{opacity:1}}
@keyframes fx-photo-in{from{opacity:0;transform:scale(.965)}to{opacity:1;transform:none}}
@keyframes fx-pop{from{opacity:0;transform:translateY(22px) scale(.97)}to{opacity:1;transform:none}}

/* Sigurnosna mreža za "smanjeni pokret" (dodatno uz postojeće pravilo) */
@media(prefers-reduced-motion:reduce){
  .fx-aurora i{animation:none!important}
  .btn:after,.card-image:before,.event-story-photo:before,.archive-image:before{display:none}
  .fx-glare,.fx-spot{display:none}
}
@media(hover:none){.fx-glare,.fx-spot{display:none}}
