/* Subscribe popup. Change the colours here to match the site. */
:root {
  --sp-accent: #2f5d50;
  --sp-accent-dark: #234539;
  --sp-cream: #f6f1e7;
  --sp-ink: #1f2a27;
  --sp-muted: #5d6b66;
  --sp-radius: 14px;z
}

html.sp-lock, html.sp-lock body { overflow: hidden; }

.sp-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(20, 28, 25, 0);
  transition: background .25s ease;
}
.sp-overlay[hidden] { display: none; }
.sp-overlay.is-open { background: rgba(20, 28, 25, .6); }

.sp-dialog {
  position: relative; width: 100%;
  max-height: 92vh; max-height: 92dvh; overflow-y: auto;
  background: #fff; color: var(--sp-ink);
  border-radius: var(--sp-radius) var(--sp-radius) 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,.25);
  transform: translateY(100%);
  transition: transform .3s ease;
  font-family: inherit; line-height: 1.5;
  -webkit-overflow-scrolling: touch;
}
.sp-overlay.is-open .sp-dialog { transform: translateY(0); }

.sp-side { display: none; }
.sp-main { padding: 28px 22px calc(24px + env(safe-area-inset-bottom, 0px)); }

.sp-close {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: var(--sp-muted);
  font-size: 30px; line-height: 1; cursor: pointer;
}
.sp-close:hover, .sp-close:focus-visible { background: rgba(0,0,0,.07); color: var(--sp-ink); }

.sp-eyebrow { margin: 0 0 6px; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--sp-accent); font-weight: 700; }
.sp-title   { margin: 0 0 10px; font-size: 1.5rem; line-height: 1.2; padding-right: 36px; }
.sp-text    { margin: 0 0 18px; color: var(--sp-muted); font-size: 1rem; }

.sp-form { display: grid; gap: 10px; }
.sp-input {
  width: 100%; box-sizing: border-box; padding: 14px 14px;
  font-size: 16px; /* 16px stops iOS from zooming in */
  border: 1.5px solid #c9d1cd; border-radius: 8px; background: #fff; color: var(--sp-ink);
}
.sp-input:focus { outline: 3px solid rgba(47,93,80,.25); border-color: var(--sp-accent); }

.sp-btn {
  display: block; width: 100%; box-sizing: border-box; padding: 14px 18px;
  border: 0; border-radius: 8px; background: var(--sp-accent); color: #fff;
  font-size: 1rem; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer;
}
.sp-btn:hover, .sp-btn:focus-visible { background: var(--sp-accent-dark); }
.sp-btn[disabled] { opacity: .65; cursor: wait; }

.sp-skip { display: block; margin: 12px auto 0; padding: 8px; border: 0; background: none; color: var(--sp-muted); font-size: .9rem; text-decoration: underline; cursor: pointer; }
.sp-fine { margin: 8px 0 0; text-align: center; font-size: .78rem; color: var(--sp-muted); }
.sp-fine a { color: inherit; }
.sp-error { margin: 0; color: #b3261e; font-size: .9rem; }

.sp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sp-success[hidden], [data-sp-form-view][hidden] { display: none; }

/* Tablet and desktop: centred two-column modal */
@media (min-width: 720px) {
  .sp-overlay { align-items: center; padding: 24px; }
  .sp-dialog {
    max-width: 780px; display: grid; grid-template-columns: 5fr 7fr;
    border-radius: var(--sp-radius); box-shadow: 0 20px 60px rgba(0,0,0,.35);
    transform: translateY(16px) scale(.97); opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
  }
  .sp-overlay.is-open .sp-dialog { transform: none; opacity: 1; }
  .sp-side {
    display: flex; flex-direction: column; justify-content: center;
    padding: 36px 28px; background: var(--sp-accent); color: var(--sp-cream);
    border-radius: var(--sp-radius) 0 0 var(--sp-radius);
  }
  .sp-side-kicker { margin: 0 0 8px; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
  .sp-side-title  { margin: 0 0 18px; font-size: 1.8rem; line-height: 1.1; font-weight: 700; }
  .sp-side-list   { margin: 0; padding: 0; list-style: none; font-size: .95rem; }
  .sp-side-list li { padding: 6px 0 6px 24px; position: relative; }
  .sp-side-list li::before { content: "\2713"; position: absolute; left: 0; font-weight: 700; }
  .sp-main { padding: 40px 36px 28px; align-self: center; }
  .sp-title { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sp-overlay, .sp-dialog { transition: none; }
}

.sp-input,
.sp-btn,
.sp-skip,
.sp-close {
  font-family: inherit;
}
