/* ============================================================
   E-Leviate · Sign-up + announcement system
   Prefix: .elsu-
   Loaded AFTER styles.css on every page.

   Everything here themes off `currentColor` so the same markup
   reads correctly on Ivory, Plum, or Periwinkle grounds — the
   announcement band is always Plum/Ivory; the inline CTA section
   inverts via the standard section[data-theme] override block.
   ============================================================ */

/* ============================================================
   1 · ANNOUNCEMENT BAND
   First child of <body>, above the sticky header. Plum ground,
   ivory text, periwinkle arrow. Collapses to a single line;
   expands to reveal the band sign-up form.
   ============================================================ */
.elsu-ann {
  background: var(--plum);
  color: var(--ivory);
  position: relative;
  z-index: 60;
}

.elsu-ann__bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 11px var(--pad-x);
}

/* The whole line is the expand trigger. Text + arrow inline, left-set
   per the brand's left-alignment rule; the dismiss control is pushed
   to the far right by margin-right:auto on the trigger. */
.elsu-ann__trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-right: auto;
  padding: 2px 0;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.005em;
  text-align: left;
  cursor: pointer;
}
.elsu-ann__text {
  opacity: 0.92;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.elsu-ann__trigger:hover .elsu-ann__text { opacity: 1; }
.elsu-ann__arrow {
  color: var(--periwinkle);
  font-weight: 300;
  font-size: 16px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.elsu-ann[data-expanded="true"] .elsu-ann__arrow {
  transform: rotate(90deg);
}

.elsu-ann__dismiss {
  appearance: none;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--ivory);
  opacity: 0.55;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.elsu-ann__dismiss:hover { opacity: 1; }

/* Height reveal via max-height — the most engine-proof animatable
   property. 640px clears the form's natural height; the inner wrapper
   clips while closed/animating. */
.elsu-ann__panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}
.elsu-ann[data-expanded="true"] .elsu-ann__panel {
  max-height: 640px;
}
.elsu-ann__panel-inner {
  overflow: hidden;
}
.elsu-ann__panel-pad {
  padding: 6px var(--pad-x) 30px;
}
.elsu-ann__panel-frame {
  max-width: 760px;
}
.elsu-ann__panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  border-top: 1px solid color-mix(in srgb, var(--ivory) 22%, transparent);
  padding-top: 22px;
}
.elsu-ann__panel-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  line-height: 1;
  opacity: 0.9;
}
.elsu-ann__panel-label::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--periwinkle);
  flex: 0 0 auto;
}
.elsu-ann__close {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.7;
  cursor: pointer;
  padding: 2px 0;
  border-bottom: 1px solid color-mix(in srgb, currentColor 40%, transparent);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.elsu-ann__close:hover { opacity: 1; }

/* ============================================================
   2 · INLINE CTA SECTION
   Full-bleed colour block. Default ivory ground / plum text via
   section[data-theme="ivory"]; inverts cleanly to plum/periwinkle.
   ============================================================ */
.elsu-section {
  padding: var(--pad-y-lg) var(--pad-x);
}
.elsu-section__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 72px;
  align-items: start;
}
.elsu-section__head {
  display: flex;
  flex-direction: column;
  gap: 26px;
  max-width: 30ch;
}
.elsu-section__title {
  font-size: clamp(34px, 4.2vw, 52px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.elsu-section__body {
  font-size: 20px;
  font-weight: 300;
  line-height: 1.45;
  letter-spacing: 0;
  text-wrap: pretty;
  max-width: 42ch;
  opacity: 0.86;
}

/* Eyebrow — periwinkle dot + tracked caps + hairline segment.
   Mirrors .ele-signup__eyebrow / .elp-eyebrow. */
.elsu-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  line-height: 1;
  opacity: 0.9;
}
.elsu-eyebrow__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--periwinkle);
  flex: 0 0 auto;
}
.elsu-eyebrow__seg {
  flex: 0 1 90px;
  height: 1px;
  background: currentColor;
  opacity: 0.3;
}

/* ============================================================
   3 · FORM — shared across band + inline variants
   Fields are hairline-underlined, never boxed. Everything keys
   off currentColor so the form is theme-proof.
   ============================================================ */
.elsu-form {
  display: flex;
  flex-direction: column;
  gap: 26px;
  max-width: 460px;
}
.elsu-form[data-variant="band"] {
  gap: 20px;
  max-width: 640px;
}

.elsu-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
.elsu-form[data-variant="band"] .elsu-form__row { gap: 20px 28px; }

