/* =========================================================
   Wanderline — Warm & Editorial theme
   Pure CSS, no framework. Palette + type via custom properties.
   ========================================================= */

:root {
  /* Palette — warm, earthy, editorial */
  --cream:      #f7f1e7;
  --cream-deep: #efe6d6;
  --teal:       #50A0D8;   /* def-palette accent */
  --teal-dark:  #285474;
  --sage:       #7c8a6f;
  --charcoal:   #2b2622;
  --ink:        #423b34;
  --muted:      #7a7066;

  /* Type */
  /* "Noto Sans JP" is a fallback so Japanese glyphs render cleanly
     (Fraunces/Inter don't include CJK characters). */
  --font-display: "Fraunces", "Noto Sans JP", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Layout */
  --maxw: 1160px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 14px;
  --shadow: 0 18px 40px -24px rgba(43, 38, 34, 0.5);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Shared type ---------- */
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
  margin: 0 0 0.75rem;
}
.eyebrow--light { color: rgba(255, 255, 255, 0.85); }

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.08;
  color: var(--charcoal);
  margin: 0 0 1rem;
}

.section-intro { max-width: 56ch; color: var(--muted); font-size: 1.05rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn--primary {
  background: var(--teal);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn--primary:hover {
  background: var(--teal-dark);
  text-decoration: none;
  transform: translateY(-2px);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 241, 231, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--cream-deep);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--charcoal);
}
.brand:hover { text-decoration: none; }
.brand-dot { color: var(--teal); }
/* Sizing for an image logo — active once you uncomment the <img> in the .brand links.
   Harmless while the brand is still text (there's no img to match). */
.brand img { height: 32px; width: auto; display: block; }
/* Stacked wordmark + "since 1991" tagline */
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-since {
  font-family: var(--font-display);
  font-size: 0.72rem;          /* smaller than the 1.4rem wordmark */
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
}
/* lighter tagline on the dark footer */
.brand--footer .brand-since { color: rgba(247, 241, 231, 0.6); }

