/*
 * Shared Check Dashboard
 * Reusable result cards for Geo checks and other structured agent outputs.
 * All rules are scoped to .check-dashboard to avoid changing normal AI output.
 */

.check-dashboard {
  --check-accent: #b45309;
  --check-accent-strong: #92400e;
  --check-accent-soft: #fff7ed;
  --check-surface: #ffffff;
  --check-surface-muted: #f8fafc;
  --check-border: #dfe5ee;
  --check-text: #172033;
  --check-text-strong: #10213f;
  --check-text-muted: #5e6b7d;
  --check-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --check-radius: 16px;

  width: 100%;
  color: var(--check-text);
}

.check-dashboard,
.check-dashboard * {
  box-sizing: border-box;
}

/* Header and daily status */

.check-dashboard__header {
  position: relative;
  margin-bottom: 22px;
  padding: 24px 26px;
  overflow: hidden;
  border: 1px solid var(--check-border);
  border-color: color-mix(in srgb, var(--check-accent) 22%, white);
  border-radius: calc(var(--check-radius) + 2px);
  background:
    linear-gradient(135deg, var(--check-accent-soft), #ffffff 72%);
}

.check-dashboard__header::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--check-accent);
}

.check-dashboard__kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  color: var(--check-accent-strong);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.check-dashboard__kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--check-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--check-accent) 14%, transparent);
}

.check-dashboard .check-dashboard__title {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  color: var(--check-text-strong) !important;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 850;
  line-height: 1.16;
}

.check-dashboard__summary {
  max-width: 70ch;
  margin: 0;
  color: var(--check-text-muted);
  font-size: 15px;
  line-height: 1.55;
}

.check-dashboard__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  color: var(--check-text-muted);
  font-size: 13px;
}

.check-dashboard__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Signal grid */

.check-dashboard__signals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 22px;
}

.check-card {
  --check-severity: var(--check-accent);
  --check-severity-soft: var(--check-accent-soft);

  position: relative;
  min-width: 0;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--check-border);
  border-top: 4px solid var(--check-severity);
  border-radius: var(--check-radius);
  background: var(--check-surface);
  box-shadow: var(--check-shadow);
}

.check-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.check-card__number {
  color: var(--check-text-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.check-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--check-border);
  border-color: color-mix(in srgb, var(--check-severity) 24%, white);
  border-radius: 999px;
  background: var(--check-severity-soft);
  color: var(--check-severity);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.check-dashboard .check-card__title {
  margin: 0 0 10px;
  color: var(--check-text-strong) !important;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
}

.check-card__description {
  margin: 0 0 16px;
  color: var(--check-text);
  font-size: 14px;
  line-height: 1.58;
}

/* Compact facts such as actor, type and status */

.check-card__facts {
  display: grid;
  gap: 0;
  margin: 0 0 16px;
  border: 1px solid var(--check-border);
  border-radius: 12px;
  background: var(--check-surface-muted);
}

.check-card__facts > div {
  display: grid;
  grid-template-columns: minmax(82px, 0.36fr) minmax(0, 1fr);
  gap: 10px;
  padding: 9px 11px;
}

.check-card__facts > div + div {
  border-top: 1px solid var(--check-border);
}

.check-card__facts dt,
.check-card__facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.4;
}

.check-card__facts dt {
  color: var(--check-text-muted);
  font-weight: 750;
}

.check-card__facts dd {
  color: var(--check-text);
  font-weight: 600;
}

.check-card__verification,
.check-card__impact {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 12px;
}

.check-card__verification {
  border: 1px solid var(--check-border);
  background: var(--check-surface-muted);
}

.check-card__impact {
  border-left: 4px solid var(--check-severity);
  background: var(--check-severity-soft);
}

