/* Grimbits Organiser - Print Files builder.
   Sits on top of editor.css: the colours, fonts, both themes and the shared
   controls (.go-btn-primary, .go-stepper, .go-input, .ib) come from there.
   Everything here is layout for the builder itself. */

@font-face {
  font-family: 'Enchanted Land';
  src: url('fonts/enchanted-land.otf') format('opentype');
  font-display: swap;
}

/* editor.css turns .go-app into its own two-column grid on wide screens; the builder lays itself out. */
.go-app.gp-app { display: block; }
.gp-app .go-topbar { padding-left: 20px; padding-right: 20px; }
.gp-app .go-topbar .go-save-status { margin: 0 10px 0 0; font-size: 14px; }

/* Two columns from tablet width up: preview and what you get on the left,
   choices on the right. One column on phones, with the choices straight after
   the preview and the summary and button last. */
.gp-body { display: flex; flex-direction: column; gap: 0; padding: 14px 16px 0; }
.gp-left { display: contents; }
.gp-stage { order: 1; }
.gp-controls { order: 2; }
.gp-summary { order: 3; }
@media (min-width: 860px) {
  .gp-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr); gap: 0 28px; align-items: start; padding: 18px 20px 0; }
  .gp-left { display: block; position: sticky; top: 12px; min-width: 0; }
}

/* preview */
.gp-stage { min-width: 0; }
.gp-canvas-wrap { position: relative; width: 100%; aspect-ratio: 16 / 11; max-height: 58vh; min-height: 260px; border: 1px solid var(--rule-strong); background: radial-gradient(ellipse at 50% 45%, rgba(255,255,255,.13), rgba(255,255,255,.03) 70%); overflow: hidden; }
.go-app[data-skin="light"] .gp-canvas-wrap { background: radial-gradient(ellipse at 50% 45%, rgba(253,248,238,.85), rgba(253,248,238,.35) 70%); }
.gp-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; outline: none; }
.gp-canvas:active { cursor: grabbing; }
.gp-stage-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 20px; text-align: center; font-size: 16px; color: var(--ink-dim); }
.go-app .gp-title { position: absolute; left: 14px; top: 10px; right: 140px; margin: 0; font-size: 22px; line-height: 1.15; pointer-events: none; }
.gp-views { position: absolute; right: 8px; top: 6px; display: flex; gap: 2px; }
.go-app .gp-views .ib { width: 40px; height: 40px; border: 1px solid transparent; }
.go-app .gp-views .ib[aria-pressed="true"] { color: var(--gold); border-color: var(--rule-strong); }
.gp-hint { position: absolute; left: 12px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-dim); pointer-events: none; }
.go-app .gp-hint .ic { width: 16px; height: 16px; }

/* what you get */
.gp-summary { min-width: 0; }
.gp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; border: 1px solid var(--rule); border-top: 0; }
.gp-stats > div { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border-left: 1px solid var(--rule); }
.gp-stats > div:first-child { border-left: 0; }
.go-app .gp-stats .ic { width: 22px; height: 22px; color: var(--gold); }
.gp-stats dt { font-size: 14px; line-height: 1.2; color: var(--ink-dim); }
.gp-stats dd { margin: 0; font-size: 17px; line-height: 1.25; font-variant-numeric: tabular-nums; color: var(--ink); }
.gp-stats .is-warning dd { color: var(--gold); }
.go-app[data-skin="light"] .gp-stats .is-warning dd { color: var(--red); }

