/* =========================================================
   Maka: stranice Reference (reference/*.html)
   Učitava se posle css/style.css i koristi iste boje i fontove.
   ========================================================= */

/* ---------- Teme po brendu ----------
   --t-bg     pozadina trake (uvod priče, objave, kartica)
   --t-shape  pravougaonik iza fotografije u luku */
.theme-cream { --t-bg: var(--cream); --t-shape: var(--peach); --accent: var(--orange-dark); }
.theme-peach { --t-bg: var(--peach); --t-shape: var(--paper); --accent: var(--orange-dark); }
.theme-olive { --t-bg: var(--olive); --t-shape: #5e5023; }
.theme-dark  { --t-bg: radial-gradient(ellipse 70% 60% at 15% 0%, #5c4d22, rgba(92, 77, 34, 0) 70%), var(--olive-2); --t-shape: var(--olive); }
.theme-olive, .theme-dark { --accent: var(--orange-light); color: #e6dac4; }
:is(.theme-olive, .theme-dark) :is(h1, h2, h3) { color: #fff7ec; }
:is(.theme-olive, .theme-dark) .eyebrow { color: var(--peach); }
:is(.theme-olive, .theme-dark) .btn-link { color: #fff7ec; }
:is(.theme-olive, .theme-dark) .badge { background: var(--orange-dark); }
:is(.theme-olive, .theme-dark) .badge-rays { fill: var(--peach); }

/* =========================================================
   Pregled svih referenci (reference/index.html)
   ========================================================= */
.ref-hero { padding: 40px 0 90px; text-align: center; }
.ref-hero .eyebrow { margin-inline: auto; }
.ref-hero h1 { max-width: 860px; margin-inline: auto; }
.ref-hero .lead { max-width: 600px; margin: 26px auto 0; }

.ref-list { padding: 0 0 130px; }
.ref-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 64px 56px; align-items: start; }
.ref-grid > li { min-width: 0; }
.ref-grid > li:nth-child(even) { margin-top: 110px; } /* kartice desno su spuštene, kao u časopisu */

.ref-card {
  position: relative; display: flex; flex-direction: column;
  border-radius: 26px; background: var(--t-bg, var(--card)); box-shadow: var(--shadow);
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s;
}
.ref-card:hover { transform: translateY(-8px); box-shadow: 0 36px 60px -30px rgba(43, 35, 10, .55); }
.ref-card:has(a:focus-visible) { outline: 3px solid rgba(210, 106, 17, .6); outline-offset: 4px; }
.ref-card h2 a:focus-visible { outline: 0; }

.ref-card-media { position: relative; margin: 14px 14px 0; aspect-ratio: 4 / 3; border-radius: 18px 18px 14px 14px; }
.ref-card-photo { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; background: var(--cream); }
.ref-card-photo img { width: 100%; height: 100%; object-fit: cover; transition: scale .9s cubic-bezier(.2, .7, .2, 1); }
.ref-card:hover .ref-card-photo img { scale: 1.06; }

/* Bela pločica sa logom klijenta (logo se skalira po visini) */
.ref-card-logo, .case-logo {
  display: flex; align-items: center; justify-content: center; background: #fff;
  box-shadow: 0 16px 32px -18px rgba(43, 35, 10, .55);
}
.ref-card-logo {
  position: absolute; z-index: 2; left: 22px; bottom: -38px;
  height: 80px; min-width: 124px; max-width: 210px; padding: 12px 16px; border-radius: 16px;
}
.ref-card-logo img, .case-logo img { height: 100%; width: auto; max-width: 100%; object-fit: contain; }
/* četvrtasti logo (npr. bedž) treba više visine da bi se čitao */
.ref-card-logo--square { height: 96px; padding: 8px 18px; bottom: -46px; }

.ref-card-num {
  position: absolute; z-index: 2; right: 24px; bottom: -.48em;
  font-family: var(--num); font-size: 5.2rem; font-weight: 700; line-height: 1; color: var(--accent, var(--orange-dark));
}
.ref-card-body { display: flex; flex-direction: column; flex: 1; padding: 62px 36px 34px; }
.ref-card-industry {
  font-size: 11.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  line-height: 1.5; color: var(--olive); margin: 0 0 8px;
}
.ref-card h2 { font-size: 1.7rem; font-weight: 600; letter-spacing: -.01em; margin: 0 0 14px; }
.ref-card h2 a::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: 26px; } /* cela kartica je link */
.ref-card-quote { font-size: 1.04rem; line-height: 1.6; color: var(--ink); margin: 0 0 28px; }
.ref-card-quote .hand { font-size: 1.5em; }
.ref-card-more {
  margin-top: auto; display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent, var(--orange-dark));
}
.ref-card-more .ic { width: 16px; height: 16px; transition: transform .25s; }
.ref-card:hover .ref-card-more .ic { transform: translateX(4px); }
:is(.theme-olive, .theme-dark) .ref-card-industry { color: var(--peach); }
:is(.theme-olive, .theme-dark) .ref-card-quote { color: #fff7ec; }

.ref-cta { padding: 0 0 120px; }
.ref-cta .offer { margin-top: 0; }

/* =========================================================
   Priča jednog brenda (reference/<brend>.html)
   ========================================================= */

/* ---------- Uvod ---------- */
.case-hero { position: relative; overflow: hidden; padding: 28px 0 160px; background: var(--t-bg); }
.case-hero-rays { position: absolute; right: -50px; top: -40px; width: 300px; height: 250px; fill: rgba(210, 106, 17, .08); }

.case-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  margin-bottom: 44px; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
}
.case-crumbs a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.case-crumbs a:hover { color: var(--orange-dark); }
.case-crumbs .ic { width: 16px; height: 16px; rotate: 180deg; transition: translate .25s; }
.case-crumbs a:hover .ic { translate: -4px 0; }
.case-crumbs span { color: var(--olive); opacity: .75; }
:is(.theme-olive, .theme-dark) .case-crumbs a { color: #fff7ec; }
:is(.theme-olive, .theme-dark) .case-crumbs a:hover { color: var(--orange-light); }
:is(.theme-olive, .theme-dark) .case-crumbs span { color: var(--peach); }

.case-hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 70px; align-items: center; }
.case-hero-grid > * { min-width: 0; }

.case-logo { width: fit-content; height: 86px; min-width: 128px; max-width: 230px; padding: 14px 22px; margin-bottom: 30px; border-radius: 18px; }
.case-logo--square { height: 116px; padding: 10px 26px; }
.case-title { font-size: clamp(1.7rem, 3vw, 2.55rem); line-height: 1.25; letter-spacing: -.01em; margin: 0; }
/* padding da kosa rukopisna slova ne budu odsečena animacijom "ispisivanja" */
.case-title .hand { display: block; margin: .05em -.4em -.25em; padding: .15em .4em .25em; font-size: 1.5em; line-height: 1.05; }
.js .case-hero-copy .case-title .hand { clip-path: inset(0 100% 0 0); }
.js .case-hero-copy.in .case-title .hand { animation: hand-write 1.4s ease-in-out .45s both; }

.case-hero-media { position: relative; justify-self: end; width: min(100%, 460px); }
.case-hero-media::before {
  content: ""; position: absolute; inset: 12% -6% -6% 20%;
  background: var(--t-shape); border-radius: 10px;
}
.case-hero-media img {
  position: relative; width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 999px 999px 12px 12px; background: var(--cream);
}
.case-hero-media .badge { left: -58px; bottom: 46px; width: 150px; font-size: 1.45rem; }

/* ---------- Kartica sa podacima o saradnji ---------- */
.case-facts-wrap { position: relative; z-index: 2; margin-top: -92px; }
.case-facts { padding: 40px 48px 34px; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); }
.case-facts-list { display: grid; grid-template-columns: .8fr 1.4fr 1fr; gap: 24px 40px; margin: 0; }
.case-facts-list > div { min-width: 0; }
.case-facts dt {
  font-size: 11.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--orange-dark); margin-bottom: 6px;
}
.case-facts dd { margin: 0; color: var(--ink); font-weight: 500; line-height: 1.5; }
.case-facts-services { grid-column: 1 / -1; padding-top: 22px; border-top: 1px solid var(--line); }

.chips { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.chips li {
  padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper);
  font-size: 13.5px; font-weight: 500; line-height: 1.3; color: var(--ink);
}

.case-links { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 24px 0 0; }
.case-links a { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--orange-dark); }
.case-links a:hover { color: #9e4a07; }
.case-links .ic { width: 18px; height: 18px; }

/* ---------- Poglavlja priče ---------- */
.case-story { padding: 110px 0 40px; }
.chapter { display: grid; grid-template-columns: 290px minmax(0, 690px); gap: 26px 70px; padding: 64px 0; border-top: 1px solid var(--line); }
.chapter:first-child { padding-top: 0; border-top: 0; }
.chapter-title {
  position: sticky; top: calc(var(--header-h) + 24px); align-self: start;
  display: flex; align-items: baseline; gap: 16px; margin: 0;
  font-size: 15px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; line-height: 1.4;
}
.chapter-num { flex: none; font-family: var(--num); font-size: 3.6rem; font-weight: 700; line-height: .8; letter-spacing: 0; color: var(--orange); }
.chapter-text { font-size: 1.04rem; }
.chapter-text > :last-child { margin-bottom: 0; }
.chapter-lead { font-size: clamp(1.15rem, 1.8vw, 1.38rem); line-height: 1.5; font-weight: 500; color: var(--ink); }
.chapter-quote { margin: 0 0 1em; font-size: clamp(1.35rem, 2.3vw, 1.85rem); line-height: 1.4; font-weight: 500; color: var(--ink); }
.chapter-quote .hand { font-size: 1.45em; }

.questions { list-style: none; margin: 0 0 1.2em; padding: 0; display: grid; gap: 10px; }
.questions li {
  position: relative; padding: 14px 20px 14px 54px; border-radius: 14px;
  background: var(--card); color: var(--ink); font-weight: 500; line-height: 1.5;
  box-shadow: 0 12px 26px -22px rgba(43, 35, 10, .55);
}
.questions li::before {
  content: "?"; position: absolute; left: 20px; top: 50%; translate: 0 -52%;
  font-family: var(--hand); font-size: 2.1rem; font-weight: 700; line-height: 1; color: var(--orange);
}

/* Galerija u poglavlju (raspored iz sekcije "Naši radovi") */
.case-gallery { margin: 36px 0 44px; }
.case-gallery figcaption { display: block; margin-top: 42px; text-align: center; font-size: 1.7rem; color: var(--olive); }
.case-gallery .works-gallery figure { aspect-ratio: 1; }
.works-gallery--wide { grid-template-columns: repeat(2, 1fr); }
.case-gallery .works-gallery--wide figure { aspect-ratio: 16 / 9; }
.works-gallery--wide figure:nth-child(3n + 2) { translate: none; }
.works-gallery--wide figure:nth-child(even) { translate: 0 22px; }

/* Stari i novi logo */
.before-after {
  display: flex; align-items: center; justify-content: center; gap: 18px 30px;
  margin: 30px 0 36px; padding: 34px 20px 26px; border-radius: 20px; background: var(--cream);
}
.before-after figure { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.before-after img {
  width: 150px; height: 150px; padding: 12px; border-radius: 50%; object-fit: contain;
  background: #fff; box-shadow: 0 16px 30px -20px rgba(43, 35, 10, .55);
}
.before-after figcaption { font-size: 1.8rem; color: var(--olive); }
.ba-arrow { flex: none; width: 110px; height: 44px; fill: none; stroke: var(--orange); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* "Šta danas prodajemo?" → "Šta naš gost želi sutra?" */
.shift { margin: 26px 0 0; padding: 30px 30px 34px; border-radius: 18px; background: var(--cream); text-align: center; }
.shift p { margin: 0; }
.shift-old { font-size: 1.3rem; font-weight: 500; color: var(--muted); }
.shift .shift-mid { margin: 8px 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--olive); }
.shift .hand { display: block; font-size: clamp(2.3rem, 4.2vw, 3.3rem); color: var(--orange-dark); }

/* ---------- Objave sa društvenih mreža ---------- */
.case-posts { position: relative; overflow: hidden; padding: 100px 0 110px; background: var(--t-bg); }
.case-posts .section-head { margin-bottom: 54px; }
.posts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 24px; align-items: center; }
.post { min-width: 0; }
.post a {
  --r: -2deg;
  position: relative; display: block; padding: 8px 8px 38px; border-radius: 4px; background: #fff;
  box-shadow: 0 22px 40px -24px rgba(20, 16, 4, .65);
  rotate: var(--r); transition: rotate .35s ease, transform .35s ease;
}
.post:nth-child(even) a { --r: 2.2deg; }
.post:nth-child(3n) a { --r: -1deg; }
.post a::before {
  content: ""; position: absolute; z-index: 1; top: -11px; left: 50%; width: 64px; height: 22px;
  translate: -50% 0; rotate: -4deg; background: rgba(236, 203, 170, .88); box-shadow: 0 2px 6px rgba(43, 35, 10, .12);
}
.post a:hover, .post a:focus-visible { rotate: 0deg; transform: translateY(-6px) scale(1.03); }
.post img { width: 100%; border-radius: 2px; background: var(--cream); }
.post-tag {
  position: absolute; left: 8px; right: 8px; bottom: 9px; text-align: center;
  font-family: var(--hand); font-size: 1.3rem; font-weight: 600; line-height: 1; color: var(--olive);
}
/* Instagram oznaka u uglu: objava vodi na Instagram */
.post-ig {
  position: absolute; z-index: 1; top: 16px; right: 16px; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 250, 244, .92); color: var(--orange-dark);
  box-shadow: 0 6px 14px -6px rgba(43, 35, 10, .5); transition: background-color .25s, color .25s, scale .25s;
}
.post-ig .ic { width: 17px; height: 17px; stroke-width: 1.9; }
.post a:hover .post-ig, .post a:focus-visible .post-ig { background: var(--orange-dark); color: #fff; scale: 1.08; }
.posts-more { margin: 56px 0 0; text-align: center; }

/* ---------- Završna rečenica ---------- */
.case-final { padding: 40px 0 110px; }
.case-final-inner { max-width: 880px; margin-inline: auto; text-align: center; }
.case-final-rays { width: 62px; height: 52px; margin: 0 auto 20px; fill: var(--orange); }
.case-final-lead { margin: 0 0 .35em; font-size: clamp(1.25rem, 2.2vw, 1.7rem); line-height: 1.45; font-weight: 500; color: var(--ink); }
.case-final-hand {
  position: relative; width: fit-content; max-width: 100%; margin: 0 auto;
  font-size: clamp(2.6rem, 5.4vw, 4.4rem); line-height: 1.08; color: var(--orange-dark);
}
.case-final-hand .swoosh { left: 50%; translate: -50% 0; width: min(60%, 320px); height: .3em; bottom: -.3em; }
.js .case-final-inner .swoosh { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .9s ease .6s; }
.js .case-final-inner.in .swoosh { stroke-dashoffset: 0; }

/* ---------- Sledeća priča i poziv ---------- */
.case-next { padding: 0 0 120px; }
.next-card {
  display: grid; grid-template-columns: 1fr 1.15fr; overflow: hidden; border-radius: 24px;
  background: var(--t-bg); box-shadow: var(--shadow); transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}
.next-card:hover { transform: translateY(-6px); }
.next-card-media { position: relative; min-height: 280px; overflow: hidden; background: var(--cream); }
.next-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: scale .9s cubic-bezier(.2, .7, .2, 1); }
.next-card:hover .next-card-media img { scale: 1.06; }
.next-card-text { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 44px 50px; }
.next-name { display: block; margin: 0 0 12px; font-size: clamp(1.9rem, 3vw, 2.5rem); font-weight: 600; line-height: 1.1; color: var(--ink); }
.next-line { display: block; margin: 0 0 24px; color: var(--ink); }
:is(.theme-olive, .theme-dark) :is(.next-name, .next-line) { color: #fff7ec; }
.case-next .offer { margin-top: 64px; }

/* Tekst samo za čitače ekrana */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* =========================================================
   Prilagođavanje ekranima
   ========================================================= */
@media (max-width: 960px) {
  .ref-grid { gap: 48px 28px; }
  .ref-grid > li:nth-child(even) { margin-top: 70px; }
  .ref-card-body { padding: 58px 26px 28px; }
  .ref-card-num { font-size: 4.4rem; }

  .case-hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .case-hero-media { justify-self: center; }
  .case-hero-media .badge { left: -18px; }
  .case-facts-list { grid-template-columns: 1fr 1fr; }
  .chapter { grid-template-columns: 1fr; gap: 18px; padding: 52px 0; }
  .chapter-title { position: static; }
  .posts { grid-template-columns: repeat(3, 1fr); gap: 36px 28px; }
  .next-card { grid-template-columns: 1fr; }
  .next-card-media { min-height: 0; aspect-ratio: 16 / 9; }
}

@media (max-width: 640px) {
  .ref-hero { padding: 24px 0 64px; }
  .ref-list, .ref-cta { padding-bottom: 80px; }
  .ref-grid { grid-template-columns: 1fr; gap: 44px; }
  .ref-grid > li:nth-child(even) { margin-top: 0; }
  .ref-card-logo { height: 70px; min-width: 108px; max-width: 180px; left: 16px; bottom: -32px; }
  .ref-card-body { padding: 52px 22px 26px; }
  .ref-card h2 { font-size: 1.5rem; }

  .case-hero { padding: 18px 0 130px; }
  .case-crumbs { margin-bottom: 30px; }
  .case-logo { height: 70px; padding: 12px 18px; margin-bottom: 24px; }
  .case-logo--square { height: 96px; padding: 8px 20px; }
  .ref-card-logo--square { height: 84px; bottom: -40px; }
  .case-hero-media .badge { left: -6px; bottom: -26px; width: 124px; padding: 20px 14px 16px; font-size: 1.2rem; }
  .case-hero-media::before { inset: 12% -3% -4% 18%; }
  .case-facts-wrap { margin-top: -80px; }
  .case-facts { padding: 28px 22px 26px; }
  .case-facts-list { grid-template-columns: 1fr; gap: 18px; }
  .case-facts-services { padding-top: 18px; }
  .case-story { padding: 80px 0 20px; }
  .chapter { padding: 44px 0; }
  .chapter-num { font-size: 3rem; }
  .questions li { padding: 12px 16px 12px 46px; }
  .questions li::before { left: 16px; font-size: 1.8rem; }
  .before-after { gap: 10px; padding: 26px 12px 20px; }
  .before-after img { width: 104px; height: 104px; padding: 8px; }
  .ba-arrow { width: 54px; height: 30px; }
  .shift { padding: 24px 18px 28px; }
  .case-posts { padding: 80px 0; }
  .posts { grid-template-columns: repeat(2, 1fr); gap: 30px 18px; }
  .post a { padding: 6px 6px 32px; }
  .post-tag { font-size: 1.1rem; bottom: 8px; }
  .case-final { padding: 30px 0 80px; }
  .case-next { padding-bottom: 80px; }
  .next-card-text { padding: 32px 24px; }
  .case-next .offer { margin-top: 44px; }
  .post-ig { top: 12px; right: 12px; width: 28px; height: 28px; }
  .post-ig .ic { width: 15px; height: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .case-hero-copy .case-title .hand, .js .case-hero-copy.in .case-title .hand { clip-path: none; animation: none; }
  .js .case-final-inner .swoosh { stroke-dashoffset: 0; }
}
