/* Kuća Kranjanac — stil.
   Film gore je topao i mračan (tekst čitljiv preko fotografija), sadržaj ispod je svetao i vazdušast. */

:root {
  /* film (mračno, toplo) */
  --ink: #1c1410;
  --ink-2: #241a13;
  --cream: #f7f0e4;
  --cream-dim: rgba(247, 240, 228, 0.74);
  --card-film: rgba(24, 17, 12, 0.72);
  --stroke-film: rgba(247, 240, 228, 0.14);

  /* sadržaj (svetlo, toplo) */
  --sand: #faf5ec;
  --sand-2: #f2e9d8;
  --paper: #fffdf8;
  --text: #2a211a;
  --text-soft: #6a5c4d;
  --line: rgba(42, 33, 26, 0.12);

  /* akcenti */
  --honey: #d69a4c;
  --honey-deep: #8f5d1e;
  --terra: #b8552f;
  --forest: #4a5d43;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  --wrap: 1120px;
  --track: 2700vh;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 2rem; }

body {
  background: var(--sand);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }

a { color: inherit; }
img { max-width: 100%; display: block; }

::selection { background: var(--honey); color: #201810; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.01em; }

/* --- skip + progres --- */
.skip {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 60;
  background: var(--honey);
  color: #201810;
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.2s;
}
.skip:focus { top: 1rem; }

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 45;
  background: rgba(255, 255, 255, 0.08);
}
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--honey), var(--terra));
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

/* --- bočna navigacija poglavlja --- */
.filmnav {
  position: fixed;
  right: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.filmnav__dot {
  position: relative;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
}
.filmnav__dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(247, 240, 228, 0.55);
  background: transparent;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
}
.filmnav__dot span {
  position: absolute;
  right: calc(100% + 0.5rem);
  top: 50%;
  transform: translateY(-50%);
  font: 600 0.66rem/1 var(--font);
  letter-spacing: 0.04em;
  color: var(--cream);
  background: rgba(24, 17, 12, 0.9);
  border: 1px solid var(--stroke-film);
  border-radius: 6px;
  padding: 0.34rem 0.55rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.filmnav__dot:hover span,
.filmnav__dot:focus-visible span { opacity: 1; }
.filmnav__dot.on::before { background: var(--honey); border-color: var(--honey); transform: translate(-50%, -50%) scale(1.3); }

/* ===================== FILM ===================== */
.film { position: relative; height: var(--track); background: var(--ink); }

.film__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--ink);
}
@supports (height: 100svh) { .film__stage { height: 100svh; } }

.film__poster,
.film__video,
.film__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.film__video { opacity: 0; transition: opacity 0.6s; }
.film__video.on { opacity: 1; }
.film__canvas { display: none; }

