/* =====================================================================
   COAST 67 — Bespoke navigation ("Editorial Index") + footer
   Replaces the Hoteller header/side-menu/footer on Canvas pages.
   Restraint-first: impressiveness comes from type, space + choreography.
   Brand tokens mirror coast67-tide.css. Scoped to body.coast67-tide.
   ===================================================================== */
.coast67-tide {
  --c67-orange: #D6894E;
  --c67-orange-deep: #C2773B;
  --c67-ink: #4E4F47;
  --c67-ink-soft: #6B6C62;
  --c67-cream: #FBF3E8;
  --c67-cream-deep: #F3E7D5;
  --c67-gold: #F5C888;
  --c67-opal: #ADD2CB;
  --c67-teal: #5F9FA9;
  --c67-ease: cubic-bezier(.16, 1, .3, 1);
  --c67-display: "Minimalust", "Jost", system-ui, sans-serif;
  --c67-ui: "Bantayog", "Jost", system-ui, sans-serif;
  --c67-serif: "Gowa", Georgia, serif;
}

/* ---- 0. Preloader veil ("first light") ------------------------------ */
.c67-pre {
  position: fixed; inset: 0; z-index: 99990;
  background: var(--c67-cream);
  display: grid; place-items: center;
  /* safety net: self-clear even if the JS choreography never runs */
  animation: c67-pre-away .7s ease 4.6s forwards;
}
html.c67-pre-skip .c67-pre { display: none; }
html.c67-pre-hold { overflow: hidden; }
.c67-pre__inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
/* Intro choreography is CSS-driven so it plays at first paint — GSAP loads
   from a CDN in the footer and only drives the EXIT wipe. */
.c67-pre__mark {
  width: 56px; height: auto; clip-path: inset(100% 0 0 0);
  animation: c67-pre-mark 1.1s cubic-bezier(.16,1,.3,1) .15s forwards;
}
@keyframes c67-pre-mark { to { clip-path: inset(0% 0 0 0); } }
.c67-pre__word {
  display: flex; overflow: hidden;
  font-family: var(--c67-display); font-weight: 500; text-transform: uppercase;
  letter-spacing: .34em; font-size: 15px; color: var(--c67-ink); padding-left: .34em;
}
.c67-pre__word span {
  display: inline-block; transform: translateY(130%);
  animation: c67-pre-letter .9s cubic-bezier(.16,1,.3,1) forwards;
}
@keyframes c67-pre-letter { to { transform: translateY(0); } }
.c67-pre__word span:nth-child(1) { animation-delay: .38s; }
.c67-pre__word span:nth-child(2) { animation-delay: .43s; }
.c67-pre__word span:nth-child(3) { animation-delay: .48s; }
.c67-pre__word span:nth-child(4) { animation-delay: .53s; }
.c67-pre__word span:nth-child(5) { animation-delay: .58s; }
.c67-pre__word span:nth-child(6) { animation-delay: .60s; }
.c67-pre__word span:nth-child(7) { animation-delay: .63s; }
.c67-pre__word span:nth-child(8) { animation-delay: .68s; }
.c67-pre__line { width: min(200px, 50vw); height: 1px; background: rgba(78,79,71,.16); overflow: hidden; margin-top: 10px; }
.c67-pre__line i {
  display: block; height: 100%; background: var(--c67-orange);
  transform: scaleX(0); transform-origin: left;
  animation: c67-pre-fill 2.6s cubic-bezier(.4,0,.2,1) .25s forwards;
}
@keyframes c67-pre-fill { to { transform: scaleX(.9); } }
/* exit: JS adds this class — hairline completes, then the veil wipes up */
.c67-pre--exit .c67-pre__line i { animation: none; transform: scaleX(1); transition: transform .28s ease; }
@keyframes c67-pre-away { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  .c67-pre { animation-delay: .8s; animation-duration: .45s; }
  .c67-pre__mark { clip-path: none; animation: none; }
  .c67-pre__word span { transform: none; animation: none; }
  .c67-pre__line { display: none; }
}

/* ---- 0.5 Page transitions + smooth image loading -------------------- */
/* leave: a two-tone tide rises over the page (deep cream leads, cream
   follows a beat later) and the brand mark surfaces at its centre. */
