/* ============================================================
   DEMOS — Web share page
   The page a user lands on (from email or the in-app browser) to
   save ready-to-post carousel images. Reuses the carousel frame
   engine (carousel.css + frames.js); adds: a SQUARE ratio mode,
   the page chrome, the copyable links + caption, and the gallery
   of rasterised, downloadable image cards.
   Depends on tokens.css → demos-preview-v2.css → carousel.css.
   ============================================================ */

/* ---- restore the few frame sizes we de-inlined in frames.js so
        SQUARE mode can override them by class, not !important ---- */
.ctitle--pet  { font-size: 74px; }
.cdisplay--sm { font-size: 82px; }

/* ============================================================
   SQUARE MODE  (1080 × 1080) — same content, tightened rhythm
   Portrait stays the default in carousel.css; .square trims the
   biggest type + vertical gaps so the slot still breathes at 4:5→1:1.
   ============================================================ */
.cframe.square { height: 1080px; }
.cframe.square .cpad { inset: 78px; }

.cframe.square .cnumber       { font-size: 168px; }
.cframe.square .cnumber.sm    { font-size: 116px; }
.cframe.square .ctitle        { font-size: 68px; }
.cframe.square .ctitle--pet   { font-size: 60px; }
.cframe.square .cdisplay      { font-size: 72px; }
.cframe.square .cdisplay--sm  { font-size: 64px; }
.cframe.square .cheadline     { font-size: 50px; }
.cframe.square .clead         { font-size: 50px; line-height: 1.24; }
.cframe.square .cbody         { font-size: 32px; }
.cframe.square .ceyebrow      { font-size: 22px; }

.cframe.square .s44 { height: 32px; }
.cframe.square .s40 { height: 28px; }
.cframe.square .s28 { height: 20px; }

/* debate — one side per frame */
.cframe.square .cside__list--solo      { gap: 34px; }
.cframe.square .cside__list--solo li   { font-size: 40px; padding-left: 44px; }
.cframe.square .cside__list--solo li::before { width: 15px; height: 15px; top: 19px; }
.cframe.square .cdbadge                { font-size: 30px; }

/* stepper */
.cframe.square .cstep        { min-height: 104px; }
.cframe.square .cstep__label { font-size: 36px; }
.cframe.square .cstep__date  { font-size: 23px; }
.cframe.square .cstep__body  { padding-bottom: 16px; }
.cframe.square .cstep__node  { width: 40px; height: 40px; flex-basis: 40px; }
.cframe.square .cstep.current .cstep__node { width: 48px; height: 48px; flex-basis: 48px; }

/* petition "where it stands" */
.cframe.square .csig__count   { font-size: 150px; }
.cframe.square .csig__label   { font-size: 38px; }
.cframe.square .cspark svg    { height: 290px; }
.cframe.square .csig__deadline { font-size: 32px; }
.cframe.square .cdeadline-tag { font-size: 28px; }

/* ============================================================
   PAGE CHROME
   ============================================================ */
html { scroll-behavior: smooth; }
body.sharepage {
  margin: 0;
  background:
    radial-gradient(1200px 480px at 50% -160px, var(--color-sage-pale), transparent 70%),
    var(--color-base);
  color: var(--color-charcoal);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01";
}
.wrap { width: min(1120px, 100% - 40px); margin: 0 auto; }
@media (max-width: 560px){ .wrap { width: 100% - 32px; width: calc(100% - 32px); } }

/* ---- header ------------------------------------------------ */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,250,250,0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--color-forest-pale);
}
.site-head__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.site-head__brand { display: flex; align-items: center; text-decoration: none; }
.site-head__brand img { height: 28px; display: block; }
.site-head__right { display: flex; align-items: center; gap: 18px; }
.site-head__back {
  font-size: 13.5px; font-weight: 600; color: var(--color-forest);
  text-decoration: none; display: inline-flex; align-items: center; white-space: nowrap;
}
.site-head__back::before { content: "\2190"; margin-right: 7px; color: var(--color-sage); font-weight: 700; }
.site-head__back:hover { color: var(--color-forest-light); }
@media (max-width: 460px){ .site-head__back { display: none; } }
.langtoggle { display: inline-flex; align-items: center; gap: 3px; }
.langtoggle button {
  appearance: none; cursor: pointer; border: none; background: transparent;
  font-family: var(--font-sans); font-weight: 700; font-size: 13px;
  color: var(--color-sage); padding: 4px 5px; border-radius: 6px; letter-spacing: 0.02em;
  transition: color var(--dur-base) var(--ease-out);
}
.langtoggle button.active { color: var(--color-forest); text-decoration: underline; text-underline-offset: 3px; }
.langtoggle button:hover { color: var(--color-forest-light); }
.langtoggle__sep { color: var(--color-sage-light); font-size: 12px; }

