/* ================================================================
   DASHBOARD.CSS – Gemeinsames Design-System
   Persönliches Dashboard-Projekt · Material 3 / „Material You" (hell)
   Eingebunden von allen Seiten (index, nachrichten, strom, wetter,
   boerse, sprit, supermarkt, pollen, krimi-/kindle-/hoerbuch-Charts)
   Stand: Mai 2026
================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Roboto+Flex:opsz,wght@8..144,400;8..144,500;8..144,700&display=swap');

/* ── 1. Material-3-Designtokens ──────────────────────────────── */
:root {
  /* Surfaces (hell, leicht getönt – Google-„surface"-Look) */
  --bg-from:    #eef3fb;
  --bg-to:      #e6ecf5;
  --card:       #ffffff;   /* surface-container-highest */

  /* Text / on-surface */
  --text:       #1f1f1f;   /* on-surface */
  --muted:      #5f6368;   /* on-surface-variant (Google grey) */

  /* Primary (Google-Blau) */
  --accent:     #0b57d0;   /* primary */
  --accent-dark:#041e49;   /* on-primary-container / dunkles Blau für Text */

  /* Linien & tonale Container */
  --border:     #d3d7de;   /* outline-variant */
  --light:      #e8f0fe;   /* primary-container (hellblau) */

  /* Status */
  --green:      #146c2e;
  --red:        #b3261e;

  /* Material-Form & Elevation */
  --radius-xl:  28px;
  --radius-lg:  20px;
  --radius-md:  16px;
  --radius-sm:  12px;
  --elev-1: 0 1px 2px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06);
  --elev-2: 0 1px 2px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.10);
  --elev-3: 0 4px 8px rgba(0,0,0,0.10), 0 8px 24px rgba(0,0,0,0.12);
}

/* ── 2. Reset ────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── 3. Body ─────────────────────────────────────────────────── */
body {
  font-family: "Roboto Flex", "Roboto", -apple-system, BlinkMacSystemFont,
               "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-from);
  background: linear-gradient(180deg, var(--bg-from) 0%, var(--bg-to) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ── 4. Header ───────────────────────────────────────────────── */
header {
  color: var(--text);
  padding: 32px 20px 22px;
  text-align: center;
}
header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
header .sub {
  color: var(--muted);
  font-size: 1rem;
}

/* ── 5. Reload-Bereich & Buttons (Material „filled button") ──── */
.reload-bar {
  text-align: center;
  margin-top: 14px;
}
.reload-bar button,
.hdr-btn {
  background: var(--accent);
  color: #ffffff;
  border: none;
  padding: 11px 26px;
  font-family: inherit;
  font-size: 0.97rem;
  font-weight: 500;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: var(--elev-1);
  transition: box-shadow 0.15s, transform 0.1s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.reload-bar button:hover,
.hdr-btn:hover { box-shadow: var(--elev-2); background: #0a4fbb; }
.reload-bar button:active,
.hdr-btn:active  { transform: scale(0.98); }
.reload-bar button:disabled,
.hdr-btn:disabled { opacity: 0.55; cursor: wait; box-shadow: none; }

/* Status-Zeile unter dem Button */
#status,
#reloadStatus,
.dash-status {
  color: var(--muted);
  font-size: 0.83rem;
  margin-top: 8px;
  min-height: 1.1em;
}

/* ── 6. Hauptbereich ─────────────────────────────────────────── */
main {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 16px 60px;
}

/* ── 7. Zurück-Link ──────────────────────────────────────────── */
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 16px;
  padding: 6px 14px 6px 10px;
  border-radius: 50px;
  background: var(--light);
  transition: background 0.15s;
}
.nav-back:hover { background: #d7e6fd; color: var(--accent-dark); }

/* ── 8. Abschnitts-Überschriften ─────────────────────────────── */
h2.section {
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin: 24px 0 14px;
}

/* ── 9. Material-Karte (surface container) ───────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--elev-1);
  border: 1px solid rgba(0,0,0,0.04);
  margin-bottom: 16px;
}

/* ── 10. Fehlermeldungs-Karte ────────────────────────────────── */
.error-card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--elev-1);
  color: var(--red);
  text-align: center;
}

/* ── 11. Info-Hinweisbox (tonaler Container) ─────────────────── */
.info-note {
  background: var(--light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 16px;
}
.info-note a { color: var(--accent); font-weight: 500; }

/* ── 12. Footer ──────────────────────────────────────────────── */
footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 20px;
}
footer a {
  color: var(--accent);
  text-decoration: none;
}

/* ── 13. Tabellen — auf schmalen Screens horizontal scrollen ─── */
.card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card table { min-width: 100%; border-collapse: collapse; }

/* ── 14. Tablet (≤ 900px) ────────────────────────────────────── */
@media (max-width: 900px) {
  main   { padding: 16px 14px 50px; max-width: 100%; }
  header { padding: 26px 16px 18px; }
  .card  { padding: 18px 16px; }
}

/* ── 15. Smartphone (≤ 600px) ───────────────────────────────── */
@media (max-width: 600px) {
  header        { padding: 20px 12px 14px; }
  header h1     { font-size: clamp(1.4rem, 6vw, 1.9rem); }
  header .sub   { font-size: 0.92rem; }
  main          { padding: 12px 10px 40px; }
  .card         { padding: 14px 12px; border-radius: var(--radius-sm); }
  h2.section    { font-size: 1.05rem; margin: 18px 0 10px; }
  .reload-bar button,
  .hdr-btn      { padding: 10px 20px; font-size: 0.92rem; }
  .info-note    { font-size: 0.78rem; padding: 10px 12px; }
  .card table   { font-size: 0.85rem; }
  .card th,
  .card td      { padding: 6px 8px !important; white-space: nowrap; }
}

/* ── 16. Sehr schmal (≤ 380px) ──────────────────────────────── */
@media (max-width: 380px) {
  header h1     { font-size: 1.3rem; }
  main          { padding: 10px 8px 32px; }
  .card         { padding: 12px 10px; }
}

/* ── 17. Kachel-Navigation (Startseite, Nachrichten-Übersicht) ── */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--elev-1);
  border: 1px solid rgba(0,0,0,0.04);
  border-top: 4px solid var(--tile-color, var(--accent));
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--elev-3); }
.tile:active { transform: translateY(-1px); }
.tile .tile-icon  { font-size: 2rem; line-height: 1; }
.tile .tile-title { font-weight: 700; font-size: 1.1rem; }
.tile .tile-descr { color: var(--muted); font-size: 0.85rem; line-height: 1.4; }
.tile .tile-meta  { margin-top: auto; font-size: 0.78rem; font-weight: 600; color: var(--tile-color, var(--accent-dark)); }