.primary-nav { display: flex; align-items: center; gap: 1.75rem; }
.primary-nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.98rem;
}
.primary-nav a:hover { color: var(--teal); text-decoration: none; }
.nav-cta {
  border: 1px solid var(--teal);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
}
.primary-nav .nav-cta:hover,
.primary-nav .nav-cta:focus,
.primary-nav .nav-cta:active { background: var(--teal); color: #fff; }

/* Language switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--cream-deep);
  border-radius: 999px;
  background: var(--cream);
}
.lang-btn {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.lang-btn:hover { color: var(--charcoal); }
.lang-btn.is-active {
  background: var(--teal);
  color: #fff;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--charcoal);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: flex;
  align-items: center;
  color: #fff;
  overflow: hidden;
}
.hero-media {
  position: absolute; inset: 0;
  background-image: url("https://images.unsplash.com/photo-1526392060635-9d6019884377?auto=format&fit=crop&w=2000&q=80");
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(43,38,34,0.72) 0%, rgba(43,38,34,0.35) 55%, rgba(43,38,34,0.15) 100%);
}
.hero-content { position: relative; padding-block: 6rem; }
.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.02;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}
.hero-lede {
  max-width: 46ch;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: rgba(255,255,255,0.9);
  margin: 0 0 2rem;
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section--muted { background: var(--cream-deep); }
.section-head { margin-bottom: clamp(2rem, 5vw, 3.25rem); }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
}
.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: 0;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 26px 50px -22px rgba(43, 38, 34, 0.55);
  outline: none;
}
.card:focus-visible { box-shadow: 0 0 0 3px var(--teal); }
.card-media { aspect-ratio: 4 / 3; overflow: hidden; }
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.card:hover .card-media img { transform: scale(1.06); }
.card-body { padding: 1.25rem 1.35rem 1.5rem; }
.card-tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.card-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--charcoal);
  margin: 0 0 0.4rem;
}
.card-desc { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Partners ---------- */
.partners {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.partner {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 96px;
  padding: 1rem;
  background: var(--cream);
  border: 1px solid rgba(43, 38, 34, 0.08);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--charcoal);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.section--muted .partner { background: #fff; }
.partner:hover { color: var(--teal); border-color: var(--teal); }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.about-media {
  min-height: 420px;
  border-radius: var(--radius);
  background-image: url("https://images.unsplash.com/photo-1488646953014-85cb44e25828?auto=format&fit=crop&w=1400&q=80");
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}
.about-text p { color: var(--ink); }
.pull-quote {
  margin: 1.75rem 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--teal);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-style: italic;
  line-height: 1.35;
  color: var(--charcoal);
}

/* ---------- Contact ---------- */
.section--contact { background: var(--charcoal); color: var(--cream); }
.section--contact .eyebrow { color: #7AD1EF; }
.section--contact .section-title { color: var(--cream); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: start;
}
.contact-intro p { color: rgba(247, 241, 231, 0.75); }
.contact-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.contact-list a { color: var(--cream); font-size: 1.05rem; }
.contact-list a:hover { color: #7AD1EF; }

.contact-form { display: grid; gap: 1rem; }
.contact-form label { display: grid; gap: 0.4rem; }
.contact-form span {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(247, 241, 231, 0.7);
}
.contact-form input,
.contact-form textarea {
  font: inherit;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(247, 241, 231, 0.25);
  background: rgba(247, 241, 231, 0.06);
  color: var(--cream);
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #7AD1EF;
  background: rgba(247, 241, 231, 0.1);
}
.contact-form .btn { justify-self: start; margin-top: 0.25rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--charcoal);
  color: rgba(247, 241, 231, 0.7);
  border-top: 1px solid rgba(247, 241, 231, 0.1);
  padding-block: 2.5rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand--footer { color: var(--cream); }
.footer-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-nav a { color: rgba(247, 241, 231, 0.75); font-size: 0.92rem; }
.footer-nav a:hover { color: #7AD1EF; text-decoration: none; }
.footer-note { width: 100%; margin: 0.5rem 0 0; font-size: 0.85rem; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(20, 17, 15, 0.85);
  backdrop-filter: blur(4px);
}
.lightbox.is-open { display: flex; }
.lightbox { align-items: flex-start; overflow-y: auto; }
.lightbox-figure {
  margin: auto;               /* centers when short, allows scroll when tall */
  max-width: 900px;
  width: 100%;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
}
/* Carousel inside the lightbox.
   Slides are STACKED in a stationary viewport and cross-faded (no moving/transformed
   track). A fixed touch target + no transform is what iOS Safari/WebKit handle reliably —
   a sliding transform track breaks touch hit-testing there after the first swipe. */
.lb-carousel { position: relative; }
.lb-viewport { position: relative; overflow: hidden; height: 46vh; }
.lb-track { position: absolute; inset: 0; }
.lb-slide {
  position: absolute; inset: 0;
  opacity: 0;
  pointer-events: none;         /* inactive slides never intercept touches */
  transition: opacity 0.3s ease;
}
.lb-slide.is-active { opacity: 1; pointer-events: auto; }
.lb-slide img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; }
/* pan-y reserves horizontal gestures for the swipe handler; vertical still scrolls. */
.lb-track, .lb-slide, .lb-slide img { touch-action: pan-y; }
/* Grab cursor as a drag-to-swipe affordance (only when there's more than one image) */
.lb-track.lb-draggable { cursor: grab; }
.lb-track.lb-draggable.is-grabbing { cursor: grabbing; }

.lb-dots {
  position: absolute;
  left: 0; right: 0; bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.lb-dots[hidden] { display: none; }
.lb-dot {
  width: 9px; height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.lb-dot:hover { background: rgba(255, 255, 255, 0.85); }
.lb-dot.is-active { background: #fff; transform: scale(1.25); }
.lightbox-caption { padding: 1.5rem 1.75rem 1.9rem; }
.lightbox-caption h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.6rem;
  color: var(--charcoal);
  margin: 0.25rem 0 0.6rem;
}
.lightbox-caption p { margin: 0; color: var(--muted); }

/* Itinerary (inside the lightbox) */
.itinerary {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(43, 38, 34, 0.12);
}
.itinerary-heading {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
  margin: 0 0 1rem;
}
.itinerary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.itinerary-item {
  display: flex;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px dashed rgba(43, 38, 34, 0.12);
}
.itinerary-item:last-child { border-bottom: 0; padding-bottom: 0; }
.itinerary-day {
  flex: 0 0 auto;
  min-width: 4.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--charcoal);
}
.itinerary-text { color: var(--ink); }
.lightbox-close {
  /* Anchored to the top-right corner of the carousel image (.lb-carousel is
     position: relative); z-index keeps it above the slides. */
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  z-index: 5;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(20, 17, 15, 0.55);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}
.lightbox-close:hover { background: rgba(20, 17, 15, 0.8); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-media { min-height: 280px; order: -1; }
}

@media (max-width: 680px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--cream-deep);
    padding: 0.5rem 12px 1.25rem; /* 12px left/right padding for the open mobile nav */
    display: none;
  }
  .primary-nav.is-open { display: flex; }
  /* 12px left/right padding on the plain nav links (Work, Collaborations, About) */
  .primary-nav a { width: 100%; padding: 0.75rem 12px; }
  /* Contact CTA keeps its pill look as a full-width button */
  .primary-nav .nav-cta { margin-top: 0.5rem; padding: 0.75rem 12px; text-align: left; }
  .lang-switch { margin-top: 1rem; align-self: flex-start; }

  /* Animate hamburger to an X when open */
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
