/* ============================================
   FREYSTA MOVING GUIDE — Shared Design System
   Prefix: mg-
   ============================================ */

/* -- Local Fonts -- */
@font-face {
  font-family: 'Glacial Indifference';
  src: url('/assets/fonts/GlacialIndifference-Regular.woff2') format('woff2'),
       url('/assets/fonts/GlacialIndifference-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Glacial Indifference';
  src: url('/assets/fonts/GlacialIndifference-Bold.woff2') format('woff2'),
       url('/assets/fonts/GlacialIndifference-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* -- Guide Page Scope -- */
.guide-page {
  --mg-cream: var(--surface-story, #F1EBE3);
  --mg-white: var(--surface-explore, #FBF9F6);
  --mg-dark: var(--surface-utility, #243D4F);
  --mg-midnight: var(--surface-strong, #0A1628);
  --mg-gold: var(--color-gold, #c4918a);
  --mg-green: #2d6a3f;
  --mg-aurora: var(--color-aurora, #7dd3c0);
  --mg-text: var(--color-text-primary, #1a1a1a);
  --mg-text-secondary: var(--color-text-secondary, #4a4a4a);
  --mg-text-muted: #666666;
  --mg-content-width: 1060px;
  --mg-narrow-width: 800px;
  --mg-wide-width: 1200px;
}

.guide-page {
  overflow-x: hidden;
  overflow-x: clip;
}

.guide-page main {
  overflow-x: hidden;
  overflow-x: clip;
}

.guide-page [id] {
  scroll-margin-top: 140px; /* header + nav strip */
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.guide-page [data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.guide-page [data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.guide-page [data-reveal="fade"] {
  transform: none;
}

.guide-page [data-reveal="left"] {
  transform: translateX(-60px);
}

.guide-page [data-reveal="left"].is-revealed {
  transform: translateX(0);
}

.guide-page [data-reveal="right"] {
  transform: translateX(60px);
}

.guide-page [data-reveal="right"].is-revealed {
  transform: translateX(0);
}

.guide-page [data-reveal="scale"] {
  transform: scale(0.92);
}

.guide-page [data-reveal="scale"].is-revealed {
  transform: scale(1);
}

/* Staggered delays */
[data-delay="100"] { transition-delay: 0.1s; }
[data-delay="200"] { transition-delay: 0.2s; }
[data-delay="300"] { transition-delay: 0.3s; }
[data-delay="400"] { transition-delay: 0.4s; }
[data-delay="500"] { transition-delay: 0.5s; }
[data-delay="600"] { transition-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
  .guide-page [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================
   MG-HERO — Guide Hero Section
   ============================================ */
.mg-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  min-height: 340px;
  max-height: 620px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.mg-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.mg-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

@media (prefers-reduced-motion: no-preference) {
  .mg-hero__media img {
    animation: mg-ken-burns 25s ease-in-out infinite alternate;
  }
}

@keyframes mg-ken-burns {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}

.mg-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(10, 22, 40, 0.85) 0%,
    rgba(10, 22, 40, 0.55) 35%,
    rgba(10, 22, 40, 0.20) 60%,
    rgba(10, 22, 40, 0.05) 100%
  );
}

.mg-hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--space-3xl) var(--space-xl) var(--space-2xl);
  max-width: var(--mg-narrow-width);
}

.mg-hero__eyebrow {
  display: inline-block;
  font-family: 'Glacial Indifference', sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mg-gold);
  margin-bottom: var(--space-md);
}

.mg-hero__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: var(--text-5xl);
  line-height: 1.05;
  color: #fff;
  margin-bottom: var(--space-sm);
}

.mg-hero__subtitle {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: var(--text-xl);
  font-weight: 400;
  font-style: italic;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
}

/* Hero credit */
.mg-hero__credit {
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-md);
  z-index: 3;
  font-family: 'Glacial Indifference', sans-serif;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.02em;
}

/* ============================================
   MG-NAV-STRIP — Guide Sub-Navigation
   ============================================ */
.mg-nav-strip {
  background: var(--mg-midnight);
  position: relative;
  z-index: 50;
}

.mg-nav-strip.is-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.mg-nav-strip.is-cta-hidden {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}

.mg-nav-strip__inner {
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 var(--space-xl);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.mg-nav-strip__inner::-webkit-scrollbar {
  display: none;
}

.mg-nav-strip__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(196, 145, 138, 0.4);
  flex-shrink: 0;
}

.mg-nav-strip__link {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  /* Default to high-contrast text; keep gold as the accent on hover/active. */
  color: rgba(250, 248, 245, 0.78);
  text-decoration: none;
  padding: var(--space-lg) var(--space-xl);
  white-space: nowrap;
  position: relative;
  transition: color 0.3s var(--ease-out-quart, ease);
}

.mg-nav-strip__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--space-xl);
  right: var(--space-xl);
  height: 1px;
  background: linear-gradient(90deg, var(--mg-gold), rgba(196, 145, 138, 0.4));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out-expo, ease);
}

.mg-nav-strip__link:hover {
  color: var(--mg-gold);
}

.mg-nav-strip__link:hover::after {
  transform: scaleX(1);
}

.mg-nav-strip__link.is-active {
  color: var(--mg-gold);
  font-weight: 600;
}

.mg-nav-strip__link.is-active::after {
  transform: scaleX(1);
}

/* Logo — fades in from left when strip becomes sticky */
.mg-nav-strip__logo {
  display: flex;
  align-items: center;
  margin-right: var(--space-md);
  opacity: 0;
  transform: translateX(-10px);
  pointer-events: none;
  transition: opacity 0.5s var(--ease-out-quart, ease), transform 0.5s var(--ease-out-quart, ease);
}

.mg-nav-strip__logo img {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(10, 22, 40, 0.3));
}

.mg-nav-strip.is-sticky .mg-nav-strip__logo {
  opacity: var(--logo-opacity, 0);
  transform: translateX(calc(-10px + 10px * var(--logo-opacity, 0)));
  pointer-events: auto;
}

.mg-nav-strip__logo:hover {
  opacity: calc(var(--logo-opacity, 0) * 0.8);
}

/* User button — fades in from right when strip becomes sticky */
.mg-nav-strip__user {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: var(--space-md);
  border-radius: 50%;
  border: 1px solid rgba(250, 248, 245, 0.24);
  color: rgba(250, 248, 245, 0.88);
  text-decoration: none;
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
  transition: opacity 0.5s var(--ease-out-quart, ease), transform 0.5s var(--ease-out-quart, ease),
    color 0.3s var(--ease-out-quart, ease), border-color 0.3s var(--ease-out-quart, ease);
}

.mg-nav-strip__user svg {
  width: 20px;
  height: 20px;
}

.mg-nav-strip.is-sticky .mg-nav-strip__user {
  opacity: var(--logo-opacity, 0);
  transform: translateX(calc(10px - 10px * var(--logo-opacity, 0)));
  pointer-events: auto;
}

.mg-nav-strip__user:hover {
  color: var(--color-gold, #c4918a);
  border-color: var(--color-gold, #c4918a);
}

/* ============================================
   MG-SECTION — Content Section Wrapper
   ============================================ */
.mg-section {
  padding: var(--space-4xl) var(--space-xl);
}

.mg-section--explore {
  background: var(--mg-white);
}

.mg-section--story {
  background: var(--mg-cream);
}

.mg-section--dark {
  background: var(--mg-dark);
  color: var(--color-text-inverse, #faf8f5);
}

.mg-section--midnight {
  background: var(--mg-midnight);
  color: var(--color-text-inverse, #faf8f5);
}

/* Gradient transitions at section edges */
.mg-section--explore + .mg-section--story {
  background: linear-gradient(to bottom, var(--mg-white) 0%, var(--mg-cream) 120px);
}

.mg-section--story + .mg-section--explore {
  background: linear-gradient(to bottom, var(--mg-cream) 0%, var(--mg-white) 120px);
}

/* ============================================
   MG-PROSE — Editorial Text Block
   ============================================ */
.mg-prose {
  max-width: var(--mg-content-width);
  margin: 0 auto;
  font-family: 'Glacial Indifference', sans-serif;
  font-size: var(--text-lg);
  line-height: 1.85;
  color: var(--mg-text-secondary);
}

.mg-prose p {
  margin-bottom: var(--space-xl);
}

.mg-prose p:last-child {
  margin-bottom: 0;
}

.mg-prose a {
  color: var(--mg-green);
  text-decoration: underline;
  text-decoration-color: var(--mg-aurora);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.3s, color 0.3s;
}

.mg-prose a:hover {
  color: #1a4d2e;
  text-decoration-color: var(--mg-green);
}

/* Lead paragraph variant */
.mg-prose--lead {
  max-width: var(--mg-narrow-width);
  text-align: center;
}

.mg-prose--lead p {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: var(--text-2xl);
  font-style: italic;
  line-height: 1.5;
  color: var(--mg-text);
}

/* Dark section prose */
.mg-section--dark .mg-prose,
.mg-section--midnight .mg-prose {
  color: rgba(250, 248, 245, 0.85);
}

.mg-section--dark .mg-prose a,
.mg-section--midnight .mg-prose a {
  color: var(--mg-aurora);
  text-decoration-color: rgba(125, 211, 192, 0.4);
}

/* ============================================
   MG-ASIDE — Dark Information Panel
   ============================================ */
.mg-aside {
  max-width: var(--mg-content-width);
  margin: var(--space-2xl) auto;
  background: var(--mg-dark);
  color: var(--color-text-inverse, #faf8f5);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-2xl);
}

.mg-aside__title {
  font-family: 'Glacial Indifference', sans-serif;
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: #fff;
}

.mg-aside__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md) var(--space-2xl);
  list-style: none;
  padding: 0;
}

.mg-aside__list li {
  font-family: 'Glacial Indifference', sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  color: rgba(250, 248, 245, 0.85);
  padding-left: var(--space-lg);
  position: relative;
}

.mg-aside__list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--mg-gold);
  font-weight: 700;
}

/* ============================================
   MG-BREADCRUMB
   ============================================ */
.mg-breadcrumb {
  display: none;
  max-width: var(--mg-wide-width);
  margin: 0 auto;
  padding: var(--space-md) var(--space-xl);
  font-family: 'Glacial Indifference', sans-serif;
  font-size: var(--text-xs);
  color: var(--mg-text-muted);
}

.mg-breadcrumb a {
  color: var(--mg-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.mg-breadcrumb a:hover {
  color: var(--mg-green);
}

.mg-breadcrumb__separator {
  margin: 0 var(--space-xs);
  color: var(--color-mist, #e8e5e0);
}

/* ============================================
   MG-CROSS-NAV — Previous / Next Navigation
   ============================================ */
.mg-cross-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  max-width: var(--mg-content-width);
  margin: 0 auto;
  /* The wrapper section already provides generous padding. Avoid double spacing. */
  padding: 0;
}

.mg-cross-nav__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  background: var(--mg-dark);
  color: #fff;
  text-decoration: none;
  padding: var(--space-xl) var(--space-2xl);
  border-radius: var(--radius-lg);
  transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s ease;
}

.mg-cross-nav__item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.mg-cross-nav__item--next {
  text-align: right;
}

.mg-cross-nav__label {
  font-family: 'Glacial Indifference', sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mg-gold);
}

.mg-cross-nav__title {
  font-family: 'Glacial Indifference', sans-serif;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.5;
}

.mg-cross-nav__desc {
  font-family: 'Glacial Indifference', sans-serif;
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.3;
}

/* ============================================
   MG-DIVIDER — Section Break
   ============================================ */
.mg-divider {
  max-width: var(--mg-narrow-width);
  margin: 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-mist, #e8e5e0), transparent);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .mg-hero__title {
    font-size: var(--text-4xl);
  }

  .mg-section {
    padding: var(--space-3xl) var(--space-lg);
  }

  .mg-aside__list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .mg-hero {
    aspect-ratio: 16 / 9;
    min-height: 280px;
    max-height: 420px;
  }

  .mg-hero__title {
    font-size: var(--text-3xl);
  }

  .mg-hero__subtitle {
    font-size: var(--text-base);
  }

  .mg-hero__content {
    padding: var(--space-2xl) var(--space-lg) var(--space-xl);
  }

  .mg-nav-strip__link {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
  }

  /* Mobile: align nav strip to the left edge (no centered gutter). */
  .mg-nav-strip__inner {
    justify-content: flex-start;
    padding-left: 0;
  }

  .mg-nav-strip__logo {
    display: none;
  }

  .mg-nav-strip__user {
    display: none;
  }

  .mg-section {
    padding: var(--space-2xl) var(--space-md);
  }

  .mg-cross-nav {
    grid-template-columns: 1fr;
  }

  .mg-prose--lead p:first-child {
    font-size: var(--text-xl);
  }
}

@media (max-width: 480px) {
  .mg-hero__title {
    font-size: var(--text-2xl);
  }

  .mg-hero__eyebrow {
    font-size: 0.6875rem;
  }

  .mg-section {
    padding: var(--space-xl) var(--space-sm);
  }
}

