/* Shared by every page (index.html and each product page). Deliberately minimal/plain v1
   styling - structure and responsiveness only. Visual design is a separate later pass. */

/* Colors. Background and primary brand color are shared by every product; only the action
   button color (--brand-accent) is per product. A product page puts its .product--<range> class
   on <body>; the landing page puts it on that product's button, so the button always matches
   the product page's own download button. */
:root {
  --brand: #004860;
  --page-bg: #c9b799;
}
.product--hide-and-peek { --brand-accent: #a29611; }
.product--worlds { --brand-accent: #307fe2; }

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, sans-serif;
  color: #1a1a1a;
  background: var(--page-bg);
}
header .header-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem;
}
header .logo { height: 32px; width: auto; }
header h1 { margin: 0; font-size: 2rem; color: var(--brand); font-weight: 300; }

main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}
@media (min-width: 760px) {
  main {
    grid-template-columns: minmax(280px, 380px) 1fr;
    align-items: start;
  }
}

#controls > section { margin-bottom: 1.75rem; }
h2 { font-size: 1rem; margin: 0 0 0.5rem; color: var(--brand); }

.picker-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
  font: inherit;
  padding: 0.6rem 1rem;
  min-height: 44px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  color: var(--brand);
  background-color: var(--page-bg);
}
.pill[disabled] { opacity: 0.4; cursor: not-allowed; }
.pill--selected { background: var(--brand); color: #fff; border-color: var(--brand); }

.language-select {
  font: inherit;
  padding: 0.6rem 1rem;
  min-height: 44px;
  min-width: 12rem;
  border: 1px solid #999;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.hint { color: #666; font-size: 0.9rem; }
.hint--error { color: #b00020; }

.theme-art {
  position: relative;
  width: 100%;
  max-width: 420px;
  /* aspect-ratio is set from the artwork's viewBox by themePicker.js */
}
.theme-art-base,
.theme-art-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.theme-art-overlay { pointer-events: none; }
.theme-art-base #masks path {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.theme-art-base #masks path:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}
.theme-art-badge circle { fill: var(--brand); }
.theme-art-badge text {
  fill: #fff;
  font-size: 10px;
  font-family: system-ui, sans-serif;
  text-anchor: middle;
  dominant-baseline: central;
}

.download-button {
  font: inherit;
  padding: 0.75rem 1.5rem;
  min-height: 44px;
  border: none;
  border-radius: 6px;
  background: var(--brand-accent);
  color: #fff;
  cursor: pointer;
}
.download-button[disabled] { opacity: 0.4; cursor: not-allowed; }

#preview-panel { min-width: 0; }
.preview-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.preview-page-col { flex: 1 1 260px; min-width: 0; }
.preview-page-label { font-size: 0.85rem; color: #666; margin-bottom: 0.4rem; }
.preview-page-outer {
  width: 100%;
  overflow: hidden;
  border: 1px solid #ccc;
}
.preview-page {
  position: relative;
  background: #fafafa;
}
.preview-page img { display: block; }
.preview-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10px;
  color: #999;
  border: 1px dashed #ccc;
  padding: 0.25rem;
}

/* Landing page (index.html): logo centered near the top, product buttons stacked below it at
   equal width. */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 12vh 1.25rem 1.25rem;
}
.landing .logo { height: 48px; width: auto; }
.product-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: min(100%, 16rem);
}
.product-button {
  display: flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 1.25rem;
  padding: 0.75rem 1.5rem;
  min-height: 44px;
  border-radius: 6px;
  background: var(--brand-accent);
  color: #fff;
  text-decoration: none;
}
