/* Filaro Collection - Welcome home card + site footer
   Phone 09/Aug/26: wrapper stacks Welcome + footer; each is its own snap plate
   (Paul: footer must snap like any plate). Desktop: wrapper display:contents.
   Architecture: Tempo Advisory footer-v1
   Tokens: Filaro wine / cream / Helvetica / Times Now
*/

/* Desktop: wrapper dissolves so Welcome + footer stay sibling plates.
   Phone: @767 makes this one snap magnet (Sable-style close). */
.filaro-end-plate {
  display: contents;
}

/* Plate 1: Welcome home to Filaro - full viewport */
.filaro-welcome {
  position: relative;
  background: var(--page-bg, var(--wine, #5b2c2d));
  color: var(--ink, #fff);
  min-height: 100vh;
  min-height: 100svh;
  height: 100vh;
  height: 100svh;
  box-sizing: border-box;
  overflow: hidden;
}

/* Legacy wrap class - treat as welcome if still present */
.filaro-footer-wrap {
  background: var(--page-bg, var(--wine, #5b2c2d));
  color: var(--ink, #fff);
}

.filaro-footer-welcome {
  position: relative;
  min-height: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  padding:
    calc(var(--site-nav-h, 4.5rem) + clamp(9.5rem, 24vh, 16rem))
    var(--gutter)
    clamp(6.5rem, 16vh, 11rem);
  box-sizing: border-box;
  text-align: left;
  overflow: visible;
  isolation: isolate;
}
/* Full chapter type stack here - Story scopes headings under .story only,
   so Welcome (outside .story) was falling back to bold default h2. */
.filaro-footer-welcome .chapter-heading {
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  max-width: 34rem;
  margin: 0;
  text-align: left;
  font-family: var(--font-sans);
  font-size: clamp(2.4rem, 4.32vw, 4.2rem);
  font-weight: 100;
  letter-spacing: -0.01em;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
  z-index: 40;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
  transform: translateZ(0);
}
.filaro-footer-welcome .chapter-heading .title-line {
  display: block;
  text-align: left;
  font-size: clamp(2.64rem, 4.75vw, 4.62rem);
  font-family: inherit;
  font-weight: inherit;
  text-transform: inherit;
}
/* Phone only (07/Aug/26 Paul): Welcome + footer SAME on Story / Residences / A Note.
   Desktop freeze. */
.filaro-footer-welcome .chapter-heading .payoff,
.filaro-footer-welcome .chapter-heading .payoff i {
  display: block;
  text-align: left;
  margin-top: -0.06em;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 250;
  font-size: clamp(1.94rem, 3.5vw, 3.4rem);
  line-height: 1;
  text-transform: none;
  font-synthesis: none;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

/* Plate 2: link columns after Welcome
   Shared by Story / Residences / A Note (same stylesheet).
   Content-height plate - page scroll only; never nested overflow. */
.site-footer,
#s10-footer.site-footer,
#s12-footer.site-footer,
#note-site-footer.site-footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--page-bg, var(--wine, #5b2c2d));
  color: var(--cream, #f7f5ef);
  min-height: 50vh;
  min-height: 50svh;
  height: auto;
  max-height: none;
  padding:
    clamp(2rem, 5vh, 3.5rem)
    var(--gutter)
    calc(clamp(1.5rem, 3vh, 2.5rem) + 3.5rem);
  box-sizing: border-box;
}
.site-footer__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--content-max, var(--max, 1240px));
  margin: 0;
  box-sizing: border-box;
}
/* Prev/Next land: hide link block until page-next fade plays (GSAP owns opacity) */
.site-footer.is-footer-landing .site-footer__inner {
  opacity: 0;
}
.site-footer__top {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(1.75rem, 3.5vw, 2.75rem) clamp(0.75rem, 1.5vw, 1.5rem);
  align-items: start;
  padding-bottom: 0;
  row-gap: clamp(1.75rem, 3.5vh, 2.75rem);
}
.site-footer__rule {
  grid-column: 1 / -1;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(247, 245, 239, 0.14);
}
.site-footer__ear {
  margin: 0 0 1.1rem;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247, 245, 239, 0.42);
  line-height: 1.2;
}
/* Phone-only Collection ear - hidden on desktop (Paul 09/Aug/26) */
.site-footer__col--collection {
  display: none;
}
/* Phone-only book links under Collection - hidden on desktop */
.site-footer__list--collection-books {
  display: none;
}
/* Phone-only Social Facebook row - hidden on desktop (Paul 09/Aug/26) */
.site-footer__social-phone {
  display: none;
}
.site-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.site-footer__list a {
  color: var(--cream, #f7f5ef);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 300;
  line-height: 1.45;
  letter-spacing: 0.02em;
  transition: opacity 0.15s;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.site-footer__list a:hover { opacity: 0.72; }
.site-footer__meta {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(1.75rem, 3.5vw, 2.75rem) clamp(0.75rem, 1.5vw, 1.5rem);
  align-items: end;
  padding-top: clamp(2rem, 4vh, 2.75rem);
}
.site-footer__meta-contact {
  grid-column: 1 / 3;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.site-footer__meta-contact a,
.site-footer__meta-contact span {
  font-size: 0.72rem;
  font-weight: 300;
  line-height: 1.45;
  color: rgba(247, 245, 239, 0.78);
  text-decoration: none;
}
.site-footer__meta-contact a:hover { color: var(--cream, #f7f5ef); }
.site-footer__meta-legal {
  grid-column: 5 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer__meta-legal a,
.site-footer__meta-legal span {
  font-size: 0.68rem;
  color: rgba(247, 245, 239, 0.48);
  text-decoration: none;
  line-height: 1.4;
}
.site-footer__meta-legal a:hover { color: rgba(247, 245, 239, 0.82); }

@media (max-width: 1100px) {
  .site-footer__top {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem 2.25rem;
  }
  .site-footer__meta {
    grid-template-columns: 1fr auto;
    gap: 1rem 2rem;
  }
  .site-footer__meta-contact { grid-column: 1; }
  .site-footer__meta-legal { grid-column: 2; }
}
@media (max-width: 900px) {
  .site-footer__top {
    grid-template-columns: 1fr 1fr;
    gap: 2rem 2.5rem;
  }
}
/* Phone (07/Aug/26 Paul): Welcome + footer shared plate treatment - all books.
   Desktop freeze. */
@media (max-width: 767px) {
  :root {
    --filaro-phone-chrome-top: 5.75rem;
    --filaro-phone-chrome-bottom: calc(
      clamp(2rem, 6vh, 3.5rem) + 2.75rem + env(safe-area-inset-bottom, 0px)
    );
    /* Phone title copy-start SSOT - same formula as Story / Residences / A Note */
    --key-copy-top: max(6.5rem, clamp(12rem, 26vh, 16rem));
    --phone-ear-size: 0.75rem;
    --phone-ear-leading: 1.2;
    --phone-ear-gap: 0.85rem;
    --phone-ear-stack: calc(
      (var(--phone-ear-size) * var(--phone-ear-leading)) + var(--phone-ear-gap)
    );
    --key-title-top: calc(var(--key-copy-top) + var(--phone-ear-stack));
    --filaro-phone-copy-top: var(--key-copy-top);
  }

  /* --- End stack: Welcome + footer stay siblings; EACH snaps as a plate ---
     Wrapper is layout only (no magnet). Paul 09/Aug/26: footer must snap. */
  .filaro-end-plate,
  #s10-end.filaro-end-plate,
  #s12-end.filaro-end-plate,
  #note-end.filaro-end-plate {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    scroll-snap-align: none !important;
    scroll-snap-stop: normal !important;
  }

  /* --- Welcome home: full-screen plate --- */
  .filaro-welcome,
  #s10.filaro-welcome,
  #s12-welcome.filaro-welcome,
  #note-welcome.filaro-welcome {
    min-height: 100vh;
    min-height: 100dvh;
    min-height: var(--phone-plate-h, 100dvh);
    height: 100vh;
    height: 100dvh;
    height: var(--phone-plate-h, 100dvh);
    max-height: 100vh;
    max-height: 100dvh;
    max-height: var(--phone-plate-h, 100dvh);
    flex: 0 0 var(--phone-plate-h, 100dvh);
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    scroll-snap-align: start !important;
    scroll-snap-stop: always !important;
  }
  .filaro-welcome .filaro-footer-welcome {
    min-height: 100%;
    height: 100%;
    padding:
      var(--key-copy-top)
      var(--phone-copy-gutter-right, 2.5rem)
      var(--filaro-phone-chrome-bottom)
      var(--phone-copy-gutter-left, var(--gutter, 1.25rem));
    box-sizing: border-box;
    text-align: left;
  }
  /* Phone title-line SSOT = Story CONNECTION fluid (Paul 07/Aug/26) */
  .filaro-welcome .filaro-footer-welcome .chapter-heading .title-line:not(#contact-drawer-title) {
    font-size: min(
      5.7rem,
      calc(
        (
            100vw - var(--phone-copy-gutter-left, var(--gutter, 1.25rem)) -
              var(--phone-copy-gutter-right, 2.5rem) - 0.35rem
          ) * 0.138
      )
    );
    font-weight: 100;
    letter-spacing: -0.01em;
    line-height: 1;
    text-transform: uppercase;
    text-align: left;
  }
  .filaro-welcome .filaro-footer-welcome .chapter-heading,
  .filaro-welcome .filaro-footer-welcome .payoff {
    text-align: left;
  }

  /* --- Footer: full-screen plate (snaps like every other plate) --- */
  .site-footer,
  #s10-footer.site-footer,
  #s12-footer.site-footer,
  #note-site-footer.site-footer {
    min-height: 100vh;
    min-height: 100dvh;
    min-height: var(--phone-plate-h, 100dvh);
    height: 100vh;
    height: 100dvh;
    height: var(--phone-plate-h, 100dvh);
    max-height: 100vh;
    max-height: 100dvh;
    max-height: var(--phone-plate-h, 100dvh);
    flex: 0 0 var(--phone-plate-h, 100dvh);
    /* Phone copy-start SSOT - first ear (The Collection) on --key-copy-top */
    padding:
      var(--key-copy-top)
      var(--phone-copy-gutter-right, 2.5rem)
      var(--filaro-phone-chrome-bottom)
      var(--phone-copy-gutter-left, var(--gutter, 1.25rem));
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start !important;
    scroll-snap-stop: always !important;
  }
  .site-footer__inner {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-height: 100%;
    overflow: hidden;
  }
  /* Phone footer IA (11/Aug/26 Paul): one plate.
     Collection (Story / Residences / A Note) full width.
     Left: Story chapters then Residences chapters.
     Right: Explore / Contact (Get in touch only) / Social (Instagram) / Legal.
     Team off. Facebook off. Sales + Development enquiries off. */
  .site-footer__top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1.1rem;
    row-gap: 1.45rem;
    align-items: start;
  }
  .site-footer__ear {
    margin: 0 0 0.4em;
    line-height: 1;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
  }
  .site-footer__list {
    gap: 0;
  }
  .site-footer__list a {
    display: flex;
    align-items: center;
    min-height: 1.35rem;
    font-size: 0.68rem;
    line-height: 1.2;
    padding: 0.08rem 0;
    box-sizing: border-box;
  }
  .site-footer__col--collection {
    display: block;
    grid-column: 1 / -1;
    grid-row: 1;
    margin-bottom: 0.35rem;
  }
  .site-footer__list--collection-books {
    display: flex;
    flex-direction: column;
  }
  .site-footer__col--collection .site-footer__ear {
    margin: 0 0 0.28em;
  }
  .site-footer__col--collection .site-footer__ear a {
    color: inherit;
    text-decoration: none;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    line-height: inherit;
    background: none;
    border: 0;
    padding: 0;
    min-height: 0;
    display: inline;
  }
  .site-footer__col[aria-label="The Story"] {
    display: block !important;
    grid-column: 1;
    grid-row: 2;
  }
  .site-footer__col[aria-label="The Residences"] {
    display: block !important;
    grid-column: 1;
    grid-row: 3 / span 3;
  }
  /* Book covers already under Collection - chapters only */
  .site-footer__col[aria-label="The Story"] .site-footer__list > li:first-child,
  .site-footer__col[aria-label="The Residences"] .site-footer__list > li:first-child {
    display: none !important;
  }
  .site-footer__col[aria-label="Explore"] {
    grid-column: 2;
    grid-row: 2;
  }
  .site-footer__col[aria-label="Contact"] {
    grid-column: 2;
    grid-row: 3;
  }
  .site-footer__col[aria-label="Social"] {
    grid-column: 2;
    grid-row: 4;
  }
  .site-footer__col[aria-label="Legal"] {
    grid-column: 2;
    grid-row: 5;
  }
  .site-footer__col[aria-label="Team"] {
    display: none !important;
  }
  .site-footer__col[aria-label="Contact"] .site-footer__list > li:nth-child(2),
  .site-footer__col[aria-label="Contact"] .site-footer__list > li:nth-child(3) {
    display: none !important;
  }
  .site-footer__social-phone {
    display: none !important;
  }
  .site-footer__rule {
    display: none !important;
  }
  .site-footer__meta {
    display: none !important;
  }

  /* Emblem stays on footer (chrome canvas) - all books; drawers still hide chrome. */
  body.is-at-footer .stamp,
  body.is-loaded.is-at-footer .stamp {
    visibility: visible;
    opacity: 1;
    pointer-events: none;
  }
  body.is-at-footer:not(.is-plan-drawer-open):not(.is-map-drawer-open):not(.is-contact-drawer-open):not(.is-design-drawer-open):not(.is-progress-drawer-open):not(.is-media-drawer-open) .site-chrome-bottom {
    visibility: visible;
    opacity: 1;
    pointer-events: none;
  }
}

.legal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(26, 20, 18, 0.55);
  overscroll-behavior: contain;
  transition: opacity 0.38s ease, visibility 0s linear 0.38s;
}
.legal-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.38s ease, visibility 0s linear 0s;
}
@media (prefers-reduced-motion: reduce) {
  .legal-overlay,
  .legal-overlay.is-open { transition: none; }
}
.legal-overlay__panel {
  position: absolute;
  inset: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--cream, #f7f5ef);
  color: #1a1412;
}
.legal-overlay__chrome {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
  padding: 0.85rem var(--gutter, clamp(1.25rem, 4vw, 3.5rem));
  background: rgba(247, 245, 239, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.legal-overlay__brand {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1a1412;
  text-decoration: none;
}
.legal-overlay__brand:hover { opacity: 0.72; }
.legal-overlay__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #1a1412;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: var(--tracking-label, 0.1em);
  text-transform: uppercase;
  padding: 0.65rem 0.25rem;
}
.legal-overlay__close:hover { opacity: 0.55; }
.legal-overlay__article {
  width: min(42rem, calc(100% - (var(--gutter, clamp(1.25rem, 4vw, 3.5rem)) * 2)));
  margin: 0 auto;
  padding: clamp(2.5rem, 6vh, 4rem) 0 clamp(4rem, 10vh, 6rem);
}
.legal-overlay__ear {
  margin: 0 0 0.85rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(26, 20, 18, 0.48);
}
.legal-overlay__title {
  margin: 0 0 0.85rem;
  font-family: var(--font-sans, "Helvetica Neue", Helvetica, Arial, sans-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 100;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-transform: uppercase;
  color: #1a1412;
}
.legal-overlay__updated {
  margin: 0 0 2rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(26, 20, 18, 0.48);
}
.legal-overlay__article h2 {
  margin: 2.5rem 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: #1a1412;
}
.legal-overlay__article p,
.legal-overlay__article li {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: #1a1412;
}
.legal-overlay__article ul {
  margin: 0 0 1.25rem;
  padding: 0 0 0 1.15rem;
}
.legal-overlay__article li { margin: 0 0 0.45rem; }
.legal-overlay__article a { color: inherit; }
.legal-overlay__article em { font-style: italic; }
body.legal-open { overflow: hidden; }
body.legal-open .site-chrome-bottom {
  visibility: hidden;
  pointer-events: none;
}

