/* Tej's Daily — shared stylesheet for the homepage and per-day digest pages.
   Finshots Daily aesthetic: warm cream bg, serif headlines, sans body, topic accent stripes. */

:root {
  --bg: #f4efe4;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --text-subtle: #9a9a9a;
  --divider: #e8e2d3;
  --terms-bg: #f9f5ea;

  --topic-finance: #1a6e4d;
  --topic-ai: #5b3a78;
  --topic-tech: #234a78;
  --topic-politics: #8b3a3a;
  --topic-default: #6b6b6b;

  --font-serif: 'Charter', 'Iowan Old Style', 'Bitstream Charter', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px;
}

/* Wider container for the homepage so the article-card grid can run 2-col on desktop. */
.container--wide {
  max-width: 960px;
}

/* ── Card shell (used by both homepage and day pages) ───────────────────── */

.card {
  background: var(--card);
  border-radius: 6px;
  padding: 44px 40px 36px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

@media (max-width: 480px) {
  .card { padding: 32px 22px 28px; }
  .container { padding: 20px 12px; }
}

/* ── Masthead (kicker + date heading + meta) ───────────────────────────── */

.kicker {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h1 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  margin: 8px 0 0;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  font-family: var(--font-sans);
}

.divider {
  border: 0;
  border-top: 2px solid var(--text);
  margin: 24px 0 0;
}

/* ── Homepage: grid of article cards (newest first) ────────────────────── */

.archive-heading h1 { font-size: 28px; }

.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 24px;
  padding: 0;
  list-style: none;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--divider);
  border-left: 4px solid var(--topic-default);
  border-radius: 10px;
  padding: 18px 20px 16px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.article-card:hover,
.article-card:focus-visible {
  border-color: var(--text-muted);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.07);
  outline: none;
}

.article-card .topic {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--topic-default);
}

.article-card .headline {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 6px 0 10px;
  color: var(--text);
  /* Cap to 3 lines for visual rhythm in grid */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .tease {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 14px;
  /* Cap to 4 lines so cards stay roughly equal-height */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .meta {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: auto; /* push to footer of card */
  padding-top: 10px;
  border-top: 1px solid var(--divider);
}

.article-card[data-topic^="finance"] { border-left-color: var(--topic-finance); }
.article-card[data-topic^="finance"] .topic { color: var(--topic-finance); }

.article-card[data-topic="ai"] { border-left-color: var(--topic-ai); }
.article-card[data-topic="ai"] .topic { color: var(--topic-ai); }

.article-card[data-topic="tech"] { border-left-color: var(--topic-tech); }
.article-card[data-topic="tech"] .topic { color: var(--topic-tech); }

.article-card[data-topic^="politics"] { border-left-color: var(--topic-politics); }
.article-card[data-topic^="politics"] .topic { color: var(--topic-politics); }

@media (max-width: 480px) {
  .article-list { gap: 12px; }
  .article-card { padding: 16px 16px 14px; }
  .article-card .headline { font-size: 18px; }
  .article-card .tease { font-size: 13px; -webkit-line-clamp: 3; }
}

.empty-articles {
  margin-top: 32px;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

.empty-articles code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  background: var(--terms-bg);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ── Day page: per-article block ───────────────────────────────────────── */

article {
  padding-left: 22px;
  margin-top: 32px;
}

article + article {
  margin-top: 36px;
}

.hero {
  width: 100%;
  height: 160px;
  margin: 0 0 24px -22px;
  display: block;
}

@media (max-width: 480px) {
  .hero { margin-left: -16px; height: 140px; }
  article { padding-left: 16px; }
}

.topic {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--topic-default);
}

.headline {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin: 8px 0 6px;
  letter-spacing: -0.012em;
  color: var(--text);
}

.source {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  font-family: var(--font-sans);
}

.source a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-muted);
}

.body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
}

.body p { margin: 0 0 16px; }
.body strong { font-weight: 700; }

.body a {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  color: var(--topic-default);
}

.body h3 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.005em;
  margin: 24px 0 10px;
  color: var(--topic-default);
}

.body figure {
  margin: 20px 0 22px;
}

.body figure svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
}

.body figcaption {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
}

/* Topic accent — applied to article via data-topic="<key>". */

article[data-topic^="finance"] {
  border-left: 3px solid var(--topic-finance);
}
article[data-topic^="finance"] .topic,
article[data-topic^="finance"] .body h3,
article[data-topic^="finance"] .body a {
  color: var(--topic-finance);
}

article[data-topic="ai"] {
  border-left: 3px solid var(--topic-ai);
}
article[data-topic="ai"] .topic,
article[data-topic="ai"] .body h3,
article[data-topic="ai"] .body a {
  color: var(--topic-ai);
}

article[data-topic="tech"] {
  border-left: 3px solid var(--topic-tech);
}
article[data-topic="tech"] .topic,
article[data-topic="tech"] .body h3,
article[data-topic="tech"] .body a {
  color: var(--topic-tech);
}

article[data-topic^="politics"] {
  border-left: 3px solid var(--topic-politics);
}
article[data-topic^="politics"] .topic,
article[data-topic^="politics"] .body h3,
article[data-topic^="politics"] .body a {
  color: var(--topic-politics);
}

/* ── Terms inline box ──────────────────────────────────────────────────── */

.terms {
  background: var(--terms-bg);
  border-radius: 4px;
  padding: 14px 18px;
  margin-top: 22px;
  font-size: 13px;
}

.terms-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.term {
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.5;
  margin: 4px 0;
}

/* ── Footer + iOS install hint ─────────────────────────────────────────── */

footer {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 22px;
  border-top: 1px solid var(--divider);
  margin-top: 36px;
  line-height: 1.6;
}

.ios-install-hint {
  display: none;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
}

.ios-install-hint.visible { display: block; }

/* ── Notify bell (push subscribe) ──────────────────────────────────────── */

.notify-bell {
  background: transparent;
  border: 1px solid var(--divider);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  padding: 0;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.notify-bell.available { display: inline-flex; }
.notify-bell:hover { color: var(--text); border-color: var(--text-muted); }
.notify-bell.subscribed { color: var(--topic-finance); border-color: var(--topic-finance); }

.notify-bell svg { width: 16px; height: 16px; }

/* ── Print ─────────────────────────────────────────────────────────────── */

@media print {
  body { background: white; }
  .card, .day-card { box-shadow: none; }
  .notify-bell, .ios-install-hint { display: none; }
}
