/* =====================================================
   DUBROVNIK TAXI & TOURS
   ===================================================== */
:root {
  --bg: #0d0e12;
  --ink: #f4f2ec;
  --muted: rgba(244, 242, 236, .72);
  --yellow: #f6c945;
  --yellow-deep: #e0a72e;
  --road-h: 112px;
}
@media (max-width: 640px) {
  :root { --road-h: 86px; }
}

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

/* scrolling is paged by script.js — gestures travel station to station */

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- shared bits ---------- */
.kicker {
  text-transform: uppercase;
  letter-spacing: .38em;
  font-size: clamp(.7rem, 2.6vw, .85rem);
  font-weight: 600;
  color: var(--yellow);
}

.checker {
  height: 12px;
  background: repeating-conic-gradient(#101117 0% 25%, var(--yellow) 0% 50%);
  background-size: 12px 12px;
}
.checker.line {
  width: 132px;
  height: 10px;
  background-size: 10px 10px;
  border-radius: 2px;
  margin: 1.4rem auto;
  opacity: .9;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  background: var(--yellow);
  color: #14130d;
  font-weight: 700;
  padding: .8em 1.5em;
  border-radius: 999px;
  white-space: nowrap;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px) scale(1.02); background: #ffd95e; }
.btn:active { transform: scale(.98); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid rgba(244, 242, 236, .45);
}
.btn.ghost:hover { background: rgba(244, 242, 236, .1); }
.btn.small { padding: .55em 1.1em; font-size: .9rem; }
.btn.big {
  font-size: clamp(1.15rem, 5vw, 1.6rem);
  padding: .85em 1.6em;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .45);
}
.btn.pulse { animation: pulse 2.2s ease-out infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 12px 36px rgba(0,0,0,.45), 0 0 0 0 rgba(246, 201, 69, .5); }
  100% { box-shadow: 0 12px 36px rgba(0,0,0,.45), 0 0 0 28px rgba(246, 201, 69, 0); }
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1.1rem, 4vw, 2.5rem);
  background: linear-gradient(rgba(10, 11, 15, .65), rgba(10, 11, 15, 0));
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: .02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
  transition: opacity .3s ease, transform .3s ease;
}
.brand span { color: var(--yellow); }
/* the road (and its taxi) takes the brand's place while touring */
body.in-tours .brand {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}
@media (max-width: 540px) {
  .topcall span { display: none; }       /* icon-only on small phones */
  .topcall { padding: .55em .7em; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  isolation: isolate;
}
/* tiny 1 KB placeholder paints instantly underneath; the sized-down
   photo replaces it as soon as it arrives */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    url("Images/opt/main-1280.jpg") center / cover no-repeat,
    url("Images/opt/main-tiny.jpg") center / cover no-repeat;
}
@media (min-width: 901px) {
  .hero::before {
    background:
      url("Images/opt/main-1920.jpg") center / cover no-repeat,
      url("Images/opt/main-tiny.jpg") center / cover no-repeat;
  }
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(13, 14, 18, .55), rgba(13, 14, 18, .25) 35%,
                    rgba(13, 14, 18, .3) 65%, rgba(13, 14, 18, .85));
}
.hero-inner {
  padding: clamp(5.5rem, 12vh, 8rem) 1.25rem calc(var(--road-h) + 5.5rem);
  max-width: 780px;
}
.hero h1 {
  font-size: clamp(3rem, 11vw, 6rem);
  font-weight: 800;
  line-height: .97;
  letter-spacing: -.01em;
  margin-top: .9rem;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .45);
}
.hero h1 .yellow { color: var(--yellow); }
.tagline {
  color: var(--muted);
  font-size: clamp(1rem, 3.4vw, 1.2rem);
  max-width: 34em;
  margin: 0 auto 2.1rem;
}
.hero-note {
  margin-top: 1.5rem;
  font-size: .85rem;
  letter-spacing: .08em;
  color: var(--muted);
}

.tours-cue {
  position: absolute;
  left: 50%;
  bottom: calc(var(--road-h) + 10px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
  z-index: 6;
}
.tours-cue svg { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(7px); }
}

/* ---------- the road ---------- */
.journey {
  position: relative;
  z-index: 5;
  margin-top: calc(-1 * var(--road-h));   /* road overlaps the hero bottom */
}
.road-sticky {
  position: sticky;
  top: 0;
  height: var(--road-h);
  z-index: 20;
  pointer-events: none;
}
#roadSvg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .35));
}

/* ---------- tours ---------- */
.tours {
  position: relative;
  /* height set from JS: tours.length * 1.5 viewports */
}
.stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  /* extra-photo tray sizing (overridden for phones further down) */
  --rail-w: min(66vw, 860px);
  --card-w: clamp(280px, 33vw, 440px);
  --card-h: min(64vh, 600px);
  --peek: 78px;
  --gap: 20px;
}

