/******************************************************************************/
/*                                                                            */
/* letter.css - LaTeX letter class for paged.js                               */
/* =============================================                              */
/*                                                                            */
/* This program is part of the Rexx Parser package                            */
/* [See https://rexx.epbcn.com/rexx-parser/]                                  */
/*                                                                            */
/* Copyright (c) 2024-2026 Josep Maria Blasco <josep.maria.blasco@epbcn.com>  */
/*                                                                            */
/* License: Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0)  */
/*                                                                            */
/* Load AFTER rexxpub-base.css.  Optional size variants:                      */
/*   letter-<size>pt.css (load AFTER this file).                              */
/*                                                                            */
/* Markdown structure using Pandoc fenced divs:                               */
/*                                                                            */
/*   ::::: sender              Sender address block                           */
/*   ::::: date                Date line                                      */
/*   ::::: recipient           Recipient address block                        */
/*   ::::: opening             Salutation ("Dear...")                         */
/*   (body paragraphs)         Normal Markdown paragraphs                     */
/*   ::::: closing             Valediction ("Sincerely,")                     */
/*   ::::: signature           Sender name (space above for handwriting)      */
/*   ::::: enclosure           Optional enclosure notice                      */
/*   ::::: cc                  Optional carbon copy list                      */
/*                                                                            */
/* Key differences from article.css:                                          */
/*   - Block letter style: no text-indent, paragraph separation via margin    */
/*   - Structured address blocks instead of title page                        */
/*   - No section headings (body is continuous prose)                         */
/*   - No page number on first page; numbers from page 2                      */
/*   - Slightly narrower margins (2.5cm vs 3cm)                               */
/*                                                                            */
/* Version history:                                                           */
/*                                                                            */
/* Date     Version Details                                                   */
/* -------- ------- --------------------------------------------------------- */
/* 20260303    0.5  First version                                             */
/* 20260306         Refactored: common styles moved to rexxpub-base.css       */
/*                                                                            */
/******************************************************************************/

/******************************************************************************/
/* CSS Custom Properties — override base for letter readability               */
/******************************************************************************/

:root {
  --doc-line-height:      1.30;         /* Slightly more generous than        */
                                        /* article for letter readability     */
}

/******************************************************************************/
/******************************************************************************/
/* Letter content                                                             */
/******************************************************************************/
/******************************************************************************/

div.content {
  font-family: "Times New Roman", Times, serif;
  font-size: var(--doc-font-size);
  line-height: var(--doc-line-height);
  text-align: left;                     /* Letters are typically ragged right */
  text-align-last: left;
  hyphens: manual;                      /* No auto-hyphenation in letters     */
  widows: 2;
  orphans: 2;
}

/******************************************************************************/
/* Block letter style: no indent, paragraph separation via vertical space     */
/******************************************************************************/

div.content p {
  margin: 0;
  margin-bottom: 0.8em;                 /* Paragraph separation               */
  text-indent: 0;                       /* Block letter: never indent         */
}

/******************************************************************************/
/* Sender address block                                                       */
/* LaTeX \address — typically top-right in European style                     */
/******************************************************************************/

div.content div.sender {
  text-align: right;
  text-align-last: right;
  margin-bottom: 1.5em;
}

div.content div.sender p {
  margin-bottom: 0;                     /* Tight line spacing in address      */
  line-height: 1.4;
}

/******************************************************************************/
/* Date                                                                       */
/* LaTeX \date — right-aligned, below the sender address                      */
/******************************************************************************/

div.content div.date {
  text-align: right;
  text-align-last: right;
  margin-bottom: 2em;
}

div.content div.date p {
  margin-bottom: 0;
}

/******************************************************************************/
/* Recipient address block                                                    */
/* LaTeX \begin{letter}{recipient} — left-aligned                             */
/******************************************************************************/

div.content div.recipient {
  text-align: left;
  text-align-last: left;
  margin-bottom: 2em;
}

div.content div.recipient p {
  margin-bottom: 0;
  line-height: 1.4;
}

/******************************************************************************/
/* Opening salutation                                                         */
/* LaTeX \opening{Dear...}                                                    */
/******************************************************************************/

div.content div.opening {
  margin-bottom: 0.8em;
}

div.content div.opening p {
  margin-bottom: 0;
}

/******************************************************************************/
/* Closing valediction                                                        */
/* LaTeX \closing{Sincerely,}                                                 */
/******************************************************************************/

div.content div.closing {
  margin-top: 1.2em;
  margin-bottom: 0;
}

div.content div.closing p {
  margin-bottom: 0;
}

/******************************************************************************/
/* Signature                                                                  */
/* LaTeX \signature — space above for handwritten signature                   */
/******************************************************************************/

div.content div.signature {
  margin-top: 3em;                      /* Space for handwritten signature    */
  margin-bottom: 2em;
}

div.content div.signature p {
  margin-bottom: 0;
  font-weight: bold;                    /* Optional: emphasize the name       */
}

/******************************************************************************/
/* Enclosure notice                                                           */
/* LaTeX \encl{}                                                              */
/******************************************************************************/

div.content div.enclosure {
  margin-top: 1.5em;
  font-size: 0.9em;
}

div.content div.enclosure p {
  margin-bottom: 0.2em;
}

/******************************************************************************/
/* Carbon copy list                                                           */
/* LaTeX \cc{}                                                                */
/******************************************************************************/

div.content div.cc {
  margin-top: 0.8em;
  font-size: 0.9em;
}

div.content div.cc p {
  margin-bottom: 0.2em;
}

/******************************************************************************/
/* Headings — rarely used in letters, but available                           */
/******************************************************************************/

h1 {
  font-size: 1.4em; font-weight: bold; margin-top: 1.5em; margin-bottom: 0.6em;
}
h2 {
  font-size: 1.2em; font-weight: bold; margin-top: 1.2em; margin-bottom: 0.5em;
}
h3 {
  font-size: 1em;   font-weight: bold; margin-top: 1em;   margin-bottom: 0.4em;
}

/******************************************************************************/
/* Lists — override base: more bottom margin for block letter style           */
/******************************************************************************/

div.content ul,
div.content ol {
  margin-bottom: 0.8em;
}

/******************************************************************************/
/* Blockquotes — italic in letters (differs from article/book)                */
/******************************************************************************/

div.content blockquote {
  margin: 0.8em 1.5em;
  padding: 0;
  font-style: italic;
  font-size: inherit;
  border-left: none;
}

/******************************************************************************/
/* Footnotes — override base: left-aligned, no hyphenation                    */
/******************************************************************************/

.footnote {
  text-align: left;
  text-align-last: left;
  hyphens: manual;
}

/******************************************************************************/
/* Pagination                                                                 */
/*                                                                            */
/* Letters use narrower margins than articles (2.5cm vs 3cm).                 */
/* No page number on the first page; page numbers from page 2 onward.         */
/******************************************************************************/

@page {

  margin: 2.5cm;
  size: A4 portrait;

  @bottom-center {
    font-family: 'Times New Roman', Times, serif;
    content: counter(page);
    font-size: 12pt;
    font-style: normal;
    text-align: center;
    text-align-last: center;
  }

}

@page:first {
  @bottom-center {
    content: none;
  }
}

@page :blank {
  @bottom-center {
    content: none;
  }
}