/* ============================================================================
   hfmt.css — Gestaltung der HFMT-Kiosk-Startseiten als wiederverwendbare
   Bausteine fuer andere Dienste. Beschreibung: ../README.md
   Stand: Okt. 2026 (Bib-Startseite Entwurf B, Asimut-Startseite, Leiste,
   Idle-Popup, USB-Seite). Flach, keine runden Ecken, keine Schatten.

   Zwei Modi:
     <body class="hfmt">            normale Website: scrollt, passt sich an
                                    Smartphone bis Grossbildschirm an
     <body class="hfmt hfmt-kiosk"> Kiosk: Groessen an der Bildschirmhoehe
                                    (vh) ausgerichtet, eine Seite = ein
                                    Bildschirm, kein Scrollen
   Pfade: Pinselstrich relativ zu dieser Datei (../assets/elemente/).
   ============================================================================ */

/* ---- 1. Farben und Masse (Tokens) ------------------------------------------ */
:root {
  /* Marke: Goldton als Hauptfarbe, dazu Schwarz und Weiss */
  --hfmt-gold: #CE9F56;          /* RGB 206 159 86  · CMYK 22 39 73 0 */
  --hfmt-gold-hover: #dbb173;
  --hfmt-ink: #111111;           /* "Schwarz" der Seiten (weicher als #000) */
  --hfmt-white: #ffffff;
  /* Fakultaets-/Dekanatsfarben (mit Gold kombinierbar) */
  --hfmt-musik: #009DE3;         /* RGB 0 157 227    · CMYK 100 0 0 0 */
  --hfmt-theater: #E6007E;       /* RGB 230 0 126    · CMYK 0 100 0 0 */
  --hfmt-wissenschaft: #1C3F86;  /* RGB 28 63 134    · CMYK 100 82 12 0 */
  --hfmt-kmm: #BB0E0C;           /* RGB 187 14 12    · CMYK 0 100 100 23 */
  --hfmt-dekanat12: #008A80;     /* RGB 0 138 128    · CMYK 98 18 57 0 */
  /* Neutrale Flaechen und Texte der Kiosk-Seiten */
  --hfmt-muted: #5c5c5c;         /* Nebentext */
  --hfmt-paper: #f6f1e7;         /* warme Kachel-/Panel-Flaeche */
  --hfmt-paper-hover: #efe6d4;
  --hfmt-line: #e4ddd0;          /* Trennlinien */
  --hfmt-danger: #BB0E0C;        /* = KMM-Rot: "Sitzung beenden", Fehler */
  --hfmt-danger-hover: #d41310;
  --hfmt-ok-bg: #e6f2f1;         /* Erfolgsmeldung (Rand: Dekanat-Gruen) */
  --hfmt-err-bg: #f7e3e2;        /* Fehlermeldung (Rand: KMM-Rot) */
  /* Dunkle Flaechen: Leiste, Popup */
  --hfmt-dark: #141414;
  --hfmt-dark-fg: #f3efe7;
  --hfmt-dark-muted: #b9b2a4;
  --hfmt-dark-dim: #8c8577;
  --hfmt-dark-divider: #3a342a;

  /* Schrift: Futura LT Pro (lizenziert, installiert) mit freien Ersatzschriften */
  --hfmt-font: "Futura LT Pro", "Futura LT Pro Book", "Futura", "URW Gothic", "Jost",
               "Century Gothic", "DejaVu Sans", sans-serif;

  /* Seitenbreite: max. 1500 px, Rand 28-96 px */
  --hfmt-max: 1500px;
  --hfmt-gutter: clamp(16px, 5vw, 96px);

  /* Typo- und Abstandsskala, Modus "Website" (rem, scrollende Seite) */
  --hfmt-h1: clamp(2.25rem, 1.2rem + 4.2vw, 6rem);
  --hfmt-h2: clamp(1.4rem, 1rem + 1.6vw, 2.25rem);
  --hfmt-lead: clamp(1.05rem, .95rem + .4vw, 1.3rem);
  --hfmt-body: 1.0625rem;
  --hfmt-small: .9375rem;
  --hfmt-tile-title: clamp(1.3rem, 1rem + 1vw, 2.25rem);
  --hfmt-space-s: .75rem;
  --hfmt-space-m: clamp(1.25rem, 1rem + 1.5vw, 3rem);
  --hfmt-space-l: clamp(1.75rem, 1rem + 3vw, 4.5rem);
  --hfmt-tile-min-h: clamp(8rem, 6rem + 6vw, 16rem);
}

