/* vup_2018_child - css/components/newsletter-widget.css */

.vu-newsletter-widget {
  --nl-surface: var(--grad-surface-1, linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(245, 248, 255, 0.9)));
  --nl-text: var(--vu-ink, #1f2c57);
  --nl-muted: rgba(24, 34, 62, 0.78);
  --nl-outline: rgba(12, 24, 48, 0.12);
  --nl-shadow: var(--vu-shadow-soft, 0 16px 28px rgba(5, 7, 19, 0.12));
  --nl-radius: 18px;
  --nl-pad: clamp(14px, 3vw, 18px);
  background: transparent;
  border: none;
  box-shadow: none;
  position: relative;
  z-index: 1;
  overflow: visible;
  padding: var(--nl-pad);
  color: var(--nl-text);
  font: inherit;
}

.vu-newsletter-widget::before {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: -2;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.1));
  border-radius: calc(var(--nl-radius) + 4px);
  pointer-events: none;
}

.vu-newsletter-widget::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--nl-surface);
  border: 1px solid var(--nl-outline);
  border-radius: var(--nl-radius);
  box-shadow: var(--nl-shadow);
  pointer-events: none;
}

.vu-newsletter-widget .vu-nl-title {
  display: block;
  line-height: 1.15;
  margin: 0 0 var(--nl-title-gap) 0;
  text-align: left;
}

.vu-newsletter-widget .vu-nl-archive {
  text-decoration: none;
  color: var(--nl-text);
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.vu-newsletter-widget .vu-nl-archive:hover {
  text-decoration: underline;
}

.vu-newsletter-widget .vu-nl-kicker {
  display: inline-block;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--nl-muted);
}

.vu-newsletter-widget .vu-nl-headline {
  display: inline-block;
  font-weight: 800;
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: .04em;
  color: var(--nl-text);
  text-decoration: none;
}

/* --- Form Layout (Compact & Interactive) --- */
.vu-newsletter-widget .vu-nl-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  position: relative;
  margin-top: 8px;
}

.vu-newsletter-widget .vu-nl-field {
  position: relative;
  width: 100%;
}

.vu-newsletter-widget .vu-nl-label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85em;
  color: #666;
  pointer-events: none;
  transition: all 0.2s ease;
  opacity: 0.7;
}

/* Hide label when input has focus or value (using :placeholder-shown trick) */
.vu-newsletter-widget .vu-nl-input:focus+.vu-nl-label,
.vu-newsletter-widget .vu-nl-input:not(:placeholder-shown)+.vu-nl-label {
  opacity: 0;
}

.vu-newsletter-widget .vu-nl-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid rgba(12, 24, 48, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  font-size: 0.95em;
  height: 38px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.vu-newsletter-widget .vu-nl-input:focus {
  border-color: var(--vu-gold);
  box-shadow: 0 0 0 2px rgba(255, 217, 0, 0.32);
}

/* Actions (Button) */
.vu-newsletter-widget .vu-nl-actions {
  display: flex;
  align-items: center;
  justify-content: center;

  /* Hidden by default, shown when typing */
  opacity: 0;
  transform: translateX(-10px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Show button when input is NOT showing placeholder (i.e. has text) */
.vu-newsletter-widget .vu-nl-form:has(.vu-nl-input:not(:placeholder-shown)) .vu-nl-actions {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.vu-newsletter-widget .vu-nl-form:has(.vu-nl-input:not(:placeholder-shown)) .vu-nl-submit {
  background: linear-gradient(135deg, #1fe0b5, #0fb38f);
  border-color: rgba(15, 179, 143, 0.65);
  color: #041827;
}

.vu-newsletter-widget .vu-nl-form:has(.vu-nl-input:not(:placeholder-shown)) .vu-nl-submit::after {
  content: "^";
  margin-left: 6px;
  font-weight: 900;
}

.vu-newsletter-widget .vu-nl-submit {
  appearance: none;
  color: #1a1f35;
  border: 1px solid rgba(255, 217, 0, .45);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.1;
  box-shadow: 0 12px 24px rgba(255, 190, 79, .35);
  background: linear-gradient(135deg, #ffc600, #ffd900);
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}

.vu-newsletter-widget .vu-nl-submit:hover {
  filter: brightness(1.07);
  box-shadow: 0 16px 32px rgba(255, 190, 79, .45);
}

.vu-newsletter-widget .vu-nl-submit:active {
  transform: translateY(1px);
}

.vu-newsletter-widget .vu-nl-submit:focus-visible {
  outline: 2px solid var(--nl-accent);
  outline-offset: 3px;
}

/* Responsive tweaks */
@media (max-width: 720px) {
  .vu-newsletter-widget .vu-nl-form {
    grid-template-columns: 1fr;
  }

  .vu-newsletter-widget .vu-nl-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .vu-newsletter-widget .vu-nl-submit {
    width: auto;
  }
}

/* Dark container safety if placed on dark sections */
@media (prefers-color-scheme: dark) {
  .vu-newsletter-widget {
    --nl-surface: var(--surface-card, linear-gradient(150deg, rgba(6, 10, 18, 0.9), rgba(10, 14, 22, 0.92)));
    --nl-outline: rgba(255, 255, 255, 0.12);
    --nl-shadow: var(--shadow-card-strong, 0 25px 45px rgba(6, 12, 30, 0.35));
    --nl-text: var(--vu-fg, #f4f4f4);
    --nl-muted: rgba(226, 233, 245, 0.75);
    background: transparent;
  }

  .vu-newsletter-widget::before {
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  }

  .vu-newsletter-widget .vu-nl-archive {
    color: inherit
  }

  .vu-newsletter-widget .vu-nl-kicker {
    color: var(--nl-muted)
  }

  .vu-newsletter-widget .vu-nl-label {
    color: var(--nl-muted)
  }

  .vu-newsletter-widget .vu-nl-input {
    background: rgba(255, 255, 255, .12);
    color: var(--nl-text);
    border-color: var(--nl-outline);
  }
}
