/* ============================================================
   Holzfeuchterechner – Stylesheet
   Scope: .hfr-calculator (all rules are namespaced)
   Fonts: Roboto, Roboto Mono (Google Fonts)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=Roboto+Mono:wght@400;700&display=swap');

/* ── Container ─────────────────────────────────────────────── */
.hfr-calculator {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    background: transparent;
    border: none;
    max-width: 1440px;
    padding: 0;
    box-sizing: border-box;
    color: #000000;
}

/* ── Section ────────────────────────────────────────────────── */
.hfr-section-title {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.25em;
    font-weight: 700;
    margin: 0 0 10px;
    padding: 0;
    color: #000000;
    border: none;
    background: none;
}

/* ── 3-column grid ──────────────────────────────────────────── */
.hfr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px 14px;
}

/* ── Field ──────────────────────────────────────────────────── */
.hfr-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hfr-label {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 0.78em;
    color: #555555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Input (editable) ───────────────────────────────────────── */
.hfr-input {
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #b0b0b0;
    padding: 7px 10px;
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    font-size: 1em;
    text-align: center;
    color: #000000;
    -moz-appearance: textfield;
    outline: none;
    border-radius: 0;
    box-shadow: none;
}

.hfr-input::-webkit-outer-spin-button,
.hfr-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.hfr-input:focus {
    border-color: #344461;
}

/* ── Output (read-only calculated) ─────────────────────────── */
.hfr-output {
    width: 100%;
    box-sizing: border-box;
    background: #e2e2e2;
    border: 1px solid #c8c8c8;
    padding: 7px 10px;
    font-family: 'Roboto Mono', monospace;
    font-size: 1em;
    font-weight: 700;
    text-align: center;
    color: #555555;
    min-height: 34px;
}

/* ── Divider ────────────────────────────────────────────────── */
.hfr-divider {
    border: none;
    border-top: 1px solid #b8b8b8;
    margin: 14px 0;
}

/* ── Result row – same grid as .hfr-grid so columns align ── */
.hfr-result-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px 14px;
    margin-bottom: 8px;
}

.hfr-result-label {
    grid-column: 1;
    font-family: 'Roboto Mono', monospace;
    font-size: 1.25em;
    font-weight: 700;
    color: #000000;
    display: flex;
    align-items: center;
}

.hfr-result-btn {
    grid-column: 2 / 4;
    padding: 11px 10px;
    text-align: center;
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    font-size: 1em;
    letter-spacing: 0.06em;
    color: #ffffff;
    background: #aaaaaa;
    cursor: default;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Floor type bar ─────────────────────────────────────────── */
.hfr-floor-type {
    border-top: 3px solid #000000;
    background: #344461;
    color: #ffffff;
    text-align: center;
    padding: 7px 10px;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 0.85em;
    margin-bottom: 6px;
    display: none;
}

.hfr-floor-type.visible {
    display: block;
}

/* ── Copyright ──────────────────────────────────────────────── */
.hfr-copyright {
    text-align: right;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 0.72em;
    color: #888888;
    margin: 4px 0 0;
    padding: 0;
}

/* ============================================================
   State colours  (applied to .hfr-output and .hfr-result-btn)
   ============================================================ */

/* Green – OK */
.hfr-output.state-ok         { color: #338b29; }
.hfr-result-btn.state-ok     { background: #338b29; }

/* Orange – slightly too humid / slightly too dry */
.hfr-output.state-warn       { color: #d78418; }
.hfr-result-btn.state-warn   { background: #d78418; }

/* Red – critical: very dry, very humid, condensation */
.hfr-output.state-danger     { color: #bf2436; }
.hfr-result-btn.state-danger { background: #bf2436; }

/* ============================================================
   Responsive – Mobile  (single column)
   ============================================================ */
@media (max-width: 540px) {

    .hfr-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .hfr-label {
        white-space: normal;
    }

    .hfr-result-row {
        grid-template-columns: 1fr;
    }

    .hfr-result-label {
        grid-column: 1;
    }

    .hfr-result-btn {
        grid-column: 1;
    }
}