/* Modus "Kiosk": exakt die Werte der Kiosk-Startseiten — alles haengt an der
   Bildschirmhoehe, damit eine Seite ohne Scrollen auf 1366x768 bis 1920x1080
   (abzueglich Leiste und Browser-Leisten) passt. */
.hfmt-kiosk {
  --hfmt-gutter: clamp(28px, 5vw, 96px);
  --hfmt-h1: clamp(40px, 8.4vh, 96px);
  --hfmt-h2: clamp(20px, 3vh, 30px);
  --hfmt-lead: clamp(15px, 2.1vh, 20px);
  --hfmt-body: clamp(14px, 1.8vh, 17px);
  --hfmt-small: clamp(13px, 1.6vh, 15px);
  --hfmt-tile-title: clamp(20px, 3.4vh, 36px);
  --hfmt-space-s: 8px;
  --hfmt-space-m: clamp(18px, 4.2vh, 48px);
  --hfmt-space-l: clamp(22px, 5vh, 60px);
  --hfmt-tile-min-h: clamp(120px, 24vh, 260px);
}

/* ---- 2. Grundlagen ------------------------------------------------------- */
.hfmt, .hfmt *, .hfmt *::before, .hfmt *::after { box-sizing: border-box; }
html:has(> body.hfmt) { height: 100%; }
body.hfmt {
  margin: 0; min-height: 100%;
  font-family: var(--hfmt-font); font-size: var(--hfmt-body); line-height: 1.4;
  color: var(--hfmt-ink); background: var(--hfmt-white);
  display: flex; flex-direction: column;
}
body.hfmt-kiosk { height: 100%; overflow: hidden; }
/* :where() = Gewichtung 0, damit Bausteine wie .hfmt-cta/.hfmt-btn als <a> ihre Farbe behalten */
:where(.hfmt) a { color: inherit; }
.hfmt :focus-visible { outline: 4px solid var(--hfmt-gold); outline-offset: 2px; }
.hfmt .hfmt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hfmt [lang="en"].hfmt-second, .hfmt .hfmt-second { color: var(--hfmt-muted); font-size: .9em; }

/* Inhaltsbreite */
.hfmt-wrap { width: min(var(--hfmt-max), 100% - 2 * var(--hfmt-gutter)); margin-inline: auto; }

/* ---- 3. Kopf: Logo links, Hinweis rechts ------------------------------------ */
.hfmt-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
               padding-top: clamp(22px, 4vh, 48px); }
.hfmt-header .hfmt-logo { width: clamp(70px, 11vh, 130px); height: auto; display: block; }
.hfmt-notice { display: flex; gap: 12px; align-items: center; max-width: 36rem; margin: 0;
               font-size: var(--hfmt-lead); line-height: 1.35; color: #222;
               border-left: 4px solid var(--hfmt-gold); padding: 6px 0 6px 14px; }
.hfmt-notice svg { flex: none; width: 22px; height: 22px; color: var(--hfmt-gold); }
.hfmt-notice small { display: block; color: var(--hfmt-muted); font-size: .8em; margin-top: 2px; }

/* Hauptbereich: beginnt mit festem Abstand unter dem Kopf (NICHT vertikal
   zentriert — das liess oben eine Luecke und zog das Gewicht nach unten) */
.hfmt-main { flex: 1; display: flex; flex-direction: column; justify-content: flex-start;
             padding: clamp(18px, 6vh, 72px) 0 clamp(12px, 3vh, 40px); }

/* ---- 4. Titel mit Pinselstrich ---------------------------------------------- */
.hfmt-title { font-size: var(--hfmt-h1); font-weight: 700; line-height: 1; margin: 0; hyphens: auto; overflow-wrap: break-word; }
/* Genau EIN kurzes Wort (das Thema der Seite, max. ~12 Zeichen) bekommt den
   Pinselstrich in die untere Haelfte. Es bricht nie um — lange Komposita
   ("Instrumentenverleih") laufen auf dem Smartphone ueber den Rand. */
.hfmt-brush { position: relative; white-space: nowrap; isolation: isolate; }
.hfmt-brush::after { content: ""; position: absolute; left: -3%; right: -4%; bottom: -.06em; height: .66em;
                     background: url("pinselstrich-gold.png") center / 100% 100% no-repeat;
                     z-index: -1; }
