/* ===========================================================================
   Ausschreibung - fuer Papier gebaut
   ---------------------------------------------------------------------------
   Anders als der Rest der Turnierseite: hell, ruhig, ohne Farbflaechen. Was
   auf A4 gedruckt wird, muss auch in Schwarzweiss lesbar sein und darf keine
   Tonerflaeche verbrauchen. Am Bildschirm sieht es aus wie das Blatt.
   =========================================================================== */

:root {
    --gruen: #0a7a02;      /* dunkler als das Signalgruen - auf Weiss lesbar */
    --text:  #16201a;
    --grau:  #5b6b5e;
    --linie: #c9d2cb;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 20px 12px 60px;
    background: #eef1ee;
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
    font-size: 11pt;
    line-height: 1.45;
}

/* --- Leiste ueber dem Blatt (wird nicht gedruckt) --- */
.werkzeug {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 21cm;
    margin: 0 auto 14px;
}
.werkzeug button {
    padding: 10px 18px;
    border: none;
    border-radius: 4px;
    background: var(--gruen);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
.werkzeug button:hover { background: #0c8f03; }
.werkzeug a { color: var(--grau); font-size: 0.95rem; }

/* --- Das Blatt --- */
.blatt {
    max-width: 21cm;
    margin: 0 auto;
    padding: 1.6cm 1.8cm 2cm;
    background: #fff;
    box-shadow: 0 2px 12px rgb(0 0 0 / 0.12);
}

/* --- Kopf --- */
.kopf {
    border-bottom: 3px solid var(--gruen);
    padding-bottom: 14px;
    margin-bottom: 22px;
}
.veranstalter {
    margin: 0 0 4px;
    font-size: 10pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--gruen);
}
.kopf h1 {
    margin: 0;
    font-size: 24pt;
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.kopf .termin { margin: 8px 0 2px; font-size: 12pt; font-weight: 600; }
.kopf .unter  { margin: 0; color: var(--grau); }

/* --- Abschnitte --- */
section { margin-bottom: 22px; }

h2 {
    margin: 0 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--linie);
    font-size: 13pt;
    color: var(--gruen);
}
h3 { margin: 14px 0 4px; font-size: 11.5pt; }

p { margin: 0 0 7px; }
.klein { font-size: 9.5pt; color: var(--grau); }

/* --- Tabellen --- */
table.liste,
table.raster {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
}

table.liste th,
table.liste td {
    padding: 5px 8px;
    text-align: left;
    border-bottom: 1px solid var(--linie);
    vertical-align: top;
}
table.liste thead th {
    font-size: 9pt;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--grau);
    border-bottom: 2px solid var(--linie);
}
table.liste tfoot td {
    border-top: 2px solid var(--linie);
    border-bottom: none;
}
table.liste .mitte,
table.liste th.mitte  { text-align: center; }
table.liste .betrag,
table.liste th.betrag { text-align: right; white-space: nowrap; }
table.liste.schmal { width: auto; min-width: 60%; }

/* Zuschüsse zweispaltig */
table.raster th,
table.raster td {
    padding: 4px 8px;
    border-bottom: 1px solid var(--linie);
}
table.raster th { text-align: left; font-weight: 600; width: 25%; }
table.raster td.betrag { text-align: right; width: 25%; white-space: nowrap; }

.zwei-spalten {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
}

.runde {
    margin-bottom: 14px;
    padding-left: 12px;
    border-left: 3px solid var(--linie);
}
.runde h3 { margin-top: 0; }

/* --- Fuß --- */
.fuss {
    margin-top: 26px;
    padding-top: 14px;
    border-top: 1px solid var(--linie);
    font-size: 9.5pt;
    color: var(--grau);
}
.fuss .adressen { margin-top: 14px; }
.fuss h3 { font-size: 10pt; color: var(--text); }
.fuss .adressen p { margin: 0; }

/* --- Handy --- */
@media (max-width: 640px) {
    body { padding: 12px 8px 40px; font-size: 10.5pt; }
    .blatt { padding: 16px 14px 24px; }
    .kopf h1 { font-size: 18pt; }
    .zwei-spalten { grid-template-columns: 1fr; }
    table.liste { font-size: 9.5pt; }
    table.liste th, table.liste td { padding: 4px 4px; }
}

/* ============================================================== Druck === */
@media print {
    @page {
        size: A4 portrait;
        margin: 14mm 15mm;
    }

    body {
        background: #fff;
        padding: 0;
        font-size: 10pt;
    }

    /* Die Bedienleiste gehoert nicht aufs Papier */
    .werkzeug { display: none; }

    .blatt {
        max-width: none;
        padding: 0;
        box-shadow: none;
    }

    /* Ein Abschnitt soll nicht mitten in der Ueberschrift umbrechen */
    section, .runde { break-inside: avoid; }
    h2, h3 { break-after: avoid; }
    table  { break-inside: auto; }
    tr     { break-inside: avoid; }

    /* Stellen, an denen bewusst eine neue Seite beginnen darf */
    .umbruch { break-before: page; }

    a { color: inherit; text-decoration: none; }
}