.c67-turn { position: fixed; inset: 0; z-index: 99980; visibility: hidden; pointer-events: none; }
.c67-turn.is-on { visibility: visible; pointer-events: auto; }
.c67-turn__layer { position: absolute; inset: 0; clip-path: inset(100% 0 0 0); }
.c67-turn__layer--deep { background: var(--c67-cream-deep); transition: clip-path .52s cubic-bezier(.7, 0, .25, 1); }
.c67-turn__layer--main { background: var(--c67-cream); transition: clip-path .52s cubic-bezier(.7, 0, .25, 1) .11s; }
.c67-turn.is-on .c67-turn__layer { clip-path: inset(0 0 0 0); }
.c67-turn__mark {
  position: absolute; left: 50%; top: 50%; width: 54px; height: auto;
  opacity: 0; transform: translate(-50%, -50%) translateY(18px);
  transition: opacity .32s ease .4s, transform .5s cubic-bezier(.16, 1, .3, 1) .4s;
}
.c67-turn.is-on .c67-turn__mark { opacity: 1; transform: translate(-50%, -50%); }
/* arrive: the next page fades in while its content drifts up into place
   (transform lives on the content wrapper, never on body — fixed chrome). */
@media (prefers-reduced-motion: no-preference) {
  html.c67-pre-skip body { animation: c67-page-in .6s ease-out both; }
  html.c67-pre-skip .elementor,
  html.c67-pre-skip main.c67-post { animation: c67-page-rise .9s cubic-bezier(.16, 1, .3, 1) both; }
}
@keyframes c67-page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes c67-page-rise { from { transform: translateY(26px); } to { transform: none; } }
/* smooth image loading: images surface softly once their pixels arrive */
.coast67-tide img.c67-ld { opacity: 0; transform: scale(1.02); }
.coast67-tide img.c67-ld.is-loaded {
  opacity: 1; transform: none;
  transition: opacity .8s var(--c67-ease), transform 1.1s var(--c67-ease);
}
@media (prefers-reduced-motion: reduce) {
  .c67-turn { transition: none; }
  .coast67-tide img.c67-ld { opacity: 1; transform: none; }
}

/* ---- 1. Top bar ----------------------------------------------------- */
.c67-bar {
  position: fixed; inset: 0 0 auto 0; z-index: 9000;
  display: flex; align-items: center; justify-content: space-between;
  height: clamp(64px, 8vh, 92px);
  padding: 0 clamp(20px, 4vw, 48px);
  color: var(--c67-cream);
  transition: color .45s var(--c67-ease), height .45s var(--c67-ease);
}
.c67-bar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--c67-cream); opacity: 0;
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  border-bottom: 1px solid transparent;
  transition: opacity .5s var(--c67-ease), border-color .5s var(--c67-ease);
}
/* legibility scrim behind cream text when the bar floats over a photo hero */
.c67-bar::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 230%; z-index: -2; pointer-events: none;
  background: linear-gradient(to bottom, rgba(45,46,40,.42), rgba(45,46,40,0));
  opacity: 1; transition: opacity .5s var(--c67-ease);
}
.c67-bar.is-scrolled::after, .c67-bar.is-open::after { opacity: 0; }
/* journal articles open on cream — no photo behind the bar, so no scrim */
body.single .c67-bar::after { opacity: 0; }
.c67-bar.is-scrolled { color: var(--c67-ink); height: clamp(56px, 6.5vh, 72px); }
.c67-bar.is-scrolled::before { opacity: 1; border-bottom-color: rgba(78,79,71,.10); }
/* while the overlay is open the bar floats transparently over cream */
.c67-bar.is-open { color: var(--c67-ink); }
.c67-bar.is-open::before { opacity: 0; border-color: transparent; }

.c67-bar__brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.c67-bar__brand .c67-mark { width: 40px; height: 40px; display: block; flex: none; object-fit: contain; }
.c67-bar__word {
  font-family: var(--c67-display); font-weight: 500;
  text-transform: uppercase; letter-spacing: .28em; font-size: clamp(12px, .95vw, 13.5px);
  line-height: 1; padding-left: .28em;
}
.c67-bar__right { display: flex; align-items: center; gap: clamp(16px, 2vw, 28px); }

