/* ============================================================
   NEWS PAGE CSS – Same width as Teaching + clean aligned timeline
   ============================================================ */

:root {
  /* Teaching-like palette (safe fallbacks) */
  --color-navy: #0f172a;
  --color-slate-50: #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --line: rgba(15, 23, 42, 0.12);
  --white: #ffffff;

  /* Accent */
  --accent: #3b82f6;

  /* Motion */
  --transition: 180ms ease;

  /* News design tokens */
  --news-radius: 18px;
  --news-shadow: 0 18px 60px rgba(2, 6, 23, 0.10);

  /* Timeline layout */
  --line-x: 20px;          /* x-position of the vertical line inside items-stack */
  --dot-size: 10px;        /* dot diameter */
  --stack-pad-left: 72px;  /* left gutter so dot/line are not hugging the card */
  --dot-top: 34px;         /* vertical alignment of dot relative to each entry */
}

/* Page background */
.news-stage {
  padding: 2rem 0 3.5rem;
  background: linear-gradient(135deg, var(--color-slate-50), #ffffff);
  min-height: calc(100vh - 120px);
}

/* Match Teaching width exactly (80rem) */
.news-container-wide {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header block */
.news-header {
  border: 1px solid var(--line);
  border-radius: calc(var(--news-radius) + 6px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--news-shadow);
  padding: 1rem;
}

/* Top small label */
.section-header {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-slate-700);
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.03);
}

/* Title */
.name-title {
  margin: 0.9rem 0 0.4rem;
  font-size: 3rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--color-navy);
}

/* Dashboard wrapper */
.news-dashboard {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.9rem;
}

/* ===========================
   Search
   =========================== */
.search-glass {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--white);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.search-glass i {
  color: rgba(15, 23, 42, 0.55);
}

.search-glass input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--color-navy);
  font-size: 1rem;
  font-weight: 600;
}

.search-glass input::placeholder {
  color: rgba(15, 23, 42, 0.40);
}

.search-glass:focus-within {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}

.clear-btn {
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.03);
  color: rgba(15, 23, 42, 0.55);
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), color var(--transition);
}

.clear-btn:hover {
  background: rgba(15, 23, 42, 0.06);
  color: rgba(15, 23, 42, 0.85);
  transform: translateY(-1px);
}

/* ===========================
   Filters / Tabs
   =========================== */
.filters-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.02);
  padding: 12px;
}

.filters-title {
  color: var(--color-slate-700);
  font-size: 0.9rem;
  font-weight: 800;
  margin: 0 0 10px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.04);
  color: rgba(15, 23, 42, 0.72);
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}

.filter-pill:hover {
  transform: translateY(-1px);
  background: rgba(15, 23, 42, 0.07);
  color: rgba(15, 23, 42, 0.92);
}

.filter-pill.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
  color: rgba(15, 23, 42, 0.92);
}

/* ===========================
   Timeline Feed
   =========================== */
#newsFeed {
  margin-top: 1.75rem;
}

/* Year group layout */
.year-group {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 28px;
  margin: 18px 0 34px;
}

/* Sticky year label */
.year-sidebar {
  font-size: 1.4rem;
  font-weight: 900;
  color: rgba(15, 23, 42, 0.35);
  position: sticky;
  top: 120px;
  height: fit-content;
  text-align: right;
  letter-spacing: -0.01em;
}

/* Stack contains the vertical line */
.items-stack {
  position: relative;
  padding-left: var(--stack-pad-left);
}

/* Vertical line – start aligned with first dot */
.items-stack::before {
  content: "";
  position: absolute;
  left: var(--line-x);
  top: calc(var(--dot-top) + 2px);
  bottom: 10px;
  width: 2px;
  border-radius: 99px;
  background: linear-gradient(
    180deg,
    rgba(59, 130, 246, 0.35),
    rgba(15, 23, 42, 0.10),
    rgba(99, 102, 241, 0.28)
  );
}

/* each entry */
.news-entry {
  position: relative;
  padding: 5px 0 5px;
}

/* DOT – subtle outline only (never filled) */
.news-entry::before {
    display: none;
  content: "";
  position: absolute;
  left: calc(var(--line-x) - (var(--dot-size) / 2));
  top: var(--dot-top);
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 50%;
  background: var(--white);
  border: 2px solid rgba(15, 23, 42, 0.22);
  box-shadow: none;
  transition: var(--transition);
  z-index: 2;
}

/* Optional: tiny emphasis on hover, still not filled */
.news-entry:hover::before {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10);
}

/* Card */
.entry-card {
  /* border: 1px solid var(--line);
  border-radius: var(--news-radius);
  background: rgba(255, 255, 255, 0.95); */
  padding: 14px 16px;
  box-shadow: 0 10px 35px rgba(2, 6, 23, 0.06);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.news-entry:hover .entry-card {
  transform: translateY(-2px);
  border-color: rgba(15, 23, 42, 0.16);
  box-shadow: 0 16px 50px rgba(2, 6, 23, 0.10);
}

/* Meta row */
.entry-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.meta-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Tag pill (your JS sets inline color/bg) */
.micro-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 4px;
  border-radius: 9px;
  font-size: 0.60rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.entry-date {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.55);
}

/* Title + action link */
.entry-row-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.entry-title {
  margin: 0;
  color: var(--slate);;
  font-size: 0.99rem;
  font-weight: 600;
  line-height: 1.6;
}

/* Arrow button */
.action-link {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.03);
  color: rgba(15, 23, 42, 0.70);
  text-decoration: none;
  transition: var(--transition);
}

.action-link:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.10);
  color: rgba(15, 23, 42, 0.90);
}

/* Empty state */
.news-empty {
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed rgba(15, 23, 42, 0.20);
  border-radius: 16px;
  color: rgba(15, 23, 42, 0.65);
  background: rgba(255, 255, 255, 0.75);
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 820px) {
  .name-title {
    font-size: 2.2rem;
  }

  .news-header {
    padding: 1.5rem;
  }

  .year-group {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .year-sidebar {
    position: static;
    text-align: left;
  }

  /* Smaller gutter on mobile */
  .items-stack {
    --line-x: 10px;
    --stack-pad-left: 44px;
    --dot-top: 30px;
    padding-left: var(--stack-pad-left);
  }
}
