/* Daylight unit — optional default styles. Publishers may override any of
   these; the CSS variables below are the supported customization surface.
   Loading this file is optional: the widget renders with clean semantic
   markup and works without any styling. */

[data-daylight] {
  --dl-radius: 10px;
  --dl-bg: #ffffff;
  --dl-fg: #111111;
  --dl-muted: #666666;
  --dl-accent: #1a56ff;
  --dl-border: rgba(0, 0, 0, 0.08);
  --dl-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  display: block;
}

.dl-card {
  background: var(--dl-bg);
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius);
  box-shadow: var(--dl-shadow);
  padding: 12px;
  font: 14px/1.35 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dl-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

/* The card link. The disclosure row is a sibling, not a child: anchors cannot
   nest, and the source credit has to be independently clickable. */
.dl-unit {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  color: var(--dl-fg);
  text-decoration: none;
}

.dl-unit__media {
  width: 96px;
  height: 96px;
  border-radius: calc(var(--dl-radius) - 3px);
  overflow: hidden;
  background: #f4f4f4;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dl-unit__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dl-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
}
.dl-fallback__letter {
  font-size: 32px; font-weight: 700; color: var(--dl-accent);
}

.dl-unit__body { min-width: 0; }
.dl-unit__title {
  font-weight: 600;
  color: var(--dl-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-unit__desc {
  color: var(--dl-muted);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dl-unit__meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--dl-muted);
  margin-top: 8px;
}
.dl-unit__source, .dl-unit__network {
  color: var(--dl-muted);
  text-decoration: none;
}
.dl-unit__source:hover, .dl-unit__network:hover { text-decoration: underline; color: var(--dl-fg); }

/* ---- Layout variants (dashboard unit editor) ------------------------------
   card    image left, text right (default)
   stack   image above, text below — fits narrow sidebars
   compact text only, no image — fits inline/footer placements            */

.dl-card--stack .dl-unit {
  grid-template-columns: 1fr;
  gap: 10px;
}
.dl-card--stack .dl-unit__media {
  width: 100%;
  height: 140px;
}

.dl-card--compact .dl-unit {
  grid-template-columns: 1fr;
  gap: 2px;
}
.dl-card--compact .dl-unit__desc {
  -webkit-line-clamp: 1;
}
