/* ═══════════════════════════════════════════════════════════════
   AMITIÉ FLEUR — 360° TOUR (standalone)
   Deliberately dependency-free: Pannellum + these two files.
   Colours mirror the main site design tokens.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --af-surface: #FBF9F4;
  --af-champagne: #F5EFEB;
  --af-umber: #32251D;
  --af-umber-dark: #1E1612;
  --af-gilded: #7A7258;
  --af-gold: #B8A88A;
  --af-gold-light: #C9BC9F;
  --af-text: #2E2620;
  --af-text-2: #675B50;
  --af-text-3: #7F7367;
  --af-border: #E0D8CC;
  --af-border-light: #ECE5DB;
  --af-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --af-body: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --af-radius: 18px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--af-surface);
  color: var(--af-text);
  font-family: var(--af-body);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ─── Page shell ─────────────────────────────────────────────── */
.af-tour {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(14px, 2.4vw, 28px);
}

/* ─── Stop rail ─────────────────────────────────────────────── */
.af-stops {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: clamp(16px, 2.4vw, 26px);
  scrollbar-width: thin;
}
.af-stops::-webkit-scrollbar { height: 6px; }
.af-stops::-webkit-scrollbar-thumb { background: var(--af-border); border-radius: 3px; }

.af-stop {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--af-border);
  border-radius: 100px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--af-text-2);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.af-stop:hover { border-color: var(--af-gilded); color: var(--af-umber); }
.af-stop[aria-selected="true"] {
  background: var(--af-gilded);
  border-color: var(--af-gilded);
  color: #fff;
}
.af-stop__order {
  font-family: var(--af-display);
  font-size: 14px;
  font-style: italic;
  opacity: 0.75;
}
.af-stop__badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 100px;
  background: rgba(255,255,255,0.22);
}
.af-stop[aria-selected="false"] .af-stop__badge { background: rgba(140,133,107,0.14); color: var(--af-gilded); }

/* ─── Heading ───────────────────────────────────────────────── */
.af-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: clamp(14px, 2vw, 22px);
}
.af-head__text { max-width: 760px; }
.af-eyebrow {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--af-gilded);
  margin-bottom: 6px;
}
.af-head__title {
  font-family: var(--af-display);
  font-size: clamp(26px, 3.2vw, 42px);
  font-style: italic;
  font-weight: 500;
  color: var(--af-umber);
  line-height: 1.15;
  margin: 0 0 8px;
}
.af-head__desc {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--af-text-2);
  margin: 0;
  text-wrap: pretty;
}
.af-head__count {
  font-family: var(--af-display);
  font-size: 15px;
  font-style: italic;
  color: var(--af-text-3);
  white-space: nowrap;
}

/* ─── Stage: viewer + rail ──────────────────────────────────── */
.af-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 16px;
  align-items: start;
}

.af-viewer {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 260px;
  border-radius: var(--af-radius);
  overflow: hidden;
  background: #16120F;
  box-shadow: 0 18px 48px rgba(30, 22, 18, 0.16);
  isolation: isolate;
}

/* The still frame sits ABOVE Pannellum's renderer (z-index 2) until the
   panorama is ready. Otherwise the empty renderer - a grey checkerboard -
   covers it, and the "still image behind this message" is invisible. */
.af-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 3;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.af-viewer.is-ready .af-poster { opacity: 0; z-index: 1; }

.af-canvas-host { position: absolute; inset: 0; z-index: 2; }

/* Hide Pannellum chrome we do not use */
.af-viewer .pnlm-load-box,
.af-viewer .pnlm-error-msg,
.af-viewer .pnlm-about-msg { display: none !important; }