/* ---------- cover photo (stays full-bleed) ---------- */
.photo-main {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.photo-bg {
  position: absolute;
  inset: 0;
  background: center / cover no-repeat var(--bg);
}
.photo-main::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(13, 14, 18, .6), rgba(13, 14, 18, .15) 30%,
                    rgba(13, 14, 18, .25) 55%, rgba(13, 14, 18, .82));
}

/* ---------- extra-photo tray (right-docked cards that peek in) ---------- */
.extras-backdrop {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, rgba(8, 9, 12, .5) 0%, rgba(8, 9, 12, .8) 44%, rgba(8, 9, 12, .92) 100%);
  transition: opacity .5s ease;
}
.extras.is-open ~ .extras-backdrop { opacity: 1; }

.extras {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: var(--rail-w);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: var(--gap);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.extras::-webkit-scrollbar { display: none; }
.extras-spacer { flex: 0 0 auto; height: 1px; pointer-events: none; }
/* the peek (scrollLeft 0) is itself a snap stop, so the tray rests peeking
   instead of snapping the first card to centre on load */
.extras-spacer.lead { flex-basis: calc(var(--rail-w) - var(--peek)); scroll-snap-align: start; }
.extras-spacer.tail { flex-basis: calc((var(--rail-w) - var(--card-w)) / 2 + 1.5rem); }

.ecard {
  position: relative;
  flex: 0 0 var(--card-w);
  height: var(--card-h);
  border-radius: 20px;
  overflow: hidden;
  scroll-snap-align: center;
  cursor: pointer;
  box-shadow: 0 26px 60px rgba(0, 0, 0, .55);
  transition: transform .45s cubic-bezier(.22, .61, .36, 1), box-shadow .35s ease;
  will-change: transform;
}
.ecard-bg {
  position: absolute;
  inset: 0;
  background: center / cover no-repeat var(--bg);
}
.ecard::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .58) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.ecard-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 1.05rem 1.2rem 1.15rem;
}
.ecard-cap .kicker { font-size: .64rem; letter-spacing: .26em; margin-bottom: .35rem; }
.ecard-cap .cap-text {
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  font-weight: 700;
  line-height: 1.18;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .65);
}
.ecard:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

/* the exposed first card gently "pops" from the right until you interact */
.extras:not(.is-open) .ecard--first { animation: peekPop 2.8s ease-in-out infinite; }
.extras:not(.is-open):hover .ecard--first { animation: none; transform: translateX(-26px); }
.extras.is-open .ecard--first { animation: none; }
@keyframes peekPop {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-13px); }
}

.slide-content {
  position: absolute;
  z-index: 2;
  left: clamp(1.25rem, 7vw, 6rem);
  right: clamp(1.25rem, 7vw, 6rem);
  bottom: clamp(2.2rem, 8vh, 5.5rem);
  max-width: 640px;
  will-change: transform;
}
.slide-content h2 {
  font-size: clamp(2.3rem, 8vw, 4.4rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.01em;
  margin: .5rem 0 .9rem;
  text-shadow: 0 4px 26px rgba(0, 0, 0, .5);
}
.slide-content .desc {
  color: var(--muted);
  font-size: clamp(.98rem, 3vw, 1.12rem);
  max-width: 36em;
  margin-bottom: 1.6rem;
}
.slide-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ---------- tray controls ---------- */
.epeek {
  position: absolute;
  z-index: 10;
  right: calc(var(--peek) + 16px);
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: .45em;
  padding: .6em 1em;
  border-radius: 999px;
  background: rgba(20, 21, 28, .62);
  border: 1px solid rgba(244, 242, 236, .2);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .03em;
  white-space: nowrap;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .4);
  transition: opacity .4s ease, transform .4s ease;
}
.epeek .epeek-n { color: var(--yellow); font-weight: 800; }
.epeek .chev { font-size: 1.25em; line-height: 0; animation: nudgeX 1.4s ease-in-out infinite; }
@keyframes nudgeX { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-5px); } }
.extras.touched ~ .epeek,
.extras.is-open ~ .epeek { opacity: 0; transform: translate(12px, -50%); pointer-events: none; }

.extras-nav {
  position: absolute;
  z-index: 10;
  right: 0;
  bottom: clamp(1rem, 3.4vh, 2rem);
  width: var(--rail-w);
  display: flex;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.extras.is-open ~ .extras-nav { opacity: 1; }
.extras-nav > * { pointer-events: auto; }

.gnav-bar {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(20, 21, 28, .5);
  border: 1px solid rgba(244, 242, 236, .16);
  backdrop-filter: blur(6px);
  padding: .3rem .4rem;
  border-radius: 999px;
}
.gnav-arrow {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: var(--ink);
  opacity: .85;
  transition: opacity .2s ease, background .2s ease, transform .15s ease;
}
.gnav-arrow:hover { background: rgba(244, 242, 236, .14); opacity: 1; }
.gnav-arrow:active { transform: scale(.9); }
.gnav-dots { display: inline-flex; align-items: center; gap: .5rem; padding: 0 .35rem; }
.gnav-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(244, 242, 236, .38);
  transition: background .25s ease, width .25s ease;
}
.gnav-dot.on { background: var(--yellow); width: 22px; }
.extras.at-start ~ .extras-nav .gnav-arrow.prev,
.extras.at-end ~ .extras-nav .gnav-arrow.next { opacity: .25; pointer-events: none; }

