/* =============================================================
   Niseko Nomads — review videos + photo gallery
   -------------------------------------------------------------
   .nn-video    self-hosted review video: a silent looping preview
                until clicked, then the full video with sound,
                captions and fullscreen (js/nn-video.js)
   .nn-gallery  justified photo grid + full-screen viewer
                (js/nn-gallery.js)
   .nn-reviews  the /reviews.html page
   ============================================================= */

/* ---- review video ---- */
.nn-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0b0b0b;
  cursor: pointer;
  isolation: isolate;
}
.nn-video > img,
.nn-video > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
  margin: 0;
}
.nn-video > .nn-video-full { object-fit: contain; background: #0b0b0b; }
.nn-video-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .35), rgba(0, 0, 0, 0) 45%);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.nn-video-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 52px;
  border-radius: 12px;
  background: rgba(106, 205, 223, .92);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .28);
  transition: transform .2s ease, background-color .2s ease;
}
.nn-video-icon::before {
  content: "";
  margin-left: 5px;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #fff;
}
.nn-video:hover .nn-video-icon,
.nn-video-play:focus-visible .nn-video-icon { transform: scale(1.08); background: #6acddf; }
.nn-video-play:focus-visible { outline: 3px solid #6acddf; outline-offset: -3px; }
.nn-video-sound {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font: 500 12px/1.2 Roboto, Arial, sans-serif;
  letter-spacing: .2px;
  pointer-events: none;
}
.nn-video-sound svg { width: 15px; height: 15px; flex: none; }
.nn-video-time {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font: 500 12px/1.3 Roboto, Arial, sans-serif;
  pointer-events: none;
}
.nn-video.is-playing { cursor: default; }
/* the homepage cards were sized for the Wistia embed */
.video-wrapper-rev { min-height: 0; }
.nn-video.is-playing .nn-video-play,
.nn-video.is-playing > img,
.nn-video.is-playing > .nn-video-preview { display: none; }
.nn-video video::cue {
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-family: Roboto, Arial, sans-serif;
  line-height: 1.35;
}
@media (max-width: 479px) {
  .nn-video-icon { width: 64px; height: 44px; }
  .nn-video-icon::before { border-width: 10px 0 10px 17px; margin-left: 4px; }
}

/* ---- photo gallery: justified rows that keep every photo's shape ---- */
.nn-gallery-wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px 4rem; }
.nn-gallery {
  --row: 250px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.nn-gallery::after { content: ""; flex-grow: 999999; }
.nn-gallery-item {
  position: relative;
  display: block;
  flex-grow: calc(var(--ar) * 100);
  flex-basis: calc(var(--ar) * var(--row));
  overflow: hidden;
  border-radius: 12px;
  background: #9fcfd6;
  color: #fff;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.nn-gallery-item::before { content: ""; display: block; padding-bottom: calc(100% / var(--ar)); }
.nn-gallery-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.nn-gallery-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 12px 9px;
  background: linear-gradient(to top, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0));
  font: 500 13px/1.3 Roboto, Arial, sans-serif;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.nn-gallery-item:hover img { transform: scale(1.04); }
.nn-gallery-item:focus-visible { outline: 3px solid #2f5249; outline-offset: 2px; }
@media (max-width: 767px) {
  .nn-gallery { --row: 170px; gap: 6px; }
  .nn-gallery-wrap { padding: 0 10px 3rem; }
  .nn-gallery-item { border-radius: 8px; }
  .nn-gallery-cap { padding: 20px 8px 6px; font-size: 11px; }
}
@media (max-width: 479px) {
  .nn-gallery { --row: 120px; }
  .nn-gallery-cap { display: none; } /* tiles are too small; the viewer shows the caption */
}

/* clips in the grid: poster + play badge + length */
.nn-gallery-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .85);
  pointer-events: none;
}
.nn-gallery-play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -5px;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
}
.nn-gallery-dur {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font: 500 12px/1.4 Roboto, Arial, sans-serif;
  pointer-events: none;
}
@media (max-width: 479px) {
  .nn-gallery-play { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
  .nn-gallery-play::before { margin: -7px 0 0 -4px; border-width: 7px 0 7px 12px; }
  .nn-gallery-dur { top: 5px; right: 5px; font-size: 10px; }
}
/* homepage teaser -> /gallery.html: even 4:3 tiles, always full rows (12 = 4x3, 3x4, 2x6) */
.nn-gallery.is-teaser { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nn-gallery.is-teaser::after { display: none; }
.nn-gallery.is-teaser .nn-gallery-item::before { padding-bottom: 75%; }
@media (max-width: 991px) { .nn-gallery.is-teaser { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .nn-gallery.is-teaser { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nn-gallery-more { margin: 26px 0 0; text-align: center; }
.nn-gallery-more a { display: inline-block; }
/* /gallery.html */
.nn-gallery-page { background: var(--primary-light, #b0dce2); }
.nn-gallery-hero {
  padding: 170px 20px 72px;
  text-align: center;
  color: #fff;
  background: linear-gradient(rgba(0, 0, 0, .45), rgba(0, 0, 0, .3)), url('/images/gallery/snow-monsters-yotei-2048.webp') center 45% / cover no-repeat #2f5249;
}
.nn-gallery-hero h1 { margin: 0 0 10px; color: #fff; font: 400 52px/1.1 'DM Serif Display', serif; text-shadow: 0 2px 14px rgba(0, 0, 0, .45); }
.nn-gallery-hero p { max-width: 620px; margin: 0 auto; font: 500 18px/1.5 Roboto, Arial, sans-serif; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.nn-gallery-section { padding-top: 44px; }
.nn-gallery-section h2 { max-width: 1200px; margin: 0 auto 16px; padding: 0 20px; font: 400 30px/1.2 'DM Serif Display', serif; color: #0b0b0b; }
.nn-gallery-section h2 span { margin-left: 10px; font: 400 15px/1 Roboto, Arial, sans-serif; color: #2f5249; }
.nn-gallery-cta { padding: 20px 20px 80px; text-align: center; }
.nn-gallery-cta p { margin: 0 0 18px; font: 400 18px/1.5 Roboto, Arial, sans-serif; color: #0b0b0b; }
@media (max-width: 767px) {
  .nn-gallery-hero { padding: 140px 16px 48px; }
  .nn-gallery-hero h1 { font-size: 38px; }
  .nn-gallery-section { padding-top: 30px; }
  .nn-gallery-section h2 { padding: 0 10px; font-size: 24px; }
}

/* ---- full-screen photo viewer ---- */
.nn-lb {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 14, .95);
  color: #fff;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.nn-lb.is-open { display: flex; }
.nn-lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: 100%; }
.nn-lb-img,
.nn-lb-video {
  display: block;
  max-width: 94vw;
  max-height: calc(100vh - 130px);
  max-height: calc(100dvh - 130px);
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  transition: opacity .2s ease, transform .2s ease;
}
.nn-lb-img.is-loading { opacity: .35; }
.nn-lb-video { background: #000; }
.nn-lb [hidden] { display: none !important; }
.nn-lb-cap { margin-top: 14px; padding: 0 64px; text-align: center; font: 400 15px/1.4 Roboto, Arial, sans-serif; }
.nn-lb-count { position: absolute; top: 18px; left: 20px; font: 500 13px/1 Roboto, Arial, sans-serif; opacity: .75; }
.nn-lb button {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s ease;
}
.nn-lb button:hover, .nn-lb button:focus-visible { background: rgba(255, 255, 255, .26); outline: none; }
.nn-lb-close { top: 10px; right: 12px; }
.nn-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.nn-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.nn-lb svg { width: 22px; height: 22px; }
html.nn-lb-lock, html.nn-lb-lock body { overflow: hidden; }
@media (max-width: 767px) {
  .nn-lb-img, .nn-lb-video { max-width: 100vw; border-radius: 0; }
  .nn-lb-prev, .nn-lb-next { top: auto; bottom: 14px; transform: none; }
  .nn-lb-prev { left: 14px; }
  .nn-lb-next { right: 14px; }
  .nn-lb-cap { padding: 0 72px; font-size: 13px; min-height: 36px; }
}

/* ---- review videos under step 1 of the apply form ---- */
.nn-apply-reviews { margin-top: 48px; padding-top: 32px; border-top: 1px solid #e2e2e2; }
.nn-apply-reviews h3 { margin: 0 0 4px; font-size: 26px; font-style: italic; }
.nn-apply-reviews > p { margin: 0 0 20px; color: #6a6a6a; font-size: 15px; }
.nn-review-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.nn-review-row figure { margin: 0; }
.nn-review-row figcaption { margin-top: 10px; font-size: 14px; line-height: 1.45; color: #1e1e1e; }
.nn-review-row figcaption strong { display: block; font-weight: 700; }
.nn-review-row figcaption span { color: #6a6a6a; font-size: 13px; }
@media (max-width: 767px) {
  /* one swipeable row instead of three full-width videos stacked */
  .nn-review-row {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 84%;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 0 16px 4px;
    scroll-padding: 0 16px;
  }
  .nn-review-row::-webkit-scrollbar { display: none; }
  .nn-review-row figure { scroll-snap-align: start; }
  .nn-apply-reviews { margin-top: 32px; }
}
@media (max-width: 380px) {
  .nn-review-row { margin: 0 -12px; padding: 0 12px 4px; scroll-padding: 0 12px; }
}

/* ---- /reviews.html ---- */
.nn-reviews { background: #fff; color: #0b0b0b; }
.nn-reviews-hero {
  padding: 170px 20px 72px;
  text-align: center;
  color: #fff;
  background: linear-gradient(rgba(0, 0, 0, .5), rgba(0, 0, 0, .38)), url('/images/gallery/crew-dinner-2048.webp') center 30% / cover no-repeat #2f5249;
}
.nn-reviews-hero h1 { margin: 0 0 10px; color: #fff; font: 400 52px/1.1 'DM Serif Display', serif; text-shadow: 0 2px 14px rgba(0, 0, 0, .45); }
.nn-reviews-hero p { max-width: 620px; margin: 0 auto; font: 500 18px/1.5 Roboto, Arial, sans-serif; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.nn-reviews-section { max-width: 1160px; margin: 0 auto; padding: 56px 20px 8px; }
.nn-reviews-section h2 { margin: 0 0 24px; text-align: center; font: 400 32px/1.2 'DM Serif Display', serif; }
.nn-reviews-videos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.nn-review-card { margin: 0; }
.nn-review-card blockquote { margin: 16px 0 10px; padding: 0; border: 0; font: 400 16px/1.55 Roboto, Arial, sans-serif; }
.nn-review-who { font: 700 15px/1.4 Roboto, Arial, sans-serif; }
.nn-review-who span { display: block; font-weight: 400; font-size: 14px; color: #555; }
.nn-reviews-quotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.nn-quote-card { margin: 0; padding: 26px 24px; border-radius: 16px; background: #f2f8f9; display: flex; flex-direction: column; }
.nn-quote-card blockquote { flex: 1; margin: 0 0 18px; padding: 0; border: 0; font: 400 16px/1.6 Roboto, Arial, sans-serif; }
.nn-quote-card figcaption { display: flex; align-items: center; gap: 12px; font: 700 15px/1.35 Roboto, Arial, sans-serif; }
.nn-quote-card figcaption img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; }
.nn-quote-card figcaption span { display: block; font-weight: 400; font-size: 13px; color: #555; }
.nn-reviews-cta { padding: 56px 20px 80px; text-align: center; }
.nn-reviews-cta p { margin: 0 0 20px; font: 400 18px/1.5 Roboto, Arial, sans-serif; }
@media (max-width: 991px) {
  .nn-reviews-videos, .nn-reviews-quotes { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .nn-reviews-hero { padding: 140px 16px 48px; }
  .nn-reviews-hero h1 { font-size: 38px; }
  .nn-reviews-videos, .nn-reviews-quotes { grid-template-columns: 1fr; gap: 32px; }
  .nn-reviews-section { padding: 40px 16px 8px; }
}
