/* Customizer — two-pane build page. Reuses the brand tokens from styles.css
   (--deep, --bronze, --champagne, --glass-*, --sans). Light cream+bronze
   chrome, matching the site-wide light theme (July 8, 2026). The live poster
   preview stage keeps its own dark matting regardless of site theme — that's
   presentation, not site chrome, and most poster styles read best framed dark. */

/* The Ink poster's own type (sharpie.mjs FONTS.clashArchivo: display=Archivo
   Black, name=Clash Display Medium) — needed here so the live in-browser
   SVG preview renders with the same faces the print render uses. */
@font-face {
  font-family: "Archivo Black";
  src: url("assets/fonts/ArchivoBlack-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Clash Display Medium";
  src: url("assets/fonts/ClashDisplay-Medium.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
/* Cityline's default display face (src/cityline.mjs CITYLINE_FONTS.clash) —
   needed for the live preview now that cityline() defaults opts.font to this
   instead of the old hardcoded Helvetica Neue. */
@font-face {
  font-family: "Clash Display Semibold";
  src: url("assets/fonts/ClashDisplay-Semibold.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

.cz-body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 800px at 18% 12%, rgba(138, 100, 53, 0.1), transparent 60%),
    radial-gradient(1000px 900px at 92% 88%, rgba(169, 127, 63, 0.07), transparent 55%),
    var(--deep);
}

/* ---------- top bar ---------- */
.cz-topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px max(24px, 5vw);
  background: rgba(244, 239, 228, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--hairline);
}
.cz-topbar .wordmark { font-size: 15px; letter-spacing: 0.28em; font-weight: 700; color: var(--white); text-decoration: none; }
.cz-back { color: var(--dim); text-decoration: none; font-size: 14px; letter-spacing: 0.06em; transition: color 0.25s; white-space: nowrap; }
.cz-back:hover { color: var(--champagne); }
/* narrow phones: tighten the wordmark so the back link keeps its own line */
@media (max-width: 520px) {
  .cz-topbar { padding: 16px 18px; gap: 14px; }
  .cz-topbar .wordmark { font-size: 12.5px; letter-spacing: 0.15em; }
  .cz-back { font-size: 13px; }
}

/* ---------- layout ---------- */
.customizer {
  display: grid;
  grid-template-columns: 1fr 0.82fr;
  gap: 48px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px max(24px, 5vw) 96px;
  align-items: start;
}

/* ---------- form ---------- */
.cz-form { display: flex; flex-direction: column; gap: 28px; }

.cz-styletoggle {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-edge);
  border-radius: 999px; padding: 4px;
}

/* photo include checkbox */
.cz-check {
  grid-column: span 2;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--sans); font-size: 14px; color: var(--white);
  cursor: pointer;
}
.cz-check input[type="checkbox"] {
  appearance: none; width: 40px; height: 22px; border-radius: 999px;
  background: rgba(26, 23, 15, 0.14); position: relative;
  border: 1px solid var(--glass-edge); cursor: pointer; transition: background 0.25s ease;
  flex: none;
}
.cz-check input[type="checkbox"]::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff8ec; transition: all 0.25s ease;
}
.cz-check input[type="checkbox"]:checked { background: var(--bronze); }
.cz-check input[type="checkbox"]:checked::after { left: 20px; background: #fff8ec; }
#photoUploadField input[type="file"] { font-size: 13px; color: var(--dim); }
.cz-style {
  appearance: none; border: 0; cursor: pointer;
  padding: 13px 18px; border-radius: 999px;
  font-family: var(--sans); font-size: 14px; letter-spacing: 0.08em;
  color: var(--dim); background: transparent; transition: all 0.28s ease;
}
.cz-style.is-active { background: var(--bronze); color: var(--deep); font-weight: 600; }

/* Cityline Classic/Grand sub-toggle — same pill visual language as
   .cz-styletoggle/.cz-style, one size down, only shown while style=cityline. */
.cz-varianttoggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-edge);
  border-radius: 999px; padding: 4px;
}
.cz-varianttoggle[hidden] { display: none; }
.cz-variant {
  appearance: none; border: 0; cursor: pointer;
  padding: 10px 16px; border-radius: 999px;
  font-family: var(--sans); font-size: 13px; letter-spacing: 0.08em;
  color: var(--dim); background: transparent; transition: all 0.28s ease;
}
.cz-variant.is-active { background: var(--bronze); color: var(--deep); font-weight: 600; }

.cz-group {
  border: 1px solid var(--glass-edge);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 6px; padding: 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.cz-group legend {
  grid-column: 1 / -1;
  font-size: 12px; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--bronze); font-weight: 600; padding: 0; margin-bottom: 2px;
}
.cz-hint { grid-column: 1 / -1; margin: -6px 0 4px; color: var(--faint); font-size: 13px; }

.cz-field { display: flex; flex-direction: column; gap: 7px; }
.cz-field.cz-col-2 { grid-column: 1 / -1; }
.cz-field > span { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }

.cz-field input,
.cz-field select,
.cz-split input {
  width: 100%; box-sizing: border-box;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--hairline);
  border-radius: 4px; padding: 12px 13px;
  color: var(--white); font-family: var(--sans); font-size: 15px;
  transition: border-color 0.22s, background 0.22s;
}
.cz-field input::placeholder, .cz-split input::placeholder { color: rgba(26, 23, 15, 0.35); }
.cz-field input:focus, .cz-field select:focus, .cz-split input:focus {
  outline: none; border-color: var(--bronze); background: rgba(255, 255, 255, 0.85);
}
.cz-field select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a6435' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px;
}

/* splits grid */
.cz-splits { grid-template-columns: 1fr; }
.cz-splitgrid { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.cz-split { display: flex; flex-direction: column; gap: 6px; }
.cz-split-num { font-size: 11px; letter-spacing: 0.14em; color: var(--faint); }
.cz-split-station .cz-split-num { color: var(--dim); }
.cz-split input { padding: 10px 12px; font-size: 14px; }

/* ---------- preview ---------- */
.cz-preview { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 20px; }
.cz-frame { position: relative; }
.poster-stage {
  aspect-ratio: 3 / 4; width: 100%;
  background: #121210; border-radius: 4px; overflow: hidden;
  border: 1px solid var(--hairline);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.poster-stage svg { display: block; }

/* buy block */
.cz-buy {
  border: 1px solid var(--glass-edge); border-radius: 6px; padding: 22px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  display: flex; flex-direction: column; gap: 14px;
}
.cz-buy-row { display: flex; align-items: baseline; justify-content: space-between; }
.cz-product { font-size: 14px; letter-spacing: 0.06em; color: var(--white); }
.cz-add { width: 100%; text-align: center; justify-content: center; }
.cz-add.is-done { background: var(--champagne); }
.cz-buy-note { color: var(--faint); font-size: 12.5px; line-height: 1.5; margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .customizer { grid-template-columns: 1fr; gap: 28px; }
  .cz-preview { position: static; order: -1; }
  .poster-stage { max-width: 380px; margin: 0 auto; }
  .cz-buy { max-width: 380px; margin: 0 auto; width: 100%; box-sizing: border-box; }
}
@media (max-width: 460px) {
  .cz-group { grid-template-columns: 1fr; }
  .cz-splitgrid { grid-template-columns: 1fr; }
}
