/*
 * Wols CA / SA Mundus — A4 one-pager layout (master).
 *
 * This is the recognisable layout of every Executive One-Pager on wolsca.com
 * (/docs/viewer.html). It is mastered here next to the one-pager texts and
 * onepagers.json and pulled daily by the website server into /onepagers/web/.
 * The website only provides the dark page chrome (sidebar, toolbar, tabs);
 * everything inside the white A4 sheet is styled by this file.
 *
 * Structure produced by the website renderer for every Markdown master:
 *   <article class="a4-sheet">
 *     <div class="a4-header"><div><div class="a4-kicker"/><h1 class="a4-title"/><h3 class="a4-subtitle"/></div><img class="a4-seal"/></div>
 *     <div class="a4-body"> ...rendered Markdown... </div>
 *     <div class="a4-footer"><em>closing italic paragraph of the Markdown</em></div>
 *   </article>
 */

.a4-sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 40px;
  background: #ffffff;
  color: #0f172a;
  padding: 18mm 20mm;
  border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.a4-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 3px solid #0a1d37;
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.a4-kicker {
  font-size: 9.5pt;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #b45309;
  text-transform: uppercase;
}
.a4-title {
  font-size: 20pt;
  font-weight: 900;
  color: #0a1d37;
  margin: 4px 0;
  line-height: 1.15;
}
.a4-subtitle {
  font-size: 11.5pt;
  font-weight: 600;
  color: #334155;
  margin: 2px 0 0;
}
.a4-seal {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.a4-body {
  font-size: 10.2pt;
  line-height: 1.52;
  color: #1e293b;
  flex: 1;
}
.a4-body p { margin: 0 0 10px 0; text-align: justify; }
.a4-body strong { color: #0a1d37; }
.a4-body h2 {
  font-size: 12.5pt;
  font-weight: 800;
  color: #0a1d37;
  margin: 14px 0 6px;
  page-break-after: avoid;
  break-after: avoid-page;
}
.a4-body h3 {
  font-size: 11pt;
  font-weight: 700;
  color: #0a1d37;
  margin: 12px 0 4px;
  page-break-after: avoid;
  break-after: avoid-page;
}
.a4-body ul, .a4-body ol { margin: 0 0 10px 0; padding-left: 20px; }
.a4-body li { margin: 0 0 3px 0; }
.a4-body a { color: #0a1d37; text-decoration: underline; }
.a4-body a[href^="http"] { color: #b45309; }
.a4-body blockquote {
  margin: 0 0 10px 0;
  padding: 6px 12px;
  border-left: 3px solid #ffcc00;
  background: #f8fafc;
  color: #334155;
}
.a4-body code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 9pt;
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 3px;
}
.a4-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 8.8pt;
}
.a4-body th {
  background: #0a1d37;
  color: #ffcc00;
  text-align: left;
  padding: 6px 8px;
  border: 1px solid #0a1d37;
}
.a4-body td {
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  vertical-align: top;
}
.a4-body tr:nth-child(even) td { background: #f8fafc; }
.a4-body hr { border: 0; border-top: 1px solid #cbd5e1; margin: 12px 0; }
.a4-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px auto;
  page-break-inside: avoid;
  break-inside: avoid;
}

.a4-footer {
  border-top: 1.5px solid #cbd5e1;
  padding-top: 8px;
  margin-top: 14px;
  font-size: 8.8pt;
  color: #475569;
}

/* Mobile (≤ 980px): the sheet fills the full screen width; the same proportions, no fixed A4 metrics */
@media screen and (max-width: 980px) {
  .a4-sheet {
    width: 100%;
    min-height: auto;
    margin: 0 0 16px;
    padding: 6mm 5mm;
    border-radius: 0;
    box-shadow: none;
  }
  .a4-title { font-size: 16pt; }
  .a4-subtitle { font-size: 10.5pt; }
  .a4-seal { width: 44px; height: 44px; }
  .a4-body table { display: block; overflow-x: auto; }
}

/* Status sheet shown while the library is loading or when the sync has not run yet */
.a4-sheet.a4-status .a4-body { display: flex; align-items: center; justify-content: center; text-align: center; color: #475569; }

@media print {
  .a4-sheet {
    box-shadow: none;
    margin: 0;
    width: 100%;
    min-height: auto;
    padding: 10mm 12mm;
    page-break-after: always;
  }
}