.check-card__verification strong,
.check-card__impact strong {
  display: block;
  margin-bottom: 4px;
  color: var(--check-text-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.check-card__verification p,
.check-card__impact p {
  margin: 0;
  color: var(--check-text);
  font-size: 13px;
  line-height: 1.52;
}

.check-card__source {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--check-border);
  font-size: 12px;
}

.check-card__source a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  color: var(--check-accent-strong);
  font-weight: 750;
  line-height: 1.4;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.check-card__source a::after {
  content: "\2197";
  flex: 0 0 auto;
  font-size: 13px;
}

.check-card__source a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.check-card__source a + a {
  margin-top: 8px;
}

.check-card__source-separator {
  display: block;
}

/* Severity variants */

.check-card--critical,
.check-badge--critical {
  --check-severity: #b42318;
  --check-severity-soft: #fef3f2;
}

.check-card--high,
.check-badge--high {
  --check-severity: #c4320a;
  --check-severity-soft: #fff4ed;
}

.check-card--elevated,
.check-badge--elevated {
  --check-severity: #b54708;
  --check-severity-soft: #fffaeb;
}

.check-card--moderate,
.check-badge--moderate {
  --check-severity: #175cd3;
  --check-severity-soft: #eff8ff;
}

.check-card--low,
.check-badge--low {
  --check-severity: #027a48;
  --check-severity-soft: #ecfdf3;
}

/* Summary panels */

.check-dashboard__section {
  margin-top: 18px;
  padding: 20px 22px;
  border: 1px solid var(--check-border);
  border-radius: var(--check-radius);
  background: var(--check-surface);
}

.check-dashboard__section--highlight {
  border-color: color-mix(in srgb, var(--check-accent) 26%, white);
  background: linear-gradient(135deg, var(--check-accent-soft), #ffffff 76%);
}

.check-dashboard .check-dashboard__section-title {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  color: var(--check-text-strong) !important;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.3;
}

.check-dashboard__section p:last-child,
.check-dashboard__section ul:last-child,
.check-dashboard__section ol:last-child {
  margin-bottom: 0;
}

.check-dashboard__articles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.check-article {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid var(--check-border);
  border-radius: 12px;
  background: var(--check-surface);
  color: var(--check-text);
  text-decoration: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.check-article:hover {
  border-color: color-mix(in srgb, var(--check-accent) 42%, white);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  text-decoration: none;
}

.check-article__source {
  color: var(--check-accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.check-article__title {
  color: var(--check-text-strong);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.check-article__focus,
.check-article__relevance {
  color: var(--check-text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.check-article__relevance {
  margin-top: 2px;
  color: var(--check-text);
}

.check-dashboard a:focus-visible {
  outline: 2px solid var(--check-accent);
  outline-offset: 3px;
}

/* Agent-specific themes: override only variables. */

.geo-agent .check-dashboard,
.geo-agent.check-dashboard,
[data-agent-slug="geo-agent"] .check-dashboard,
[data-agent-slug="geo-agent"].check-dashboard {
  --check-accent: #b45309;
  --check-accent-strong: #92400e;
  --check-accent-soft: #fff7ed;
}

.gfdd-agent .check-dashboard,
.gfdd-agent.check-dashboard,
[data-agent-slug="gfdd-agent"] .check-dashboard,
[data-agent-slug="gfdd-agent"].check-dashboard {
  --check-accent: #1d4ed8;
  --check-accent-strong: #1e40af;
  --check-accent-soft: #eff6ff;
}

@media (max-width: 760px) {
  .check-dashboard__header {
    padding: 20px 18px 20px 21px;
  }

  .check-dashboard__signals,
  .check-dashboard__articles {
    grid-template-columns: 1fr;
  }

  .check-card,
  .check-dashboard__section {
    padding: 17px;
  }
}

@media (max-width: 480px) {
  .check-dashboard__header {
    margin-bottom: 16px;
    padding: 18px 15px 18px 18px;
    border-radius: 14px;
  }

  .check-dashboard .check-dashboard__title {
    font-size: 22px;
  }

  .check-dashboard__signals {
    gap: 14px;
  }

  .check-card {
    padding: 15px;
    border-radius: 14px;
  }

  .check-card__topline {
    align-items: flex-start;
  }

  .check-card__facts > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .check-dashboard__section {
    padding: 16px;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .check-article {
    transition: none;
  }
}

@media (forced-colors: active) {
  .check-dashboard__header,
  .check-card,
  .check-dashboard__section,
  .check-article {
    border: 1px solid CanvasText;
  }
}

/* Schaaf-Media-Empfehlungen: kompakter Link-Button */

.check-dashboard .check-article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.check-dashboard .check-article__text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  row-gap: 4px;
  column-gap: 8px;
  min-width: 0;
}

.check-dashboard .check-article__date {
  margin: 0;
}

.check-dashboard .check-article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.check-dashboard .check-article__text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  row-gap: 4px;
  column-gap: 8px;
  min-width: 0;
}

.check-dashboard .check-article__date {
  margin: 0;
}

.check-dashboard a.check-article__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  gap: 6px;

  flex: 0 0 auto;
  width: auto !important;
  min-width: 0;
  max-width: none;
  height: 36px;

  box-sizing: border-box;
  padding: 0 10px 0 7px;

  border: 1px solid #d6deeb;
  border-radius: 999px;
  background: #f7f9fc;
  text-decoration: none;
  white-space: nowrap;
}

.check-dashboard a.check-article__button:hover {
  border-color: #93a4bd;
  background: #eef3f8;
}

.check-dashboard .check-article__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}

.check-dashboard .check-article__favicon {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.check-dashboard .check-article__button-label {
  display: inline-block;
  color: #10284b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 640px) {
  .check-dashboard .check-article {
    gap: 10px;
  }

  .check-dashboard a.check-article__button {
    height: 34px;
    padding: 0 8px 0 6px;
    gap: 5px;
  }

  .check-dashboard .check-article__button-label {
    font-size: 10px;
  }
}
