/* =====================================================
   Limerick Press — email signup
   - Daily Email home tile (envelope badge fills tile)
   - Trigger Warnings home tile (red-accent like Back Story)
   - Signup modal (form / success / error views)
   - Capsule email pill (third pill alongside Rate + Share)
   ===================================================== */

/* ---- Daily Email tile (mirrors envelope badge) ---- */
.tile--email {
  background: #fff8e5;
  border-color: #ee0a14;
  color: var(--ink);
}
.tile--email::before {
  background:
    radial-gradient(60% 50% at 50% 10%, rgba(200, 22, 26, 0.16), transparent 70%),
    radial-gradient(60% 50% at 50% 100%, rgba(43, 39, 36, 0.10), transparent 70%);
}
.tile-label--email {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  container-type: inline-size;
  padding: 0.2rem 0.1rem;
}
.tile--email .mb-line {
  font-family: var(--font-serif, 'Fraunces', Georgia, serif);
  font-style: italic;
  font-weight: 800;
  color: #ee0a14;
  letter-spacing: -0.01em;
  line-height: 1.0;
  white-space: nowrap;
  font-size: clamp(0.92rem, 11cqi, 2.2rem);
}
.tile--email .mb-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.tile--email .mb-icon {
  display: block;
  width: clamp(80px, 70cqi, 220px);
  max-width: 100%;
}
.tile--email .mb-icon svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 6px rgba(43, 39, 36, 0.18));
}

/* ---- Trigger Warnings tile (red-accent, warning glyph) ---- */
.tile--triggers {
  background: #fff4d9;
  border-color: var(--accent, #ee0a14);
  color: var(--ink);
}
.tile--triggers::before {
  background:
    radial-gradient(60% 50% at 50% 10%, rgba(179, 38, 30, 0.18), transparent 70%),
    radial-gradient(60% 50% at 50% 100%, rgba(43, 39, 36, 0.10), transparent 70%);
}
.tile--triggers .tile-label {
  width: 100%;
  container-type: inline-size;
  align-items: center;
  text-align: center;
}
.tile--triggers .tile-icon--warn {
  color: #ee0a14;
  width: clamp(54px, 22cqi, 90px);
  height: clamp(54px, 22cqi, 90px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.35rem;
  filter: drop-shadow(0 2px 4px rgba(179, 38, 30, 0.18));
}
.tile--triggers .tile-title--backstory {
  font-size: clamp(0.7rem, 10.5cqi, 3rem);
  color: var(--ink);
}

/* ---- Grid layout adjustments for 7 tiles total ----
   Existing rule locked DIY to grid-column:3 / row:2. With seven tiles
   we want a natural flow on desktop:
     Row 1: [Hero (span 2) — Back Story]
     Row 2: [DIY — Shop — Dumb Daddy]
     Row 3: [Daily Email — Trigger Warnings — (empty)]
   Letting the new tiles flow naturally keeps everything balanced.
   On mobile (≤540px) the wide tile spans both cols then 6 small tiles
   stack into 3 rows of 2 automatically. */
@media (min-width: 541px) {
  /* Keep the original DIY placement at desktop sizes only. */
  .tile--post-right { grid-column: 3; grid-row: 2; }
}

/* ---- Signup modal ---- */
.signup-modal[hidden] { display: none !important; }
.signup-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2rem);
}
.signup-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(43, 39, 36, 0.55);
  backdrop-filter: blur(2px);
}
.signup-modal__panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: #fffaee;
  border: 1.5px solid #2b2724;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(43, 39, 36, 0.35);
  padding: clamp(1.5rem, 5vw, 2.25rem);
  font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
}
.signup-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  line-height: 0;
  border-radius: 8px;
}
.signup-modal__close:hover { background: rgba(43, 39, 36, 0.08); }
/* Screen-reader-only helper for keeping the modal’s accessible title without
   rendering it visually. */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden; white-space: nowrap;
}

.signup-modal__mark {
  text-align: center;
  margin: 0 0 0.9rem;
}
/* Envelope fills nearly the full panel width so “FREE” reads as a big,
   confident mark. The SVG keeps its aspect ratio via preserveAspectRatio. */
.signup-modal__envelope {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 0 auto;
}
.signup-modal__title { /* repurposed as sr-only above when .sr-only is applied */ }
.signup-modal__sub {
  /* Left-aligned text inside a block that is centered under the envelope.
     Block is sized to roughly match the envelope width so it reads as a
     deliberate copy block, not full-bleed body text. */
  margin: 0 auto 1.4rem;
  width: fit-content;
  max-width: 100%;
  font-family: var(--font-serif, 'Fraunces', Georgia, serif);
  font-weight: 500;
  font-size: clamp(1.05rem, 4.4vw, 1.35rem);
  line-height: 1.32;
  color: var(--ink, #2b2724);
  text-align: left;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.signup-form { display: flex; flex-direction: column; gap: 0.7rem; }
.signup-form__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft, #5a544c);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.signup-form input[type="email"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid #2b2724;
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink, #2b2724);
}
.signup-form input[type="email"]:focus {
  outline: 2px solid #ee0a14;
  outline-offset: 1px;
}
.signup-form__btn {
  display: inline-block;
  padding: 0.95rem 1.2rem;
  background: #24b400;
  color: #fff;
  border: 1.5px solid #2b2724;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.signup-form__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(200, 22, 26, 0.35);
}
.signup-form__btn--ghost {
  background: #fff;
  color: var(--ink, #2b2724);
  margin-top: 1rem;
}
.signup-form__btn--ghost:hover {
  background: #f5ecd6;
  box-shadow: 0 4px 12px rgba(43, 39, 36, 0.18);
}
.signup-form__legal {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-soft, #5a544c);
  text-align: center;
  line-height: 1.4;
}

.signup-success__mark { text-align: center; margin-bottom: 0.6rem; }
.signup-success__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif, 'Fraunces', Georgia, serif);
  font-weight: 800;
  font-size: 1.4rem;
  text-align: center;
  color: var(--ink, #2b2724);
}
.signup-success__body, .signup-success__hint {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink, #2b2724);
  text-align: center;
}
.signup-success__hint { color: var(--ink-soft, #5a544c); font-size: 0.86rem; }

.signup-error {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  background: #fdecea;
  border: 1px solid #ee0a14;
  border-radius: 8px;
  color: #8b1a13;
  text-align: center;
  font-size: 0.95rem;
}

/* ---- Capsule email pill (sits inline with Rate / Share / Footnotes) ---- */
.lw-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: #fff;
  border: 1px solid #ee0a14;
  border-radius: 999px;
  color: #ee0a14;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(0.78rem, 2.1vw, 0.9rem);
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}
.lw-email-btn:hover,
.lw-email-btn:focus-visible {
  background: #ee0a14;
  color: #fff;
  outline: none;
  transform: translateY(-1px);
}
.lw-email-icon { display: inline-flex; line-height: 0; }
.lw-email-icon svg { display: block; }
.lw-email-label { white-space: nowrap; }

/* Email pill label — sized identically to Rate/Share/Footnotes so all four
   pills share the same row. No row-break needed anymore. */
.lw-email-label { font-weight: 600; letter-spacing: 0.04em; }
.lw-row-break {
  /* Legacy: kept but zero-impact if no rowBreak element is injected. */
  flex-basis: 100%;
  width: 100%;
  height: 0;
  margin: 0;
}

/* Audio-soon bar always drops to its own line beneath the pill cluster so
   pills (Rate / Email / Share) read as a single group above. */
.lw-rate-row .audio-soon {
  flex-basis: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 0.25rem;
}
