/* =========================================================
   Bergen RIB Safari — mobile experience layer
   Loaded last. Phones are the majority of tour traffic, so the
   patterns here follow what the big experience platforms do:
   a persistent booking bar, a full-screen menu sheet, thumb-sized
   targets, and short scannable sections instead of long scrolls.
   ========================================================= */

/* ---------- 1. Persistent booking bar (phones + small tablets) ---------- */
.x-bookbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: none; align-items: center; gap: 1rem;
  padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
  background: rgba(14, 20, 23, .96);
  backdrop-filter: saturate(140%) blur(12px);
  border-top: 1px solid rgba(255, 255, 255, .12);
  transform: translateY(110%);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.x-bookbar.is-in { transform: none; }
.x-bookbar__price { color: #fff; line-height: 1.25; }
.x-bookbar__price { min-width: 0; }
.x-bookbar__price b { display: block; font-family: var(--x-serif, Georgia, serif); font-size: 1.2rem; font-weight: 400; white-space: nowrap; }
.x-bookbar__price span {
  display: block; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255, 255, 255, .62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.x-bookbar__cta {
  margin-left: auto; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 1.5rem;
  background: #fff; color: #0e1417;
  font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}
.x-bookbar__cta:active { background: #cbb89a; }

@media (max-width: 860px) {
  .x-bookbar { display: flex; }
  /* Keep the last section clear of the bar. */
  body { padding-bottom: 4.9rem; }
}

/* ---------- 2. Full-screen menu sheet ---------- */
.x-sheet {
  position: fixed; inset: 0; z-index: 90;
  background: #0e1417; color: #fff;
  display: flex; flex-direction: column;
  padding: 1rem 1.4rem calc(2rem + env(safe-area-inset-bottom));
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s;
}
.x-sheet.is-open { opacity: 1; visibility: visible; transform: none; }
.x-sheet__top { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.x-sheet__brand { font-family: var(--x-serif, Georgia, serif); font-size: 1.25rem; }
.x-sheet__close {
  width: 48px; height: 48px; display: grid; place-items: center;
  background: none; border: 1px solid rgba(255, 255, 255, .25); color: #fff; cursor: pointer;
}
.x-sheet__links { list-style: none; margin: 2rem 0 0; padding: 0; flex: 1; }
.x-sheet__links a {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 58px; padding: .4rem 0;
  font-family: var(--x-serif, Georgia, serif); font-size: 1.55rem; font-weight: 300;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.x-sheet__links a::after { content: "→"; font-family: var(--x-sans, sans-serif); font-size: .95rem; color: rgba(255, 255, 255, .4); }
.x-sheet__foot { display: grid; gap: .9rem; margin-top: 1.5rem; }
.x-sheet__foot .x-btn { justify-content: center; min-height: 54px; }
.x-sheet__meta { font-size: .82rem; color: rgba(255, 255, 255, .55); text-align: center; }
body.x-locked { overflow: hidden; }

/* ---------- 3. Phone layout ---------- */
@media (max-width: 700px) {
  /* A slim bar: the booking CTA lives at the bottom of the screen, so the top
     only needs the brand and the menu. */
  .site-header .nav { height: 62px; }
  .x-page .brand, .x-inner .brand { font-size: 1.02rem; }
  .brand__mark { width: 30px; height: 30px; }
  .nav__cta .btn { display: none; }
  .nav__toggle { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; margin-right: -.5rem; }
  .nav__toggle svg { width: 24px; height: 24px; }

  /* Readable body copy: nothing under 15px, comfortable measure. */
  .x-body, .x-lead, .x-col p, .x-note p, p { font-size: 1rem; line-height: 1.68; }
  /* Small caps still have to be readable at arm's length in daylight. */
  .x-meta li { font-size: .82rem; }
  .x-eyebrow { font-size: .74rem; letter-spacing: .2em; }
  .x-hero__chips li { font-size: .74rem; }
  .x-btn, .btn, .x-textlink, .x-bookbar__cta { font-size: .8rem; }
  .x-price small, .x-pick__meta { font-size: .78rem; }

  /* Thumb-sized targets everywhere. */
  .x-btn, .btn { min-height: 52px; padding: .95rem 1.5rem; }
  .brand { min-height: 44px; }
  .x-textlink { display: inline-flex; align-items: center; min-height: 44px; }
  .x-footer ul { gap: .1rem; }
  .x-footer ul a, .site-footer a { display: inline-flex; align-items: center; min-height: 44px; }

  /* Hero: image on phones (no autoplay video — data, battery, and it never
     plays before the first paint anyway). */
  .x-hero { min-height: 88svh; }
  .x-hero video { display: none; }
  .x-hero__poster { display: block; position: absolute; inset: 0; }
  .x-hero__poster img { width: 100%; height: 100%; object-fit: cover; }
  .x-hero__inner { padding-top: 6rem; padding-bottom: 2.4rem; }
  .x-hero .x-display { font-size: clamp(2.4rem, 12vw, 3.4rem); line-height: 1; }
  .x-hero__sub { font-size: 1rem; line-height: 1.55; margin: .9rem 0 1.3rem; max-width: 34ch; }
  .x-hero__cta { gap: .6rem; }
  /* One quiet row of proof, swipeable — never a stack that pushes the CTA off. */
  .x-hero__chips {
    display: flex; gap: .45rem; margin: 1.1rem -1.25rem 0; padding: 0 1.25rem; list-style: none;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .x-hero__chips::-webkit-scrollbar { display: none; }
  .x-hero__chips li {
    flex: none; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
    padding: .45rem .75rem; border: 1px solid rgba(255, 255, 255, .3); color: rgba(255, 255, 255, .92);
    white-space: nowrap;
  }

  /* Sections: tighter, so the page is scannable instead of endless. */
  .x-section { padding: 3.4rem 0; }
  .x-h2 { font-size: clamp(1.85rem, 8vw, 2.3rem); }
  .x-row + .x-row { margin-top: 2.6rem; }
  .x-row { gap: 1.1rem; }
  .x-row__media { aspect-ratio: 4 / 3; }
  .x-row__no { font-size: 2.4rem; top: .7rem; left: .9rem; }
  .x-actions { margin-top: 1.2rem; gap: .8rem; }
  .x-actions .x-btn { flex: 1 1 100%; justify-content: center; }
  .x-price { font-size: 1.7rem; }
  .x-col + .x-col { margin-top: .4rem; }

  /* Gallery becomes a swipeable strip — one screen instead of six. */
  .x-gallery {
    display: grid; grid-auto-flow: column; grid-auto-columns: 78%;
    grid-template-columns: none; gap: .6rem;
    overflow-x: auto; scroll-snap-type: x mandatory;
    margin-inline: -1.25rem; padding: 0 1.25rem 1rem;
    scrollbar-width: none;
  }
  .x-gallery::-webkit-scrollbar { display: none; }
  .x-gallery figure { scroll-snap-align: center; aspect-ratio: 3 / 4; }
  .x-band { aspect-ratio: 3 / 2; }

  .x-specs li { flex-direction: column; gap: .2rem; }
  .x-cta { min-height: 62svh; }
  .x-footer__grid { gap: 2rem; }
}

/* Older pages (.x-inner) get the same phone treatment for their own classes. */
@media (max-width: 700px) {
  .x-inner .section { padding: 3.2rem 0; }
  .x-inner .grid--3, .x-inner .grid--2 { grid-template-columns: 1fr; gap: 1.2rem; }
  .x-inner .split { grid-template-columns: 1fr; gap: 1.4rem; }
  .x-inner .hero__inner { padding: 6.5rem 0 3rem; }
  .x-inner .hero__trust { gap: .6rem 1.2rem; }
  .x-inner .hero__trust li { font-size: .86rem; }
  .x-inner .stats { grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
  .x-inner .card, .x-inner .tour-card { margin-bottom: 0; }
  .x-inner .faq__q { min-height: 56px; font-size: 1rem; }
}

/* ---------- 3b. Booking picker (book.html) ---------- */
.x-picker {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem;
  margin-bottom: 2.5rem;
}
.x-pick {
  display: block; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid var(--x-line, rgba(14,20,23,.14)); border-radius: 0;
  padding: 0 0 .9rem; overflow: hidden; font: inherit; color: inherit;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.x-pick img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; margin-bottom: .75rem; }
.x-pick__name { display: block; padding: 0 .9rem; font-family: var(--x-serif, Georgia, serif); font-size: 1.05rem; line-height: 1.25; }
.x-pick__meta { display: block; padding: .25rem .9rem 0; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: #74818a; }
.x-pick.is-on { border-color: var(--x-ink, #0e1417); box-shadow: inset 0 0 0 1px var(--x-ink, #0e1417); }
.x-pick:hover { transform: translateY(-2px); }
.x-panel.is-hidden { display: none; }
.x-panel .bokun-mount { margin-top: 1.2rem; }

@media (max-width: 860px) {
  /* Swipeable chooser — four cards never fit across a phone. */
  .x-picker {
    grid-auto-flow: column; grid-auto-columns: 62%; grid-template-columns: none;
    overflow-x: auto; scroll-snap-type: x mandatory;
    margin-inline: -1.25rem; padding: .2rem 1.25rem 1rem; scrollbar-width: none;
  }
  .x-picker::-webkit-scrollbar { display: none; }
  .x-pick { scroll-snap-align: center; }
  .x-pick:hover { transform: none; }
}

/* ---------- 4. Desktop keeps the video, hides the phone furniture ---------- */
@media (min-width: 701px) {
  .x-hero__poster { display: none; }
  .x-hero__chips { display: none; }
}