.gp-parts { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.gp-parts li { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin: 0; padding: 7px 10px; font-size: 15px; line-height: 1.2; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.gp-parts li b { font-weight: 500; color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gp-parts li.is-note { grid-column: 1 / -1; display: block; font-size: 14.5px; color: var(--ink-dim); }

.gp-actions { margin: 14px 0 8px; }
.go-app .gp-main-btn { width: 100%; justify-content: center; gap: 10px; padding: 13px 16px; font-size: 18px; background: var(--gold); color: var(--bg); border-color: var(--gold); }
.go-app .gp-main-btn:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.go-app .gp-main-btn:disabled { background: none; color: var(--ink-dim); border-color: var(--rule-strong); opacity: 1; }
/* Light theme: the shared button style is a cream plaque with plum text; the main action is a solid wine button instead. */
.go-app[data-skin="light"] .gp-main-btn { background: var(--wine); color: #fdf6f4; border-color: var(--wine); box-shadow: none; font-size: 14px; padding: 14px 16px; }
.go-app[data-skin="light"] .gp-main-btn:hover { background: var(--plum); border-color: var(--plum); color: #fdf6f4; }
.go-app[data-skin="light"] .gp-main-btn:disabled { background: transparent; color: var(--ink-dim); border-color: var(--rule-strong); }
.gp-actions-note { margin: 8px 0 0; font-size: 14.5px; text-align: center; color: var(--ink-dim); }
.gp-progress { margin: 8px 0 0; font-size: 15px; text-align: center; color: var(--ink); }
.gp-progress.is-error { color: var(--red); }

/* choices */
.gp-controls { min-width: 0; padding: 4px 0 0; }
.gp-group { padding: 0 0 14px; }
.gp-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 0 22px; }
.go-app .gp-h { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--rule); font-size: 19px; }
.gp-h small { font-family: var(--body-font); font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-dim); }
.go-app[data-skin="light"] .gp-h { font-family: var(--label-font); font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--wine, var(--ink)); }

.gp-size { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gp-step { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 6px; border: 1px solid var(--rule); }
.gp-step-name { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-dim); }
.go-app .gp-step-name .ic { width: 18px; height: 18px; }
.gp-step .go-stepper { gap: 8px; }
.gp-step .go-step-value { min-width: 26px; font-size: 22px; }

.gp-seg { display: flex; border: 1px solid var(--rule-strong); }
.go-app .gp-seg button { flex: 1; padding: 9px 6px; font-size: 16px; color: var(--ink-dim); text-align: center; }
.gp-app .gp-token-note { margin: 6px 0 0; font-size: 14px; line-height: 1.3; color: var(--ink-dim); }
.gp-app .gp-token-note[hidden] { display: none; }
.gp-app .gp-token-note a { color: var(--gold); text-decoration: underline; }
.go-app .gp-seg button + button { border-left: 1px solid var(--rule-strong); }
.go-app .gp-seg button[aria-pressed="true"] { background: var(--gold); color: var(--bg); }
.go-app[data-skin="light"] .gp-seg button[aria-pressed="true"] { color: #fdf6f4; }

.gp-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; }
.go-app .gp-swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--rule-strong); }
.go-app .gp-swatch[aria-pressed="true"] { outline: 2px solid var(--gold); outline-offset: 2px; }
.go-app .gp-swatch:focus-visible, .go-app .gp-dot:focus-visible, .go-app .gp-seg button:focus-visible, .go-app .gp-views .ib:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.gp-label-row { display: flex; align-items: center; gap: 10px; padding: 1px 0; }
.gp-label-num { flex: none; width: 20px; text-align: right; font-size: 15px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.gp-label-row .go-input { flex: 1; font-size: 16px; padding: 7px 0; }
.go-app[data-skin="light"] .gp-label-row .go-input { padding: 7px 10px; }
.gp-label-row.is-long .go-input { border-bottom-color: var(--gold); }
.gp-label-row.is-over .go-input { border-bottom-color: var(--red); }
.gp-label-colours { position: relative; flex: none; }
.go-app .gp-dot { display: block; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--rule-strong); }
.gp-palette { position: absolute; right: 0; top: 30px; z-index: 5; display: grid; grid-template-columns: repeat(4, 28px); gap: 8px; padding: 10px; background: var(--bg); border: 1px solid var(--rule-strong); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.go-app[data-skin="light"] .gp-palette { background: #f3ecdc; }
.gp-label-msg { margin: 0 0 4px 30px; font-size: 14px; color: var(--ink-dim); }
.gp-label-row.is-over + .gp-label-msg { color: var(--red); }

.gp-loadout { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.gp-loadout p { flex: 1 1 200px; margin: 0; font-size: 15.5px; line-height: 1.35; color: var(--ink-dim); }
.gp-loadout p.is-warning { color: var(--gold); }
.go-app[data-skin="light"] .gp-loadout p.is-warning { color: var(--red); }
.go-app .gp-loadout .go-btn { flex: none; text-decoration: none; font-size: 15.5px; }
.go-app .gp-loadout .go-btn .ic { width: 18px; height: 18px; }

/* On a normal page (the shortcode) the builder is wider than the 900px the other public tools use. */
html.gsx-light .gsx-page.gp-page > .go-wrap, .gp-page > .go-wrap { max-width: 1180px; margin-left: auto; margin-right: auto; }

@media (max-width: 859px) {
  .gp-controls { padding-top: 14px; }
  .gp-summary { padding-top: 4px; }
}
@media (max-width: 520px) {
  .gp-body { padding: 10px 10px 0; }
  .gp-canvas-wrap { aspect-ratio: 5 / 4; }
  .go-app .gp-title { font-size: 18px; right: 132px; }
  .gp-stats { grid-template-columns: 1fr; }
  .gp-stats > div { border-left: 0; border-top: 1px solid var(--rule); }
  .gp-stats > div:first-child { border-top: 0; }
  .gp-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gp-pair { grid-template-columns: 1fr; }
}

.go-app[data-skin="light"] .gp-title { font-family: var(--label-font); font-size: 19px; font-weight: 700; }

/* "Recommended" sits at the right of the Size heading. */
.go-app .gp-rec { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 3px 10px; border: 1px solid var(--gold); font-family: var(--body-font); font-size: 15px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--gold); }
.go-app .gp-rec:hover { color: var(--ink); border-color: var(--ink); }
.go-app .gp-rec .ic { width: 16px; height: 16px; }

/* What the customer needs besides the files; tick boxes before buying. */
.go-app .gp-needs-h { margin-top: 14px; }
.gp-needs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.gp-needs li { display: flex; align-items: center; gap: 9px; min-width: 0; margin: 0; padding: 6px 0; font-size: 15.5px; line-height: 1.25; border-bottom: 1px solid var(--rule); }
.go-app .gp-need-icon .ic { width: 20px; height: 20px; color: var(--gold); }
.gp-need-icon { display: inline-flex; flex: none; }
.gp-need-text { flex: 1; min-width: 0; }
.go-app .gp-need-box { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid var(--gold); color: var(--bg); }
.go-app .gp-needs li.is-ticked .gp-need-box { background: var(--gold); }
.go-app .gp-need-box .ic { width: 18px; height: 18px; }
.go-app[data-skin="light"] .gp-needs li.is-ticked .gp-need-box { color: #fdf6f4; }
.go-app .gp-need-box:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.go-app .gp-need-link { flex: none; font-size: 14.5px; color: var(--gold); text-decoration: underline; }
@media (max-width: 520px) { .gp-needs { grid-template-columns: 1fr; } }
/* The licence line, with the button rather than in the list above. */
.gp-licence { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 10px; font-size: 14.5px; line-height: 1.3; color: var(--ink-dim); }
.gp-licence .gp-need-box, .gp-licence .gp-need-icon { margin-top: 1px; }
.go-app .gp-licence.is-ticked .gp-need-box { background: var(--gold); }
.go-app[data-skin="light"] .gp-licence.is-ticked .gp-need-box { color: #fdf6f4; }

/* Theme isolation, as in editor.css: themes restyle bare dt, dd, li, h3 and label text (capitals, spacing, weight). */
.gp-app dt, .gp-app dd, .gp-app li, .gp-app small { text-transform: none; letter-spacing: normal; font-weight: 400; }
.gp-app dl, .gp-app ul { margin-left: 0; }
.gp-app .gp-parts li, .gp-app .gp-needs li { margin-bottom: 0; }
.gp-app .gp-h { text-transform: none; }
.go-app[data-skin="light"] .gp-h { text-transform: uppercase; }

/* The switch for names printed in the trays. */
.go-app .gp-names-toggle[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.gp-loadout p + p { flex-basis: 100%; }

/* Toggle switch under the labels. */
.gp-switch-row { display: flex; align-items: center; gap: 12px; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--rule); }
.gp-switch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gp-switch-title { font-size: 16.5px; color: var(--ink); }
.gp-switch-hint { font-size: 14px; color: var(--ink-dim); }
.go-app .gp-switch { flex: none; position: relative; width: 46px; height: 26px; border-radius: 13px; border: 1px solid var(--rule-strong); background: transparent; transition: background .15s, border-color .15s; }
.go-app .gp-switch .gp-switch-knob { position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-dim); transition: left .15s, background .15s; }
.go-app .gp-switch[aria-checked="true"] { background: var(--gold); border-color: var(--gold); }
.go-app .gp-switch[aria-checked="true"] .gp-switch-knob { left: 23px; background: var(--bg); }
.go-app[data-skin="light"] .gp-switch[aria-checked="true"] .gp-switch-knob { background: #fdf6f4; }
.go-app .gp-switch:disabled { opacity: .45; cursor: default; }
.go-app .gp-switch:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Keep each figure in the size summary stacked, label above value, whatever the theme does to dt and dd. */
.gp-app .gp-stats dt, .gp-app .gp-stats dd { display: block; float: none; width: auto; padding: 0; margin: 0; }

/* Text colours stated firmly: dark site themes paint bare headings and paragraphs near-white, which vanishes on the light theme's parchment. */
.go-app.gp-app .gp-title { color: var(--ink); }
.go-app.gp-app .gp-actions-note, .go-app.gp-app .gp-loadout p, .go-app.gp-app .gp-token-note { color: var(--ink-dim); }
.go-app.gp-app .gp-progress { color: var(--ink); }
.go-app.gp-app .gp-loadout p.is-warning { color: var(--gold); }
.go-app.gp-app[data-skin="light"] .gp-loadout p.is-warning { color: var(--red); }
.go-app.gp-app .gp-progress.is-error { color: var(--red); }

/* Bought on Etsy: a quiet line under the button that opens a two-field form. */
.go-app.gp-app .gp-etsy { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--rule); text-align: center; font-size: 14.5px; }
.gp-app .gp-etsy[hidden] { display: none; }
.go-app.gp-app .gp-etsy p { margin: 6px 0 0; color: var(--ink-dim); font-size: 14.5px; line-height: 1.35; }
.go-app.gp-app .gp-etsy-toggle { background: none; border: 0; padding: 2px 0; color: var(--gold); font-size: 15px; text-decoration: underline; cursor: pointer; text-transform: none; letter-spacing: normal; min-height: 0; line-height: 1.3; }
.go-app.gp-app .gp-etsy-form { display: grid; grid-template-columns: minmax(0, 260px) auto; justify-content: center; gap: 8px; margin: 10px 0 0; align-items: stretch; }
.go-app.gp-app .gp-etsy-form input { min-width: 0; width: 100%; margin: 0; padding: 8px 10px; font-size: 15px; height: auto; color: var(--ink); background: transparent; border: 1px solid var(--rule-strong); box-shadow: none; }
.go-app.gp-app[data-skin="light"] .gp-etsy-form input { background: #fff; }
.go-app.gp-app .gp-etsy-form .go-btn { margin: 0; }
.go-app.gp-app .gp-etsy-msg.is-error { color: var(--red); }
@media (max-width: 520px) { .go-app.gp-app .gp-etsy-form { grid-template-columns: 1fr; } }

/* The product page: a heading above the builder and the product's description below it. */
/* The heading sits in the builder's top bar, on the same line as the theme button. */
.go-app.gp-app .go-topbar .gp-product-title { flex: 1; min-width: 0; margin: 0; padding: 0; font-size: 26px; line-height: 1.25; white-space: normal; color: var(--ink); text-transform: none; letter-spacing: normal; }
.go-app.gp-app .go-topbar .gp-product-title + .go-save-status { margin-left: 12px; }
.gp-product.gp-page { padding-top: 22px; }
.gp-product .gp-product-desc { max-width: 1180px; margin: 30px auto 0; padding: 0 20px 10px; font-size: 16px; line-height: 1.6; }
.gp-product .gp-product-desc h2 { margin: 28px 0 8px; font-size: 17px; letter-spacing: .04em; text-transform: uppercase; }
.gp-product .gp-product-desc p { margin: 0 0 14px; }
.gp-product .gp-product-desc ul { margin: 0 0 14px 20px; padding: 0; }
.gp-product .gp-product-desc li { margin: 0 0 7px; }
.gp-product .gp-product-desc .gp-lead { font-size: 17.5px; }
.gp-product .gp-product-desc .gp-small { margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(128, 128, 128, .35); font-size: 14.5px; opacity: .85; }
.gp-product .gp-product-desc .gp-small h2 { margin-top: 0; font-size: 15px; }
/* Light theme: the page is parchment, so the text takes the builder's plum and wine. */
html.gsx-light .gp-product .gp-product-desc h2 { color: #5c2020; }
/* Light theme: the blackletter face used for short titles is hard to read at this length, so the heading takes the label face. */
.go-app.gp-app[data-skin="light"] .go-topbar .gp-product-title { color: var(--wine); font: 700 21px/1.3 var(--label-font); letter-spacing: .03em; }
html.gsx-light .gp-product .gp-product-desc, html.gsx-light .gp-product .gp-product-desc p, html.gsx-light .gp-product .gp-product-desc li { color: #31153e; }
html.gsx-light .gp-product .gp-product-desc a { color: #5c2020; }
@media (max-width: 600px) { .go-app.gp-app .go-topbar .gp-product-title, .go-app.gp-app[data-skin="light"] .go-topbar .gp-product-title { font-size: 20px; } }

/* The description uses the organiser's own type, not the site theme's: Garamond on the dark page, Franklin with Caudex headings on parchment. */
.gp-product .gp-product-desc, .gp-product .gp-product-desc p, .gp-product .gp-product-desc li { font-family: 'EB Garamond', Garamond, 'Times New Roman', serif; font-size: 18px; line-height: 1.5; }
.gp-product .gp-product-desc h2 { font-family: 'EB Garamond', Garamond, 'Times New Roman', serif; font-size: 21px; font-weight: 500; letter-spacing: normal; text-transform: none; }
.gp-product .gp-product-desc .gp-lead { font-size: 20px; }
.gp-product .gp-product-desc .gp-small, .gp-product .gp-product-desc .gp-small p { font-size: 16px; }
.gp-product .gp-product-desc .gp-small h2 { font-size: 18px; }
.gp-product .gp-product-desc a { color: #c9a24a; text-decoration: underline; }
html.gsx-light .gp-product .gp-product-desc, html.gsx-light .gp-product .gp-product-desc p, html.gsx-light .gp-product .gp-product-desc li { font-family: 'Libre Franklin', 'Franklin Gothic Medium', Arial, sans-serif; font-size: 16px; line-height: 1.5; }
html.gsx-light .gp-product .gp-product-desc h2 { font: 700 13px/1.3 'Caudex', 'Palatino Linotype', Georgia, serif; letter-spacing: .09em; text-transform: uppercase; }
html.gsx-light .gp-product .gp-product-desc .gp-lead { font-size: 17px; }
html.gsx-light .gp-product .gp-product-desc .gp-small, html.gsx-light .gp-product .gp-product-desc .gp-small p { font-size: 14.5px; }
html.gsx-light .gp-product .gp-product-desc a { color: #5c2020; }

/* Two layout choices, stacked and the same width. */
.go-app .gp-loadout .gp-loadout-stack { flex: none; display: flex; flex-direction: column; gap: 8px; }
.go-app .gp-loadout .gp-loadout-stack .go-btn { justify-content: flex-start; width: 100%; }
@media (max-width: 520px) { .go-app .gp-loadout .gp-loadout-stack { flex: 1 1 100%; } }