/* ---------- phones: tray sits in the upper area, clear of the title ---------- */
@media (max-width: 640px) {
  .slide {
    --rail-w: 100vw;
    --card-w: 80vw;
    --card-h: 42vh;
    --peek: 56px;
    --gap: 14px;
  }
  .extras {
    top: 0;
    bottom: auto;
    height: 60vh;
    align-items: flex-start;
    padding-top: 8vh;
  }
  /* tray is up top on phones, so dim vertically — heavy over the cards,
     easing off toward the title at the bottom */
  .extras-backdrop {
    background: linear-gradient(180deg, rgba(8, 9, 12, .92) 0%, rgba(8, 9, 12, .85) 48%, rgba(8, 9, 12, .5) 100%);
  }
  .extras-spacer.tail { flex-basis: calc((var(--rail-w) - var(--card-w)) / 2 + 1rem); }
  .epeek { top: 29vh; font-size: .76rem; right: calc(var(--peek) + 10px); }
  .extras-nav { bottom: auto; top: calc(50vh + 1rem); }
  .slide-content { bottom: clamp(2rem, 6vh, 3.2rem); }
}

/* tour-position dots — on the left, since the right edge is the photo tray */
.dots {
  position: absolute;
  z-index: 10;
  left: clamp(.9rem, 3vw, 2rem);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 1.5px solid rgba(244, 242, 236, .75);
  background: transparent;
  transition: background .25s ease, height .25s ease, border-color .25s ease;
}
.dot.on {
  background: var(--yellow);
  border-color: var(--yellow);
  height: 26px;
}

/* ---------- footer ---------- */
.footer { background: #0a0b0f; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  padding: clamp(2.2rem, 6vw, 3.5rem) clamp(1.25rem, 5vw, 3rem) 1.6rem;
}
.f-brand { font-size: 1.45rem; font-weight: 800; }
.f-brand span { color: var(--yellow); }
.f-muted { color: var(--muted); margin-top: .3rem; }
.f-contact { display: flex; flex-wrap: wrap; gap: .8rem; }
.copy {
  text-align: center;
  color: rgba(244, 242, 236, .45);
  font-size: .85rem;
  padding: 0 1.25rem 1.8rem;
}

/* ---------- crawlable "details" content (tours + transfers + FAQ) ----------
   Real, indexable HTML that mirrors the animated slides above so the copy,
   headings and photos exist for search engines / social / AI crawlers that
   don't run JavaScript. */
.detail {
  position: relative;
  background: var(--bg);
  padding: clamp(3.5rem, 9vw, 7rem) clamp(1.25rem, 5vw, 3rem) clamp(2rem, 5vw, 3.5rem);
}
.detail > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.detail h2 {
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.01em;
  margin: .6rem 0 0;
}
.detail .lead {
  color: var(--muted);
  font-size: clamp(1rem, 2.7vw, 1.18rem);
  max-width: 48em;
  margin: 1.1rem auto 0;
}
.detail .lead a { color: var(--yellow); font-weight: 700; }

.d-card {
  display: grid;
  gap: clamp(1rem, 3vw, 2.2rem);
  align-items: center;
  margin-top: clamp(2.2rem, 6vw, 3.5rem);
}
@media (min-width: 760px) {
  .d-card.has-media { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.d-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.d-body h3 {
  font-size: clamp(1.35rem, 3.6vw, 1.9rem);
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: .7rem;
}
.d-body p { color: var(--muted); font-size: clamp(.98rem, 2.5vw, 1.08rem); max-width: 42em; }

.faq { margin-top: clamp(2.8rem, 7vw, 4.5rem); }
.faq h3 { font-size: clamp(1.3rem, 4vw, 1.8rem); font-weight: 800; margin-bottom: 1rem; }
.faq details {
  border-top: 1px solid rgba(244, 242, 236, .14);
  padding: 1rem .2rem;
}
.faq details:last-of-type { border-bottom: 1px solid rgba(244, 242, 236, .14); }
.faq summary {
  font-weight: 700;
  font-size: clamp(1rem, 2.6vw, 1.12rem);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--yellow); font-weight: 800; flex: 0 0 auto; }
.faq details[open] summary::after { content: "\2013"; }
.faq details p { color: var(--muted); margin-top: .7rem; max-width: 46em; }
.faq a { color: var(--yellow); font-weight: 700; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn.pulse, .tours-cue svg, .epeek .chev, .extras .ecard--first { animation: none; }
  .btn, .dot { transition: none; }
}
