/* ============================================
   PDF Maker — UI styles for the /pdf/ page.
   Étape A scope: page chrome + artwork list + bundle controls + stub buttons.
   Reuses global tokens from style.css; does NOT style the generated PDF
   (that's the jsPDF engine's job in Étape C).
   ============================================ */

.pdf-maker {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.pdf-maker h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2.1rem;
  margin: 0 0 .35rem;
  color: var(--color-text);
}

.pdf-maker .subtitle {
  margin: 0 0 1.5rem;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.5;
}

/* ─────────────── Section headings inside the workspace ─────────────── */
.pdf-maker__h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 1.5rem 0 .65rem;
  color: var(--color-text);
}

/* ─────────────── Empty state (no hand-off) ─────────────── */
.pdf-maker__empty,
.pdf-maker__overcap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin-top: 1.5rem;
}
.pdf-maker__empty p,
.pdf-maker__overcap p { margin: 0 0 .5rem; }
.pdf-maker__empty-sub { color: var(--color-text-muted); font-size: .9rem; }
.pdf-maker__overcap {
  border-color: var(--color-warning-border);
  background: var(--color-warning-bg);
}

/* ─────────────── Source banner (came from Resize/Mockup) ─────────────── */
.pdf-maker__source-banner {
  margin: 0 0 1.25rem;
  padding: .65rem .85rem;
  background: var(--color-success-bg);
  border-left: 3px solid var(--color-success-border);
  border-radius: 4px;
  font-size: .9rem;
  color: var(--color-text);
}

/* ─────────────── Artwork list — one card per artwork ─────────────── */
.pdf-maker__artworks {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  margin-bottom: 1.5rem;
}

.pdf-maker__artwork {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: .85rem;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: .85rem 1rem;
  transition: opacity 0.12s;
}
/* When the seller unchecks "Include", the card stays in place (preserves
   order + lets them re-include in one click) but visually fades back so the
   included set is unmistakable. */
.pdf-maker__artwork--excluded {
  opacity: 0.45;
}
.pdf-maker__artwork--excluded .pdf-maker__artwork-name {
  text-decoration: line-through;
}
.pdf-maker__artwork--portrait  { border-left-color: var(--color-orientation-portrait); }
.pdf-maker__artwork--landscape { border-left-color: var(--color-orientation-landscape); }
.pdf-maker__artwork--square    { border-left-color: var(--color-orientation-square); }

.pdf-maker__artwork-ord {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--color-text-muted);
  text-align: center;
}

.pdf-maker__artwork-main {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  min-width: 0;
}

.pdf-maker__artwork-row1,
.pdf-maker__artwork-row2 {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.pdf-maker__artwork-orient {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .12rem .5rem;
  border-radius: 999px;
  color: #fff;
  white-space: nowrap;
}
.pdf-maker__artwork-orient--portrait  { background: var(--color-orientation-portrait); }
.pdf-maker__artwork-orient--landscape { background: var(--color-orientation-landscape); }
.pdf-maker__artwork-orient--square    { background: var(--color-orientation-square); }

.pdf-maker__artwork-name {
  font-weight: 600;
  color: var(--color-text);
  /* truncate if extremely long (the per-design cap is 30 chars so this is just defensive) */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.pdf-maker__artwork-sizes {
  font-size: .85rem;
  color: var(--color-text-muted);
}

.pdf-maker__artwork-drive {
  font-size: .8rem;
  font-weight: 500;
  padding: .15rem .55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.pdf-maker__artwork-drive--ok {
  color: var(--color-success-dark);
  background: var(--color-success-bg);
}
.pdf-maker__artwork-drive--missing {
  color: #8a5a00;
  background: var(--color-warning-bg);
}

/* Per-artwork Include checkbox — third column of the artwork card. Always
   stays at full opacity even when its parent card is dimmed (so the seller
   can re-include without hunting for the control). */
.pdf-maker__include-toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  user-select: none;
  font-size: .85rem;
  color: var(--color-text-muted);
  /* Cancel the parent's --excluded opacity so the control stays clickable. */
  opacity: 1;
}
.pdf-maker__artwork--excluded .pdf-maker__include-toggle {
  opacity: 1;
}
.pdf-maker__include-toggle input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}
.pdf-maker__include-label {
  font-weight: 500;
}

/* ─────────────── Bundle controls ─────────────── */
.pdf-maker__bundle {
  margin-bottom: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
}

.pdf-maker__bundle-toggle {
  display: flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
}
.pdf-maker__bundle-toggle input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}
.pdf-maker__bundle-toggle span { color: var(--color-text); }

.pdf-maker__bundle-help {
  margin: .5rem 0 0 1.85rem;
  font-size: .85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.pdf-maker__bundle-name-row {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin: 1rem 0 0 1.85rem;
  max-width: 480px;
}
.pdf-maker__bundle-name-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--color-text);
}
.pdf-maker__bundle-name-input {
  font: inherit;
  padding: .55rem .75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
}
.pdf-maker__bundle-name-input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
  border-color: var(--color-primary);
}
.pdf-maker__bundle-name-error {
  margin: .2rem 0 0;
  font-size: .85rem;
  color: var(--color-error-border);
}

/* ─────────────── Branding stub ─────────────── */
.pdf-maker__branding-stub {
  margin-bottom: 1.5rem;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
}
.pdf-maker__branding-stub-text {
  margin: .25rem 0 .75rem;
  color: var(--color-text-muted);
  font-size: .9rem;
  line-height: 1.5;
}
.pdf-maker__branding-stub-text em {
  color: var(--color-text-muted);
  font-style: italic;
}

/* ─────────────── Buttons ─────────────── */
.pdf-maker__btn {
  font: inherit;
  font-weight: 600;
  padding: .65rem 1.15rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s;
}
.pdf-maker__btn--primary {
  background: var(--color-primary);
  color: #fff;
  border: 1px solid var(--color-primary);
}
.pdf-maker__btn--primary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.pdf-maker__btn--primary:disabled { opacity: .55; cursor: not-allowed; }

.pdf-maker__btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.pdf-maker__btn--secondary:hover { border-color: var(--color-text-muted); }
.pdf-maker__btn--secondary:disabled { opacity: .55; cursor: not-allowed; }

.pdf-maker__generate-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .55rem;
  margin-bottom: 1.25rem;
}
.pdf-maker__generate-row .pdf-maker__btn {
  align-self: flex-start;
}
.pdf-maker__generate-status {
  margin: 0;
  font-size: .9rem;
  color: var(--color-text);
}

/* ─────────────── Reset (form only) — matches the existing reset-btn family ─────────────── */
.pdf-maker .reset-btn {
  margin-top: .5rem;
}

/* ─────────────── Responsive ─────────────── */
@media (max-width: 540px) {
  .pdf-maker { padding: 1.25rem 1rem 3rem; }
  .pdf-maker h1 { font-size: 1.7rem; }
  /* On narrow screens the Include checkbox drops to a third row on the right,
     keeping touch targets comfortable. */
  .pdf-maker__artwork {
    grid-template-columns: 28px 1fr auto;
    padding: .75rem .85rem;
  }
  .pdf-maker__include-label {
    /* Hide the word "Include" on tight screens — the checkbox itself + the
       tooltip carry the meaning. */
    display: none;
  }
  .pdf-maker__bundle-name-row,
  .pdf-maker__bundle-help { margin-left: 0; }
}
