/* =========================================================
   HERO / Slideshow – komponenta bez vanjskih margina
   (razmak od headera i ostalih sekcija rješava se u page-*.css)
   ========================================================= */

/* Mobile tap highlight off (prevents blue flash on tap) */
*{
  -webkit-tap-highlight-color: transparent;
}

a, button{
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* Osnovni layout – hero je neutralan blok (bez vanjskih margina) */
.hero {
  margin: 0;
  overflow: visible;
}

.hero .frame {
  position: relative;
  border-radius: 33px;
  overflow: hidden;
  background: none;
  transition: all .4s ease;
}

.hero .frame::before,
.hero .frame::after {
  content: none;
}

.hero .hstage {
  position: relative;
  isolation: isolate;
  padding: 0;
  display: flex;
  height: 75svh;
  min-height: 540px;
  border-radius: var(--radius-lg);
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
  background: none;
  transform: scale(.985);
  transition: transform .45s ease;
  will-change: transform;
  transform-origin: center;
}

.hero .hslides {
  position: absolute;
  inset: 0;
  display: flex;
  will-change: transform;
  transition: transform .8s cubic-bezier(.22,.61,.36,1);
}

.hero .hslide {
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vw, 42px);
  padding: 16px 28px;
  pointer-events: none;
  opacity: 1;
  transform-origin: center;
}

.hero .hslide.is-current {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.hero .visual {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero .copy {
  flex: 0 0 55%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

/* Fade-in teksta */

.hero .hslide .copy {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .6s ease, transform .6s ease;
}

.hero .hslide.is-current .copy {
  opacity: 1;
  transform: translateY(0);
}

/* “Micro zoom” + blur/fade na naslovnici */

/* početno stanje: lagani blur i niža opacity */
.hero .hslide .slot-23 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;

  will-change: transform, opacity, filter;
  transform: translateZ(0) scale(1.0);
  opacity: 0;
  filter: blur(10px);

  transition:
    opacity .35s ease-out,
    filter .35s ease-out,
    transform .7s ease;
}

/* kad je slika spremna (JS dodaje .is-loaded) → skini blur i pokaži je */
.hero .hslide .slot-23 img.is-loaded {
  opacity: 1;
  filter: blur(0);
}

/* micro-zoom samo za current slide, kad je slika već loaded */
.hero .hslide.is-current .slot-23 img.is-loaded {
  transform: scale(1.03);
}

/* Omotač naslovnice (slot-23) */

.hero .visual .slot-23 {
  transform-origin: center;
  width: clamp(260px, 28vw, 420px);
  aspect-ratio: 2 / 3;
}

.slot-23 {
  position: relative;
  aspect-ratio: 2 / 3;
  display: block;
  margin: auto;
  border: 0.5px solid rgba(50, 50, 50, 0.5);
  border-radius: 33px;
  overflow: hidden;
  background: none;
  box-shadow:
    0 0 10px rgba(255,210,100,.25),
    0 0 20px rgba(255,220,130,.20),
    0 0 30px rgba(255,200,0,.15);
}

.slot-23 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Naslovi u hero-u */

.hero .title {
  font-family: Garamond, "Times New Roman", serif;
  font-size: clamp(28px, 4.2vw, 50px);
  line-height: 1.08;
  margin: 0 0 6px;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: .02em;
  color: #383731;
  text-shadow:
    0 0 6px rgba(255,215,80,.5),
    0 0 12px rgba(255,220,100,.35),
    0 0 18px rgba(255,230,130,.25);
}

.hero .subtitle {
  font-family: Garamond, "Times New Roman", serif;
  font-size: clamp(20px, 2.2vw, 30px);
  margin: 6px 0 0;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .92;
  color: #383731;
  text-shadow:
    0 0 6px rgba(255,215,80,.5),
    0 0 12px rgba(255,220,100,.35),
    0 0 18px rgba(255,230,130,.25);
}

/* Pametni marquee samo za jako duge podnaslove */
/* Hero subtitle – fiksni box jedne linije (ne diže hero, ne gura sliku) */
.hero .subtitle {
  display: block;
  line-height: 1.4;
  height: 1.4em;       /* fiksna visina – ovo je tvoj “box” */
  overflow: hidden;    /* sve izvan te visine se reže */
  white-space: nowrap; /* tekst se drži u jednom redu */
  text-overflow: ellipsis;
  min-width: 0;
}

/* Kad JS odluči da je podnaslov predug – pretvori ga u single-line marquee */
.hero .subtitle.is-hero-marquee {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
}

/* Unutarnji wrapper koji se pomiče */
.hero .subtitle .hero-marquee-inner {
  display: inline-flex;
  gap: var(--hero-marquee-gap, 10px);
  white-space: nowrap;
  animation-name: hero-marquee;
  animation-duration: var(--hero-marquee-duration, 8s);
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-play-state: running;
  will-change: transform;
}

/* Segmenti teksta koji se ponavljaju */
.hero .subtitle .hero-marquee-segment {
  display: inline-block;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  padding: 0;
}

/* Ako iz nekog razloga skinemo .is-hero-marquee klasu, animacija se gasi */
.hero .subtitle:not(.is-hero-marquee) .hero-marquee-inner {
  animation-name: none;
  animation-duration: 0s;
}

/* Reduced motion – ne animiraj uopće */
@media (prefers-reduced-motion: reduce) {
  .hero .subtitle.is-hero-marquee .hero-marquee-inner {
    animation: none !important;
  }
  .hero .subtitle {
    white-space: normal;
  }
}

/* Keyframes za hero marquee */
@keyframes hero-marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(calc(var(--hero-marquee-distance) * -1)); }
}
/* Kraj Marquee */

