/* R363: the same house typography and HTML whitespace model in both surfaces.
 * Inline author/editor styles take precedence. No !important declarations. */
html body.mce-content-body,
html body.mceContentBody,
html body.single-writing .ix-single-content {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 16px;
  line-height: 1.8;
  color: rgb(221, 213, 192);
  white-space: normal;
}
/* Specific enough to beat a later generic theme p rule, while script/play
 * descendants retain their shared role defaults. Inline editor styles win. */
html body.mce-content-body p:not(:where(.ix-script p, .ix-play p)),
html body.mceContentBody p:not(:where(.ix-script p, .ix-play p)),
html body.single-writing .ix-single-content p:not(:where(.ix-script p, .ix-play p)) {
  margin: 0 0 1.4em;
  text-indent: 0;
}
html body.mce-content-body .ix-poem-stanza,
html body.mceContentBody .ix-poem-stanza,
html body.single-writing .ix-single-content .ix-poem-stanza {
  white-space: normal;
}
/* Class marks a nonempty inline barrier for WordPress mode switching. It adds
 * no spacing itself: the prefix is real, editable nonbreaking whitespace. */
.iexile-leading-indent { white-space: normal; }

/* R363: canonical screenplay/play defaults shared by public and editor.
 * Values, aliases, transitions and dual dialogue come from fresh LIVE R163.8/
 * R254/R299, preserving those later corrections. Inline editor styles win. */

      /* ============================================================
         SCREENPLAY — Final Draft column grid (5 elements)
         ============================================================ */
      .ix-script {
        font-family: 'Courier Prime', 'Courier New', Courier, monospace;
        font-size: 15px;
        line-height: 1.5;
        color: var(--color-text-bright, #f0e8d8);
        max-width: 60ch;
        margin: 0 auto;
        padding: 24px 0;
        text-align: left;
      }
      .ix-script p { margin: 0; padding: 0; font-family: 'Courier Prime', 'Courier New', Courier, monospace; }

      .ix-script p.ix-script-action,
      .ix-script p.ix-script-slugline,
      .ix-script p.ix-script-transition {
        margin: 1.05em 0;
        padding: 0;
        max-width: 60ch;
      }
      .ix-script p.ix-script-slugline {
        text-transform: uppercase;
        font-weight: bold;
        letter-spacing: 0.02em;
        margin-top: 2em;
        margin-bottom: 1em;
      }
      .ix-script p.ix-script-transition {
        text-align: right;
        text-transform: uppercase;
        margin: 1.5em 0;
      }
      /* FADE IN: is the one transition that sits flush LEFT (start of script
         or start of a sequence) — every other transition (CUT TO:, FADE OUT.,
         DISSOLVE TO:, CUT TO BLACK, etc.) stays right-aligned above. */
      .ix-script p.ix-script-transition.ix-script-transition-left {
        text-align: left;
      }
      .ix-script p.ix-script-character {
        margin: 1.6em 0 0 22ch;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        padding-right: 4ch;
        max-width: 35ch;
      }
      .ix-script p.ix-script-parenthetical {
        margin: 0 20ch 0 16ch;
        max-width: 24ch;
        font-style: italic;
        color: var(--color-text, #d4c4a8);
      }
      .ix-script p.ix-script-dialogue {
        margin: 0 15ch 0 10ch;
        max-width: 35ch;
      }

      /* Dual dialogue — two characters speaking at once, true side-by-side
         columns (Final Draft "Create Dual Dialogue"). Each column keeps its
         own character cue + optional parenthetical + dialogue, centered
         within its half rather than the full-width single-speaker grid. */
      .ix-script .ix-script-dual {
        display: flex;
        gap: 3ch;
        align-items: flex-start;
        margin: 1.6em auto;
        max-width: 60ch;
      }
      .ix-script .ix-script-dual .ix-script-dual-col {
        flex: 1 1 50%;
        min-width: 0;
      }
      .ix-script .ix-script-dual .ix-script-dual-col p.ix-script-character {
        margin: 0 0 0.2em;
        text-align: center;
        max-width: 100%;
        padding-right: 0;
      }
      .ix-script .ix-script-dual .ix-script-dual-col p.ix-script-parenthetical {
        margin: 0 auto 0.2em;
        max-width: 100%;
        text-align: center;
      }
      .ix-script .ix-script-dual .ix-script-dual-col p.ix-script-dialogue {
        margin: 0;
        max-width: 100%;
        text-align: left;
      }

      /* ============================================================
         PLAY — Final Draft stage play layout (6 elements)
         ============================================================ */
      .ix-play {
        font-family: 'Courier Prime', 'Courier New', Courier, monospace;
        font-size: 15px;
        line-height: 1.5;
        color: var(--color-text-bright, #f0e8d8);
        max-width: 60ch;
        margin: 0 auto;
        padding: 24px 0;
      }
      .ix-play p { margin: 0; padding: 0; font-family: 'Courier Prime', 'Courier New', Courier, monospace; }

      /* Scene Heading — centered, bold, all-caps. "SCENE 1" / "ACT II". */
      .ix-play p.ix-play-scene-heading {
        text-align: center;
        text-transform: uppercase;
        font-weight: bold;
        letter-spacing: 0.06em;
        margin: 2.5em 0 1em;
      }

      /* Notations (stage direction) — author's instructions to the production:
         lighting, sound, mood, blocking. Italic, left-aligned, full body width.
         This is what Final Draft stores as Type="Notations". */
      .ix-play p.ix-play-notations,
      .ix-play p.ix-play-stage-direction,
      .ix-play p.ix-play-stage_direction {
        font-style: italic;
        text-align: left;
        margin: 0.9em 0;
        color: var(--color-text, #d4c4a8);
        max-width: 60ch;
      }

      /* Action — what characters DO. Body weight, left-aligned, NOT italic.
         "Bellboy 3 walks through his coworkers and opens the door." */
      .ix-play p.ix-play-action {
        font-style: normal;
        text-align: left;
        margin: 0.6em 0;
        max-width: 60ch;
      }

      /* Character cue — centered, all-caps. Final Draft stores any case,
         text-transform handles the all-caps render so editor can type
         "Steven" / "STEVEN" / "StEVEN" and they all look right. */
      .ix-play p.ix-play-character {
        text-align: center;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin: 1.6em 0 0;
        font-weight: normal;
      }

      /* Parenthetical — italic, centered, narrower. "(in tears)" */
      .ix-play p.ix-play-parenthetical {
        text-align: center;
        font-style: italic;
        margin: 0 0 0.2em; /* R254: no gap between character cue and parenthetical */
        color: var(--color-text, #d4c4a8);
        max-width: 35ch;
        margin-left: auto;
        margin-right: auto;
      }

      /* Dialogue — body width, slightly indented from the page edges. */
      .ix-play p.ix-play-dialogue {
        margin: 0.1em auto;
        text-align: left;
        max-width: 50ch;
      }

      /* Legacy aliases */
      .ix-play p.ix-play-setting { margin: 0 0 1.5em; }

      /* ============================================================
         MOBILE — collapse the column grid for narrow viewports
         ============================================================ */
      @media (max-width: 540px) {
        .ix-script, .ix-play {
          font-size: 12px;
          padding: 16px 12px;
        }
        .ix-script p.ix-script-character    { margin-left: 12ch; }
        .ix-script p.ix-script-parenthetical { margin: 0 8ch 0 8ch; }
        .ix-script p.ix-script-dialogue     { margin: 0 4ch 0 4ch; }
        .ix-script .ix-script-dual          { flex-direction: column; gap: 0.8em; }
        .ix-play p.ix-play-dialogue         { max-width: 100%; }
        .ix-play p.ix-play-parenthetical    { max-width: 100%; }
      }

/* The writing-wide legacy 16px rule must not flatten a script's 15px/1.5
 * desktop (12px mobile) metrics. Only inherited typography is set here; role
 * margins, alignment and emphasis above remain the default. */
html body.single-writing .ix-single-content .ix-script p,
html body.single-writing .ix-single-content .ix-play p,
html body.mce-content-body .ix-script p,
html body.mce-content-body .ix-play p,
html body.mceContentBody .ix-script p,
html body.mceContentBody .ix-play p {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}
