/* Base styles for V2 creatives rendered by NAS.
 *
 * NAS emits HTML using class names `.creative-{id}`, `.creative-header`,
 * `.creative-body`, `.creative-button`, `.creative-button-positive`, etc.
 * and per-creative CSS custom property values (`--positive-button-bg`,
 * `--header-color`, …). This stylesheet provides the rules that consume
 * those custom properties — without it, NAS-rendered creatives fall back
 * to browser defaults.
 *
 * Everything lives inside `@layer base` so pod-theme custom CSS
 * (`@layer pod-theme-custom-css`, declared higher in the cascade by NAS)
 * can override these defaults. Without the layer, unlayered rules would
 * win over any layered rule per the CSS cascade — and operator-authored
 * pod-theme CSS could never override e.g. `.creative-header`.
 *
 * This single stylesheet is inlined into both the live NAS-served creative
 * and the editor preview (cashew assembles the preview document with the
 * on-disk file), so the preview always matches production.
 */

@layer base {
  .creative {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    max-width: min(450px, 100%);
    margin: 0 auto;
    box-sizing: border-box;
  }

  .creative:has(> .ad-label) {
    padding-top: 36px;
  }

  .creative-header {
    margin: 0;
    color: var(--header-color);
    font-size: var(--header-size);
    line-height: 1.2;
    font-weight: 700;
    text-align: center;
  }

  .creative-body {
    margin: 0;
    color: var(--body-color);
    font-size: var(--body-size);
    line-height: 1.4;
    text-align: center;
  }

  .creative-consent-text {
    margin: 0;
    color: #999;
    font-size: 11px;
    line-height: 1.4;
  }

  .creative-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
  }

  .creative-button {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
  }

  .creative-button-positive {
    background: var(--positive-button-bg);
    color: var(--positive-button-text);
  }

  .creative-button-negative {
    background: var(--negative-button-bg);
    color: var(--negative-button-border);
    border: 1px solid var(--negative-button-border);
  }

  .creative-skip-link {
    display: inline-block;
    color: #0066cc;
    text-decoration: underline;
    font-size: 13px;
  }

  /* Survey creatives (nas survey_render.go) bypass the element tree and emit
   * their own classes. Each mirrors its element-tree counterpart so the same
   * style tokens apply: question ↔ header, secondary ↔ body, answer ↔
   * positive button, button-style skip ↔ negative button. */
  .creative-survey-question {
    margin: 0;
    color: var(--header-color);
    font-size: var(--header-size);
    line-height: 1.2;
    font-weight: 700;
    text-align: center;
  }

  .creative-survey-secondary {
    margin: 0;
    color: var(--body-color);
    font-size: var(--body-size);
    line-height: 1.4;
    text-align: center;
  }

  .creative-survey-answer {
    background: var(--positive-button-bg);
    color: var(--positive-button-text);
  }

  .creative-skip-button {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    background: var(--negative-button-bg);
    color: var(--negative-button-border);
    border: 1px solid var(--negative-button-border);
  }

  /* Ad-label overlays sit in the corners of .creative; the wrapper is
   * position: relative above so they overlay rather than push content. */
  .ad-label {
    position: absolute;
    top: 12px;
    font-size: 11px;
    color: rgb(128, 128, 128);
    z-index: 1;
  }

  .ad-label-top-left {
    left: 12px;
  }

  .ad-label-top-right {
    right: 12px;
  }
}