/* ── 18. Nachrichten-Artikel (geteilt von allen Rubrik-Seiten) ── */
:root {
  --spiegel: #e74c3c;
  --sz:      #003366;
  --zeit:    #c8a45c;
  --faz:     #0f3057;
  --kn:      #005baa;
}
.news-item {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--elev-1);
  border: 1px solid rgba(0,0,0,0.04);
  border-left: 4px solid var(--accent);
}
.news-item .rank {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  width: 32px; height: 32px;
  border-radius: 50%;
  text-align: center;
  line-height: 32px;
  margin-right: 10px;
  vertical-align: middle;
}
.news-item h3 {
  margin: 0 0 8px;
  font-size: 1.18rem;
  display: inline-block;
  vertical-align: middle;
  width: calc(100% - 50px);
}
.news-item h3 a { color: inherit; text-decoration: none; }
.news-item h3 a:hover { text-decoration: underline; }
.news-item p { margin: 8px 0; color: var(--text); }
.tags { margin-top: 8px; }
.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 5px;
  margin-bottom: 4px;
  color: #fff;
}
.tag-spiegel { background: var(--spiegel); }
.tag-sz      { background: var(--sz); }
.tag-zeit    { background: var(--zeit); color: #333; }
.tag-faz     { background: var(--faz); }
.tag-kn      { background: var(--kn); }
.tag-fvz         { background: #d97706; }
.tag-wochenblatt { background: #0e7490; }
.tag-laprovincia { background: #b45309; }
.tag-mz          { background: #0891b2; }
.tag-ddm         { background: #0369a1; }
.news-image-wrap { margin: 10px 0 6px; }
.news-image {
  display: block;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--elev-1);
  background: #f1f5f9;
}
.news-image-caption {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
  font-style: italic;
}

@media (max-width: 600px) {
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .tile { padding: 18px 16px; border-radius: var(--radius-sm); }
  .tile .tile-icon  { font-size: 1.7rem; }
  .tile .tile-title { font-size: 1rem; }
  .news-item h3 { font-size: 1.05rem; width: calc(100% - 45px); }
  .news-item { padding: 14px 14px; }
  .news-image { max-width: 100%; }
}
