/* ==========================================================================
   The Strati Table — newsletter signup (pop-up, inline/footer form, /table page)
   Uses the site's own tokens from site.css; fallbacks keep it working alone.
   ========================================================================== */

.st-scope,
.st-popup,
.st-inline,
.st-page {
  --st-night: var(--night, #161616);
  --st-ink: var(--ink, #101010);
  --st-paper: var(--paper, #f7f1e9);
  --st-cream: var(--cream, #ebd0b5);
  --st-clay: var(--clay, #9a6b54);
  --st-muted: var(--muted, #a49b91);
  --st-line: var(--line, rgba(235, 208, 181, 0.28));
  --st-serif: "Cormorant Garamond", Georgia, serif;
  --st-sans: "Inter", Arial, sans-serif;
}

/* ---------- Shared pieces ---------- */

.st-eyebrow {
  margin: 0 0 14px;
  font-family: var(--st-sans);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--st-cream);
}

.st-title {
  margin: 0 0 14px;
  font-family: var(--st-serif);
  font-weight: 500;
  font-size: clamp(2rem, 4.2vw, 2.7rem);
  line-height: 1.05;
  color: var(--st-paper);
}

.st-lede {
  margin: 0 0 22px;
  font-family: var(--st-sans);
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(247, 241, 233, 0.82);
}

.st-draw {
  margin: -8px 0 20px;
  padding-left: 12px;
  border-left: 2px solid var(--st-clay);
  font-family: var(--st-sans);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--st-cream);
}
.st-draw[hidden] { display: none; }

.st-form { display: grid; gap: 10px; margin: 0; }
.st-form[hidden] { display: none; }

.st-field { display: grid; gap: 6px; }
.st-field label {
  font-family: var(--st-sans);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--st-muted);
}

.st-field input {
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  padding: 12px 13px;
  border: 1px solid var(--st-line);
  border-radius: 0;
  background: rgba(247, 241, 233, 0.06);
  color: var(--st-paper);
  font: 400 1rem/1.3 var(--st-sans); /* 16px stops iOS zooming in */
  -webkit-appearance: none;
  appearance: none;
}
.st-field input::placeholder { color: rgba(247, 241, 233, 0.38); }
.st-field input:focus {
  outline: none;
  border-color: var(--st-cream);
  background: rgba(247, 241, 233, 0.1);
}
.st-field input[aria-invalid="true"] { border-color: #d98c75; }

/* Honeypot: hidden from people, visible to bots */
.st-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

.st-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  padding: 12px 22px;
  border: 1px solid var(--st-cream);
  border-radius: 999px;
  background: var(--st-cream);
  color: var(--st-night);
  font: 500 0.76rem/1 var(--st-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.st-button:hover { background: var(--st-paper); border-color: var(--st-paper); }
.st-button:focus-visible { outline: 2px solid var(--st-paper); outline-offset: 3px; }
.st-button[disabled] { opacity: 0.6; cursor: progress; }

.st-consent {
  margin: 12px 0 0;
  font-family: var(--st-sans);
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--st-muted);
}
.st-consent a { color: var(--st-cream); text-underline-offset: 2px; }

.st-error {
  margin: 4px 0 0;
  font-family: var(--st-sans);
  font-size: 0.82rem;
  color: #e7a48f;
}
.st-error:empty { display: none; }

.st-success { display: none; }
.st-success.is-visible { display: block; animation: st-fade 0.35s ease both; }
.st-success .st-title { font-size: clamp(1.8rem, 3.6vw, 2.3rem); }

@keyframes st-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Pop-up ---------- */

.st-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.st-popup.is-open { display: flex; }

.st-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.72);
  animation: st-fade 0.3s ease both;
}

.st-popup__panel {
  position: relative;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  width: min(820px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--st-night);
  border: 1px solid var(--st-line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  animation: st-rise 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes st-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes st-sheet { from { transform: translateY(100%); } to { transform: none; } }

.st-popup__media {
  position: relative;
  min-height: 100%;
  background: #222 center / cover no-repeat;
}
.st-popup__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(22, 22, 22, 0) 55%, rgba(22, 22, 22, 0.55));
}
.st-popup__logo {
  position: absolute;
  left: 24px;
  bottom: 22px;
  z-index: 1;
  width: 104px;
  height: auto;
}

.st-popup__body { padding: 46px 42px 34px; }

.st-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--st-paper);
  cursor: pointer;
}
.st-close:hover { background: rgba(247, 241, 233, 0.08); }
.st-close:focus-visible { outline: 2px solid var(--st-cream); outline-offset: 2px; }
.st-close svg { width: 18px; height: 18px; }