/* ---- hero -------------------------------------------------- */
.hero { padding: 52px 0 12px; }
.hero__eyebrow {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--color-maple); margin: 0 0 18px;
  display: flex; align-items: center; gap: 12px;
}
.hero__eyebrow .cat { display: inline-flex; align-items: center; gap: 8px; }
.hero__eyebrow .cat::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.hero__idrow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.idtag {
  font-family: var(--font-mono); font-size: 15px; font-weight: 500;
  color: var(--color-forest); background: var(--color-white);
  border: 1px solid var(--color-forest-pale); border-radius: 999px;
  padding: 7px 16px; letter-spacing: 0.01em; white-space: nowrap;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 58px); font-weight: 800; letter-spacing: -0.025em;
  line-height: 1.04; color: var(--color-forest); margin: 0; max-width: 18ch;
  text-wrap: balance;
}
.hero__sub {
  font-size: clamp(16px, 2.4vw, 20px); line-height: 1.55; color: var(--color-warm-gray);
  max-width: 60ch; margin: 20px 0 0; text-wrap: pretty;
}
.hero__sub b { color: var(--color-charcoal); font-weight: 600; }

/* status chip echoed in the page (uses frame .cchip but smaller) */
.pagechip {
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
  font-size: 14px; font-weight: 600; padding: 7px 16px 7px 13px; border-radius: 999px;
}
.pagechip .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.pagechip.assent  { background: #E4F0E9; color: var(--color-success); }
.pagechip.assent .dot { background: var(--color-success); }
.pagechip.open    { background: var(--color-sage-pale); color: var(--color-forest-light); }
.pagechip.open .dot { background: var(--color-sage); }
.pagechip.progress{ background: var(--forest-50); color: var(--color-forest-light); }
.pagechip.progress .dot { background: var(--color-sage-light); }
.pagechip.closed  { background: #F3F4F6; color: var(--color-warm-gray); }
.pagechip.closed .dot { background: var(--color-warm-gray); }

/* ---- controls rail ---------------------------------------- */
.controls {
  position: sticky; top: 59px; z-index: 40; margin-top: 26px;
  background: rgba(250,250,250,0.82);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-top: 1px solid var(--color-forest-pale);
  border-bottom: 1px solid var(--color-forest-pale);
}
.controls__in {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 13px 0;
}
@media (max-width: 560px){ .controls__in { gap: 10px; } }
.controls__label { font-size: 13px; font-weight: 600; color: var(--color-warm-gray); }
.controls__divider { width: 1px; height: 22px; background: var(--color-forest-pale); }
.seg {
  display: inline-flex; background: var(--color-sage-pale);
  border: 1px solid var(--color-forest-pale); border-radius: 12px; padding: 4px; gap: 3px;
}
.seg button {
  appearance: none; cursor: pointer; border: none; background: transparent;
  font-family: var(--font-sans); font-weight: 600; font-size: 14px;
  color: var(--color-warm-gray); padding: 9px 18px; border-radius: 9px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.seg button svg { width: 16px; height: 16px; }
.seg button.active { background: var(--color-forest); color: #fff; box-shadow: var(--shadow-xs); }
.controls__spacer { flex: 1 1 auto; }
.controls__count { font-family: var(--font-mono); font-size: 13px; color: var(--color-sage); }

.btn-save-all {
  appearance: none; cursor: pointer; font-family: var(--font-sans);
  font-weight: 600; font-size: 13.5px; color: var(--color-forest);
  background: var(--color-white); border: 1px solid var(--color-forest-pale);
  border-radius: 11px; padding: 9px 16px; display: inline-flex; align-items: center; gap: 8px;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.btn-save-all svg { width: 16px; height: 16px; }
.btn-save-all .lbl { white-space: nowrap; }
.btn-save-all:hover { background: var(--color-sage-pale); border-color: var(--color-sage-light); }
.btn-save-all:disabled { opacity: 0.5; cursor: default; }

/* ============================================================
   LINKS + CAPTION  (paste-along kit)
   ============================================================ */
.kit { margin: 40px 0 8px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 20px; }
@media (max-width: 820px){ .kit { grid-template-columns: 1fr; } }
.panel {
  background: var(--color-white); border: 1px solid var(--color-forest-pale);
  border-radius: var(--radius-2xl); box-shadow: var(--shadow-sm); padding: 24px 24px 26px;
}
.panel__lbl {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-sage); margin: 0 0 4px;
}
.panel__hint { font-size: 13.5px; color: var(--color-warm-gray); margin: 0 0 18px; line-height: 1.5; }

.linkrow {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-top: 1px dashed var(--color-forest-pale);
}
.linkrow:first-of-type { border-top: none; }
.linkrow__ico {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-sage-pale); color: var(--color-forest);
}
.linkrow__ico.maple { background: var(--maple-100); color: var(--color-maple); }
.linkrow__ico svg { width: 19px; height: 19px; }
.linkrow__main { min-width: 0; flex: 1 1 auto; }
.linkrow__name { display: block; font-size: 13px; font-weight: 700; color: var(--color-forest); margin-bottom: 2px; }
.linkrow__url {
  display: block;
  font-family: var(--font-mono); font-size: 13px; color: var(--color-warm-gray);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.copybtn {
  appearance: none; cursor: pointer; flex: 0 0 auto;
  font-family: var(--font-sans); font-weight: 600; font-size: 12.5px; color: var(--color-forest);
  background: transparent; border: 1px solid var(--color-forest-pale); border-radius: 9px;
  padding: 8px 13px; display: inline-flex; align-items: center; gap: 7px;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.copybtn svg { width: 14px; height: 14px; }
.copybtn { white-space: nowrap; }
.copybtn:hover { background: var(--color-sage-pale); }
.copybtn.copied { background: #E4F0E9; border-color: #CFE4D7; color: var(--color-success); }

.caption-wrap { display: flex; flex-direction: column; }
.caption-text {
  font-size: 14.5px; line-height: 1.6; color: var(--color-charcoal);
  background: var(--color-base); border: 1px solid var(--color-forest-pale);
  border-radius: var(--radius-lg); padding: 16px 17px; margin: 0 0 16px; text-wrap: pretty;
  flex: 1 1 auto;
}
.caption-text .link { color: var(--color-forest); font-weight: 600; word-break: break-all; }
.btn-copy-caption {
  appearance: none; cursor: pointer; align-self: flex-start; white-space: nowrap;
  font-family: var(--font-sans); font-weight: 700; font-size: 14px; color: #fff;
  background: var(--color-forest); border: none; border-radius: 11px;
  padding: 12px 20px; display: inline-flex; align-items: center; gap: 9px;
  transition: background var(--dur-base) var(--ease-out);
}
.btn-copy-caption svg { width: 16px; height: 16px; }
.btn-copy-caption:hover { background: var(--color-forest-light); }
.btn-copy-caption.copied { background: var(--color-success); }

/* ============================================================
   DEBATE CUSTOMISE  (bills only) — optional, collapsible
   ============================================================ */
.customize { margin: 34px 0 0; }
.customize__bar {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--color-white); border: 1px solid var(--color-forest-pale);
  border-radius: var(--radius-xl); padding: 15px 18px; cursor: pointer;
  appearance: none; font-family: var(--font-sans); text-align: left;
  transition: border-color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.customize__bar:hover { border-color: var(--color-sage-light); }
.customize__bar .ic { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 9px; background: var(--color-sage-pale); color: var(--color-forest); display: flex; align-items: center; justify-content: center; }
.customize__bar .ic svg { width: 19px; height: 19px; }
.customize__bar .t { flex: 1 1 auto; }
.customize__bar .t b { display: block; font-size: 15px; font-weight: 700; color: var(--color-forest); }
.customize__bar .t span { font-size: 13px; color: var(--color-warm-gray); }
.customize__bar .chev { color: var(--color-sage); transition: transform var(--dur-base) var(--ease-out); }
.customize__bar .chev svg { width: 20px; height: 20px; display: block; }
.customize.open .customize__bar .chev { transform: rotate(180deg); }
.customize__body {
  display: none; padding: 8px 4px 4px;
}
.customize.open .customize__body { display: block; }
.customize__group { margin-top: 16px; }
.customize__grouplbl { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 10px; }
.customize__grouplbl.for { color: var(--color-success); }
.customize__grouplbl.against { color: var(--color-warm-gray); }
.picks2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px){ .picks2 { grid-template-columns: 1fr; } }
.pick2 {
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  border: 1px solid var(--color-forest-pale); border-radius: 12px;
  padding: 13px 15px; background: var(--color-base);
  transition: border-color var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
.pick2:hover { border-color: var(--color-sage-light); }
.pick2.off { opacity: 0.5; }
.pick2__box {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 7px; margin-top: 1px;
  border: 2px solid var(--color-sage); background: var(--color-white);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.pick2.on .pick2__box { background: var(--color-forest); border-color: var(--color-forest); }
.pick2__box svg { width: 14px; height: 14px; }
.pick2.off .pick2__box svg { display: none; }
.pick2__txt { font-size: 14px; line-height: 1.42; color: var(--color-charcoal); }

/* ============================================================
   GALLERY  (rasterised, downloadable image cards)
   ============================================================ */
.gallery-head { margin: 46px 0 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.gallery-head h2 { font-size: clamp(22px, 4vw, 30px); font-weight: 700; letter-spacing: -0.015em; color: var(--color-forest); margin: 0; }
.gallery-head p { font-size: 14px; color: var(--color-warm-gray); margin: 6px 0 0; max-width: 52ch; line-height: 1.5; }
.gallery-head p svg { width: 16px; height: 16px; color: var(--color-sage); vertical-align: -3px; margin-right: 7px; }

.cards {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
@media (max-width: 620px){ .cards { grid-template-columns: 1fr; gap: 26px; } }

.dcard {
  display: flex; flex-direction: column;
  background: var(--color-white); border: 1px solid var(--color-forest-pale);
  border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.dcard:hover { box-shadow: var(--shadow-md); }
.dcard__imgwrap {
  position: relative; width: 100%; background: var(--color-sage-pale);
  aspect-ratio: 1080 / 1350; overflow: hidden;
}
.dcard__imgwrap.square { aspect-ratio: 1 / 1; }
.dcard__img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* skeleton while rasterising */
.dcard__skel { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.dcard__skel::after {
  content: ""; width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--color-sage-light); border-top-color: var(--color-forest);
  animation: dspin 0.7s linear infinite;
}
@keyframes dspin { to { transform: rotate(360deg); } }

.dcard__foot { display: flex; align-items: center; gap: 12px; padding: 13px 15px; }
.dcard__cap { min-width: 0; flex: 1 1 auto; }
.dcard__n { font-family: var(--font-mono); font-size: 12px; color: var(--color-sage); }
.dcard__t { font-size: 14px; font-weight: 600; color: var(--color-forest); display: block; margin-top: 1px; }
.dl {
  appearance: none; cursor: pointer; flex: 0 0 auto;
  font-family: var(--font-sans); font-weight: 700; font-size: 13.5px; color: #fff;
  background: var(--color-forest); border: none; border-radius: 10px;
  padding: 10px 16px; display: inline-flex; align-items: center; gap: 8px;
  transition: background var(--dur-base) var(--ease-out);
}
.dl svg { width: 16px; height: 16px; }
.dl:hover { background: var(--color-forest-light); }
.dl.done { background: var(--color-success); }
.dl:disabled { opacity: 0.5; cursor: default; }

/* ---- privacy note + footer -------------------------------- */
.privacy {
  margin: 48px 0 0; display: flex; gap: 14px; align-items: flex-start;
  background: var(--color-white); border: 1px solid var(--color-forest-pale);
  border-radius: var(--radius-2xl); padding: 20px 22px;
}
.privacy .ic { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 11px; background: var(--color-sage-pale); color: var(--color-forest); display: flex; align-items: center; justify-content: center; }
.privacy .ic svg { width: 21px; height: 21px; }
.privacy p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--color-charcoal); text-wrap: pretty; }
.privacy p b { color: var(--color-forest); font-weight: 700; }

.site-foot { margin-top: 56px; border-top: 1px solid var(--color-forest-pale); }
.site-foot__in { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 28px 0 48px; }
.site-foot__brand { display: flex; align-items: center; text-decoration: none; }
.site-foot__brand img { height: 24px; display: block; }
.site-foot__note { font-size: 13px; color: var(--color-warm-gray); }
.site-foot__back {
  font-size: 13.5px; font-weight: 600; color: var(--color-forest); text-decoration: none;
  display: inline-flex; align-items: center; white-space: nowrap;
}
.site-foot__back::before { content: "\2190"; margin-right: 7px; color: var(--color-sage); font-weight: 700; }
.site-foot__back:hover { color: var(--color-forest-light); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--color-charcoal); color: #fff; font-size: 14px; font-weight: 600;
  padding: 13px 22px; border-radius: 999px; z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  display: flex; align-items: center; gap: 10px; white-space: nowrap; box-shadow: var(--shadow-lg);
}
.toast svg { width: 17px; height: 17px; color: var(--color-sage-light); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* off-screen rasterising host (live frames rendered here, then captured) */
.raster-host { position: fixed; left: -99999px; top: 0; width: 1080px; pointer-events: none; opacity: 1; }
