/* Projects als eine Seite ohne Scrollen – auf jedem Bildschirm (Desktop-Raster, Handy kompakte Liste) */

.page:has(.cards) main { gap: 1.25rem; }
.cards { margin: 0; }
.cards .item { height: 100%; }

/* Desktop und Tablet: Raster mit gleich hohen Karten */
@media (min-width: 768px) {
  .page:has(.cards) { padding-top: 2.5rem; padding-bottom: 2.5rem; }
  .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .cards .item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    gap: .55rem .75rem;
    align-items: start;
    padding: .85rem .95rem .8rem;
  }
  .cards .item > img { width: 36px; height: 36px; border-radius: 8px; padding: 3px; }
  .cards .item-body { display: contents; }
  /* Name neben dem Logo, Status unten rechts neben der Art – so bleibt der Name ganz lesbar */
  .cards .item-top { display: contents; }
  .cards .item h3 { grid-column: 2; grid-row: 1; align-self: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  .cards .item .status { grid-column: 1 / -1; grid-row: 3; justify-self: end; align-self: center; padding: .05rem .5rem; font-size: 10.5px; }
  .cards .item p:not(.kind) {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .cards .item p.kind { grid-column: 1 / -1; grid-row: 3; align-self: center; margin: 0; font-size: 11px; }
  /* Zwei Spalten: das Hauptprojekt doppelt breit, dann gehen die Reihen auf */
  .cards > li:first-child { grid-column: span 2; }
}
/* Breite Bildschirme: drei Spalten */
@media (min-width: 980px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Drei Spalten: 2+1, 3, 2+1 – volle Reihen statt einer einzelnen Karte unten */
  .cards > li:nth-child(6) { grid-column: span 2; }
}
/* Niedrige Bildschirme (z. B. Laptop 1280×720): ohne Untertitel */
@media (min-width: 768px) and (max-height: 760px) {
  .page:has(.cards) { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  .page:has(.cards) .head p:not(.kicker) { display: none; }
}

/* Sehr niedrige Fenster (z. B. 800×600): Beschreibung einzeilig, Überschrift kleiner */
@media (min-width: 768px) and (max-height: 640px) {
  .page:has(.cards) { padding-top: 1rem; padding-bottom: 1rem; }
  .page:has(.cards) main { gap: .75rem; }
  .page:has(.cards) .head .kicker { display: none; }
  .page:has(.cards) .head h1 { font-size: 1.6rem; }
  .cards { gap: .5rem; }
  .cards .item { gap: .4rem .75rem; padding: .65rem .85rem; }
  .cards .item p:not(.kind) { -webkit-line-clamp: 1; }
}

/* Handy: eine Zeile pro Projekt – Logo, Name mit Status, Beschreibung einzeilig */
@media (max-width: 767px) {
  .page:has(.cards) { padding-top: 1.75rem; }
  .page:has(.cards) main { gap: 1rem; }
  .page:has(.cards) .head h1 { font-size: 1.5rem; }
  .page:has(.cards) .head p { font-size: 13px; }
  .cards { display: flex; flex-direction: column; gap: .5rem; }
  .cards .item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: .7rem;
    row-gap: .15rem;
    align-items: center;
    padding: .55rem .75rem;
    border-radius: 12px;
  }
  .cards .item > img { grid-row: 1 / span 2; width: 32px; height: 32px; border-radius: 8px; padding: 3px; }
  .cards .item-body { display: contents; }
  .cards .item-top { grid-column: 2; }
  .cards .item h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; line-height: 1.3; }
  .cards .item .status { padding: 0 .45rem; font-size: 10px; }
  .cards .item p:not(.kind) {
    grid-column: 2;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.4;
  }
  .cards .item p.kind { display: none; }
}
/* Kleine Handys (z. B. iPhone SE): Untertitel und Beschreibungen weg, nur Logo, Name, Status */
@media (max-width: 767px) and (max-height: 740px) {
  .page:has(.cards) { padding-top: 1rem; }
  .page:has(.cards) .head .kicker,
  .page:has(.cards) .head p { display: none; }
  .cards .item { grid-template-rows: auto; padding: .5rem .7rem; }
  .cards .item > img { grid-row: auto; }
  .cards .item p:not(.kind) { display: none; }
}

/* Nur für Screenreader sichtbar */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
