/* ══════════════════════════════════════════════════════════════
   LUPE.AT – Rechner
   Ein Stylesheet für alle Rechner. Vorher hatte jede Werkzeugseite
   ihr eigenes Inline-CSS mit blauem Farbverlauf, der zum
   Zeitungsdesign der Seite nicht passte.
   ══════════════════════════════════════════════════════════════ */

.tool-page {
    max-width: 860px;
    margin: 0 auto 3rem;
    padding: 0 1.25rem;
    font-family: var(--lupe-sans, 'Source Sans Pro', system-ui, sans-serif);
}

/* ── Kopf ─────────────────────────────────────────────────── */
.tool-head {
    padding: 1.5rem 0 1.25rem;
    border-bottom: 2px solid var(--lupe-red, #c41e1e);
    margin-bottom: 2rem;
}
.tool-head__icon { font-size: 2.2rem; display: block; line-height: 1; margin-bottom: 0.4rem; }
.tool-head h1 {
    font-family: var(--lupe-title, 'Playfair Display', Georgia, serif);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    line-height: 1.15;
    margin: 0 0 0.6rem;
    color: var(--lupe-ink, #1a1a1a);
}
.tool-head__lead {
    font-size: 1.02rem;
    line-height: 1.6;
    color: #444;
    margin: 0;
    max-width: 62ch;
}
.tool-head__stand {
    margin: 0.9rem 0 0;
    font-size: 0.8rem;
    color: var(--lupe-muted, #6b6b6b);
    background: var(--lupe-paper, #faf9f6);
    border-left: 3px solid #d8d5cd;
    padding: 0.5rem 0.75rem;
}

/* ── Der Rechner selbst ───────────────────────────────────── */
.calc {
    background: var(--lupe-paper, #faf9f6);
    border: 1px solid var(--lupe-line, #e5e3de);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.calc h2 {
    font-family: var(--lupe-sans, sans-serif);
    font-size: 0.78rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--lupe-muted, #6b6b6b);
    margin: 0 0 1.1rem;
}
.calc + .calc { margin-top: -0.5rem; }

.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem 1.25rem;
}
.calc-field { display: flex; flex-direction: column; gap: 0.3rem; }
.calc-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #333;
}
.calc-field .hint { font-size: 0.75rem; color: var(--lupe-muted, #6b6b6b); font-weight: 400; }

.calc input[type="number"],
.calc input[type="text"],
.calc select {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid #cfccc4;
    border-radius: 3px;
    background: #fff;
    color: #111;
    width: 100%;
    box-sizing: border-box;
}
.calc input:focus, .calc select:focus {
    outline: 2px solid var(--lupe-red, #c41e1e);
    outline-offset: -1px;
    border-color: var(--lupe-red, #c41e1e);
}
.calc input[type="range"] { width: 100%; accent-color: var(--lupe-red, #c41e1e); }

.calc-inline { display: flex; gap: 0.5rem; align-items: center; }
.calc-inline input { flex: 1; }
.calc-unit { font-size: 0.85rem; color: var(--lupe-muted, #6b6b6b); white-space: nowrap; }

.calc-radios { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.calc-radios label {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid #cfccc4; border-radius: 3px;
    background: #fff; cursor: pointer; font-size: 0.88rem; font-weight: 400;
}
.calc-radios input { accent-color: var(--lupe-red, #c41e1e); }
.calc-radios label:has(input:checked) {
    border-color: var(--lupe-red, #c41e1e);
    background: #fdf4f4;
    font-weight: 600;
}

.calc-actions { margin-top: 1.25rem; display: flex; gap: 0.6rem; flex-wrap: wrap; }
.calc-btn {
    font-family: inherit; font-size: 0.9rem; font-weight: 600;
    padding: 0.65rem 1.3rem;
    border: 1px solid var(--lupe-ink, #1a1a1a);
    background: var(--lupe-ink, #1a1a1a); color: #fff;
    border-radius: 3px; cursor: pointer;
}
.calc-btn:hover { background: #000; }
.calc-btn--ghost { background: #fff; color: var(--lupe-ink, #1a1a1a); }
.calc-btn--ghost:hover { background: #f0efec; }

/* ── Ergebnis ─────────────────────────────────────────────── */
.calc-result {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid var(--lupe-line, #e5e3de);
    border-left: 4px solid var(--lupe-red, #c41e1e);
    border-radius: 3px;
}
.calc-result[hidden] { display: none; }
.calc-result__main {
    font-family: var(--lupe-title, Georgia, serif);
    font-size: clamp(1.5rem, 5vw, 2.1rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--lupe-ink, #1a1a1a);
    margin: 0 0 0.3rem;
}
.calc-result__label {
    font-size: 0.75rem; letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--lupe-muted, #6b6b6b); margin: 0 0 0.5rem;
}
.calc-result__note { font-size: 0.9rem; line-height: 1.55; color: #444; margin: 0.6rem 0 0; }

.calc-detail {
    margin-top: 1rem; border-top: 1px solid var(--lupe-line, #e5e3de); padding-top: 0.9rem;
    display: grid; grid-template-columns: 1fr auto; gap: 0.4rem 1rem;
    font-size: 0.9rem;
}
.calc-detail dt { color: #555; }
.calc-detail dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.calc-detail .sum { border-top: 1px solid #ddd; padding-top: 0.45rem; margin-top: 0.2rem; }
.calc-detail dt.sum, .calc-detail dd.sum { font-weight: 700; }

.calc-badge {
    display: inline-block; font-size: 0.78rem; font-weight: 700;
    padding: 0.25rem 0.65rem; border-radius: 3px; margin-bottom: 0.5rem;
}
.calc-badge.gut     { background: #e6f4ea; color: #1a6d33; }
.calc-badge.achtung { background: #fef5e0; color: #8a5a00; }
.calc-badge.warn    { background: #fdeaea; color: #a51c1c; }

.calc-error {
    margin-top: 1rem; padding: 0.7rem 0.9rem;
    background: #fdeaea; border-left: 3px solid #c41e1e;
    font-size: 0.88rem; color: #7a1414;
}
.calc-error[hidden] { display: none; }

/* Balken für Vergleiche */
.calc-bars { margin-top: 1rem; display: grid; gap: 0.55rem; }
.calc-bar { display: grid; grid-template-columns: 11rem 1fr auto; gap: 0.6rem; align-items: center; font-size: 0.88rem; }
.calc-bar__track { background: #eceae4; border-radius: 2px; height: 1.1rem; overflow: hidden; }
.calc-bar__fill { background: var(--lupe-red, #c41e1e); height: 100%; }
.calc-bar__fill.alt { background: #7a7a7a; }
.calc-bar__val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
@media (max-width: 560px) {
    .calc-bar { grid-template-columns: 1fr auto; }
    .calc-bar__track { grid-column: 1 / -1; }
}

/* ── Fließtext ────────────────────────────────────────────── */
.tool-text { margin: 2.5rem 0; }
.tool-text h2 {
    font-family: var(--lupe-title, Georgia, serif);
    font-size: 1.35rem; margin: 2rem 0 0.7rem; color: var(--lupe-ink, #1a1a1a);
}
.tool-text h3 { font-size: 1.05rem; margin: 1.4rem 0 0.5rem; }
.tool-text p, .tool-text li { font-size: 1rem; line-height: 1.68; color: #2c2c2c; }
.tool-text ul, .tool-text ol { padding-left: 1.3rem; }
.tool-text li { margin-bottom: 0.4rem; }
.tool-text a { color: var(--lupe-ink, #1a1a1a); text-decoration: underline; text-underline-offset: 2px; }
.tool-text a:hover { color: var(--lupe-red, #c41e1e); }
.tool-text .merke {
    background: var(--lupe-paper, #faf9f6);
    border-left: 3px solid var(--lupe-red, #c41e1e);
    padding: 0.9rem 1.1rem; margin: 1.2rem 0; font-size: 0.95rem; line-height: 1.6;
}

/* ── Tabellen ─────────────────────────────────────────────── */
.tool-table-wrap { overflow-x: auto; margin: 1.2rem 0; }
.tool-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 420px; }
.tool-table th, .tool-table td { padding: 0.55rem 0.7rem; text-align: left; border-bottom: 1px solid var(--lupe-line, #e5e3de); }
.tool-table th { background: var(--lupe-ink, #1a1a1a); color: #fff; font-size: 0.78rem; letter-spacing: 0.6px; text-transform: uppercase; font-weight: 600; }
.tool-table tbody tr:nth-child(even) { background: var(--lupe-paper, #faf9f6); }
.tool-table td.num, .tool-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tool-table tr.hervor { background: #fdf4f4 !important; }
.tool-table tr.hervor td { font-weight: 700; }

/* ── Fragen ───────────────────────────────────────────────── */
.tool-faq { margin: 2.5rem 0; }
.tool-faq h2 { font-family: var(--lupe-title, Georgia, serif); font-size: 1.35rem; margin: 0 0 1rem; }
.tool-faq details {
    border: 1px solid var(--lupe-line, #e5e3de);
    border-radius: 3px; margin-bottom: 0.6rem; background: #fff;
}
.tool-faq summary {
    padding: 0.85rem 1rem; cursor: pointer; font-weight: 600; font-size: 0.95rem;
    list-style: none; position: relative; padding-right: 2.4rem;
}
.tool-faq summary::-webkit-details-marker { display: none; }
.tool-faq summary::after {
    content: '+'; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
    font-size: 1.25rem; color: var(--lupe-red, #c41e1e); line-height: 1;
}
.tool-faq details[open] summary::after { content: '–'; }
.tool-faq details > div { padding: 0 1rem 1rem; font-size: 0.95rem; line-height: 1.65; color: #333; }
.tool-faq details > div p:first-child { margin-top: 0; }

/* ── Übersicht und Querverweise ───────────────────────────── */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.9rem;
}
.tool-card {
    display: flex; flex-direction: column; gap: 0.3rem;
    padding: 1.1rem;
    border: 1px solid var(--lupe-line, #e5e3de);
    border-radius: 3px; background: #fff;
    text-decoration: none; color: inherit;
    transition: border-color .15s, transform .15s;
}
.tool-card:hover { border-color: var(--lupe-red, #c41e1e); transform: translateY(-2px); }
.tool-card__icon { font-size: 1.6rem; line-height: 1; }
.tool-card__title { font-family: var(--lupe-title, Georgia, serif); font-size: 1.05rem; font-weight: 700; color: var(--lupe-ink, #1a1a1a); }
.tool-card__text { font-size: 0.85rem; line-height: 1.5; color: #555; }

.tool-verwandt { margin: 2.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--lupe-line, #e5e3de); }
.tool-verwandt h2 { font-family: var(--lupe-title, Georgia, serif); font-size: 1.25rem; margin: 0 0 1rem; }
.tool-verwandt__alle { margin-top: 1rem; font-size: 0.9rem; }
.tool-verwandt__alle a { color: var(--lupe-red, #c41e1e); text-decoration: none; font-weight: 600; }

/* Übersichtsseite */
.tools-index { max-width: 1100px; margin: 0 auto 3rem; padding: 0 1.25rem; }
.tools-index__head { padding: 2rem 0 1.5rem; border-bottom: 2px solid var(--lupe-red, #c41e1e); margin-bottom: 2rem; }
.tools-index__head h1 { font-family: var(--lupe-title, Georgia, serif); font-size: clamp(1.8rem, 5vw, 2.5rem); margin: 0 0 0.5rem; }
.tools-index__head p { font-size: 1.05rem; color: #444; margin: 0; max-width: 65ch; line-height: 1.6; }
.tools-rubrik { margin-bottom: 2.5rem; }
.tools-rubrik h2 {
    font-family: var(--lupe-sans, sans-serif);
    font-size: 0.82rem; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--lupe-muted, #6b6b6b);
    border-bottom: 1px solid var(--lupe-line, #e5e3de);
    padding-bottom: 0.5rem; margin: 0 0 1rem;
}

@media (max-width: 600px) {
    .calc { padding: 1.1rem; }
    .calc-grid { grid-template-columns: 1fr; }
    .calc-actions .calc-btn { width: 100%; }
}
