/* ============================================================================
   Campaign — the colourful, gently pulsing call to action (block + modal).
   Shipped ONLY to a site whose record has a campaign. Its palette is fixed and
   deliberately louder than any template's: a registration window is the one
   thing on the page that must not be missed. All motion stops under
   prefers-reduced-motion.
   ========================================================================= */
:root {
  --cb-1: #f2b705;   /* gold   */
  --cb-2: #ff5a36;   /* coral  */
  --cb-3: #e3197b;   /* magenta */
  --cb-4: #12a150;   /* green  */
  --cb-ink: #10141a;
}
@property --cb-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

/* ---- the block beside a collection page's heading ------------------------- */
.head-with-campaign { display: grid; gap: clamp(1.25rem, 3vw, 2.5rem); align-items: center; margin-bottom: var(--s-4, 2rem); }
.head-with-campaign .section-head { margin-bottom: 0; }
@media (min-width: 960px) { .head-with-campaign { grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); } }

.campaign-block {
  --cb-angle: 0deg;
  position: relative; isolation: isolate; border-radius: 22px; padding: 4px;
  background: conic-gradient(from var(--cb-angle), var(--cb-1), var(--cb-2), var(--cb-3), var(--cb-4), var(--cb-1));
  box-shadow: 0 18px 50px rgb(255 90 54 / .28), 0 6px 18px rgb(18 161 80 / .18);
  animation: cb-spin 5s linear infinite, cb-glow 2.2s ease-in-out infinite;
}
.cb-ring {           /* a second, blurred ring behind — the glow that "breathes" */
  position: absolute; inset: -6px; z-index: -1; border-radius: 26px; filter: blur(14px); opacity: .55;
  background: conic-gradient(from var(--cb-angle), var(--cb-1), var(--cb-2), var(--cb-3), var(--cb-4), var(--cb-1));
  animation: cb-spin 5s linear infinite;
}
.cb-inner {
  border-radius: 18px; padding: clamp(1.1rem, 2vw, 1.5rem); color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, rgb(255 90 54 / .35), transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgb(18 161 80 / .4), transparent 60%),
    linear-gradient(150deg, #111a2e, #0c1220);
}
.cb-kicker { display: flex; align-items: center; gap: .55rem; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--cb-1); margin: 0 0 .5rem; }
.cb-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cb-2); flex: none; box-shadow: 0 0 0 0 rgb(255 90 54 / .7); animation: cb-ping 1.4s ease-out infinite; }
[data-phase="open"] .cb-dot { background: #2ee07a; animation-name: cb-ping-green; }
.cb-title { font-size: clamp(1.35rem, 1.05rem + 1vw, 1.75rem); font-weight: 900; line-height: 1.1; letter-spacing: -.02em; margin: 0 0 .9rem; color: #fff; }
.cb-dates { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 0 0 1rem; }
.cb-dates div { background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .14); border-radius: 12px; padding: .6rem .7rem; }
.cb-dates dt { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: rgb(255 255 255 / .65); }
.cb-dates dd { margin: .2rem 0 0; font-weight: 800; font-size: 14px; line-height: 1.25; color: #fff; }
.cb-btn {
  display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 52px; padding: .8rem 1.1rem;
  border-radius: 999px; font-weight: 900; font-size: 16px; text-decoration: none; color: var(--cb-ink);
  background: linear-gradient(90deg, var(--cb-1), #ffd23f 45%, var(--cb-1)); background-size: 200% 100%;
  box-shadow: 0 10px 28px rgb(242 183 5 / .45); animation: cb-shine 2.6s ease-in-out infinite;
  transition: transform .18s ease;
}
.cb-btn:hover { transform: translateY(-2px) scale(1.01); color: var(--cb-ink); }
.cb-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.cb-btn .i { width: 18px; height: 18px; }
.cb-count { margin: .7rem 0 0; font-size: 13px; font-weight: 700; color: rgb(255 255 255 / .82); text-align: center; min-height: 1em; }

@keyframes cb-spin { to { --cb-angle: 360deg; } }
@keyframes cb-glow { 0%, 100% { box-shadow: 0 18px 50px rgb(255 90 54 / .22), 0 6px 18px rgb(18 161 80 / .15); } 50% { box-shadow: 0 22px 64px rgb(227 25 123 / .42), 0 8px 24px rgb(242 183 5 / .35); } }
@keyframes cb-ping { 0% { box-shadow: 0 0 0 0 rgb(255 90 54 / .75); } 80%, 100% { box-shadow: 0 0 0 12px rgb(255 90 54 / 0); } }
@keyframes cb-ping-green { 0% { box-shadow: 0 0 0 0 rgb(46 224 122 / .75); } 80%, 100% { box-shadow: 0 0 0 12px rgb(46 224 122 / 0); } }
@keyframes cb-shine { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }

/* ---- the home-page modal --------------------------------------------------- */
.campaign-modal {
  /* base.css resets every margin to 0, which removes the browser's own centring of a modal dialog. */
  margin: auto; inset: 0;
  width: min(760px, calc(100vw - 1.5rem)); max-height: min(92vh, 900px); padding: 0; border: 0; border-radius: 24px;
  overflow: hidden; color: var(--cb-ink); background: #fff; box-shadow: 0 40px 120px rgb(0 0 0 / .45);
}
.campaign-modal[open] { display: flex; flex-direction: column; animation: cm-in .35s cubic-bezier(.2,.8,.2,1); }
.campaign-modal::backdrop { background: rgb(8 12 20 / .62); backdrop-filter: blur(4px); }
.cm-close-form { position: absolute; top: .8rem; right: .8rem; z-index: 2; margin: 0; }
.cm-x { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: rgb(255 255 255 / .16); color: #fff; }
.cm-x:hover { background: rgb(255 255 255 / .3); }
.cm-x .i { width: 20px; height: 20px; }
.cm-head {
  position: relative; padding: clamp(1.4rem, 3vw, 2rem) clamp(1.25rem, 3vw, 2rem) 1.25rem; color: #fff; flex: none;
  background:
    radial-gradient(110% 120% at 100% 0%, rgb(227 25 123 / .55), transparent 55%),
    radial-gradient(90% 100% at 0% 100%, rgb(18 161 80 / .6), transparent 60%),
    linear-gradient(135deg, #ff5a36, #f2b705 120%);
}
.cm-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--cb-1), var(--cb-2), var(--cb-3), var(--cb-4)); }
.cm-kicker { display: inline-flex; align-items: center; gap: .55rem; font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; background: rgb(0 0 0 / .22); padding: .35rem .75rem; border-radius: 999px; margin: 0 0 .8rem; }
.campaign-modal h2 { color: #fff; font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); line-height: 1.05; letter-spacing: -.02em; font-weight: 900; margin: 0 0 .5rem; padding-right: 2.5rem; }
.cm-text { margin: 0 0 1rem; font-size: 15.5px; font-weight: 600; color: rgb(255 255 255 / .95); max-width: 52ch; }
.cm-dates { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 0; }
.cm-dates div { background: rgb(0 0 0 / .2); border: 1px solid rgb(255 255 255 / .25); border-radius: 14px; padding: .7rem .85rem; }
.cm-dates dt { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: rgb(255 255 255 / .85); }
.cm-dates dd { margin: .25rem 0 0; font-size: clamp(15px, 1.4vw, 18px); font-weight: 900; color: #fff; }
.cm-count { color: #fff; text-align: left; }
.cm-body { overflow-y: auto; padding: 1.25rem clamp(1.25rem, 3vw, 2rem); flex: 1 1 auto; }
.cm-note { display: flex; gap: .6rem; align-items: flex-start; margin: 0 0 1.1rem; padding: .8rem 1rem; border-radius: 12px; background: #fff7e0; color: #5b4500; font-size: 14px; font-weight: 600; line-height: 1.5; }
.cm-note .i { width: 18px; height: 18px; flex: none; margin-top: .1rem; color: #c48a00; }
.cm-cols { display: grid; gap: 1.1rem; }
@media (min-width: 680px) { .cm-cols { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.cm-cols h3 { font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--cb-2); margin: 0 0 .6rem; }
.cm-cols section:nth-child(2) h3 { color: var(--cb-4); }
.cm-cols section:nth-child(3) h3 { color: var(--cb-3); }
.cm-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.cm-cols li { display: grid; grid-template-columns: 18px 1fr; gap: .5rem; font-size: 14.5px; line-height: 1.45; color: #2b3340; }
.cm-cols li .i { width: 16px; height: 16px; margin-top: .15rem; color: var(--cb-4); }
.cm-foot { flex: none; padding: 1rem clamp(1.25rem, 3vw, 2rem) 1.25rem; border-top: 1px solid #eceef2; display: grid; gap: .5rem; grid-template-columns: 1fr auto; align-items: center; }
.cm-foot form { margin: 0; }
.cm-later { border: 0; background: transparent; font-weight: 700; color: #5b6472; padding: .8rem 1rem; cursor: pointer; border-radius: 999px; }
.cm-later:hover { background: #f1f3f6; }
.cm-small { grid-column: 1 / -1; margin: .2rem 0 0; font-size: 12.5px; color: #6b7480; }
@media (max-width: 520px) { .cm-foot { grid-template-columns: 1fr; } .cm-later { width: 100%; } .cm-dates, .cb-dates { grid-template-columns: 1fr; } }
@keyframes cm-in { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

/* the notice strip's optional link */
.alert-strip .alert-link { display: inline-flex; align-items: center; gap: .3rem; margin-left: .35rem; white-space: nowrap; }
.alert-strip .alert-link .i { width: 15px; height: 15px; }

@media (prefers-reduced-motion: reduce) {
  .campaign-block, .cb-ring, .cb-dot, .cb-btn, .campaign-modal[open] { animation: none !important; }
}
@media print { .campaign-modal, .campaign-block { display: none !important; } }
