/* ============================================================
   Albora · Floating newsletter widget
   Anchored bottom-right, shows when the user reaches the footer.
   Two states: expanded (card) ↔ collapsed (pill). Cannot be fully dismissed
   (only collapsed) unless the user successfully subscribes.
   ============================================================ */

.nl-widget {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 60; /* above main content; cookie banner uses 70+ */
  font-family: 'Poppins', sans-serif;
  color: #F5F5F4;
  pointer-events: none; /* enabled per-state below */
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.nl-widget.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nl-widget[hidden] { display: none !important; }

/* Shared card surface */
.nl-widget-card,
.nl-widget-pill {
  background: #1A1A1A;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55), 0 8px 24px -10px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

/* ---------- EXPANDED CARD ---------- */
.nl-widget-card {
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
}

.nl-widget-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 0 22px;
  gap: 8px;
}

.nl-widget-grip {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 auto;
}

.nl-widget-collapse {
  background: transparent;
  border: 0;
  color: rgba(245, 245, 244, 0.7);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.nl-widget-collapse:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFF;
}

.nl-widget-card-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  padding: 16px 22px 22px;
  align-items: center;
}

.nl-widget-thumb {
  width: 92px;
  height: 116px;
  border-radius: 16px;
  overflow: hidden;
  background: #2A2A2A;
  flex-shrink: 0;
}
.nl-widget-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nl-widget-content { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.nl-widget-eyebrow {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 245, 244, 0.55);
}

.nl-widget-title {
  font-size: 18px;
  line-height: 1.18;
  letter-spacing: -0.01em;
  font-weight: 500;
  color: #F5F5F4;
  margin: 0;
}

.nl-widget-form { display: flex; flex-direction: column; gap: 8px; padding: 0 22px 18px; }

.nl-widget-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.nl-widget-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F5F5F4;
  padding: 11px 16px;
  border-radius: 999px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  min-width: 0;
}
.nl-widget-input::placeholder { color: rgba(245, 245, 244, 0.4); }
.nl-widget-input:focus { border-color: #FCA353; background: rgba(255, 255, 255, 0.09); }

.nl-widget-button {
  background: #FCA353;
  color: #1A1A1A;
  border: 0;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.nl-widget-button:hover { background: #F08F38; }
.nl-widget-button:active { transform: scale(0.98); }

.nl-widget-fineprint {
  font-size: 10.5px;
  line-height: 1.5;
  color: rgba(245, 245, 244, 0.5);
  margin: 2px 0 0;
}
.nl-widget-fineprint a { color: rgba(245, 245, 244, 0.75); text-decoration: underline; }
.nl-widget-fineprint a:hover { color: #FCA353; }

.nl-widget-status {
  font-size: 12px;
  font-weight: 500;
  color: #FCA353;
  margin: 4px 0 0;
  min-height: 16px;
}
.nl-widget-status.is-error { color: #F08F38; }
.nl-widget-status.is-success { color: #86EFAC; }

/* ---------- COLLAPSED PILL ---------- */
.nl-widget-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 12px 16px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #1A1A1A;
  color: #F5F5F4;
  font: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.nl-widget-pill:hover {
  transform: translateY(-2px);
  background: #232323;
}

.nl-widget-pill-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #FCA353;
  color: #1A1A1A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nl-widget-pill-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
  gap: 2px;
}
.nl-widget-pill-eyebrow {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 245, 244, 0.55);
}
.nl-widget-pill-title {
  font-size: 13px;
  font-weight: 500;
  color: #F5F5F4;
}

.nl-widget-pill-caret {
  margin-left: 4px;
  color: rgba(245, 245, 244, 0.6);
  font-size: 18px;
}

/* ---------- STATE TOGGLES ---------- */
.nl-widget[data-state="collapsed"] .nl-widget-card { display: none; }
.nl-widget[data-state="expanded"] .nl-widget-pill { display: none; }

/* ---------- MOBILE ---------- */
@media (max-width: 640px) {
  .nl-widget {
    right: 12px;
    bottom: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  .nl-widget-card {
    width: calc(100vw - 24px);
    max-width: 380px;
  }
  .nl-widget-card-body {
    grid-template-columns: 72px 1fr;
    gap: 14px;
    padding: 14px 18px 18px;
  }
  .nl-widget-thumb {
    width: 72px;
    height: 96px;
    border-radius: 12px;
  }
  .nl-widget-title { font-size: 16px; }
  .nl-widget-form { padding: 0 18px 16px; }
  .nl-widget-row { flex-direction: column; }
  .nl-widget-input,
  .nl-widget-button { width: 100%; }
}

/* Avoid overlap with the sticky action bar present on divadi.html mobile (height ≈ 78px) */
body.has-mobile-stickybar .nl-widget {
  bottom: calc(78px + max(12px, env(safe-area-inset-bottom)));
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .nl-widget,
  .nl-widget-pill,
  .nl-widget-button { transition: none; }
}
