/* =============================================================
   zins-widget.css
   Styling for the Bundesbank rate widget on umschuldungsprofi.de
   ============================================================= */

.zins-widget {
  --zw-bg:         #ffffff;
  --zw-bg-muted:   #f6f9fc;
  --zw-border:     #e1e8ef;
  --zw-text:       #1f2937;
  --zw-muted:      #64748b;
  --zw-brand:      #1f4e79;
  --zw-accent:     #2e75b6;
  --zw-good:       #16a34a;
  --zw-bad:        #dc2626;
  --zw-shadow:     0 1px 3px rgba(15, 23, 42, .05), 0 4px 12px rgba(15, 23, 42, .04);

  max-width: 1350px;
  margin: 3rem auto;
  padding: 1.5rem;
  background: var(--zw-bg);
  color: var(--zw-text);
  border: 1px solid var(--zw-border);
  border-radius: 14px;
  box-shadow: var(--zw-shadow);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.zins-widget__header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--zw-border);
  padding-bottom: 1rem;
}

.zins-widget__header h2 {
  margin: 0 0 .25rem;
  color: var(--zw-brand);
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: 700;
}

.zins-widget__stand {
  color: var(--zw-muted);
  font-weight: 400;
  font-size: 1rem;
}

.zins-widget__intro {
  margin: .5rem 0 0;
  color: var(--zw-muted);
  font-size: .95rem;
  max-width: 72ch;
}

.zins-widget__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.zins-card {
  background: var(--zw-bg-muted);
  border: 1px solid var(--zw-border);
  border-radius: 12px;
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
.zins-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--zw-shadow);
}

.zins-card__head { margin-bottom: .25rem; }

.zins-card__title {
  margin: 0 0 .15rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--zw-brand);
}
.zins-card__title a {
  color: inherit;
  text-decoration: none;
}
.zins-card__title a:hover { text-decoration: underline; }

.zins-card__sub {
  margin: 0;
  color: var(--zw-muted);
  font-size: .85rem;
}

.zins-card__rate {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
}
.zins-card__rate-value {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--zw-brand);
  letter-spacing: -0.02em;
  line-height: 1;
}
.zins-card__rate-label {
  color: var(--zw-muted);
  font-size: .9rem;
}

.zins-card__meta {
  margin: 0;
  font-size: .9rem;
}
.zins-card__trend {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: rgba(100, 116, 139, .1);
  color: var(--zw-muted);
  font-weight: 500;
}
.zins-card__trend--up   { background: rgba(220, 38, 38, .1);  color: var(--zw-bad);  }
.zins-card__trend--down { background: rgba(22, 163, 74, .1);  color: var(--zw-good); }

.zins-card__chart {
  width: 100%;
  max-width: 100%;
  height: 180px;
  margin-top: .25rem;
  display: block;
}

.zins-card__footnote {
  margin: .5rem 0 0;
  font-size: .85rem;
  color: var(--zw-muted);
  border-top: 1px dashed var(--zw-border);
  padding-top: .6rem;
}
.zins-card__footnote a {
  color: var(--zw-accent);
  font-weight: 600;
  text-decoration: none;
}
.zins-card__footnote a:hover { text-decoration: underline; }

.zins-widget__source {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--zw-border);
  font-size: .82rem;
  color: var(--zw-muted);
}
.zins-widget__source p { margin: 0 0 .4rem; }
.zins-widget__source a { color: var(--zw-accent); }
.zins-widget__legal {
  font-size: .78rem;
  line-height: 1.5;
}

.zins-widget__fallback {
  padding: 1.5rem;
  background: var(--zw-bg-muted);
  border: 1px dashed var(--zw-border);
  border-radius: 10px;
  text-align: center;
  color: var(--zw-muted);
}
.zins-widget__fallback a {
  color: var(--zw-accent);
  font-weight: 600;
}

/* --- Mobile tweaks --- */
@media (max-width: 640px) {
  .zins-widget { margin: 1.5rem 0.5rem; padding: 1rem; }
  .zins-widget__header h2 { font-size: 1.35rem; }
  .zins-card__rate-value { font-size: 2rem; }
}

/* --- Prefers-reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
  .zins-card { transition: none; }
}

/* --- Print --- */
@media print {
  .zins-widget { box-shadow: none; border: 1px solid #ccc; }
  .zins-card__chart { display: none; }
}
