/*! =============================================================================================
    Metin Aksoy platform — the ONE shared print stylesheet (increment 1.11c).

    This file is the REWRITE of the legacy site's print stylesheet (the two-rule `print.css` at the
    workspace root: `.noprint { visibility: hidden; display: none }` and `.print { visibility: visible }`),
    which is what docs/09-ui-account-settings-and-ai-chat.md § 5 asks for. Printing is a real workflow in
    this product — the legacy site carries print commands for receipts, declaration lists, tax
    certificates and document lists (§ 1.2) — so the mechanism belongs to the shared chrome and lives in
    exactly ONE file (decision D125 rule 2).

    Linked from the shared chrome with media="print" (`_PrintStyles.cshtml`), so a SCREEN renderer never
    applies a rule from this file: the screen output — and therefore the JavaScript-disabled output — is
    unchanged by the sheet's presence (D125 rule 1). Every reference to this file carries media="print",
    including the one `_Layout.Print` emits.

    What the rewrite keeps and what it changes:
      * KEPT, restated — a `.noprint` escape hatch (an element that must not reach paper).
      * DROPPED — the legacy `.print { visibility: visible }` rule: nothing in the platform sets that
        class, and `visibility: visible` fights the cascade rather than expressing intent.
      * ADDED — the ergonomics targets of D125 rule 5: deterministic pagination with repeating table
        headers, @page margins, a legible font floor for readers over fifty, table rules that survive a
        tablet-width page, and no colour dependence (a black-and-white print stays readable).

    No colour in this file is chromatic: every literal is greyscale (r = g = b), so nothing here depends
    on hue, toner or a colour printer. This file is self-contained: no @import, no font file, no image
    and no script (D10, D122 rule 5 — the platform's print path needs no enhancement layer at all).
   ============================================================================================= */

/* --- 1. Paper geometry ------------------------------------------------------------------------
   An explicit page box, so pagination does not depend on the browser's defaults: A4 portrait with
   room for a binder margin at the foot. */
@page {
    size: A4 portrait;
    margin: 18mm 16mm 22mm 16mm;
}

/* --- 2. The legible floor ---------------------------------------------------------------------
   12pt is the floor, never a ceiling: office staff read these pages at arm's length and often over
   fifty, so no rule in this file declares a smaller size. Line height is opened up for the same reason. */
html,
body {
    margin: 0;
    padding: 0;
    background: #fff;
    color: #000;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 12pt;
    line-height: 1.5;
}

h1 {
    font-size: 20pt;
    margin: 0 0 3mm;
}

h2 {
    font-size: 15pt;
    margin: 6mm 0 2mm;
}

h3 {
    font-size: 13pt;
    margin: 5mm 0 2mm;
}

h4 {
    font-size: 12pt;
    margin: 4mm 0 1mm;
}

p,
li,
dd,
dt,
td,
th,
caption,
label,
.muted,
.badge,
.print-footnote {
    font-size: 12pt;
}

/* --- 3. Deterministic pagination --------------------------------------------------------------
   A heading never ends a page, and a row, a list item, a panel or the document's own title block is
   never split across two sheets. The table itself MAY break — that is what makes a long list print —
   and `thead` repeats on every page, which is what makes a broken table still readable. */
h1,
h2,
h3,
h4 {
    break-after: avoid-page;
    page-break-after: avoid;
    break-inside: avoid;
    page-break-inside: avoid;
}

tr,
li,
.panel,
.print-document-header,
.print-footnote {
    break-inside: avoid;
    page-break-inside: avoid;
}

img,
svg,
figure {
    max-width: 100%;
    break-inside: avoid;
    page-break-inside: avoid;
}

table {
    border-collapse: collapse;
    width: 100%;
    break-inside: auto;
    page-break-inside: auto;
}

/* The repeating header itself: every printed page of a long table carries its column titles. */
thead {
    display: table-header-group;
}

tfoot {
    display: table-footer-group;
}

/* --- 4. Tables that survive a narrow page -----------------------------------------------------
   Office staff print from a tablet as often as from a desktop (docs/09 § 1.2), so nothing here fixes a
   pixel width and every cell wraps rather than overflowing the page: a wide column shrinks, a long
   value breaks, and the rules between cells stay visible without any colour at all. */
th,
td {
    border: 0.5pt solid #000;
    padding: 4pt 6pt;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

thead th,
tbody th[scope="row"] {
    background: #f2f2f2;
    font-weight: 700;
}

td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* --- 5. No colour dependence ------------------------------------------------------------------
   A black-and-white print must be readable, so every previously coloured element becomes text plus a
   border. A status label keeps its Turkish word, so the meaning survives without the hue. */
a {
    color: #000;
    text-decoration: underline;
}

.badge,
.badge.ok,
.badge.off,
.badge.bad,
.badge.override {
    background: transparent;
    color: #000;
    border: 0.5pt solid #000;
    font-weight: 700;
}

.danger-zone h3 {
    color: #000;
}

/* --- 6. Chrome has no place on paper ----------------------------------------------------------
   The shared print sheet is linked by every shell, so printing ANY platform page yields the document
   rather than the navigation: the shell chrome, the breadcrumb trail and a transient flash message are
   removed, and the screen's content width cap is lifted so the page uses the full paper width. A print
   view rendered through `_Layout.Print` has no chrome to begin with; these rules are for the shells. */
.noprint {
    display: none !important;
}

.shell-header,
.shell-nav,
.shell-footer,
.breadcrumbs,
.flash,
button {
    display: none;
}

.shell-main {
    max-width: none;
    padding: 0;
    margin: 0;
}

.shell-body {
    display: block;
}

.shell-menu,
.shell-menu-items,
.shell-menu-subitems {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* --- 7. The print document ---------------------------------------------------------------------
   The vocabulary a print view renders: one titled document with a subtitle, its tables, and a footnote
   stamp. It is presentation only — the layout that renders it carries no chrome (D125 rule 3). */
.print-main {
    margin: 0;
    padding: 0;
}

.print-document-header {
    border-bottom: 1pt solid #000;
    padding-bottom: 2mm;
    margin-bottom: 4mm;
}

.print-document-title {
    margin: 0;
}

.print-document-subtitle {
    margin: 1mm 0 0;
    color: #333;
}

.print-footnote {
    margin-top: 6mm;
    border-top: 0.5pt solid #000;
    padding-top: 2mm;
    color: #333;
}