/* ============================================================
   Open Society News Tracker
   ============================================================ */

:root {
  --bg:           #ffffff;
  --text:         #111111;
  --text-muted:   #5a5a5a;
  --text-faint:   #999999;
  --border:       #e2e2e2;
  --border-light: #eeeeee;
  --link:         #111111;
  --link-hover:   #0047b3;
  --accent:       #111111;
  --max-width:    740px;
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                  Helvetica, Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Header ---- */

header {
  padding: 44px 24px 32px;
  border-bottom: 2px solid var(--text);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.header-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 10px;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text);
}

.subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 520px;
}

/* ---- Search bar ---- */

.search-bar-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 13px 24px;
}

.search-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-faint);
  pointer-events: none;
}

#search {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: #f5f5f5;
  border: 1px solid transparent;
  border-radius: 5px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

#search:focus {
  background: var(--bg);
  border-color: var(--accent);
}

#search::placeholder { color: var(--text-faint); }
#search::-webkit-search-cancel-button { display: none; }

.result-count {
  font-size: 12.5px;
  color: var(--text-faint);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
  flex-shrink: 0;
}

/* ---- Articles container ---- */

#articles-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 100px;
}

/* ---- Date groups ---- */

.date-group {
  padding-top: 44px;
}

.date-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}

/* Extending line after the date label */
.date-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.date-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  white-space: nowrap;
  flex-shrink: 0;
}

.date-article-count {
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
}

/* ---- Article list ---- */

.article-list { list-style: none; }

.article-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border-light);
  transition: padding-left 0.15s ease;
}

.article-item:last-child { border-bottom: none; }

.article-item:hover {
  padding-left: 10px;
  border-bottom-color: var(--border);
}

.article-title {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: var(--link);
  text-decoration: none;
  line-height: 1.5;
  margin-bottom: 6px;
  transition: color 0.1s ease;
}

.article-title:hover {
  color: var(--link-hover);
}

.article-title:visited { color: #888888; }

.article-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-source {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.article-desc {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- State messages ---- */

.state-msg {
  display: flex;
  justify-content: center;
  padding: 80px 0 60px;
}

.state-msg-text {
  font-size: 14px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.7;
}

/* ---- Footer ---- */

footer {
  border-top: 1px solid var(--border);
  padding: 24px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.8;
}

/* ---- Noscript ---- */

.noscript-warn {
  padding: 20px 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  background: #fafafa;
  border-top: 1px solid var(--border);
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
  header              { padding: 28px 16px 24px; }
  .search-bar-wrap    { padding: 11px 16px; }
  #articles-container { padding: 0 16px 60px; }
  h1                  { font-size: 22px; }
}
