/*
 * Wochenplan – Feld in Türkis. Oben die Tage (Montag bis Sonntag), links die Tageszeiten mit Bild, dazwischen
 * die Felder mit bis zu 3 Karten. Heute hell und mit Rahmen, vergangene Tage blass, die jetzige Tageszeit orange.
 */

.wochenplan {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.5vh, 12px);
    padding: clamp(10px, 2.4vh, 20px);
    color: var(--tinte);
}
.wochenplan__leer {
    flex: none;
    align-self: center;
    padding: 8px 18px;
    border-radius: var(--radius-voll);
    background: color-mix(in srgb, var(--weiss) 55%, transparent);
    font-family: var(--schrift-titel);
    font-size: clamp(15px, 2.2vh, 18px);
    font-weight: 700;
}

/* ---------- Raster: Tageszeit-Spalte + 7 Tage, Kopfzeile + 4 Tageszeiten ---------- */

.wochenplan__raster {
    --abstand-raster: clamp(4px, .9vh, 8px);
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: clamp(68px, 8.5vw, 108px) repeat(7, minmax(0, 1fr));
    grid-template-rows: auto repeat(4, minmax(0, 1fr));
    gap: var(--abstand-raster);
}

/* Tage oben */
.wochenplan__tag {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: clamp(5px, 1vh, 9px) 4px;
    border: 0;
    border-radius: clamp(12px, 2vh, 16px);
    background: color-mix(in srgb, var(--weiss) 40%, transparent);
    color: var(--tinte);
    font-family: var(--schrift-titel);
    cursor: pointer;
    transition: transform .45s var(--feder), opacity .3s;
}
.wochenplan__tag:active { transform: scale(.93); }
.wochenplan__tag-name {
    max-width: 100%;
    font-size: clamp(13px, 2.2vh, 19px);
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wochenplan__heute { display: none; font-size: clamp(11px, 1.6vh, 13px); font-weight: 700; color: var(--orange); }
.wochenplan__tag.ist-heute { background: var(--tinte); color: var(--creme); }
.wochenplan__tag.ist-heute .wochenplan__heute { display: block; }

/* Tageszeiten links */
.wochenplan__zeit {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px;
    border-radius: clamp(12px, 2vh, 16px);
    background: color-mix(in srgb, var(--weiss) 25%, transparent);
    text-align: center;
}
.wochenplan__zeit-bild { width: clamp(28px, 6vh, 54px); height: clamp(28px, 6vh, 54px); border-radius: 8px; background: var(--weiss); -webkit-user-drag: none; }
.wochenplan__zeit-name { max-width: 100%; font-family: var(--schrift-titel); font-size: clamp(11px, 1.7vh, 15px); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.wochenplan__zeit.ist-jetzt { background: var(--orange); }

/* Felder */
.wochenplan__feld {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
    border-radius: clamp(12px, 2vh, 16px);
    background: color-mix(in srgb, var(--weiss) 25%, transparent);
    transition: opacity .3s;
}
.wochenplan__feld.ist-heute { background: color-mix(in srgb, var(--weiss) 70%, transparent); }
.wochenplan__feld.ist-jetzt { box-shadow: inset 0 0 0 4px var(--orange); }
.wochenplan__tag.ist-vorbei, .wochenplan__feld.ist-vorbei { opacity: .45; }

/* Karten: Bild über dem Wort; bei drei Karten in einem Feld liegen sie quer (Bild links) */
.wochenplan__karte {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: clamp(4px, .8vh, 7px);
    border: 0;
    border-radius: clamp(9px, 1.5vh, 12px);
    background: var(--weiss);
    color: var(--tinte);
    box-shadow: 0 3px 8px rgba(0, 40, 50, .18);
    cursor: pointer;
    transition: transform .45s var(--feder);
}
.wochenplan__karte:active { transform: scale(.93); }
.wochenplan__bild { flex: 1; min-height: 0; width: 100%; display: block; object-fit: contain; border-radius: 6px; -webkit-user-drag: none; }
.wochenplan__bild--leer { background: repeating-linear-gradient(135deg, #F3E7CB 0 8px, #FBF5E6 8px 16px); }
.wochenplan__wort {
    max-width: 100%;
    font-family: var(--schrift-titel);
    font-size: clamp(11px, 1.9vh, 16px);
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wochenplan__feld.anzahl-2 .wochenplan__wort { font-size: clamp(11px, 1.7vh, 14px); }
/* Drei Karten: Bild links, Wort rechts – darf auf zwei Zeilen umbrechen */
.wochenplan__feld.anzahl-3 .wochenplan__karte { flex-direction: row; gap: 5px; padding: 3px 5px 3px 3px; }
.wochenplan__feld.anzahl-3 .wochenplan__bild { flex: none; width: auto; height: 100%; aspect-ratio: 1; }
.wochenplan__feld.anzahl-3 .wochenplan__wort {
    flex: 1;
    min-width: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: clamp(10px, 1.5vh, 13px);
    text-align: left;
    white-space: normal;
    hyphens: auto;
}

/* ---------- Hochkant oder schmal: das Raster behält seine Breite, das Feld lässt sich seitlich wischen ---------- */

@media (max-width: 599px), (orientation: portrait) {
    .wochenplan { height: auto; }
    .wochenplan__raster { flex: none; min-width: 760px; grid-template-rows: auto repeat(4, 130px); }
}