/* Meta tekst: autor • godina • žanr */

.hero .copy .sub {
  font-size: .9rem;
  font-weight: 400;
  letter-spacing: .3px;
  color: rgba(255,255,255, 0.9);
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
  margin-top: 4px;
}

/* READ & META – izlaze nakon rukopisa */

.read-btn{
  display: inline-block;
  margin-top: 10px;
  padding: 8px 26px;
  border-radius: 12px;
  background-color: rgba(255,255,255,.38);
  border: 1px solid rgba(255,255,255,.50);
  color: #2b2a27;
  -webkit-text-fill-color: #2b2a27;
  text-decoration: none;
  font-family: "Garamond","Times New Roman",serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow:
    0 6px 18px rgba(0,0,0,.15),
    inset 0 1px 8px rgba(255,255,255,.25);
  transition:
    transform var(--motion-normal) var(--ease-soft),
    box-shadow var(--motion-normal) var(--ease-soft),
    background-color var(--motion-normal) var(--ease-soft),
    border-color var(--motion-normal) var(--ease-soft),
    color var(--motion-fast) var(--ease-soft),
    opacity var(--motion-fast) var(--ease-soft);
  will-change: transform, opacity;
}

.read-btn:hover {
  background-color: rgba(255,255,255,.48);
  border-color: rgba(255,255,255,.6);
  transform: translateY(-1px);
  box-shadow:
    0 8px 24px rgba(0,0,0,.22),
    inset 0 1px 10px rgba(255,255,255,.28);
}

.hero .copy .read-btn,
.hero .copy .sub {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .6s ease, transform .6s ease;
  transition-delay: 1.8s;
}

.hero .hslide.is-current .copy .read-btn,
.hero .hslide.is-current .copy .sub {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 2.1s;
}

.hero .hslide:not(.is-current) .copy .read-btn,
.hero .hslide:not(.is-current) .copy .sub {
  opacity: 0;
  transform: translateY(6px);
  transition-delay: 0s;
}

/* Kontrole i “dots” */

.hero .controls {
  position: absolute;
  inset: auto 0 50% 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0;
  transform: translateY(50%);
  z-index: 5;
  pointer-events: none;
}