/* ---- Field --------------------------------------------------- */
.elsu-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.elsu-field__label {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 0.85;
}
.elsu-field__req {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.55;
}
.elsu-field__input {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, currentColor 32%, transparent);
  border-radius: 0;
  color: inherit;
  font: inherit;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.3;
  padding: 10px 0;
  transition: border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.elsu-field__input:hover {
  border-bottom-color: color-mix(in srgb, currentColor 55%, transparent);
}
.elsu-field__input:focus {
  outline: none;
  border-bottom-color: currentColor;
}
.elsu-field__input::placeholder {
  color: color-mix(in srgb, currentColor 38%, transparent);
}
.elsu-field[data-invalid="true"] .elsu-field__input {
  border-bottom-color: var(--coral);
}

/* Native select — currentColor chevron drawn with two angled strokes,
   matching the .ele-signup-field language. */
.elsu-field__input--select {
  cursor: pointer;
  padding-right: 28px;
  background-image:
    linear-gradient(135deg, transparent 45%, currentColor 45%, currentColor 55%, transparent 55%),
    linear-gradient(45deg,  transparent 45%, currentColor 45%, currentColor 55%, transparent 55%);
  background-position:
    calc(100% - 13px) 56%,
    calc(100% - 7px)  56%;
  background-size: 8px 8px, 8px 8px;
  background-repeat: no-repeat;
}
.elsu-field__input--select option {
  color: var(--plum);
  background: var(--ivory);
}

/* ---- Consent checkbox --------------------------------------- */
.elsu-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  cursor: pointer;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.5;
}
.elsu-consent__native {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.elsu-consent__box {
  width: 18px; height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.elsu-consent__box svg {
  width: 12px; height: 12px;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.elsu-consent__native:checked + .elsu-consent__box {
  background: var(--periwinkle);
  border-color: var(--periwinkle);
}
.elsu-consent__native:checked + .elsu-consent__box svg { opacity: 1; }
.elsu-consent__native:checked + .elsu-consent__box svg path { stroke: var(--plum); }
.elsu-consent__native:focus-visible + .elsu-consent__box {
  outline: 2px solid var(--periwinkle);
  outline-offset: 2px;
}
.elsu-consent__text { opacity: 0.86; }
.elsu-consent__placeholder {
  opacity: 0.55;
  font-style: italic;
}
.elsu-field[data-invalid="true"] .elsu-consent__box {
  border-color: var(--coral);
}

/* ---- Error messages ----------------------------------------- */
.elsu-field__error {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--coral);
}

/* ---- Submit -------------------------------------------------- */
.elsu-form__submit {
  align-self: flex-start;
  margin-top: 4px;
  padding: 15px 26px;
  font-size: 15px;
}
.elsu-form__submit .ele-btn__arrow {
  color: var(--periwinkle);
  font-size: 17px;
  margin-left: 2px;
}
/* On dark grounds the primary pill is ivory; keep the arrow periwinkle. */

/* ---- Resolved states ---------------------------------------- */
.elsu-form__result {
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: -0.005em;
  text-wrap: pretty;
  max-width: 30ch;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.elsu-form__result::before {
  content: "";
  width: 8px; height: 8px;
  margin-top: 0.5em;
  border-radius: 50%;
  background: var(--periwinkle);
  flex: 0 0 auto;
}
.elsu-form__result a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.elsu-form[data-variant="band"] .elsu-form__result {
  font-size: 20px;
}

/* ============================================================
   4 · DATA-THEME ADJUSTMENTS
   The section[data-theme] block in styles.css already swaps the
   section bg+color. currentColor handles the form. The only extra
   work: periwinkle dots/accents that vanish on a periwinkle ground.
   ============================================================ */
.elsu-section[data-theme="periwinkle"] .elsu-eyebrow__dot,
.elsu-section[data-theme="periwinkle"] .elsu-form__result::before {
  background: var(--plum);
}
.elsu-section[data-theme="periwinkle"] .elsu-consent__native:checked + .elsu-consent__box {
  background: var(--plum);
  border-color: var(--plum);
}
.elsu-section[data-theme="periwinkle"] .elsu-consent__native:checked + .elsu-consent__box svg path {
  stroke: var(--periwinkle);
}
.elsu-section[data-theme="periwinkle"] .elsu-form__submit .ele-btn__arrow {
  color: var(--plum);
}

/* ============================================================
   5 · RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .elsu-section__inner { gap: 56px; }
}
@media (max-width: 860px) {
  .elsu-section { padding: var(--pad-y-md) var(--pad-x); }
  .elsu-section__inner {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .elsu-section__head { max-width: none; }
  .elsu-form, .elsu-form[data-variant="band"] { max-width: none; }
}
@media (max-width: 640px) {
  .elsu-ann__bar { gap: 10px; padding: 10px var(--pad-x); }
  .elsu-ann__trigger { font-size: 13px; gap: 8px; }
  .elsu-form__row { grid-template-columns: 1fr; gap: 26px; }
  .elsu-form[data-variant="band"] .elsu-form__row { gap: 20px; }
}
@media (max-width: 420px) {
  .elsu-section__body { font-size: 17px; }
}
