/* ================================================================
   LEGAL TYPESETTING TEMPLATES
   Each template scopes formatting under a parent class on .editor-shell
================================================================ */

/* ── Federal High Court Pleading ── */
.tmpl-fhc-pleading .editor-content { padding: 0.5rem 2rem 2rem; }
.tmpl-fhc-pleading #tiptap-editor,
.tmpl-fhc-pleading #tiptap-editor .ProseMirror { font-family: 'Times New Roman', 'EB Garamond', serif; font-size: 14pt; line-height: 2; }
.tmpl-fhc-pleading #tiptap-editor .ProseMirror h1,
.tmpl-fhc-pleading #tiptap-editor .ProseMirror h2 { text-align: center; text-transform: uppercase; font-family: 'Times New Roman', serif; }
.tmpl-fhc-pleading #tiptap-editor .ProseMirror h1 { font-size: 16pt; }
.tmpl-fhc-pleading #tiptap-editor .ProseMirror h2 { font-size: 14pt; }
.tmpl-fhc-pleading #tiptap-editor .ProseMirror p { text-align: justify; }

/* ── State High Court Pleading ── */
.tmpl-shc-pleading .editor-content { padding: 0.5rem 2rem 2rem; }
.tmpl-shc-pleading #tiptap-editor,
.tmpl-shc-pleading #tiptap-editor .ProseMirror { font-family: 'Times New Roman', serif; font-size: 13pt; line-height: 2; }
.tmpl-shc-pleading #tiptap-editor .ProseMirror h1,
.tmpl-shc-pleading #tiptap-editor .ProseMirror h2 { text-align: center; text-transform: uppercase; }
.tmpl-shc-pleading #tiptap-editor .ProseMirror h1 { font-size: 15pt; }
.tmpl-shc-pleading #tiptap-editor .ProseMirror p { text-align: justify; }

/* ── Court of Appeal Process ── */
.tmpl-coa-process .editor-content { padding: 0.5rem 2rem 2rem; }
.tmpl-coa-process #tiptap-editor,
.tmpl-coa-process #tiptap-editor .ProseMirror { font-family: 'Times New Roman', serif; font-size: 14pt; line-height: 2; }
.tmpl-coa-process #tiptap-editor .ProseMirror h1 { text-align: center; text-transform: uppercase; font-size: 16pt; }
.tmpl-coa-process #tiptap-editor .ProseMirror h2 { text-align: center; font-size: 14pt; text-transform: uppercase; }
.tmpl-coa-process #tiptap-editor .ProseMirror p { text-align: justify; }
.tmpl-coa-process #tiptap-editor .ProseMirror ol { list-style-type: lower-roman; }

/* ── Motion on Notice ── */
.tmpl-motion .editor-content { padding: 0.5rem 2rem 2rem; }
.tmpl-motion #tiptap-editor,
.tmpl-motion #tiptap-editor .ProseMirror { font-family: 'Times New Roman', serif; font-size: 13pt; line-height: 1.8; }
.tmpl-motion #tiptap-editor .ProseMirror h1 { text-align: center; text-transform: uppercase; font-size: 14pt; font-weight: 700; }
.tmpl-motion #tiptap-editor .ProseMirror h2 { text-align: center; font-size: 13pt; text-decoration: underline; }
.tmpl-motion #tiptap-editor .ProseMirror p { text-align: justify; }

/* ── Written Address ── */
.tmpl-written-address .editor-content { padding: 0.5rem 2rem 2rem; }
.tmpl-written-address #tiptap-editor,
.tmpl-written-address #tiptap-editor .ProseMirror { font-family: 'Times New Roman', serif; font-size: 14pt; line-height: 2; }
.tmpl-written-address #tiptap-editor .ProseMirror h1 { text-align: center; text-transform: uppercase; font-size: 16pt; text-decoration: underline; }
.tmpl-written-address #tiptap-editor .ProseMirror h2 { font-size: 14pt; text-transform: uppercase; font-weight: 700; }
.tmpl-written-address #tiptap-editor .ProseMirror p { text-align: justify; text-indent: 2rem; }
.tmpl-written-address #tiptap-editor .ProseMirror blockquote { text-indent: 0; font-style: italic; }