.film__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(125% 90% at 50% 42%, transparent 52%, rgba(20, 13, 9, 0.6) 100%),
    linear-gradient(180deg, rgba(20, 13, 9, 0.5), transparent 20%, transparent 74%, rgba(20, 13, 9, 0.72));
}
.film__grain {
  position: absolute;
  inset: -40%;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* poglavlja preko filma */
.film__chapters { position: absolute; inset: 0; }
.chapter {
  position: absolute;
  top: var(--at, 0%);
  left: 0;
  width: 100%;
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 0 clamp(1.25rem, 7vw, 6.5rem);
  color: var(--cream);
  z-index: 2;
}
.chapter--hero { text-align: center; justify-items: center; }
.chapter--final { top: auto; bottom: 0; }
.chapter--final .card { justify-self: center; text-align: center; }

/* iste pozicije kao u config.js — prvi render ne sme da skače dok se JS ne javi */
#pocetak { --at: 0%; }
#dobrodoslica { --at: 11%; }
#dnevni-kutak { --at: 22%; }
#stepeniste { --at: 33%; }
#soba-parovi { --at: 44%; }
#trokrevetna-roze { --at: 55%; }
#sobe-svetla { --at: 66%; }
#kuhinja { --at: 77%; }
#okolina { --at: 88%; }

.card {
  max-width: 560px;
  background: var(--card-film);
  border: 1px solid var(--stroke-film);
  border-radius: 18px;
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
.card--bare { background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; max-width: 720px; text-align: center; }
.card--wide { max-width: 680px; }

/* reveal — bez JS-a kartice ostaju vidljive */
html.js .card { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
html.js .card.in { opacity: 1; transform: none; }

.overline {
  font: 600 0.72rem/1 var(--font);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--honey);
  margin-bottom: 0.9rem;
}
.chapter h1 {
  font-size: clamp(3rem, 10vw, 7rem);
  line-height: 0.98;
  color: var(--cream);
  text-shadow: 0 18px 55px rgba(0, 0, 0, 0.5);
}
.chapter h2 {
  font-size: clamp(1.8rem, 4.2vw, 2.9rem);
  line-height: 1.1;
  margin-bottom: 0.8rem;
  color: var(--cream);
}
.lead { font-size: clamp(1.15rem, 2.3vw, 1.5rem); color: var(--cream-dim); margin-top: 1rem; }
.card p { color: var(--cream-dim); }
.transition-line { font-size: clamp(1.3rem, 3vw, 2rem); font-family: var(--serif); color: var(--cream); }

.hint {
  margin-top: clamp(2.2rem, 6vh, 4rem);
  font: 500 0.72rem/1 var(--font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.hint__chev {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--honey);
  border-bottom: 2px solid var(--honey);
  transform: rotate(45deg);
  animation: chev 1.6s ease-in-out infinite;
}
@keyframes chev {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 1; }
  50% { transform: rotate(45deg) translate(4px, 4px); opacity: 0.4; }
}
html.scrolled .hint { opacity: 0; transition: opacity 0.4s; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.3rem; }
.chips li {
  font: 600 0.7rem/1 var(--font);
  letter-spacing: 0.06em;
  color: var(--honey);
  border: 1px solid color-mix(in srgb, var(--honey) 38%, transparent);
  border-radius: 99px;
  padding: 0.45rem 0.8rem;
  background: color-mix(in srgb, var(--honey) 10%, transparent);
}

/* mini-galerija u kartici */
.gallery { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.3rem; }
.thumb {
  border: 0;
  padding: 0;
  width: 92px;
  aspect-ratio: 3 / 2;
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
  background: rgba(247, 240, 228, 0.08);
  outline-offset: 3px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.thumb:hover img { transform: scale(1.06); }

/* izlet kartice u finalu */
.trips { list-style: none; display: grid; gap: 0.7rem; margin-top: 1.3rem; text-align: left; }
.trip { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-top: 1px solid var(--stroke-film); }
.trip:first-child { border-top: 0; }
.trip b { color: var(--cream); font-weight: 600; }
.trip span { color: var(--honey); font-weight: 600; white-space: nowrap; }

/* ===================== DUGMAD ===================== */
.cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.7rem; }
.chapter--hero .cta, .chapter--final .cta { justify-content: center; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  border-radius: 11px;
  padding: 0.9rem 1.6rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primary { background: var(--terra); color: #fff; box-shadow: 0 12px 32px rgba(192, 90, 52, 0.32); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(192, 90, 52, 0.42); }
.btn--honey { background: var(--honey); color: #201810; box-shadow: 0 12px 32px rgba(214, 154, 76, 0.3); }
.btn--honey:hover { transform: translateY(-2px); }
.btn--ghost { border-color: rgba(247, 240, 228, 0.32); color: var(--cream); }
.btn--ghost:hover { background: rgba(247, 240, 228, 0.1); }

/* na svetloj podlozi ghost dugme menja boju */
.section .btn--ghost { border-color: var(--line); color: var(--text); }
.section .btn--ghost:hover { background: rgba(42, 33, 26, 0.05); }

/* ===================== SADRŽAJ (svetlo) ===================== */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.25rem, 5vw, 2rem); }
.section--alt { background: var(--sand-2); }
.wrap { max-width: var(--wrap); margin-inline: auto; }
.section__head { max-width: 640px; margin-bottom: 2.4rem; }
.section h2 { font-size: clamp(1.9rem, 4.5vw, 3rem); color: var(--text); }
.section__head .overline { color: var(--honey-deep); }
.section__head p { color: var(--text-soft); margin-top: 0.8rem; font-size: 1.1rem; }
.trust {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  color: var(--forest);
  background: color-mix(in srgb, var(--forest) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--forest) 22%, transparent);
  border-radius: 99px;
  padding: 0.5rem 0.95rem;
  font-size: 0.92rem;
}

/* cenovnik */
.pricing { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--paper); }
.pricing table { width: 100%; border-collapse: collapse; }
.pricing caption { text-align: left; padding: 1.1rem 1.3rem 0; color: var(--text-soft); font-size: 0.95rem; }
.pricing th, .pricing td { text-align: left; padding: 1rem 1.3rem; border-top: 1px solid var(--line); }
.pricing thead th { border-top: 0; font: 600 0.72rem/1 var(--font); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-soft); }
.pricing tbody th { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; color: var(--text); }
.pricing td.cap { color: var(--text-soft); }
.pricing td.price { color: var(--honey-deep); font-weight: 700; white-space: nowrap; }
.pricing__note { margin-top: 1.1rem; color: var(--text-soft); font-size: 0.95rem; }

