/* ============================================================================
   ATLAS REDESIGN — Organic Social (Marketing) screen styles
   Ship-readiness Wave (b) · 2026-07-03

   Prefix: .rd-social. Tokens only (--r-*) so Calm (almanac) + Operator themes
   both work automatically. Platform badge hues are identity-semantic and are
   mixed against theme ink/transparent so they stay legible on both surfaces.
   Content scrolls with the page — no viewport-locked heights.
   ========================================================================== */

.rd-social {
  font-family: var(--r-font-body);
  color: var(--r-body);
  padding: var(--r-gutter);
  max-width: var(--r-page-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---- page header --------------------------------------------------------- */
.rd-social-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rd-social-eyebrow {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-eyebrow);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--r-clay);
}
.rd-social-h1 {
  font-family: var(--r-font-display);
  font-size: var(--r-fs-h1);
  font-weight: 600;
  line-height: 1.1;
  color: var(--r-ink);
  margin: 0;
}
.rd-social-sub {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--r-muted);
  max-width: 640px;
}
.rd-social-org {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-meta);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--r-mint-ink);
  background: var(--r-mint-surface);
  border-radius: var(--r-radius-pill);
  padding: 1px 8px;
}

/* ---- shared date-range filter row (Wave 1 2026-07-04) --------------------
   Gates the scheduled timeline + recently-posted list (and relabels the two
   date-stamped KPI tiles when active — see social.js render()). */
.rd-social-datefilter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.rd-social-datefilter-label {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-meta);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--r-muted);
}

/* ---- KPI strip fallback (3-up; RDKpiCard renders its own when present) ---- */
.rd-social-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.rd-social-kpi {
  background: var(--r-surface);
  border: 1px solid var(--r-hairline-2);
  border-radius: var(--r-radius-card);
  box-shadow: var(--r-shadow-card);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.rd-social-kpi-label {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-eyebrow);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--r-faint);
}
.rd-social-kpi-value {
  font-family: var(--r-font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  color: var(--r-ink);
}
.rd-social-kpi-sub {
  font-size: 12px;
  color: var(--r-muted);
}

/* ---- main grid (scheduled | posted) --------------------------------------- */
.rd-social-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  align-items: start;
  min-height: 0;
}
.rd-social-col-main,
.rd-social-col-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---- shared card chrome ---------------------------------------------------- */
.rd-social-card {
  background: var(--r-surface);
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-card);
  box-shadow: var(--r-shadow-card);
  padding: 20px 22px;
  transition: box-shadow var(--r-dur) var(--r-ease),
              transform var(--r-dur) var(--r-ease);
}
.rd-social-card:hover {
  box-shadow: var(--r-shadow-hover);
  transform: translateY(-2px);
}
.rd-social-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.rd-social-card-title {
  margin: 0;
  font-family: var(--r-font-display);
  font-size: var(--r-fs-h2);
  font-weight: 600;
  color: var(--r-ink);
}
.rd-social-card-note {
  font-size: 12px;
  color: var(--r-muted);
}

/* ---- timeline -------------------------------------------------------------- */
.rd-social-list {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}
.rd-social-day {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-meta);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--r-faint);
  padding: 14px 0 4px;
  border-bottom: 1px solid var(--r-hairline);
}
.rd-social-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--r-hairline-2);
}
.rd-social-row:last-child { border-bottom: 0; }
.rd-social-time {
  flex: none;
  width: 64px;
  font-family: var(--r-font-mono);
  font-size: 12px;
  color: var(--r-muted);
  white-space: nowrap;
}

/* caption: two-line clamp, never overflows the row */
.rd-social-cap {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--r-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rd-social-cap--none {
  color: var(--r-faint);
  font-style: italic;
}

.rd-social-link {
  flex: none;
  font-size: 13px;
  color: var(--r-muted);
  text-decoration: none;
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-chip);
  padding: 1px 7px;
  transition: color var(--r-dur) var(--r-ease),
              border-color var(--r-dur) var(--r-ease);
}
.rd-social-link:hover {
  color: var(--r-ink);
  border-color: var(--r-ink);
}

/* status chip (only rendered for real failure states from the feed) */
.rd-social-status {
  flex: none;
  font-family: var(--r-font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .05em;
  border-radius: var(--r-radius-chip);
  padding: 2px 7px;
}
.rd-social-status[data-tone="alert"] {
  background: color-mix(in srgb, var(--r-alert) 14%, transparent);
  color: var(--r-alert);
}

/* ---- platform badges (identity hues, theme-mixed for legibility) ----------- */
.rd-social-plat {
  flex: none;
  font-family: var(--r-font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .05em;
  border-radius: var(--r-radius-chip);
  padding: 2px 7px;
  background: var(--r-well);
  color: var(--r-muted);
}
.rd-social-plat[data-plat="ig"] {
  background: color-mix(in srgb, #d6249f 14%, transparent);
  color: color-mix(in srgb, #d6249f 58%, var(--r-ink));
}
.rd-social-plat[data-plat="fb"] {
  background: color-mix(in srgb, #1877f2 14%, transparent);
  color: color-mix(in srgb, #1877f2 58%, var(--r-ink));
}
.rd-social-plat[data-plat="li"] {
  background: color-mix(in srgb, #0a66c2 14%, transparent);
  color: color-mix(in srgb, #0a66c2 58%, var(--r-ink));
}
.rd-social-plat[data-plat="yt"] {
  background: color-mix(in srgb, #cc3327 14%, transparent);
  color: color-mix(in srgb, #cc3327 58%, var(--r-ink));
}
.rd-social-plat[data-plat="pin"] {
  background: color-mix(in srgb, #bd081c 14%, transparent);
  color: color-mix(in srgb, #bd081c 58%, var(--r-ink));
}
.rd-social-plat[data-plat="gbp"] {
  background: color-mix(in srgb, #188038 14%, transparent);
  color: color-mix(in srgb, #188038 58%, var(--r-ink));
}
.rd-social-plat[data-plat="tt"],
.rd-social-plat[data-plat="x"] {
  background: color-mix(in srgb, var(--r-ink) 10%, transparent);
  color: var(--r-ink);
}

/* ---- engine footnote (quiet) ------------------------------------------------ */
.rd-social-engine {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--r-muted);
  padding: 10px 12px;
  border: 1px solid var(--r-hairline-2);
  border-radius: var(--r-radius-control);
  background: var(--r-well);
}
.rd-social-engine-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--r-mint-ink);
  transform: translateY(-1px);
}

/* ---- empty states (honest, dashed) ------------------------------------------ */
.rd-social-empty {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-meta);
  letter-spacing: .02em;
  line-height: 1.6;
  color: var(--r-faint);
  text-align: center;
  padding: 26px 14px;
  border: 1px dashed var(--r-border);
  border-radius: var(--r-radius-control);
  margin: 10px 2px 2px;
}

/* ---- focus visibility (keyboard) --------------------------------------------- */
.rd-social :focus-visible { outline: var(--r-focus); outline-offset: 2px; }

/* ---- responsive --------------------------------------------------------------- */
@media (max-width: 980px) {
  .rd-social-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .rd-social-kpis { grid-template-columns: 1fr; }
  .rd-social-time { width: 56px; }
}
