/**
 * Endure Weekly — newsletter capture for runbikecalc
 * Editorial cream + oxblood palette to match site identity
 * Three placements:
 *   1) .ew-footer  — block injected into <footer> on every page
 *   2) .ew-sticky  — dismissable sticky bar at bottom of viewport
 *   3) .ew-inline  — inline CTA usable inside articles/calculators
 */

/* ============ Footer block (sits above <footer> sitewide) ============ */
.ew-footer {
  background: #FAF8F5;
  border-top: 1px solid rgba(26, 26, 26, 0.08);
  border-bottom: 1px solid rgba(26, 26, 26, 0.08);
  padding: 4rem 1.5rem;
  margin: 0;
  color: #1A1A1A;
  text-align: center;
  position: relative;
  width: 100%;
}
.ew-footer > * {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.ew-footer form { max-width: 460px; }
.ew-footer::before {
  content: '';
  display: block;
  width: 56px;
  height: 1px;
  background: #7C2D3A;
  margin: 0 auto 1.25rem;
}
.ew-footer .ew-eyebrow {
  display: inline-block;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  font-weight: 600;
  color: #7C2D3A;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.ew-footer .ew-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0 0 0.4rem;
  line-height: 1.05;
}
.ew-footer .ew-tagline {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  color: #7C2D3A;
  margin: 0 0 1.1rem;
  font-weight: 400;
}
.ew-footer .ew-sub {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #444;
  max-width: 520px;
  margin: 0 auto 1.5rem;
}
.ew-footer form {
  display: flex;
  gap: 0.5rem;
  max-width: 460px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}
.ew-footer input[type="email"] {
  flex: 1 1 240px;
  min-width: 0;
  padding: 0.85rem 1rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  background: #fff;
  color: #1A1A1A;
  border: 1px solid rgba(26, 26, 26, 0.18);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ew-footer input[type="email"]:focus {
  border-color: #7C2D3A;
  box-shadow: 0 0 0 3px rgba(124, 45, 58, 0.15);
}
.ew-footer button[type="submit"] {
  padding: 0.85rem 1.5rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #1A1A1A;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s;
}
.ew-footer button[type="submit"]:hover:not(:disabled) {
  background: #7C2D3A;
}
.ew-footer button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.ew-footer .ew-trust {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.78rem;
  color: rgba(26, 26, 26, 0.55);
  margin: 1.1rem 0 0;
  font-style: italic;
}

/* ============ Sticky bottom bar ============ */
.ew-sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: #1A1A1A;
  color: #fff;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.18);
  font-family: 'Source Sans 3', sans-serif;
  animation: ew-slide-up 0.4s ease-out;
}
@keyframes ew-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.ew-sticky .ew-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  color: #C67B4E;
}
.ew-sticky .ew-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.ew-sticky .ew-copy strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0;
}
.ew-sticky .ew-copy span {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.3;
}
.ew-sticky form {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.ew-sticky input[type="email"] {
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  outline: none;
  width: 220px;
  font-family: 'Source Sans 3', sans-serif;
  transition: border-color 0.15s, background-color 0.15s;
}
.ew-sticky input[type="email"]::placeholder { color: rgba(255, 255, 255, 0.4); }
.ew-sticky input[type="email"]:focus {
  border-color: #C67B4E;
  background: rgba(255, 255, 255, 0.1);
}
.ew-sticky button[type="submit"] {
  padding: 0.55rem 1.1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #C67B4E;
  color: #1A1A1A;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.15s;
  white-space: nowrap;
  font-family: 'Source Sans 3', sans-serif;
}
.ew-sticky button[type="submit"]:hover:not(:disabled) { background: #d68a5d; }
.ew-sticky .ew-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  flex-shrink: 0;
  transition: color 0.15s;
  font-family: inherit;
}
.ew-sticky .ew-close:hover { color: #fff; }

/* ============ Inline CTA (use inside articles) ============ */
.ew-inline {
  background: linear-gradient(180deg, #FAF8F5, #fff);
  border-left: 3px solid #7C2D3A;
  padding: 1.5rem 1.5rem 1.4rem;
  margin: 2rem 0;
  border-radius: 0 4px 4px 0;
}
.ew-inline .ew-eyebrow {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7C2D3A;
  font-weight: 600;
  display: block;
  margin-bottom: 0.4rem;
}
.ew-inline .ew-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0 0 0.4rem;
  line-height: 1.15;
}
.ew-inline .ew-sub {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #444;
  margin: 0 0 1rem;
}
.ew-inline form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ew-inline input[type="email"] {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.7rem 0.95rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.92rem;
  background: #fff;
  color: #1A1A1A;
  border: 1px solid rgba(26, 26, 26, 0.18);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ew-inline input[type="email"]:focus {
  border-color: #7C2D3A;
  box-shadow: 0 0 0 3px rgba(124, 45, 58, 0.15);
}
.ew-inline button[type="submit"] {
  padding: 0.7rem 1.3rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #1A1A1A;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s;
}
.ew-inline button[type="submit"]:hover:not(:disabled) { background: #7C2D3A; }

/* ============ Mobile ============ */
@media (max-width: 720px) {
  .ew-footer {
    padding: 2rem 1.25rem;
  }
  .ew-footer .ew-headline {
    font-size: 1.85rem;
  }
  .ew-sticky {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }
  .ew-sticky .ew-icon { display: none; }
  .ew-sticky .ew-copy { flex: 1 1 100%; margin-bottom: 0.5rem; }
  .ew-sticky form { flex: 1 1 100%; }
  .ew-sticky input[type="email"] { flex: 1; width: auto; }
  .ew-sticky .ew-close {
    position: absolute;
    top: 0.4rem;
    right: 0.6rem;
  }
}
