/* AdNeed Platform (Site 1) — Post Maker tool styles.
   Same light auth-card visual language as card-maker.css (Sora/Manrope,
   navy/orange/amber tokens from adneed.css) — deliberately similar
   naming/structure to card-maker.css so the two tools feel like one
   product family, but namespaced "pm-" since it's a separate page, not
   shared markup. Two views live inside #toolCard: #pmGalleryView
   (browse templates by festival, unlock/save) and #pmEditorView (fill
   placeholders, preview, download) — only one visible at a time,
   toggled in post-maker.js. */

.auth-card--pm {
  max-width: 980px; text-align: left;
  /* Post Maker's chrome lives on the individual poster tiles (.pm-card)
     now, not one big card wrapping the whole page — so strip the
     shared .auth-card box treatment here and let this content sit
     directly on the page background, same as a dashboard page would. */
  background: none; border: none; box-shadow: none; padding: 8px 0 32px;
}
.auth-card--pm .auth-logo { margin: 0 0 16px; }
.auth-card--pm h1 { text-align: left; }
.auth-card--pm > p.sub { text-align: left; }

.pm-title { margin: 0; }
.pm-subtitle { margin: 0 0 18px; }

/* ---------------------------------------------------------------- Title row (title + price tag) */
.pm-header-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 6px;
}
.pm-price-tag {
  font-family:'AdNeedRupee','Sora', sans-serif; font-weight: 700; font-size: 12.5px; color: var(--orange-500);
  background: #FDECE4; border: 1px solid rgba(232,73,29,.25); border-radius: 999px; padding: 6px 12px;
}

/* ---------------------------------------------------------------- Festival tabs */
.pm-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin: 0 0 20px; }
.pm-tab {
  font-family:'AdNeedRupee','Manrope', sans-serif; font-size: 12.5px; font-weight: 700;
  color: var(--text-muted); background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 999px; padding: 8px 14px; cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.pm-tab:hover { border-color: rgba(232,73,29,.35); }
.pm-tab.active { background: #FDECE4; border-color: var(--orange-500); color: var(--orange-500); }

/* ---------------------------------------------------------------- Gallery grid */
.pm-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.pm-card {
  border: 1.5px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface);
  display: flex; flex-direction: column;
}
.pm-card-thumb {
  aspect-ratio: 1 / 1; background: linear-gradient(135deg, #FFF3E8, #FDECE4);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.pm-card-thumb .pm-thumb-icon { font-size: 40px; opacity: .85; }
.pm-card-thumb.has-thumb .pm-thumb-icon, .pm-card-thumb.is-loading .pm-thumb-icon { display: none; }
.pm-card-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-thumb-spinner {
  display: none; width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid rgba(232,73,29,.18); border-top-color: var(--orange-500);
  animation: pmThumbSpin .8s linear infinite;
}
.pm-card-thumb.is-loading .pm-thumb-spinner { display: block; }
@keyframes pmThumbSpin { to { transform: rotate(360deg); } }
.pm-card-save {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.9); border: 1px solid var(--border); display: flex;
  align-items: center; justify-content: center; cursor: pointer; font-size: 15px; line-height: 1;
}
.pm-card-save.is-saved { color: var(--orange-500); border-color: var(--orange-500); }
.pm-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pm-card-cat { font-family:'AdNeedRupee','Sora', sans-serif; font-weight: 700; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--orange-500); }
.pm-card-name { margin: 0; font-family:'AdNeedRupee','Sora', sans-serif; font-size: 15px; font-weight: 800; color: var(--text); }
.pm-card-date { margin: 0; font-size: 12.5px; color: var(--text-muted); }
.pm-card-actions { margin-top: auto; padding-top: 8px; }
.pm-card-actions .btn--unlock { background: var(--grad); color: #fff; }
.pm-card-actions .btn--open { background: var(--surface); color: var(--navy-900); border: 1.5px solid var(--navy-900); }
.pm-card-actions .btn { width: 100%; justify-content: center; font-size: 12.5px; padding: 9px 10px; }
.pm-empty-note { color: var(--text-muted); padding: 24px 0; }

/* ---------------------------------------------------------------- Editor */
.pm-editor-topbar { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.pm-back-link {
  display: inline-flex; align-items: center; gap: 4px; font-family:'AdNeedRupee','Manrope', sans-serif;
  font-weight: 700; font-size: 13px; color: var(--text-muted); background: none; border: none; cursor: pointer; padding: 0;
}
.pm-back-link:hover { color: var(--orange-500); }
.pm-editor-preset-name { margin: 0; font-weight: 700; color: var(--text); }

.pm-editor-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 26px; }
@media (max-width: 760px) { .pm-editor-grid { grid-template-columns: 1fr; } }

.pm-editor-preview-wrap { position: relative; }
.pm-editor-preview-frame {
  border: 1.5px solid var(--border); border-radius: 14px; overflow: hidden; background: #F4F4F6;
  display: flex; align-items: center; justify-content: center; min-height: 260px; position: relative;
}
.pm-editor-preview-frame img { width: 100%; display: block; }
.pm-editor-preview-wrap.is-loading .pm-editor-preview-frame::after {
  content: ""; position: absolute; top:0; right:0; bottom:0; left:0; background: rgba(255,255,255,.55);
}
.pm-preview-spinner {
  display: none; position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%; border: 3px solid rgba(0,0,0,.1); border-top-color: var(--orange-500);
  animation: pmThumbSpin .8s linear infinite;
}
.pm-editor-preview-wrap.is-loading .pm-preview-spinner { display: block; }
.pm-preview-empty { color: var(--text-muted); font-size: 13.5px; padding: 20px; text-align: center; }
.pm-editor-download-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.pm-editor-fields { display: flex; flex-direction: column; gap: 14px; }
.pm-autofill-note { margin: 0 0 14px; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.pm-autofill-note a { color: var(--orange-500); font-weight: 700; }
/* .field-label / .tool-note are defined per-tool-page across this
   codebase (see qr-tool.css, tools.css) rather than centrally in
   adneed.css — card-maker.html actually skips importing either file,
   so its own .field-label/.tool-note render unstyled today (a
   pre-existing gap, not touched here). Self-contained here instead of
   adding a cross-file dependency on qr-tool.css, which carries a lot
   of QR-specific rules this page doesn't want. */
.field-label { display: block; font-family:'AdNeedRupee','Sora', sans-serif; font-weight: 700; font-size: 12.5px; color: var(--text); margin: 0 0 5px; }
.tool-note { color: var(--text-muted); font-size: 12.5px; line-height: 1.6; margin: 22px 0 0; }
.pm-unlock-box {
  border: 1.5px dashed rgba(232,73,29,.4); border-radius: 12px; padding: 14px 16px;
  background: #FFF9F4; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.pm-unlock-box p { margin: 0; font-size: 13.5px; color: var(--text-muted); }
