/* ====================
   Model page styles (mobile-first)
   ==================== */

/* Breadcrumbs removed */

/* Adjust anchor scroll offset to include sticky subnav height on model page */
html {
  /* Use the SHRUNK header height for offsets; fall back to current */
  scroll-padding-top: calc(
    var(--header-shrunk-h, var(--header-current-h, 72px)) +
      var(--model-subnav-h, 0px)
  );
  /* Disable smooth scrolling on model pages to avoid header resize race */
  scroll-behavior: auto !important;
}

/* ----- Full-bleed Hero ----- */
.hero--fullbleed {
  position: relative;
  /* Lock hero to remaining viewport height at load. */
  /* Fallback for browsers without svh: */
  min-height: calc(
    100vh - var(--header-expanded-h, 72px) - var(--site-nav-h, 0px)
  );
  /* Prefer stable viewport height to avoid address bar hide/show jumps: */
  @supports (height: 100svh) {
    min-height: calc(
      100svh - var(--header-expanded-h, 72px) - var(--site-nav-h, 0px)
    );
  }
  display: grid;
  align-items: end;
  overflow: clip;
  isolation: isolate;
  color: #fff;
  background: var(--ink);
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hero-media-position, 18% 50%);
  filter: saturate(1.05) contrast(1.03);
  display: block;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.1),
      rgba(0, 0, 0, 0.55) 60%,
      rgba(0, 0, 0, 0.85)
    ),
    radial-gradient(
      1200px 400px at 8% -10%,
      rgba(25, 41, 69, 0.35),
      transparent 60%
    );
}
.model-hero__content {
  padding-block: clamp(2rem, 8vw, 4rem);
}
.hero-chipbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.hero-chipbar .chip {
  --_bg: rgba(255, 255, 255, 0.16);
  --_bd: rgba(255, 255, 255, 0.28);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--_bd);
  border-radius: 999px;
  background: var(--_bg);
  font-size: 0.9rem;
  backdrop-filter: blur(6px);
}
.hero-title {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.05;
  font-size: clamp(2rem, 6vw, 3.25rem);
  letter-spacing: -0.01em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}
.hero-summary {
  max-width: 62ch;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: #e6eaf2;
  margin-top: 0.6rem;
  text-wrap: balance;
}

/* Eyebrow styles moved to global (css/styles.css) */

/* ----- Sticky model subnav ----- */
.model-subnav {
  --_bg: rgba(255, 255, 255, 0.16);
  --subnav-gutter: max(1rem, calc((100vw - var(--container)) / 2));
  background: var(--_bg);
  backdrop-filter: blur(6px);
  position: sticky;
  top: var(--header-current-h, 72px); /* mobile default: stick under header */
  z-index: 60;
  /*background: var(--surface-transparent);*/
  box-shadow: 0 14px 30px -14px rgb(0 0 0 / 55%), 0 2px 0 rgb(0 0 0 / 8%);
  backdrop-filter: blur(6px);
  overflow: visible;
}
.model-subnav .container {
  padding-block: 0.5rem;
  position: relative; /* for edge-fade pseudo elements */
  overflow: visible;
}

.model-subnav.can-scroll .container {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.model-subnav__list {
  --subnav-gap: 0.5rem;
  display: flex;
  gap: var(--subnav-gap);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  /* Hide scrollbar but keep scrollability */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
  -webkit-overflow-scrolling: touch; /* momentum on iOS */
  overflow-y: visible;
}

.model-subnav.can-scroll .model-subnav__list {
  scroll-padding-inline: var(--subnav-gutter);
  scroll-padding-left: var(--subnav-gutter);
  scroll-padding-right: var(--subnav-gutter);
}

.model-subnav.can-scroll .model-subnav__list::before,
.model-subnav.can-scroll .model-subnav__list::after {
  content: "";
  flex: 0 0 auto;
  width: calc(var(--subnav-gutter) - var(--subnav-gap));
}
.model-subnav__list::-webkit-scrollbar {
  display: none;
} /* WebKit */

/* Subtle edge fades to indicate scrollability */
.model-subnav .container::before,
.model-subnav .container::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 1;
}
.model-subnav .container::before {
  left: 0;
  backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.75),
    transparent
  );
  mask-image: linear-gradient(to right, rgba(0, 0, 0, 0.75), transparent);
}
.model-subnav .container::after {
  right: 0;
  backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(
    to left,
    rgba(0, 0, 0, 0.75),
    transparent
  );
  mask-image: linear-gradient(to left, rgba(0, 0, 0, 0.75), transparent);
}
.model-subnav.can-left .container::before {
  opacity: 1;
}
.model-subnav.can-right .container::after {
  opacity: 1;
}
.model-subnav__link {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-xs);
  background: #fff;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease, color 0.15s ease;
  will-change: transform;
}
.model-subnav__link.is-active {
  background: var(--brand);
  color: var(--ink);
}
/* Premium hover/focus lift similar to hero buttons */
.model-subnav__link:hover,
.model-subnav__link:focus-visible,
.model-subnav__link.is-active:hover,
.model-subnav__link.is-active:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(25, 41, 69, 0.12);
}

