/* Articles - Minimal Mobile Reader */

@font-face {
  font-family: 'FKGroteskNeue';
  src: url('https://r2cdn.perplexity.ai/fonts/FKGroteskNeue.woff2') format('woff2');
}

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

html, body {
  font-family: "FKGroteskNeue", "Geist", "Inter", -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
  background: var(--bg);
}

/* Theme colors - simple and direct */
:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --accent: #21808d;
}

[data-theme="dark"] {
  --bg: #1f2121;
  --text: #f5f5f5;
  --text-secondary: #a0a0a0;
  --accent: #32b8c6;
}

/* Footer row with theme toggle */
.footer-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Main article container */
.article {
  padding: 24px 20px 24px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 24px);
  background: var(--bg);
  min-height: 100vh;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Title */
.article-title {
  font-size: 26px;
  font-weight: 550;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 18px;
  padding-bottom: 14px;
  position: relative;
}

.article-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, #e07a5f 0%, #f2cc8f 100%);
  border-radius: 2px;
}

/* Body text */
.article-text {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--text);
}

.article-text p {
  margin-bottom: 1.5em;
}

.article-text p:last-child {
  margin-bottom: 0;
}

.article-text strong {
  font-weight: 600;
}

.article-text em {
  font-style: italic;
  color: var(--text-secondary);
}

.article-text h2 {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin-top: 2.5em;
  margin-bottom: 0.8em;
}

.article-text h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  margin-top: 2em;
  margin-bottom: 0.6em;
}

.article-text blockquote {
  border-left: 3px solid #e07a5f;
  padding-left: 20px;
  margin: 2em 0;
  color: var(--text-secondary);
  font-style: italic;
  font-size: 18px;
}

.article-text ul, .article-text ol {
  margin: 1.4em 0;
  padding-left: 1.6em;
}

.article-text li {
  margin-bottom: 0.6em;
  line-height: 1.65;
}

.article-text hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, #e07a5f 0%, #f2cc8f 50%, transparent 100%);
  margin: 3em 0;
  max-width: 120px;
}

.article-text a {
  color: var(--accent);
  text-decoration: none;
}

/* Tables */
.article-text .table-wrapper {
  overflow-x: auto;
  margin: 1.8em 0;
}

.article-text table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.article-text th, .article-text td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

[data-theme="dark"] .article-text th,
[data-theme="dark"] .article-text td {
  border-bottom-color: rgba(255,255,255,0.1);
}

.article-text th {
  font-weight: 550;
  background: rgba(0,0,0,0.03);
}

[data-theme="dark"] .article-text th {
  background: rgba(255,255,255,0.05);
}

/* Images */
.article-image {
  margin: 2em 0;
}

.article-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* Theme toggle button - inline at bottom of article */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid rgba(128,128,128,0.2);
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.theme-toggle .sun-icon {
  display: block;
  color: #a84b2f;
}

.theme-toggle .moon-icon {
  display: none;
  color: var(--accent);
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  display: block;
}