.st-nothanks {
  display: block;
  margin: 14px auto 0;
  padding: 6px 10px;
  border: 0;
  background: none;
  font-family: var(--st-sans);
  font-size: 0.78rem;
  color: var(--st-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.st-nothanks:hover { color: var(--st-paper); }

/* Phones: a bottom sheet */
@media (max-width: 700px) {
  .st-popup { align-items: flex-end; padding: 0; }
  .st-popup__panel {
    grid-template-columns: 1fr;
    width: 100%;
    max-height: 92vh;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    animation-name: st-sheet;
  }
  .st-popup__media { min-height: 120px; height: 120px; }
  .st-popup__logo { width: 84px; bottom: 16px; left: 20px; }
  .st-popup__body { padding: 26px 22px calc(22px + env(safe-area-inset-bottom)); }
  .st-popup .st-title { font-size: 2rem; }
  .st-popup .st-lede { font-size: 0.9rem; margin-bottom: 16px; }
  .st-close { background: rgba(16, 16, 16, 0.55); }
}

@media (prefers-reduced-motion: reduce) {
  .st-popup__panel, .st-popup__backdrop, .st-success.is-visible { animation: none; }
}

/* Lock page scroll behind the pop-up */
html.st-locked, html.st-locked body { overflow: hidden; }

/* ---------- Inline / footer form ---------- */

.st-inline {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 40px;
  align-items: center;
  max-width: var(--max, 1160px);
  margin: 0 auto;
  padding: 56px 24px;
  border-top: 1px solid var(--st-line);
  border-bottom: 1px solid var(--st-line);
}
.st-inline .st-title { font-size: clamp(1.9rem, 3.4vw, 2.5rem); margin-bottom: 10px; }
.st-inline .st-lede { margin-bottom: 0; }
.st-inline .st-form { grid-template-columns: 1fr 1.4fr auto; align-items: end; }
.st-inline .st-button { width: auto; min-height: 46px; margin-top: 0; white-space: nowrap; }
.st-inline .st-error,
.st-inline .st-consent { grid-column: 1 / -1; }
.st-inline .st-success { grid-column: 1 / -1; text-align: center; }
.st-inline .st-success .st-lede { margin-bottom: 0; }

@media (max-width: 900px) {
  .st-inline { grid-template-columns: 1fr; gap: 22px; padding: 44px 20px; }
  .st-inline .st-form { grid-template-columns: 1fr; }
  .st-inline .st-button { width: 100%; }
}

/* ---------- /table page ---------- */

.st-page {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--st-night);
  color: var(--st-paper);
}

.st-page__media {
  position: relative;
  background: #222 center / cover no-repeat;
}
.st-page__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(22, 22, 22, 0.15), rgba(22, 22, 22, 0.75));
}
.st-page__media-logo {
  position: absolute;
  left: 40px;
  top: 36px;
  z-index: 1;
  width: 150px;
}
.st-page__quote {
  position: absolute;
  left: 40px;
  right: 40px;
  bottom: 40px;
  z-index: 1;
  margin: 0;
  font-family: var(--st-serif);
  font-size: 1.5rem;
  line-height: 1.25;
  color: var(--st-paper);
}
.st-page__quote span {
  display: block;
  margin-top: 10px;
  font-family: var(--st-sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--st-cream);
}

.st-page__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px clamp(24px, 6vw, 88px);
}
.st-page__inner { width: 100%; max-width: 460px; }
.st-page .st-title { font-size: clamp(2.4rem, 5vw, 3.4rem); }

.st-perks {
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--st-line);
}
.st-perks li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--st-line);
  font-family: var(--st-sans);
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(247, 241, 233, 0.86);
}
.st-perks b {
  font-family: var(--st-serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--st-cream);
}

.st-page__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 26px;
  font-family: var(--st-sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.st-page__links a { color: var(--st-cream); text-decoration: none; }
.st-page__links a:hover { color: var(--st-paper); }

.st-page__mobile-logo { display: none; }

@media (max-width: 860px) {
  .st-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .st-page__media { min-height: 34vh; }
  .st-page__media-logo { left: 22px; top: 22px; width: 110px; }
  .st-page__quote { display: none; }
  .st-page__body { padding: 30px 22px 40px; justify-content: flex-start; }
}

/* Offer link (next to the canape line) and the offer terms block on /table */
.st-offer-link { color: var(--st-cream); text-underline-offset: 2px; white-space: nowrap; }
.st-terms {
  margin: 26px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--st-line);
  font-family: var(--st-sans);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--st-muted);
}
.st-terms h2 {
  margin: 0 0 10px;
  font-family: var(--st-serif);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--st-cream);
}
.st-terms ul { margin: 0; padding-left: 1.1em; }
.st-terms li { margin: 0 0 6px; }
.st-terms:target { scroll-margin-top: 24px; }