/* Desktop: subnav sticks under the site-nav, and scroll offset includes it */
@media (min-width: 900px) {
  .model-subnav {
    --_bg: rgba(255, 255, 255, 0.16);
    --subnav-gutter: max(1rem, calc((100vw - var(--container)) / 2));
    top: calc(var(--header-current-h, 72px) + var(--site-nav-h, 48px));
  }
  html {
    scroll-padding-top: calc(
      var(--header-shrunk-h, var(--header-current-h, 72px)) +
        var(--site-nav-h, 48px) + var(--model-subnav-h, 0px)
    );
  }
}

/* ----- Intro / long description ----- */
.model-intro {
  padding-block: var(--section-spacing);
  background: var(--bg);
  color: var(--brand);
}
.intro-grid {
  display: grid;
  gap: 1rem;
}
.intro-copy {
  display: grid;
  gap: 0.4rem;
}
@media (min-width: 900px) {
  .intro-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2rem;
    align-items: center;
  }
}
.prose p {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.075rem);
  line-height: 1.7;
  text-align: justify;
}
.intro-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm, 14px);
  border: 1px solid rgba(25, 41, 69, 0.12);
  box-shadow: 0 10px 30px rgba(25, 41, 69, 0.08);
}
.intro-media {
  margin: 0;
}

/* ----- Gallery ----- */
.gallery {
  padding-block: var(--section-spacing);
  color: var(--brand);
  background: var(--bg);
}
.media-disclaimer {
  font-size: 0.9rem;
  color: #475569dc;
  font-style: oblique;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.media-disclaimer::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(25, 41, 69, 0.08);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
  flex-shrink: 0;
  font-style: normal;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}
@media (min-width: 700px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
  }
}
@media (min-width: 1100px) {
  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.g-card {
  position: relative;
  border: 0;
  padding: 0;
  color: inherit;
  text-decoration: none;
  background: #ffffff;
  cursor: pointer;
  display: block;
  border-radius: 0;
  overflow: clip;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.g-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(25, 41, 69, 0.12);
}
.g-card:focus-visible {
  outline: 3px solid rgba(25, 41, 69, 0.65);
  outline-offset: 3px;
}
.g-card img {
  width: 100%;
  height: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Fancybox backdrop tuning for model gallery */
html.with-fancybox .fancybox__container {
  --fancybox-backdrop-bg: rgba(4, 7, 12, 0.992);
}

html.with-fancybox .fancybox__backdrop {
  backdrop-filter: blur(1px);
}

@media (max-width: 768px) {
  .fancybox__container .f-button.is-arrow {
    display: none !important;
  }
}

/* ----- Downloads ----- */
.downloads {
  padding-block: var(--section-spacing);
  color: var(--brand);
  background: radial-gradient(
      900px 320px at 100% -120px,
      rgba(25, 41, 69, 0.08),
      transparent 60%
    ),
    var(--surface);
}
.download-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  padding: 0;
  list-style: none;
}
@media (min-width: 700px) {
  .download-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .download-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.d-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-sm);
  overflow: clip;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.d-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(25, 41, 69, 0.12);
}
.d-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px #74c0fc, 0 10px 24px rgba(25, 41, 69, 0.12);
}
.d-card__link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  color: inherit;
  text-decoration: none;
  border-radius: inherit;
}
.d-card__link:focus-visible {
  outline: 3px solid #74c0fc; /* match site button focus ring */
  outline-offset: 3px;
}
.d-card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--brand);
  background: linear-gradient(
    180deg,
    rgba(25, 41, 69, 0.08),
    rgba(25, 41, 69, 0.02)
  );
  border: 1px solid rgba(25, 41, 69, 0.15);
}
.d-card__title {
  font-weight: 800;
}
.d-card__meta {
  color: var(--muted);
  font-size: 0.9rem;
}
.d-card__cta {
  font-weight: 700;
  color: var(--brand);
}
/* Stack title and meta vertically */
.d-card__body {
  display: grid;
}

/* ----- Tour ----- */
.tour {
  padding-block: var(--section-spacing);
  color: var(--brand);
  background: var(--bg);
}
.tour-frame {
  display: grid;
  gap: 0.75rem;
}
.tour-frame iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-sm);
}
.tour-full {
  justify-self: start;
}
.tour-placeholder {
  background: var(--surface);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-xs);
  padding: 1rem;
  color: var(--muted);
}

/* ----- Features & Specs ----- */
.features {
  padding-block: var(--section-spacing);
  color: var(--brand);
  background: var(--bg);
}
.features-grid {
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 900px) {
  .features-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}
.feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}
.feature-list li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--muted);
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--brand);
}
.specs {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 0.9rem;
  align-content: start;
}
.specs dt {
  font-weight: 700;
  color: var(--brand);
}
.specs dd {
  margin: 0;
  color: var(--muted);
}

/* ----- CTA strip ----- */
.cta-strip {
  padding-block: clamp(1.4rem, 6vw, 2rem);
  background: radial-gradient(
      900px 320px at 10% -120px,
      rgba(25, 41, 69, 0.08),
      transparent 60%
    ),
    var(--surface);
}
.cta-grid {
  display: grid;
  gap: 0.6rem;
}
@media (min-width: 700px) {
  .cta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Polished buttons */
.btn {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(25, 41, 69, 0.12);
}