.c67-bar__menu {
  -webkit-appearance: none; appearance: none; background: none; border: 0; cursor: pointer;
  color: inherit; display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--c67-ui); text-transform: uppercase; letter-spacing: .2em; font-size: 11px;
  padding: 10px 0;
}
.c67-bar__menu-label { display: inline-block; min-width: 3.4em; text-align: right; }
.c67-bar__menu-glyph { position: relative; width: 22px; height: 8px; display: inline-block; }
.c67-bar__menu-glyph i {
  position: absolute; left: 0; right: 0; height: 1px; background: currentColor;
  transition: transform .45s var(--c67-ease), opacity .3s var(--c67-ease);
}
.c67-bar__menu-glyph i:nth-child(1) { top: 0; }
.c67-bar__menu-glyph i:nth-child(2) { bottom: 0; }
.c67-bar.is-open .c67-bar__menu-glyph i:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.c67-bar.is-open .c67-bar__menu-glyph i:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

.c67-bar__book {
  font-family: var(--c67-ui); text-transform: uppercase; letter-spacing: .2em; font-size: 11px;
  text-decoration: none; color: inherit;
  border: 1px solid currentColor; padding: 10px 18px;
  transition: background-color .4s var(--c67-ease), color .4s var(--c67-ease), border-color .4s var(--c67-ease);
}
.c67-bar__book:hover { background: var(--c67-orange); border-color: var(--c67-orange); color: var(--c67-cream); }

/* ---- 2. "Editorial Index" overlay ----------------------------------- */
.c67-overlay {
  position: fixed; inset: 0; z-index: 8000;
  visibility: hidden; pointer-events: none;
}
.c67-overlay.is-open { visibility: visible; pointer-events: auto; }
.c67-overlay__bg {
  position: absolute; inset: 0; background: var(--c67-cream);
  clip-path: inset(0 0 100% 0); will-change: clip-path;
}
.c67-overlay__inner {
  position: relative; height: 100%; box-sizing: border-box;
  display: grid; grid-template-columns: 1.45fr 1fr; align-items: center; gap: 4vw;
  max-width: 1540px; margin: 0 auto; overflow-y: auto;
  padding: clamp(84px, 11vh, 140px) clamp(20px, 5vw, 72px) clamp(36px, 5vh, 64px);
}
.c67-overlay__rule {
  position: absolute; left: clamp(20px, 5vw, 72px); right: clamp(20px, 5vw, 72px);
  top: clamp(86px, 12vh, 128px); height: 1px; background: rgba(78,79,71,.16);
  transform: scaleX(0); transform-origin: left; will-change: transform;
}

.c67-overlay__eyebrow {
  display: block; overflow: hidden;
  font-family: var(--c67-ui); text-transform: uppercase; letter-spacing: .34em;
  font-size: 12px; color: var(--c67-orange); margin-bottom: clamp(12px, 2vh, 24px);
}
.c67-overlay__eyebrow > i { display: inline-block; font-style: normal; transform: translateY(120%); transition: transform .8s var(--c67-ease) .12s; }
.c67-overlay.is-open .c67-overlay__eyebrow > i { transform: translateY(0); }

