/* ═══════════════════════════════════════════════════
   IMIFACTORY – Universal Einheiten-Rechner
   style.css | Version 1.1
   Standard: htmlarchtekt.txt v3.0
   ═══════════════════════════════════════════════════ */

/* ─── GEÄNDERT: box-sizing global – verhindert Layout-Brüche auf kleinen Screens ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ─── 1. BODY ─── */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f8fafc;
  margin: 0;
  color: #333;
  line-height: 1.6;
}

/* ─── 2. HEADER ─── */
header {
  background: linear-gradient(90deg, #05263d 0%, #0b3c5d 100%);
  padding: 15px 25px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sitename {
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sitename img {
  height: 32px;
  width: auto;
}

/* ─── 3. BREADCRUMB ─── */
.breadcrumb {
  margin-top: 8px;
  font-size: 12px;
  color: #cbd5e1;
}

.breadcrumb a {
  color: #fff;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: #00bfae;
}

/* ─── 4. CONTAINER ─── */
.container {
  max-width: 1000px;
  margin: 30px auto;
  padding: 0 20px;
}

/* ─── 5. BACK LINK ─── */
.back-link {
  display: inline-block;
  margin-bottom: 15px;
  text-decoration: none;
  color: #0b3c5d;
  font-size: 14px;
  font-weight: 700;
}

.back-link:hover {
  color: #00897b;
}

/* ─── 6. INTROBOX ─── */
.imi-intro {
  background: linear-gradient(90deg, #e7f3fd, #f4faff);
  border-left: 5px solid #0b3c5d;
  padding: 24px 28px;
  border-radius: 4px;
  margin-bottom: 22px;
}

.imi-intro h2 {
  margin: 0 0 10px;
  color: #0b3c5d;
  font-size: 20px;
}

.imi-intro p {
  font-size: 15px;
  color: #444;
  margin: 0;
}

/* ─── 7. KATEGORIE-NAVIGATION ─── */
.cat-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

/* GEÄNDERT: min-height 44px für WCAG 2.5.5 Touch-Target */
.cat-btn {
  padding: 10px;
  min-height: 44px;
  background: #fff;
  border: 1px solid #d1dce6;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  color: #0b3c5d;
  font-size: 13px;
  text-align: center;
  font-family: inherit;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.cat-btn:hover {
  background: #f0f4f8;
}

.cat-btn.active {
  background: #0b3c5d;
  color: #fff;
  border-color: #0b3c5d;
}

/* GEÄNDERT: Fokus-Indikator für Tastaturnavigation (WCAG 2.4.7) */
.cat-btn:focus-visible {
  outline: 3px solid #00bfae;
  outline-offset: 2px;
}

/* ─── 8. CONTENT BOX ─── */
.content-box {
  background: #fff;
  border: 1px solid #d1dce6;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 22px;
}

/* ─── 9. BOX HEADER ─── */
.box-header {
  background: #0b3c5d;
  color: #fff;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─── 10. BOX BODY ─── */
.box-body {
  padding: 24px 28px;
}

/* ─── 11. RECHNER GRID ─── */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ─── 12. EINZEL-EINHEIT ─── */
.unit-group {
  margin: 0;
}

/* GEÄNDERT: label via for-Attribut verknüpft (Accessibility WCAG 1.3.1) */
.unit-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #5a7080;
  margin-bottom: 5px;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #d1dce6;
  border-radius: 6px;
  overflow: hidden;
}

/* GEÄNDERT: min-height 44px für Touch-Target (WCAG 2.5.5) */
.input-wrapper input[type="number"] {
  flex: 1;
  border: none;
  padding: 12px;
  font-size: 16px;
  background: transparent;
  outline: none;
  width: 100%;
  font-family: monospace;
  min-height: 44px;
  color: #333;
}

/* GEÄNDERT: Fokus-Ring auf Wrapper, nicht nur input */
.input-wrapper:focus-within {
  border-color: #0b3c5d;
  box-shadow: 0 0 0 2px rgba(11, 60, 93, 0.15);
}

/* GEÄNDERT: Spinner bei number-input ausblenden (cleaner UI) */
.input-wrapper input[type="number"]::-webkit-inner-spin-button,
.input-wrapper input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-wrapper input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.unit-tag {
  padding: 12px;
  background: #e2ebf3;
  color: #0b3c5d;
  font-weight: 700;
  font-size: 10px;
  min-width: 75px;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── 13. INFO TEXT ─── */
.info-text {
  font-size: 13px;
  color: #64748b;
  margin-top: 15px;
  font-style: italic;
  border-top: 1px solid #eee;
  padding-top: 10px;
  margin-bottom: 0;
}

/* ─── 14. NOTE LIST ─── */
.note-list {
  font-size: 14px;
  padding-left: 18px;
  margin: 0;
}

.note-list li {
  margin-bottom: 8px;
}

/* ─── 15. FOOTER ─── */
footer {
  text-align: center;
  font-size: 13px;
  color: #64748b;
  margin-top: 40px;
  padding-bottom: 30px;
  border-top: 1px solid #e2e8f0;
  padding-top: 20px;
}

footer a {
  color: #0b3c5d;
  text-decoration: none;
  margin: 0 10px;
  font-weight: 600;
}

footer a:hover {
  color: #00897b;
}

/* GEÄNDERT: Fokus-Indikator für Footer-Links */
footer a:focus-visible {
  outline: 2px solid #00bfae;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ─── 16. RESPONSIVE ─── */
@media (max-width: 680px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }

  .cat-nav {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .box-body {
    padding: 16px;
  }

  .imi-intro {
    padding: 18px 16px;
  }
}

@media (max-width: 400px) {
  .sitename {
    font-size: 18px;
  }

  .cat-nav {
    grid-template-columns: 1fr 1fr;
  }
}