/* ─── Overlay (loading / error) ─────────────────────────────── */
.af-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 14, 11, 0.55);
  backdrop-filter: blur(2px);
  transition: opacity 0.35s ease;
}
.af-viewer.is-ready .af-overlay { opacity: 0; pointer-events: none; }
.af-overlay__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 30px;
  border-radius: 16px;
  background: rgba(24, 19, 15, 0.72);
  border: 1px solid rgba(201, 188, 159, 0.28);
  text-align: center;
  max-width: 300px;
}
.af-overlay__text {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  line-height: 1.7;
}
.af-overlay__detail {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.6;
  color: rgba(255,255,255,0.62);
  word-break: break-all;
  max-width: 260px;
}
.af-overlay__detail code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  color: rgba(201, 188, 159, 0.9);
}

.af-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(201, 188, 159, 0.25);
  border-top-color: var(--af-gold-light);
  animation: af-spin 0.9s linear infinite;
}
@keyframes af-spin { to { transform: rotate(360deg); } }
.af-viewer.is-error .af-spinner { display: none; }

/* ─── Compass / hint / controls ─────────────────────────────── */
.af-compass {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  padding: 6px 12px;
  border-radius: 100px;
  background: rgba(20, 15, 12, 0.55);
  border: 1px solid rgba(201, 188, 159, 0.3);
  color: #fff;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}
.af-hint {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 5;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
  transition: opacity 0.4s ease;
}
.af-hint.is-hidden { opacity: 0; }
.af-controls {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 5;
  display: flex;
  gap: 8px;
}
.af-ctrl {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(201, 188, 159, 0.34);
  background: rgba(20, 15, 12, 0.55);
  color: #fff;
  transition: background 0.2s, transform 0.2s;
}
.af-ctrl:hover { background: rgba(20, 15, 12, 0.8); transform: translateY(-1px); }
.af-ctrl svg { width: 17px; height: 17px; }
.af-ctrl svg * { fill: currentColor; }
.af-ctrl svg path[stroke] { fill: none; }

/* ─── Viewpoint rail ────────────────────────────────────────── */
.af-rail { display: flex; flex-direction: column; gap: 10px; }
.af-scene {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--af-border-light);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.af-scene:hover { border-color: var(--af-gold); }
.af-scene[aria-selected="true"] {
  border-color: var(--af-gilded);
  box-shadow: 0 0 0 1px var(--af-gilded) inset;
}
.af-scene__thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--af-champagne);
}
.af-scene__thumb img { width: 100%; height: 100%; object-fit: cover; }
.af-scene__body { min-width: 0; }
.af-scene__name {
  display: block;
  font-family: var(--af-display);
  font-size: 15px;
  font-style: italic;
  color: var(--af-umber);
  line-height: 1.3;
}
.af-scene__caption {
  display: block;
  font-size: 11.5px;
  color: var(--af-text-2);
  line-height: 1.45;
  margin-top: 2px;
}

/* ─── Footer note ───────────────────────────────────────────── */
.af-foot {
  margin: 16px 0 0;
  font-size: 11.5px;
  color: var(--af-text-3);
  letter-spacing: 0.04em;
}
.af-foot a { color: var(--af-gilded); text-decoration: none; }
.af-foot a:hover { text-decoration: underline; }

.af-btn {
  padding: 9px 18px;
  border-radius: 100px;
  border: 1px solid var(--af-gold-light);
  background: transparent;
  color: var(--af-gold-light);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.af-btn--solid { background: var(--af-guilded, #7A7258); color: #fff; border-color: transparent; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .af-stage { grid-template-columns: minmax(0, 1fr); }
  .af-rail { flex-direction: row; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
  .af-scene { min-width: 232px; scroll-snap-align: start; }
}
@media (max-width: 560px) {
  .af-tour { padding: 10px; }
  .af-viewer { aspect-ratio: 4 / 3; border-radius: 14px; }
  .af-hint { display: none; }
  .af-head__desc { font-size: 13.5px; }
  .af-scene { min-width: 208px; }
  .af-scene__thumb { width: 46px; height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .af-spinner { animation-duration: 2.4s; }
  * { transition-duration: 0.01ms !important; }
}