.c67-index { list-style: none; margin: 0; padding: 0; }
.c67-index__item { border-top: 1px solid rgba(78,79,71,.14); }
.c67-index__item:last-child { border-bottom: 1px solid rgba(78,79,71,.14); }
.c67-index__item a {
  position: relative; display: flex; align-items: baseline; gap: clamp(16px, 2vw, 32px);
  text-decoration: none; color: var(--c67-ink); padding: clamp(8px, 1.3vh, 15px) 0;
}
.c67-index__item a::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 0;
  background: var(--c67-orange); transition: width .55s var(--c67-ease);
}
.c67-index__item a:hover::after { width: 100%; }
.c67-index__no {
  font-family: var(--c67-ui); font-size: clamp(11px, .95vw, 13px); letter-spacing: .16em;
  color: var(--c67-orange); width: 2.6em; flex: none; transform: translateY(-.55em);
  transition: color .4s var(--c67-ease);
}
.c67-index__label {
  display: inline-block; overflow: hidden;
  font-family: var(--c67-display); font-weight: 500; text-transform: uppercase; letter-spacing: .015em;
  font-size: clamp(1.45rem, min(3.6vw, 5.2vh), 2.85rem); line-height: 1;
  color: var(--c67-ink); transition: color .4s var(--c67-ease), transform .55s var(--c67-ease);
}
.c67-index__label > i { display: inline-block; font-style: normal; transform: translateY(112%); will-change: transform; transition: transform .9s var(--c67-ease); }
.c67-overlay.is-open .c67-index__item:nth-child(1) .c67-index__label > i { transform: translateY(0); transition-delay: .20s; }
.c67-overlay.is-open .c67-index__item:nth-child(2) .c67-index__label > i { transform: translateY(0); transition-delay: .27s; }
.c67-overlay.is-open .c67-index__item:nth-child(3) .c67-index__label > i { transform: translateY(0); transition-delay: .34s; }
.c67-overlay.is-open .c67-index__item:nth-child(4) .c67-index__label > i { transform: translateY(0); transition-delay: .41s; }
.c67-overlay.is-open .c67-index__item:nth-child(5) .c67-index__label > i { transform: translateY(0); transition-delay: .48s; }
.c67-overlay.is-open .c67-index__item:nth-child(6) .c67-index__label > i { transform: translateY(0); transition-delay: .55s; }
.c67-overlay.is-open .c67-index__item:nth-child(7) .c67-index__label > i { transform: translateY(0); transition-delay: .62s; }
/* closing: labels + eyebrow dive back into their masks immediately (no
   stagger) while the GSAP timeline reverses the bg — prevents text from
   floating over the page after the veil has gone. */
.c67-overlay.is-closing .c67-index__label > i {
  transform: translateY(112%) !important;
  transition: transform .38s var(--c67-ease) !important;
  transition-delay: 0s !important;
}
.c67-overlay.is-closing .c67-overlay__eyebrow > i {
  transform: translateY(120%) !important;
  transition: transform .3s var(--c67-ease) !important;
  transition-delay: 0s !important;
}
/* …and the rest of the panel (numbers, hairlines, aside) dissolves just
   behind them, before the bg finishes its reverse wipe */
.c67-overlay.is-closing .c67-overlay__index,
.c67-overlay.is-closing .c67-overlay__aside {
  opacity: 0 !important;
  transition: opacity .28s ease .1s !important;
}
.c67-index__item a:hover .c67-index__label { color: var(--c67-orange); transform: translateX(12px); }
.c67-index__item a:hover .c67-index__no { color: var(--c67-ink-soft); }
.c67-index__item a.is-current .c67-index__label { color: var(--c67-orange); }
.c67-index__item a.is-current .c67-index__no { color: var(--c67-ink); }

/* right column */
.c67-overlay__aside { align-self: center; display: flex; flex-direction: column; gap: clamp(20px, 3vh, 32px); }
/* hover preview: each index link crossfades its photo in here (desktop) */
.c67-overlay__media { position: relative; width: 100%; aspect-ratio: 4 / 5; max-height: 44vh; overflow: hidden; background: var(--c67-cream-deep); }
.c67-overlay__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.05); transition: opacity .7s var(--c67-ease), transform 1.4s var(--c67-ease); }
.c67-overlay__media img.is-active { opacity: 1; transform: scale(1); }
.c67-overlay__brandline {
  font-family: var(--c67-serif); font-style: italic; margin: 0;
  font-size: clamp(1.05rem, 1.55vw, 1.4rem); line-height: 1.5; color: var(--c67-ink);
}
.c67-overlay__contact {
  font-family: var(--c67-ui); font-size: 13px; letter-spacing: .04em; line-height: 1.95; color: var(--c67-ink-soft);
}
.c67-overlay__contact a { color: var(--c67-ink-soft); text-decoration: none; border-bottom: 1px solid transparent; transition: color .3s, border-color .3s; }
.c67-overlay__contact a:hover { color: var(--c67-orange); border-color: var(--c67-orange); }
.c67-overlay__book {
  align-self: flex-start; font-family: var(--c67-ui); text-transform: uppercase; letter-spacing: .2em;
  font-size: 12px; text-decoration: none; color: var(--c67-cream); background: var(--c67-orange);
  padding: 14px 26px; transition: background-color .4s var(--c67-ease), letter-spacing .4s var(--c67-ease);
}
.c67-overlay__book:hover { background: var(--c67-orange-deep); letter-spacing: .26em; }