.hfmt-h2 { font-size: var(--hfmt-h2); font-weight: 700; line-height: 1.1; margin: 0; }

/* ---- 5. Aktionszeile: Suche bzw. Hauptknopf + Nebenlink ---------------------- */
.hfmt-actionrow { display: flex; gap: 12px; margin: var(--hfmt-space-m) 0 0; max-width: 1240px; }
.hfmt-hint { margin: var(--hfmt-space-s) 0 0; color: var(--hfmt-muted); font-size: var(--hfmt-small); max-width: 62rem; }

/* Suchfeld: 2 px schwarzer Rahmen, schwarzer Knopf angesetzt */
.hfmt-search { flex: 1; display: flex; border: 2px solid var(--hfmt-ink); background: var(--hfmt-white); }
.hfmt-search input { flex: 1; min-width: 0; border: 0; font: inherit; font-size: clamp(18px, 2.6vh, 26px);
                     padding: clamp(12px, 2vh, 20px) 22px; background: transparent; color: inherit; }
.hfmt-search input:focus-visible { outline: none; box-shadow: inset 0 -4px 0 var(--hfmt-gold); }
.hfmt-search button { border: 0; background: var(--hfmt-ink); color: var(--hfmt-white); font: inherit; font-weight: 700;
                      font-size: clamp(16px, 2.2vh, 22px); padding: 0 clamp(18px, 2vw, 34px);
                      display: flex; gap: 10px; align-items: center; cursor: pointer; }
.hfmt-search button svg { width: 22px; height: 22px; }

/* Hauptknopf (Call to Action): schwarze Flaeche, fette Zeile + Unterzeile, Pfeil rechts */
.hfmt-cta { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 18px;
            background: var(--hfmt-ink); color: var(--hfmt-white); text-decoration: none; border: 2px solid var(--hfmt-ink);
            padding: clamp(12px, 2vh, 20px) clamp(18px, 2vw, 34px); }
