/* ==========================================================================
   The Collective — newsletter signup (homepage feature + compact Library band)
   One shared component. It is built around MailerLite's own form structure (the .ml-* classes are what
   MailerLite's script looks for), so MailerLite's CSS is not shipped: everything here is the site's own look.
   Works with the homepage (story.css) and the Library page (publications/styles.css): it brings its own tokens.
   ========================================================================== */

.nl {
  --nl-teal: #326762;
  --nl-teal-night: #1B3733;
  --nl-ink: #1E3A38;
  --nl-cream: #F7F5F0;
  --nl-aqua: #E7F2F0;
  --nl-lilac: #ECE7FA;
  --nl-warm: #FFF3D1;
  --nl-gold: #D9A340;
  --nl-gold-light: #FFD97A;
  --nl-orange: #E8742A;
  --nl-error: #8C1D18;
  --nl-error-bg: #FDECEA;
  --nl-font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  position: relative;
  color: var(--nl-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.nl *, .nl *::before, .nl *::after { box-sizing: border-box; }
.nl .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.nl .d-none { display: none; }

/* ---------- Logo, headline, lead ---------- */
.nl-logo { display: block; width: min(210px, 62%); height: auto; margin: 0 0 16px; }
.nl h2, .nl-lead { overflow-wrap: anywhere; }
.nl h2 { margin: 0 0 14px; font-family: var(--nl-font); font-weight: 800; color: var(--nl-teal-night); line-height: 1.1; letter-spacing: -0.01em; }
.nl-lead { margin: 0 0 22px; font-size: 1.125rem; line-height: 1.6; color: var(--nl-ink); max-width: 36rem; }
.nl-kicker { margin: 0 0 12px; font-family: var(--nl-font); font-size: 0.875rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--nl-teal); }

/* ---------- The form card (MailerLite structure, site look) ---------- */
.nl-embed { width: 100%; max-width: 36rem; }
.nl-embed .ml-form-embedWrapper { background: #fff; border: 2px solid rgba(50, 103, 98, 0.2); border-radius: 24px; padding: 22px 22px 18px; box-shadow: 0 14px 30px rgba(30, 58, 56, 0.1); }
.nl-embed form { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 12px; align-items: end; }
.nl-embed .ml-form-formContent { grid-column: 1; margin: 0; }
.nl-embed .ml-form-embedSubmit { grid-column: 2; margin: 0; }
.nl-embed .ml-form-embedPermissions { grid-column: 1 / -1; }
.nl-embed .nl-msg, .nl-embed .ml-server-error { grid-column: 1 / -1; }
.nl-embed input[type="hidden"] { display: none; }

.nl-embed label { display: block; margin: 0 0 6px; font-family: var(--nl-font); font-size: 0.9375rem; font-weight: 700; color: var(--nl-teal-night); }
.nl-embed input[type="email"] {
  display: block; width: 100%; min-height: 56px; margin: 0; padding: 12px 16px;
  font: 400 1.0625rem/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--nl-ink);
  background: #fff; border: 2px solid var(--nl-teal); border-radius: 16px; appearance: none; -webkit-appearance: none;
}
.nl-embed input[type="email"]:focus-visible, .nl-embed button:focus-visible, .nl-embed a:focus-visible, .nl-embed h3:focus-visible {
  outline: 4px solid var(--nl-teal-night); outline-offset: 3px; box-shadow: 0 0 0 7px #fff;
}
.nl-embed h3:focus { outline: none; }
.nl-embed h3:focus-visible { outline: 4px solid var(--nl-teal-night); }

.nl-embed .ml-form-embedSubmit button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 56px; min-width: 56px; padding: 0 28px; margin: 0; width: 100%;
  font-family: var(--nl-font); font-size: 1rem; font-weight: 800; line-height: 1.2; color: var(--nl-teal-night);
  background: var(--nl-gold); border: 3px solid #FFE7A8; border-radius: 999px; box-shadow: 0 5px 0 rgba(27, 55, 51, 0.28); cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.nl-embed .ml-form-embedSubmit button.primary:hover { background: #E4B04F; transform: translateY(-1px); box-shadow: 0 6px 0 rgba(27, 55, 51, 0.28); }
.nl-embed .ml-form-embedSubmit button.primary:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(27, 55, 51, 0.28); }
.nl-embed .ml-form-embedSubmit button.loading { background: #EBD08F; cursor: default; box-shadow: none; }
.ml-form-embedSubmitLoad { display: inline-block; width: 22px; height: 22px; }
.ml-form-embedSubmitLoad::after { content: ""; display: block; width: 14px; height: 14px; margin: 2px; border-radius: 50%; border: 4px solid var(--nl-teal-night); border-color: var(--nl-teal-night) var(--nl-teal-night) var(--nl-teal-night) transparent; animation: nl-spin 1.2s linear infinite; }
@keyframes nl-spin { to { transform: rotate(360deg); } }

.nl-embed .ml-form-embedPermissionsContent p { margin: 0; font-size: 0.875rem; line-height: 1.55; color: #3B5754; }
.nl-embed .ml-form-embedPermissionsContent a { color: var(--nl-teal); font-weight: 700; text-underline-offset: 3px; }

/* ---------- Errors: always text, never colour alone ---------- */
.nl-embed .nl-msg:empty, .nl-embed .ml-field-error-message:empty { display: none; }
.nl-embed .nl-msg, .nl-embed .ml-server-error, .nl-embed .ml-field-error-message {
  margin: 0; padding: 10px 14px 10px 44px; position: relative; border-radius: 12px; border-left: 6px solid var(--nl-error);
  background: var(--nl-error-bg); color: var(--nl-error); font-size: 0.9375rem; font-weight: 700; line-height: 1.45;
}
.nl-embed .nl-msg::before, .nl-embed .ml-server-error::before, .nl-embed .ml-field-error-message::before {
  content: "!"; position: absolute; left: 12px; top: 10px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--nl-error); color: #fff; font-size: 0.875rem; line-height: 22px; text-align: center;
}
.nl-embed .ml-field-error-message { margin-top: 8px; }
.nl-embed .ml-error input[type="email"], .nl-embed input[aria-invalid="true"] { border-color: var(--nl-error); }
.nl-embed .ml-error label { color: var(--nl-error); }

/* ---------- Success ---------- */
.nl-embed .ml-form-successBody { padding: 6px 4px 4px; }
.nl-embed .ml-form-successContent h3 { margin: 0 0 10px; font-family: var(--nl-font); font-size: 1.5rem; font-weight: 800; line-height: 1.2; color: var(--nl-teal-night); }
.nl-embed .ml-form-successContent p { margin: 0; font-size: 1.0625rem; line-height: 1.6; }
.nl-embed.is-success .ml-form-embedWrapper { border-color: var(--nl-teal); background: linear-gradient(135deg, #fff 0%, var(--nl-aqua) 100%); }

/* ==========================================================================
   Homepage feature
   ========================================================================== */
.nl-home { --edge-bg: var(--nl-cream); z-index: 5; padding: 120px 0 104px; background: var(--nl-cream); }
/* the splashes are clipped in their own box, so the torn paper edge above the section is not */
.nl-splashes { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.nl-home .nl-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.nl-home h2 { font-size: clamp(2.125rem, 1.2rem + 2.8vw, 3.375rem); }

/* Splashes of colour, taken from The Collective Monthly (teal, mustard, orange, soft lilac) */
.nl-splash { position: absolute; z-index: 0; border-radius: 50%; pointer-events: none; }
.nl-splash-gold { width: 460px; height: 460px; right: -140px; top: 30px; background: radial-gradient(circle at 40% 40%, rgba(255, 217, 122, 0.55), rgba(255, 217, 122, 0) 68%); }
.nl-splash-lilac { width: 420px; height: 420px; left: -120px; bottom: -150px; background: radial-gradient(circle at 60% 40%, rgba(236, 231, 250, 0.95), rgba(236, 231, 250, 0) 70%); }
.nl-splash-aqua { width: 340px; height: 340px; right: 18%; bottom: -160px; background: radial-gradient(circle at 50% 40%, rgba(107, 183, 176, 0.28), rgba(107, 183, 176, 0) 70%); }

.nl-art { position: relative; z-index: 1; display: flex; justify-content: center; align-items: flex-end; min-height: 360px; }
.nl-disc { position: absolute; left: 50%; bottom: 0; width: min(100%, 360px); aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle at 35% 28%, #FFFFFF 0%, #D5ECE8 46%, #BFE0DB 100%); box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.7); }
.nl-dot { position: absolute; border-radius: 50%; }
.nl-dot-1 { width: 38px; height: 38px; left: 6%; top: 14%; background: var(--nl-gold); }
.nl-dot-2 { width: 24px; height: 24px; right: 8%; top: 8%; background: var(--nl-orange); }
.nl-dot-3 { width: 30px; height: 30px; right: 2%; bottom: 26%; background: var(--nl-teal); }
.nl-cally { position: relative; z-index: 1; display: block; width: min(100%, 290px); height: auto; margin-bottom: 4px; filter: drop-shadow(0 14px 16px rgba(30, 58, 56, 0.24)); transform-origin: 50% 96%; }

@media (prefers-reduced-motion: reduce) {
  .nl-embed .ml-form-embedSubmit button { transition: none; }
  .nl-embed .ml-form-embedSubmit button.primary:hover, .nl-embed .ml-form-embedSubmit button.primary:active { transform: none; }
}

/* A gentle sway while the section is on screen. Off for anyone who asks for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .nl.is-visible .nl-cally { animation: nl-sway 6s ease-in-out infinite; }
  .nl.is-visible .nl-dot { animation: nl-bob 5s ease-in-out infinite; }
  .nl.is-visible .nl-dot-2 { animation-delay: -1.6s; }
  .nl.is-visible .nl-dot-3 { animation-delay: -3.1s; }
}
@keyframes nl-sway { 0%, 100% { transform: rotate(-1.4deg) translateY(0); } 50% { transform: rotate(1.4deg) translateY(-7px); } }
@keyframes nl-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* Homepage success state: room around the heading so the keyboard focus ring does not crowd the words (ring itself unchanged: 4px, 12:1). */
.nl-home .nl-embed.is-success .ml-form-embedWrapper { padding: 28px 30px; }
.nl-home .nl-embed .ml-form-successBody { padding: 0; }
.nl-home .nl-embed .ml-form-successContent h3 { margin: 0 0 14px -10px; padding: 6px 10px; border-radius: 12px; }
.nl-home .nl-embed .ml-form-successContent h3:focus-visible { outline-offset: 3px; }

/* ==========================================================================
   Narrow screens, zoomed text
   ========================================================================== */
@media (max-width: 720px) {
  .nl-home { padding: 96px 0 72px; }
  .nl-home .nl-grid { grid-template-columns: 1fr; gap: 8px; }
  .nl-home .nl-art { order: 2; min-height: 0; margin-top: 8px; }
  .nl-home .nl-copy { order: 1; }
  .nl-home .nl-disc { width: min(62%, 230px); }
  .nl-home .nl-cally { width: min(42vw, 168px); }
  .nl-home .nl-dot-1 { left: 14%; } .nl-home .nl-dot-2 { right: 14%; } .nl-home .nl-dot-3 { right: 10%; }
  .nl-home .nl-kicker { font-size: 0.8125rem; }
  .nl-lead { font-size: 1.0625rem; margin-bottom: 18px; }
}
@media (max-width: 560px) {
  .nl-embed form { grid-template-columns: 1fr; }
  .nl-embed .ml-form-formContent, .nl-embed .ml-form-embedSubmit { grid-column: 1; }
  .nl-embed .ml-form-embedWrapper { padding: 18px 16px 16px; border-radius: 20px; }
}
@media (max-width: 400px) {
  .nl-embed label { font-size: 0.875rem; }
}

@media (forced-colors: active) {
  .nl-embed .ml-form-embedWrapper, .nl-embed input[type="email"], .nl-embed .ml-form-embedSubmit button { border: 2px solid CanvasText; }
  .nl-splash, .nl-disc, .nl-dot { display: none; }
}

/* ==========================================================================
   The Collective Library page: subscription feature under the latest edition.
   Deep teal, cream and gold, in the editorial style of The Collective Monthly. Only the Library page uses this.
   ========================================================================== */
.nl-compact { background: var(--pale-aqua, #E7F2F0); }
.nl-compact .nl-inner { max-width: var(--content-width, 1080px); margin: 0 auto; padding: 8px 24px 72px; }
.nl-compact .nl-panel {
  position: relative; display: grid; grid-template-columns: 290px minmax(0, 1fr); grid-template-areas: "art copy" "art form";
  column-gap: 56px; row-gap: 26px; align-items: start; padding: 60px 64px 60px 32px;
  border-radius: 32px; color: #F7F5F0; background: linear-gradient(135deg, #1B3733 0%, #24504B 100%);
  box-shadow: 0 26px 48px rgba(27, 55, 51, 0.26); overflow: visible;
}
.nl-compact .nl-panel::before { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(255, 217, 122, 0.4); border-radius: 22px; pointer-events: none; }
.nl-compact .nl-art { grid-area: art; position: relative; align-self: end; display: flex; justify-content: center; align-items: flex-end; min-height: 0; margin: 0 0 -60px; }
.nl-compact .nl-disc { left: 50%; bottom: 60px; width: 250px; background: radial-gradient(circle at 38% 30%, rgba(143, 205, 197, 0.55) 0%, rgba(63, 125, 118, 0.55) 58%, rgba(63, 125, 118, 0.18) 100%); box-shadow: inset 0 0 0 2px rgba(255, 217, 122, 0.6); }
.nl-compact .nl-cally { width: 270px; margin: 0; filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.35)); transform-origin: 50% 96%; }
.nl-compact .nl-copy { grid-area: copy; position: relative; z-index: 1; }
.nl-compact .nl-formcol { grid-area: form; position: relative; z-index: 1; }
.nl-compact .nl-kicker { margin: 0 0 14px; padding-bottom: 14px; position: relative; color: #FFD97A; }
.nl-compact .nl-kicker::after { content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 3px; border-radius: 2px; background: #D9A340; }
.nl-compact h2 { margin: 0 0 12px; font-size: clamp(1.875rem, 1.2rem + 2.2vw, 2.75rem); line-height: 1.12; color: #F7F5F0; }
.nl-compact .nl-lead { margin: 0; max-width: 34rem; font-size: 1.1875rem; color: #E6EFEC; }
.nl-compact .nl-embed { max-width: 36rem; }
.nl-compact .nl-embed .ml-form-embedWrapper { padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.nl-compact .nl-embed form { gap: 14px 14px; }
.nl-compact .nl-embed label { color: #F7F5F0; }
.nl-compact .nl-embed input[type="email"] { min-height: 60px; background: #FBF7EE; border-color: #FFD97A; color: #1B3733; }
.nl-compact .nl-embed .ml-form-embedSubmit button { min-height: 60px; padding: 0 30px; font-size: 1.0625rem; white-space: nowrap; }
.nl-compact .nl-embed input[type="email"]:focus-visible, .nl-compact .nl-embed button:focus-visible, .nl-compact .nl-embed a:focus-visible, .nl-compact .nl-embed h3:focus-visible { outline: 4px solid #FFD97A; outline-offset: 3px; box-shadow: 0 0 0 7px #1B3733; }
.nl-compact .nl-embed .ml-form-embedPermissionsContent p { font-size: 0.9375rem; line-height: 1.6; color: #E6EFEC; }
.nl-compact .nl-embed .ml-form-embedPermissionsContent a { color: #FFD97A; }
.nl-compact .nl-embed .ml-error label { color: #FFB4AE; }
.nl-compact .nl-embed.is-success .ml-form-embedWrapper { padding: 22px 24px; border: 2px solid rgba(255, 217, 122, 0.55); border-radius: 20px; background: rgba(255, 255, 255, 0.07); }
.nl-compact .nl-embed .ml-form-successContent h3 { color: #FFD97A; }
.nl-compact .nl-embed .ml-form-successContent p { color: #F7F5F0; }

@media (max-width: 900px) {
  .nl-compact .nl-panel { grid-template-columns: 220px minmax(0, 1fr); column-gap: 36px; padding: 48px 40px 48px 20px; }
  .nl-compact .nl-cally { width: 210px; }
  .nl-compact .nl-disc { width: 200px; }
  .nl-compact .nl-art { margin-bottom: -48px; }
}
@media (max-width: 720px) {
  .nl-compact .nl-inner { padding: 4px 16px 44px; }
  .nl-compact .nl-panel { grid-template-columns: minmax(0, 1fr) 124px; grid-template-areas: "copy art" "form form"; column-gap: 14px; row-gap: 18px; padding: 30px 20px 26px; border-radius: 26px; }
  .nl-compact .nl-panel::before { inset: 10px; border-radius: 18px; }
  .nl-compact .nl-art { align-self: end; margin: 0 -4px 0 0; }
  .nl-compact .nl-cally { width: 124px; }
  .nl-compact .nl-disc { width: 120px; bottom: 6px; }
  .nl-compact .nl-kicker { margin-bottom: 10px; padding-bottom: 10px; font-size: 0.6875rem; letter-spacing: 0.1em; white-space: nowrap; }
  .nl-compact h2 { font-size: 1.5rem; margin-bottom: 8px; }
  .nl-compact .nl-lead { font-size: 1rem; }
  .nl-compact .nl-embed .ml-form-embedSubmit button { width: 100%; }
}
@media (max-width: 360px) {
  .nl-compact .nl-panel { grid-template-columns: 1fr; grid-template-areas: "art" "copy" "form"; }
  .nl-compact .nl-art { justify-self: start; margin: 0; }
  .nl-compact .nl-cally { width: 96px; }
  .nl-compact .nl-disc { width: 92px; }
}
@media (forced-colors: active) {
  .nl-compact .nl-panel { background: Canvas; border: 2px solid CanvasText; }
  .nl-compact .nl-embed input[type="email"] { border-color: CanvasText; }
}