.hero .btn {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--nav-glass);
  border: 1px solid var(--nav-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  color: #111;
  font-weight: 900;
  transition:
    transform .18s ease,
    box-shadow .25s ease,
    background .25s ease,
    border-color .25s ease;
}

.hero .btn:hover {
  background: var(--nav-glass);
  border-color: rgba(255,255,255,.35);
  box-shadow:
    0 12px 16px rgba(0,0,0,.24),
    0 0 10px rgba(255,209,60,.52);
  transform: translateY(-1px);
}

.hero .btn:active {
  transform: translateY(0);
}

.hero .dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
}

/* === ink-write animacija naslova u hero-u === */

.hero .title.ink-write,
.hero .subtitle.ink-write {
  -webkit-mask: linear-gradient(#000 0 0) left / 0% 100% no-repeat;
  mask: linear-gradient(#000 0 0) left / 0% 100% no-repeat;
  animation: ink-reveal var(--ink-dur, 1.8s) steps(40, end) forwards;
  animation-delay: var(--ink-delay, 0s);
  position: relative;
}

.hero .subtitle.ink-write {
  animation-duration: var(--ink-dur, 1.6s);
  animation-delay: var(--ink-delay, .25s);
}

.hero .hslide:not(.is-current) .title.ink-write,
.hero .hslide:not(.is-current) .subtitle.ink-write {
  -webkit-mask: none;
  mask: none;
  animation: none;
}

/* Keyframes + soft fade */

@keyframes ink-reveal {
  to {
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
  }
}

.hero .hslide:not(.is-current) .title.ink-write,
.hero .hslide:not(.is-current) .subtitle.ink-write {
  opacity: 0;
  transition: opacity .8s ease;
}

.hero .hslide.is-current .title.ink-write,
.hero .hslide.is-current .subtitle.ink-write {
  opacity: 1;
  transition: opacity .8s ease .1s;
}

@media (prefers-reduced-motion: reduce) {
  .hero .title.ink-write,
  .hero .subtitle.ink-write {
    -webkit-mask: none;
    mask: none;
    animation: none;
  }
}

/* ---------------- Hero adjustments (visine, scale, responsive) ---------------- */
@media (min-width: 900px) {
  .hero .frame {
    transition: transform .45s ease, box-shadow .45s ease;
  }

  .hero .slot-23 {
    box-shadow:
      0 10px 20px rgba(0,0,0,.24),
      0 0 20px rgba(255,210,90,.06);
  }

  .hero .hslide.is-current .slot-23 img {
    transform: scale(1.02);
    transition: transform .9s cubic-bezier(.2,.8,.2,1);
  }
}

@media (max-width: 899px) {
  .hero .hstage {
    height: 62svh;
    min-height: 420px;
    transform: none;
  }

  .hero .slot-23 {
    box-shadow: 0 8px 20px rgba(0,0,0,.18);
    border-radius: 20px;
  }

  .hero .hslides {
    transition: transform .5s cubic-bezier(.22,.65,.3,1);
  }
}

/* =========================================================
   MEDIA – HERO KAO KOMPONENTA (bez vanjskih margina)
   ========================================================= */

/* 1) VERY SMALL PHONES (≤ 399px) */
@media (max-width: 399px) {
  .hero .hstage {
    height: auto;
    min-height: 0;
    overflow: visible;
    transform: none;
    display: block;
    padding-bottom: 2px;
    touch-action: pan-y;
  }

  .hero .hslides {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .hero .hslide {
    flex-direction: column;
    gap: 20px;
    padding: 0;
  }

  .hero .controls {
    display: none !important; /* skrivamo strelice na najmanjim ekranima */
  }

  .hero .visual {
    flex: unset;
    width: 90%;
    margin: 0 auto;
  }

  .hero .visual .slot-23 {
    width: 85%;
    margin: 0 auto;
  }

  .hero .copy {
    flex: unset;
    width: 85%;
    text-align: center;
  }

  .hero .title {
    font-size: 1.6rem;
    margin-top: -1rem;
    margin-bottom: 0.2rem;
    line-height: 1.3;
    font-weight: 2000;
  }

  .hero .subtitle {
    font-size: 1.33rem;
    font-weight: 2000;
    padding-bottom: 7px;
  }

  .hero .copy .sub {
    font-size: 0.7rem;
  }

  /* Manji "Read" gumb u slideshowu */
  .hero .read-btn {
    font-size: 0.8rem;
    padding: 6px 16px;
    border-radius: 8px;
    margin-top: 10px;
  }

  /* Ukloni snažan glow i micro-zoom na coveru na vrlo malim ekranima */
  .hero .visual .slot-23,
  .slot-23 {
    box-shadow: none !important;
    border: 1px solid rgba(0,0,0,.18);
  }

  .hero .hslide .slot-23 img {
    transform: none !important;
  }
}

/* 2) MOBITELI (400–767px) */
@media (min-width: 400px) and (max-width: 767px) {
  .hero .hstage {
    height: auto;
    min-height: 0;
    overflow: visible;
    transform: none;
    display: block;
    padding-bottom: 2px;
    touch-action: pan-y;
  }

  .hero .hslides {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .hero .hslide {
    flex-direction: column;
    gap: 20px;
    padding: 0;
  }

  .hero .controls {
    display: none !important;
  }

  .hero .visual {
    flex: unset;
    width: 90%;
    margin: 0 auto;
  }

  .hero .visual .slot-23 {
    width: 85%;
    margin: 0 auto;
  }

  .hero .copy {
    flex: unset;
    width: 85%;
    text-align: center;
  }

  .hero .title {
    font-size: 1.8rem;
    margin-top: -0.7rem;
    margin-bottom: 0.2rem;
    line-height: 1.3;
    font-weight: 2000;
  }

  .hero .subtitle {
    font-size: 1.44rem;
    font-weight: 2000;
    padding-bottom: 7px;
  }

  .hero .read-btn {
    font-size: 0.9rem;
    padding: 7px 16px;
    border-radius: 10px;
    margin-top: 10px;
  }

  /* Manje agresivan glow i zoom na mobile */
  .hero .visual .slot-23,
  .slot-23 {
    box-shadow: none !important;
    border: 1px solid rgba(0,0,0,.18);
  }

  .hero .hslide .slot-23 img {
    transform: none !important;
  }
}

/* 3) TABLETI (768–1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .hero .hslides {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .hero .hslide {
    flex-direction: column;
    gap: 20px;
    padding: 0;
  }

  .hero .hstage {
    height: auto;
    min-height: 520px;
    overflow: visible;
    padding-bottom: 2px;
    display: block;
    touch-action: pan-y;
  }

  .hero .visual {
    flex: unset;
    width: 100%;
    margin: 0 auto;
  }

  .hero .visual .slot-23 {
    width: clamp(500px, 50vw, 550px);
  }

  .hero .copy {
    padding: 14px;
    width: 70%;
    flex: unset;
    text-align: center;
  }

  .hero .controls {
    display: none !important;
  }

  .hero .title {
    font-size: 2.7rem;
    margin-top: 0.4rem;
    margin-bottom: 0.2rem;
    line-height: 1.3;
    font-weight: 2000;
  }

  .hero .subtitle {
    font-size: 2.33rem;
    font-weight: 2000;
    padding-bottom: 7px;
  }

  .hero .copy .sub {
    font-size: 1.2rem;
  }

  .hero .read-btn {
    font-size: 1.4rem;
  }

  /* Na tabletima smanji glow covera i mikropomak */
  .hero .visual .slot-23,
  .slot-23 {
    box-shadow: none !important;
    border: 1px solid rgba(0,0,0,.18);
  }

  .hero .hslide .slot-23 img {
    transform: none !important;
  }
}

/* ========================================================= */