/* ── Affidavit ── */
.tmpl-affidavit .editor-content { padding: 0.5rem 2rem 2rem; }
.tmpl-affidavit #tiptap-editor,
.tmpl-affidavit #tiptap-editor .ProseMirror { font-family: 'Times New Roman', serif; font-size: 13pt; line-height: 2; }
.tmpl-affidavit #tiptap-editor .ProseMirror h1 { text-align: center; text-transform: uppercase; font-size: 15pt; text-decoration: underline; }
.tmpl-affidavit #tiptap-editor .ProseMirror h2 { font-size: 13pt; text-transform: uppercase; }
.tmpl-affidavit #tiptap-editor .ProseMirror ol { list-style-type: decimal; }

/* ── Standard Agreement ── */
.tmpl-agreement .editor-content { padding: 0.5rem 2rem 2rem; }
.tmpl-agreement #tiptap-editor,
.tmpl-agreement #tiptap-editor .ProseMirror { font-family: 'EB Garamond', Georgia, serif; font-size: 12pt; line-height: 1.7; }
.tmpl-agreement #tiptap-editor .ProseMirror h1 { text-align: center; text-transform: uppercase; font-size: 16pt; font-weight: 700; }
.tmpl-agreement #tiptap-editor .ProseMirror h2 { font-size: 13pt; font-weight: 700; text-transform: uppercase; }
.tmpl-agreement #tiptap-editor .ProseMirror p { text-align: justify; }

/* ── Tenancy Agreement ── */
.tmpl-tenancy .editor-content { padding: 0.5rem 2rem 2rem; }
.tmpl-tenancy #tiptap-editor,
.tmpl-tenancy #tiptap-editor .ProseMirror { font-family: 'EB Garamond', Georgia, serif; font-size: 12pt; line-height: 1.7; }
.tmpl-tenancy #tiptap-editor .ProseMirror h1 { text-align: center; text-transform: uppercase; font-size: 15pt; }
.tmpl-tenancy #tiptap-editor .ProseMirror h2 { font-size: 12pt; font-weight: 700; text-transform: uppercase; }
.tmpl-tenancy #tiptap-editor .ProseMirror p { text-align: justify; }

/* ── Legal Opinion Letter ── */
.tmpl-legal-opinion .editor-content { padding: 0.5rem 2rem 2rem; }
.tmpl-legal-opinion #tiptap-editor,
.tmpl-legal-opinion #tiptap-editor .ProseMirror { font-family: 'EB Garamond', Georgia, serif; font-size: 12pt; line-height: 1.6; }
.tmpl-legal-opinion #tiptap-editor .ProseMirror h1 { font-size: 15pt; font-weight: 700; text-decoration: underline; }
.tmpl-legal-opinion #tiptap-editor .ProseMirror h2 { font-size: 13pt; font-weight: 600; }

/* ── Firm Letter ── */
.tmpl-firm-letter .editor-content { padding: 0.5rem 2rem 2rem; }
.tmpl-firm-letter #tiptap-editor,
.tmpl-firm-letter #tiptap-editor .ProseMirror { font-family: 'DM Sans', system-ui, sans-serif; font-size: 11pt; line-height: 1.6; }
.tmpl-firm-letter #tiptap-editor .ProseMirror h1 { font-size: 14pt; font-weight: 600; }
.tmpl-firm-letter #tiptap-editor .ProseMirror h2 { font-size: 12pt; font-weight: 600; }

/* ── Template selector panel ── */
.template-panel {
  position: absolute; top: 100%; right: 0; margin-top: 0.3rem;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  min-width: 18rem; max-height: 24rem; overflow-y: auto;
  z-index: 20; padding: 0.4rem;
}
.template-item {
  display: flex; flex-direction: column; gap: 0.1rem;
  padding: 0.5rem 0.6rem; border-radius: var(--r-sm); cursor: pointer;
}
.template-item:hover { background: var(--surface); }
.template-item.active { background: var(--gold-bg); border-left: 3px solid var(--gold); }
.template-item-name { font-size: 0.8rem; font-weight: 500; color: var(--ink); }
.template-item-desc { font-size: 0.7rem; color: var(--muted); }
