/* 8Bit-Homecomputermuseum – responsives Stylesheet */
:root {
  --bg: #24150e;
  --bg-2: #2f1c12;
  --surface: #3d2519;
  --surface-2: #4a2e1f;
  --line: #6b432c;
  --text: #f3ebe3;
  --muted: #cdb9a8;
  --yellow: #f6e300;
  --gold: #ffd200;
  --orange: #ff8c2a;
  --orange-hover: #ffd200;
  --radius: 12px;
  --maxw: 1080px;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.65 var(--sans);
  overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: inline-block; vertical-align: middle; }
a { color: var(--orange); font-weight: 600; text-decoration: underline; text-underline-offset: .15em; text-decoration-thickness: 1px; }
a:hover, a:focus-visible { color: var(--orange-hover); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 3px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--yellow); color: #000; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: .5rem; top: .5rem; }

/* ---------- Kopfbereich ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(36, 21, 14, .96); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.bar { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--text); }
.brand-mark {
  flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem;
  background: var(--yellow); color: #2a1810; border-radius: 8px;
  font: 800 1.5rem/1 var(--mono); box-shadow: 3px 3px 0 #ff6600;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { color: var(--yellow); font: 700 1.15rem/1.2 var(--mono); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: #e3970d; font-size: .78rem; letter-spacing: .06em; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-toggle {
  display: none; align-items: center; gap: .5rem; flex: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: .5rem .9rem; font: 600 .95rem var(--sans); cursor: pointer;
  min-height: 44px;
}
.burger, .burger::before, .burger::after { display: block; width: 18px; height: 2px; background: var(--yellow); border-radius: 2px; position: relative; transition: transform .2s, background .2s; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -6px; } .burger::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .burger { background: transparent; }
.nav-toggle[aria-expanded="true"] .burger::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .burger::after { transform: translateY(-6px) rotate(-45deg); }

.main-nav { background: var(--yellow); }
.main-nav ul { list-style: none; margin: 0 auto; padding: 0 .5rem; max-width: var(--maxw); display: flex; flex-wrap: wrap; }
.main-nav a { display: block; padding: .55rem .8rem; color: #4a2410; text-decoration: none; font-weight: 700; font-size: .92rem; letter-spacing: .02em; }
.main-nav a:hover, .main-nav a:focus-visible { background: #4a2410; color: var(--yellow); }
.main-nav a[aria-current="page"] { background: #4a2410; color: #fff; }

.stripes { height: 6px; background: linear-gradient(to bottom, #ff6600 0 33%, #e3970d 33% 66%, #a9431a 66% 100%); }

/* ---------- Inhalt ---------- */
.content { max-width: var(--maxw); margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.crumbs { font-size: .9rem; color: var(--muted); margin: .25rem 0 1rem; }
.crumbs a { font-weight: 500; }
.crumbs .sep { margin: 0 .3rem; opacity: .7; }

h1, h2 { color: var(--gold); line-height: 1.25; text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); margin: .3rem 0 1rem; }
h2 { font-size: clamp(1.25rem, 3.4vw, 1.55rem); margin: 2.2rem 0 .8rem; }
p { margin: 0 0 1em; }
.lead { color: var(--muted); }
.hl, .ueberschrift { color: var(--gold); font-weight: 700; }
.ueberschrift { display: block; font-size: 1.12rem; line-height: 1.35; margin-bottom: .5rem; }
.inv, .inv a { color: #ff8a80; }
ul, ol { padding-left: 1.3rem; }
li { margin: .2rem 0; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(.9rem, 3vw, 1.5rem);
  margin: 0 0 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.panel > p > img, .panel > img { display: block; margin: 0 auto; border-radius: 8px; }

/* Bild + Text Zeilen */
.media-list { display: grid; gap: 1rem; margin: 0 0 1rem; }
.media {
  display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 1.25rem; align-items: start;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 1rem;
}
.media-solo { grid-template-columns: minmax(0, 400px); }
.media-textonly { grid-template-columns: 1fr; }
.media-img { margin: 0; }
.media-img img { border-radius: 6px; display: block; width: 100%; max-width: 400px; cursor: zoom-in; }
.media-img img + img { margin-top: .75rem; }
.media-text > :last-child { margin-bottom: 0; }

@media (min-width: 641px) {
  .panel .media-list { gap: 0; }
  .panel .media { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 1.1rem 0; }
  .panel .media:first-child { padding-top: 0; }
  .panel .media:last-child { border-bottom: 0; padding-bottom: 0; }
}

/* Datentabellen */
.table-wrap { overflow-x: auto; margin: 0 0 1rem; border-radius: 10px; border: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; background: var(--bg-2); }
table.data th, table.data td { padding: .65rem .85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.data th { color: var(--gold); background: var(--surface-2); font-size: .95rem; }
table.data tr:last-child td { border-bottom: 0; }
table.data td > :last-child { margin-bottom: 0; }

/* Startseite */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1.5rem; align-items: start; }
.home-intro img { border-radius: var(--radius); display: block; width: 100%; }
.news { background: var(--yellow); color: #3b1e0f; border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: 4px 4px 0 #ff6600; }
.news h2 { color: #3b1e0f; margin: 0 0 .5rem; font-size: 1.2rem; }
.news a { color: #7a2e00; }
.news time { font-weight: 700; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; margin-top: 2rem; }
.tile { display: flex; flex-direction: column; gap: .2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; text-decoration: none; transition: transform .15s, border-color .15s; }
.tile:hover, .tile:focus-visible { transform: translateY(-2px); border-color: var(--yellow); }
.tile-title { color: var(--yellow); font-weight: 700; font-size: 1.08rem; }
.tile-sub { color: var(--muted); font-weight: 400; font-size: .92rem; }

/* Sammlung */
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; margin: 1rem 0 1.5rem; position: sticky; top: 5.6rem; z-index: 5; }
.filter > label:first-child { font-weight: 700; color: var(--gold); }
.filter input[type="search"] { flex: 1 1 220px; min-height: 44px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .4rem .75rem; }
.filter .chk { display: flex; align-items: center; gap: .4rem; font-size: .95rem; color: var(--muted); }
.filter .chk input { width: 1.15rem; height: 1.15rem; accent-color: var(--yellow); }
.brand-group h2 { margin-top: 1.6rem; padding-bottom: .3rem; border-bottom: 2px solid var(--line); }
.computer-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
.computer-grid li { margin: 0; }
.card a { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s; }
.card a:hover, .card a:focus-visible { transform: translateY(-2px); border-color: var(--yellow); }
.card .thumb { display: grid; place-items: center; aspect-ratio: 3 / 2; background: #f4efe9; padding: .4rem; }
.card .thumb img { max-height: 100%; width: auto; object-fit: contain; }
.card .name { padding: .55rem .75rem .7rem; font-weight: 600; font-size: .95rem; line-height: 1.35; }
.card a .name { color: var(--yellow); }
.card.pending { display: flex; flex-direction: column; justify-content: space-between; gap: .3rem; height: 100%; border: 1px dashed var(--line); border-radius: 10px; padding: .1rem 0 .6rem; color: var(--muted); }
.card.pending .name { font-weight: 500; }
.card.pending .soon { margin: 0 .75rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.brand-group[hidden], .computer-grid li[hidden] { display: none; }

/* Impressum */
.contact-card { background: var(--yellow); color: #3b1e0f; border-radius: var(--radius); padding: 1rem 1.2rem; margin: 0 0 1.5rem; max-width: 420px; box-shadow: 4px 4px 0 #ff6600; }
.contact-card a { color: #7a2e00; }

/* Hinweise */
.note { color: var(--muted); font-size: .95rem; }

/* Fußbereich */
.site-footer { background: var(--yellow); color: #3b1e0f; margin-top: 2rem; border-top: 6px solid #ff6600; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 1rem .5rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem 2rem; font-size: .95rem; }
.site-footer a { color: #7a2e00; }
.site-footer a:hover { color: #000; }
.copy { max-width: var(--maxw); margin: 0 auto; padding: .5rem 1rem 1.5rem; font-size: .85rem; opacity: .8; }

/* Bildvergrößerung */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(10, 5, 2, .92); }
.lightbox img { position: absolute; inset: 0; margin: auto; max-width: 96vw; max-height: 86vh; object-fit: contain; border-radius: 6px; cursor: zoom-out; }
.lightbox p { position: absolute; left: 0; right: 0; bottom: 1rem; margin: 0; text-align: center; color: #eee; font-size: .95rem; padding: 0 1rem; }
.lightbox button { position: absolute; top: .75rem; right: .75rem; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--yellow); color: #000; font-size: 1.4rem; cursor: pointer; }

/* ---------- Mobil ---------- */
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .main-nav { display: none; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: .3rem 0; }
  .main-nav a { padding: .8rem 1.2rem; font-size: 1rem; border-bottom: 1px solid rgba(74, 36, 16, .15); }
  .home-grid { grid-template-columns: 1fr; }
  .filter { top: 4.4rem; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 1rem; }
  .media, .media-solo { grid-template-columns: 1fr; padding: .75rem; gap: .75rem; }
  .media-img img { max-width: 100%; }
  .computer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .card .name { font-size: .88rem; }
  .filter { position: static; }
  .panel { background: none; border: 0; box-shadow: none; padding: 0; }
  /* Tabellen mit Kopfzeile als Karten */
  table.data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data:has(thead) tr { display: block; border-bottom: 1px solid var(--line); padding: .4rem 0; }
  table.data:has(thead) td { display: block; border: 0; padding: .25rem .85rem; }
  table.data:has(thead) td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); }
  table.data:not(:has(thead)) tr { display: block; border-bottom: 1px solid var(--line); padding: .4rem 0; }
  table.data:not(:has(thead)) td { display: block; border: 0; padding: .25rem .85rem; }
}

@media (max-width: 420px) {
  .bar { padding: .5rem .75rem; gap: .5rem; }
  .brand { gap: .5rem; }
  .brand-mark { width: 2rem; height: 2rem; font-size: 1.25rem; box-shadow: 2px 2px 0 #ff6600; }
  .brand-text strong { font-size: .84rem; }
  .nav-toggle { padding: .45rem .75rem; }
  .content { padding-left: .85rem; padding-right: .85rem; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media print {
  .site-header, .site-footer, .filter, .crumbs { display: none; }
  body { background: #fff; color: #000; }
  .panel, .media { background: none; border-color: #ccc; box-shadow: none; }
  h1, h2, .hl, .ueberschrift { color: #000; }
}