/* Fallback when GSAP isn't driving reveals (no lib / CDN miss): show final state.
   .c67-anim is added by JS only when GSAP is present and motion is allowed. */
html:not(.c67-anim) .c67-overlay.is-open .c67-overlay__bg { clip-path: inset(0 0 0 0); transition: clip-path .8s var(--c67-ease); }
html:not(.c67-anim) .c67-overlay.is-open .c67-overlay__rule { transform: scaleX(1); transition: transform .6s var(--c67-ease); }

/* ---- 3. Bespoke footer ---------------------------------------------- */
.c67-foot {
  background: var(--c67-ink); color: var(--c67-cream);
  padding: clamp(56px, 9vh, 112px) clamp(20px, 5vw, 72px) 40px;
  font-family: var(--c67-ui);
}
.c67-foot__top {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr auto; gap: clamp(28px, 4vw, 56px);
  align-items: start; max-width: 1540px; margin: 0 auto;
}
.c67-foot__brandword { font-family: var(--c67-display); font-weight: 500; text-transform: uppercase; letter-spacing: .24em; font-size: clamp(1.4rem, 2.3vw, 2rem); }
.c67-foot__line { font-family: var(--c67-serif); font-style: italic; color: rgba(251,243,232,.66); margin-top: 14px; font-size: 1.05rem; line-height: 1.5; max-width: 22em; }
.c67-foot h4 { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--c67-gold); margin: 0 0 16px; font-weight: 400; }
.c67-foot__col p, .c67-foot__col a { font-size: 13.5px; line-height: 2; letter-spacing: .02em; margin: 0; }
.c67-foot__col a, .c67-foot a { color: rgba(251,243,232,.82); text-decoration: none; display: block; transition: color .3s; }
.c67-foot a:hover { color: var(--c67-orange); }
.c67-foot__book {
  display: inline-block; border: 1px solid rgba(251,243,232,.5); color: var(--c67-cream) !important;
  text-transform: uppercase; letter-spacing: .2em; font-size: 12px; padding: 14px 24px; white-space: nowrap;
  transition: background-color .4s var(--c67-ease), border-color .4s var(--c67-ease), color .4s var(--c67-ease);
}
.c67-foot__book:hover { background: var(--c67-orange); border-color: var(--c67-orange); color: var(--c67-cream) !important; }
.c67-foot__bottom {
  max-width: 1540px; margin: clamp(40px, 6vh, 72px) auto 0; padding-top: 22px;
  border-top: 1px solid rgba(251,243,232,.14);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(251,243,232,.5);
}
.c67-foot__bottom a { display: inline; color: rgba(251,243,232,.5); }

/* ---- 4. Responsive -------------------------------------------------- */
@media (max-width: 900px) {
  .c67-overlay__inner { grid-template-columns: 1fr; align-content: center; gap: clamp(24px, 4vh, 40px); padding-top: clamp(96px,14vh,140px); }
  .c67-overlay__media { display: none; }
  .c67-overlay__aside { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
  .c67-overlay__brandline { flex: 1 1 100%; }
  .c67-foot__top { grid-template-columns: 1fr 1fr; }
  .c67-foot__brand { grid-column: 1 / -1; }
  .c67-foot__cta { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .c67-bar__word { display: none; }
  .c67-foot__top { grid-template-columns: 1fr; }
}

/* ---- 5. Reduced motion ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .c67-overlay__bg { clip-path: none !important; }
  .c67-overlay__rule { transform: scaleX(1) !important; }
  .c67-index__label > i, .c67-overlay__eyebrow > i { transform: none !important; }
  .c67-overlay.is-open .c67-overlay__mark { animation: none; }
  .c67-bar, .c67-bar__menu-glyph i, .c67-index__label, .c67-index__item a::after { transition: none !important; }
}