/* pogodnosti */
.perks { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.8rem; }
.perk { display: flex; gap: 0.85rem; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; padding: 1rem 1.15rem; }
.perk svg { width: 22px; height: 22px; flex: none; color: var(--honey-deep); margin-top: 2px; }
.perk b { display: block; font-weight: 600; color: var(--text); }
.perk span { color: var(--text-soft); font-size: 0.92rem; }

/* FAQ — nativni <details> */
.faq { display: grid; gap: 0.7rem; max-width: 780px; }
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 1.3rem;
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--honey-deep); font-size: 1.4rem; line-height: 1; transition: transform 0.25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 1.3rem 1.2rem; color: var(--text-soft); }

/* mapa */
.map-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.6rem; align-items: stretch; }
.map-frame { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; min-height: 340px; background: var(--sand-2); }
.map-frame iframe { width: 100%; height: 100%; min-height: 340px; border: 0; display: block; }
.map-info { align-self: center; }
.map-info h3 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.map-info address { font-style: normal; color: var(--text-soft); margin-bottom: 1rem; }
.map-info p { color: var(--text-soft); margin-bottom: 1.2rem; }

/* forma */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 2.2rem; align-items: start; }
.contact-aside h2 { margin-bottom: 0.8rem; }
.contact-aside p { color: var(--text-soft); margin-bottom: 1.3rem; }
.contact-lines { display: grid; gap: 0.6rem; margin: 1.4rem 0; }
.contact-lines a { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; color: var(--text); text-decoration: none; }
.contact-lines a:hover { color: var(--terra); }
.contact-lines svg { width: 20px; height: 20px; color: var(--honey-deep); }

.form { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: clamp(1.4rem, 3vw, 2rem); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.field input, .field textarea {
  font: inherit;
  color: var(--text);
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  width: 100%;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--honey); outline-offset: 1px; border-color: transparent; }
.field textarea { resize: vertical; min-height: 96px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__submit { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 0.4rem; }
.form__fine { color: var(--text-soft); font-size: 0.85rem; }
.form__status { margin-top: 1rem; font-weight: 600; }
.form__status.ok { color: var(--forest); }
.form__status.err { color: var(--terra); }

/* footer */
.footer { background: var(--ink); color: var(--cream-dim); padding: 2.6rem clamp(1.25rem, 5vw, 2rem); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; }
.footer a { color: var(--cream); text-decoration: underline; text-underline-offset: 2px; }
.footer a:hover { text-decoration-thickness: 2px; }
.footer__brand { font-family: var(--serif); font-size: 1.2rem; color: var(--cream); }
.footer__meta { font-size: 0.9rem; }

/* sticky CTA (mobilni) */
.mobilebar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  display: none;
  gap: 0.6rem;
  padding: 0.6rem;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  border-top: 1px solid var(--stroke-film);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.mobilebar .btn { flex: 1; justify-content: center; padding: 0.85rem 1rem; }

/* ===================== REŽIMI ===================== */
html[data-mode="poster"] .film { height: auto; }
html[data-mode="poster"] .film__stage { position: relative; height: 60vh; }
html[data-mode="poster"] .film__chapters { position: static; }
html[data-mode="poster"] .chapter { position: static; min-height: 0; padding-top: 3rem; padding-bottom: 3rem; }
html[data-mode="poster"] .film__video { display: none; }
html[data-mode="poster"] .chapter--final { bottom: auto; }

html[data-mode="frames"] .film__canvas { display: block; }
html[data-mode="frames"] .film__video { display: none; }

/* ===================== LIGHTBOX ===================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(16, 11, 8, 0.92);
}
.lightbox.on { display: flex; }
.lightbox__fig { max-width: min(1100px, 92vw); max-height: 86vh; text-align: center; }
.lightbox__fig img { max-width: 100%; max-height: 78vh; border-radius: 10px; object-fit: contain; }
.lightbox__fig figcaption { color: var(--cream-dim); margin-top: 0.7rem; font-size: 0.9rem; }
.lightbox__close, .lightbox__nav {
  background: rgba(247, 240, 228, 0.1);
  border: 1px solid var(--stroke-film);
  color: var(--cream);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  flex: none;
}
.lightbox__close { position: absolute; top: 1rem; right: 1rem; }
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(247, 240, 228, 0.2); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .filmnav { display: none; }
  :root { --track: 1800vh; }
  .chapter { padding: 0 1.1rem; }
  .card { max-width: none; }
  .map-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .mobilebar { display: flex; }
  body { padding-bottom: 4.6rem; }
  .footer .wrap { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .form__row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hint__chev { animation: none; }
  html.js .card { opacity: 1; transform: none; transition: none; }
  .btn, .thumb img, .filmnav__dot, .filmnav__dot::before { transition: none; }
}
