/* Kategorie-Uebersicht (/kategorien) — 2026-08-28.
 *
 * Zweck: Auf dem Handy gab es keinen Weg durch die Taxonomie. Das Menue in
 * der Leiste ist ein Hover-Menue und unter 992 Pixeln ausgeblendet; auf einem
 * Touchgeraet gaebe es dafuer auch gar kein Hover. Diese Seiten ersetzen es
 * dort durch echte Links.
 *
 * Deshalb ist alles hier zuerst fuer die schmale Breite gebaut und waechst
 * nach oben, nicht umgekehrt. Farben sind die Projekt-Toene aus navbar.css
 * (#00A8CC / #008FB3), bewusst als feste Werte wie im uebrigen Projekt.
 */

.kat-seite {
    max-width: 1100px;
    padding-bottom: 3rem;
}

/* Pfad */
.kat-pfad {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    margin-bottom: .9rem;
    font-size: .8rem;
    color: #6b7785;
}

.kat-pfad a {
    color: #6b7785;
    text-decoration: none;
}

.kat-pfad a:hover {
    color: #008FB3;
    text-decoration: underline;
}

.kat-h1 {
    margin: 0 0 .35rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.kat-unter {
    margin: 0 0 1.4rem;
    color: #6b7785;
    font-size: .92rem;
}

.kat-kopf {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .6rem;
    margin-bottom: 1.2rem;
}

.kat-alle {
    color: #008FB3;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.kat-alle:hover {
    text-decoration: underline;
}

/* --- Uebersicht: eine Kachel je Hauptkategorie ------------------------- */

/* Eine Spalte auf dem Handy. Zwei nebeneinander waeren bei 390 Pixeln rund
   170 Pixel breit, und darin bricht "Bücher, Filme & Musik" dreizeilig um. */
.kat-raster {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: .6rem;
}

@media (min-width: 640px) {
    .kat-raster { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
    .kat-raster { grid-template-columns: repeat(3, 1fr); }
}

.kat-kachel {
    display: flex;
    align-items: center;
    gap: .85rem;
    /* 64 Pixel hohe Trefferflaeche: Eine Zeile Text waere auf dem Handy zu
       knapp fuer den Daumen. */
    min-height: 64px;
    padding: .7rem .9rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .75rem;
    color: #2c3e50;
    text-decoration: none;
    transition: border-color .12s, box-shadow .12s;
}

.kat-kachel:hover,
.kat-kachel:focus {
    border-color: #00A8CC;
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .06);
    color: #2c3e50;
    text-decoration: none;
}

/* Die Huelle steht immer, auch ohne Motiv — sonst ruecken die Namen, sobald
   die Bilder eintreffen, und die ganze Liste zappelt. Dieselbe Ueberlegung
   wie im Hover-Menue. */
.kat-bild {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #f1f3f5;
    border: 1px solid #e9ecef;
}

.kat-bild-leer {
    background: #f8f9fa;
    border-color: #f1f3f5;
}

.kat-bild img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.kat-text {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
}

.kat-name {
    font-size: .96rem;
    font-weight: 600;
    line-height: 1.25;
}

.kat-zahl {
    color: #6b7785;
    font-size: .76rem;
    font-weight: 400;
}

.kat-pfeil {
    margin-left: auto;
    color: #c3c9d2;
    font-size: 1.1rem;
}

.kat-kachel:hover .kat-pfeil {
    color: #008FB3;
}

/* --- Eine Hauptkategorie: Unterkategorien mit ihren Punkten ------------ */

.kat-block {
    padding: .9rem 0;
    border-top: 1px solid #eef1f4;
}

.kat-block:first-of-type {
    border-top: none;
    padding-top: 0;
}

.kat-h2 {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    margin: 0 0 .5rem;
    font-size: 1rem;
    font-weight: 700;
}

.kat-h2 a {
    color: #2c3e50;
    text-decoration: none;
}

.kat-h2 a:hover {
    color: #008FB3;
    text-decoration: underline;
}

/* Zwei Spalten schon auf dem Handy: Die Namen der dritten Ebene sind kurz
   ("Tastaturen", "Mäuse"), und eine einspaltige Liste mit 100 Punkten waere
   endloses Scrollen. */
.kat-liste {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .1rem .8rem;
}

@media (min-width: 768px) {
    .kat-liste { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1100px) {
    .kat-liste { grid-template-columns: repeat(4, 1fr); }
}

.kat-liste a {
    display: block;
    /* 40 Pixel Trefferflaeche, auch wenn der Text nur eine Zeile fuellt. */
    min-height: 40px;
    padding: .5rem .1rem;
    color: #4b5563;
    font-size: .86rem;
    line-height: 1.3;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.kat-liste a:hover,
.kat-liste a:focus {
    color: #008FB3;
    text-decoration: underline;
}

/* --- Wechsel in eine andere Hauptkategorie ---------------------------- */

.kat-wechsel {
    margin-top: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid #e2e8f0;
}

.kat-chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.kat-chips a {
    display: inline-block;
    padding: .45rem .8rem;
    background: #f4f6f8;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #4b5563;
    font-size: .84rem;
    text-decoration: none;
}

.kat-chips a:hover,
.kat-chips a:focus {
    background: #eaf7fb;
    border-color: #00A8CC;
    color: #007fa3;
}

/* --- Dunkle Darstellung ------------------------------------------------ */

html.dark-mode .kat-kachel {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

html.dark-mode .kat-kachel:hover {
    border-color: #38bdf8;
    color: #e5e7eb;
}

html.dark-mode .kat-bild {
    background: #111827;
    border-color: #374151;
}

html.dark-mode .kat-h2 a,
html.dark-mode .kat-name {
    color: #e5e7eb;
}

html.dark-mode .kat-h2 a:hover,
html.dark-mode .kat-liste a:hover,
html.dark-mode .kat-alle {
    color: #38bdf8;
}

html.dark-mode .kat-liste a {
    color: #d1d5db;
}

html.dark-mode .kat-block {
    border-top-color: #374151;
}

html.dark-mode .kat-chips a {
    background: #111827;
    border-color: #374151;
    color: #d1d5db;
}