.hfmt-cta strong { display: block; font-size: clamp(20px, 3vh, 30px); line-height: 1.1; }
.hfmt-cta small { display: block; margin-top: 4px; font-size: clamp(13px, 1.8vh, 17px); color: #cfc9bd; }
.hfmt-cta .hfmt-arrow { flex: none; font-size: clamp(26px, 4vh, 40px); line-height: 1; }
.hfmt-cta:hover { background: #2a2a2a; }

/* Nebenlink neben Suche/Hauptknopf: 2 px Rahmen, transparent */
.hfmt-sidelink { display: flex; align-items: center; gap: 8px; padding: 0 clamp(16px, 1.6vw, 28px);
                 border: 2px solid var(--hfmt-ink); color: var(--hfmt-ink); font-weight: 700; text-decoration: none;
                 white-space: nowrap; font-size: var(--hfmt-lead); }
.hfmt-sidelink:hover { background: var(--hfmt-paper); }

/* ---- 6. Knoepfe ---------------------------------------------------------- */
.hfmt-btn { display: inline-flex; align-items: center; gap: 8px; border: 2px solid transparent; font: inherit; font-weight: 700;
            font-size: clamp(14px, 1.9vh, 18px); line-height: 1.2; padding: 9px 16px; cursor: pointer; text-decoration: none;
            background: var(--hfmt-ink); color: var(--hfmt-white); }
.hfmt-btn svg { width: 20px; height: 20px; flex: none; }
.hfmt-btn:hover { background: #2a2a2a; }
.hfmt-btn:disabled, .hfmt-btn[aria-disabled="true"] { opacity: .35; cursor: default; }
/* Gold: IMMER mit dunkler Schrift (weiss auf Gold hat nur 2,4:1 Kontrast) */
.hfmt-btn-gold { background: var(--hfmt-gold); color: var(--hfmt-ink); }
.hfmt-btn-gold:hover { background: var(--hfmt-gold-hover); }
.hfmt-btn-danger { background: var(--hfmt-danger); color: var(--hfmt-white); }
.hfmt-btn-danger:hover { background: var(--hfmt-danger-hover); }
.hfmt-btn-outline { background: transparent; color: var(--hfmt-ink); border-color: var(--hfmt-ink); }
.hfmt-btn-outline:hover { background: var(--hfmt-paper); }
.hfmt-btn-outline.hfmt-btn-danger { color: var(--hfmt-danger); border-color: var(--hfmt-danger); background: transparent; }
/* Fakultaetsfarbe als Knopf: nur mit ausreichendem Kontrast (siehe README) */
.hfmt-btn-faculty { background: var(--c, var(--hfmt-wissenschaft)); color: var(--hfmt-white); }

/* ---- 7. Kacheln (Aufgaben/Dienste) -------------------------------------------- */
/* Farbe je Kachel per style="--c: var(--hfmt-musik)" — 8 px Oberkante + Icon */
.hfmt-tiles { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: clamp(12px, 1.5vw, 24px);
              margin: var(--hfmt-space-l) 0 0; padding: 0; list-style: none; }
.hfmt-tile { display: flex; flex-direction: column; justify-content: flex-start; gap: clamp(14px, 3vh, 34px);
             min-height: var(--hfmt-tile-min-h); padding: clamp(16px, 2.5vh, 28px); background: var(--hfmt-paper);
             color: inherit; text-decoration: none; border-top: 8px solid var(--c, var(--hfmt-gold)); }
a.hfmt-tile:hover { background: var(--hfmt-paper-hover); }
.hfmt-tile > svg { width: clamp(36px, 5vh, 52px); height: clamp(36px, 5vh, 52px); color: var(--c, var(--hfmt-gold)); }
.hfmt-tile strong { display: block; font-size: var(--hfmt-tile-title); font-weight: 700; line-height: 1.1; }
.hfmt-tile small { display: block; margin-top: 6px; font-size: var(--hfmt-body); color: var(--hfmt-muted); }
.hfmt-tile p { margin: 6px 0 0; line-height: 1.35; }

/* Schritt-Kacheln: grosse Ziffer + Icon in der Kachelfarbe */
.hfmt-step-num { display: flex; align-items: center; gap: 12px; color: var(--c, var(--hfmt-gold)); }
.hfmt-step-num b { font-size: clamp(28px, 4.6vh, 48px); font-weight: 700; line-height: 1; }
.hfmt-step-num svg { width: clamp(30px, 4.4vh, 44px); height: clamp(30px, 4.4vh, 44px); }

/* ---- 8. Panel (Arbeitsflaeche mit Liste, z.B. USB-Seite) ---------------------- */
.hfmt-panel { display: flex; flex-direction: column; background: var(--hfmt-paper); border-top: 8px solid var(--c, var(--hfmt-gold)); }
.hfmt-panel-head { padding: clamp(12px, 2.2vh, 22px) clamp(14px, 1.6vw, 24px) 10px; }
.hfmt-panel-head h2 { margin: 0; font-size: var(--hfmt-h2); display: flex; align-items: center; gap: 12px; }
.hfmt-panel-head h2 svg { color: var(--c, var(--hfmt-gold)); width: 30px; height: 30px; flex: none; }
.hfmt-list { margin: 0 clamp(14px, 1.6vw, 24px); background: var(--hfmt-white); border: 1px solid var(--hfmt-line); }
.hfmt-list > * { display: flex; align-items: center; gap: 12px; padding: clamp(7px, 1.3vh, 12px) 14px;
                 border-bottom: 1px solid var(--hfmt-line); }
.hfmt-list > *:last-child { border-bottom: 0; }
.hfmt-list svg { color: var(--hfmt-muted); width: 22px; height: 22px; flex: none; }
.hfmt-panel-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: clamp(10px, 2vh, 18px) clamp(14px, 1.6vw, 24px); }
.hfmt-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px;
              margin: 0 clamp(14px, 1.6vw, 24px); border: 2px dashed #d0d0c8; padding: 20px; color: var(--hfmt-muted); }
.hfmt-empty strong { color: var(--hfmt-ink); font-size: 1.15em; }
.hfmt-meter { height: 8px; background: #e4e4de; max-width: 360px; }
.hfmt-meter > i { display: block; height: 100%; background: var(--hfmt-gold); }

/* ---- 9. Meldungen ------------------------------------------------------- */
.hfmt-msg { margin: var(--hfmt-space-s) 0 0; padding: 10px 16px; font-weight: 700; background: var(--hfmt-ok-bg);
            border-left: 6px solid var(--hfmt-dekanat12); }
.hfmt-msg-err { background: var(--hfmt-err-bg); border-color: var(--hfmt-danger); }
.hfmt-msg-info { background: var(--hfmt-paper); border-color: var(--hfmt-gold); }

/* ---- 10. Fusszeile ------------------------------------------------------ */
.hfmt-footer { margin-top: auto; border-top: 1px solid var(--hfmt-line); }
.hfmt-footer .hfmt-wrap { display: flex; flex-wrap: wrap; gap: 10px 32px; align-items: center; padding: clamp(12px, 2.2vh, 22px) 0; }
.hfmt-footer a, .hfmt-footer .hfmt-footer-item { display: inline-flex; gap: 9px; align-items: center; font-weight: 700; text-decoration: none;
                                                  font-size: clamp(15px, 1.9vh, 18px); }
.hfmt-footer svg { color: var(--hfmt-gold); width: 22px; height: 22px; flex: none; }
.hfmt-footer .hfmt-footer-aside { margin-left: auto; color: var(--hfmt-muted); font-size: var(--hfmt-small); }

/* ---- 11. Dunkle Leiste (wie die Kiosk-waybar) ------------------------------ */
.hfmt-bar { display: flex; align-items: center; min-height: 40px; background: var(--hfmt-dark); color: var(--hfmt-dark-fg);
            border-bottom: 3px solid var(--hfmt-gold); font-size: 15px; }
.hfmt-bar img { height: 28px; margin: 0 10px 0 14px; }
.hfmt-bar-brand { font-weight: 700; font-size: 16px; padding: 0 16px 0 0; margin: 8px 0; border-right: 1px solid var(--hfmt-dark-divider); }
.hfmt-bar-hint { color: var(--hfmt-dark-muted); padding: 0 16px; }
.hfmt-bar-spacer { flex: 1; }
.hfmt-bar-meta { color: var(--hfmt-dark-dim); font-size: 12px; padding: 0 16px 0 6px; }
.hfmt-bar .hfmt-btn { height: 32px; margin: 4px 0 4px 6px; font-size: 15px; padding: 0 16px; }
.hfmt-bar .hfmt-btn:last-child { margin-right: 8px; }

/* ---- 12. Popup / Dialog (wie die Idle-Vorwarnung) ---------------------------- */
.hfmt-popup { display: flex; align-items: center; gap: 34px; max-width: 980px; padding: 30px 40px;
              background: rgba(20, 20, 20, .94); color: var(--hfmt-dark-fg); border: 4px solid var(--hfmt-gold); font-size: 24px; line-height: 1.3; }
.hfmt-popup-urgent { border-color: var(--hfmt-danger); }
.hfmt-popup img { width: 110px; flex: none; }
.hfmt-popup b.hfmt-popup-title { display: block; font-size: 1.25em; margin-bottom: 12px; }
.hfmt-popup small { display: block; margin-top: 14px; font-size: .7em; color: var(--hfmt-dark-muted); }

/* ---- 13. Statusseite (Vollbild, z.B. "Verbinde ...") ------------------------- */
.hfmt-status { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 0 8vw; background: var(--hfmt-white); }
.hfmt-status .hfmt-logo { width: clamp(90px, 10vw, 160px); margin-bottom: 5vh; }
.hfmt-status .hfmt-title { font-size: clamp(36px, 6vw, 96px); }
.hfmt-status-msg { margin: 4vh 0 0; font-size: clamp(18px, 2.2vw, 32px); color: var(--hfmt-muted); border-left: 6px solid var(--hfmt-gold);
                   padding-left: 18px; max-width: 40em; }

/* ---- 14. Kleine Bildschirme (nur Modus Website) ----------------------------- */
@media (max-width: 1100px) {
  body.hfmt:not(.hfmt-kiosk) .hfmt-tiles { --cols: 2; }
}
@media (max-width: 720px) {
  body.hfmt:not(.hfmt-kiosk) .hfmt-header { flex-direction: column; }
  body.hfmt:not(.hfmt-kiosk) .hfmt-actionrow { flex-direction: column; }
  body.hfmt:not(.hfmt-kiosk) .hfmt-sidelink { padding: 12px 16px; }
  body.hfmt:not(.hfmt-kiosk) .hfmt-tiles { --cols: 1; }
  body.hfmt:not(.hfmt-kiosk) .hfmt-title { white-space: normal; }
  body.hfmt:not(.hfmt-kiosk) .hfmt-footer .hfmt-footer-aside { margin-left: 0; }
  body.hfmt:not(.hfmt-kiosk) .hfmt-popup { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .hfmt * { transition: none !important; } }
