/* archive.css — pages: /us-daily, /us-weekly, /option-flow
 * Unified style for archive pages: dense sidebar list + main viewer,
 * FinceptTerminal aesthetic (black bg, orange accent, monospace, dense).
 */

/* ===== Layout: sidebar + main ===== */
.ar-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 12px;
  padding: 12px;
  min-height: calc(100vh - 200px);
  font-family: var(--mono);
}

.ar-sidebar {
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - 200px);
  position: sticky;
  top: 12px;
}

.ar-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}

.ar-sidebar-title {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.ar-sidebar-count {
  color: var(--text-mute);
  font-size: 11px;
}

.ar-search {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.ar-search input {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 11px;
  outline: none;
}

.ar-search input:focus {
  border-color: var(--accent);
}

.ar-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) var(--bg-2);
}

.ar-list::-webkit-scrollbar { width: 6px; }
.ar-list::-webkit-scrollbar-track { background: var(--bg-2); }
.ar-list::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }

.ar-list-loading,
.ar-list-error {
  padding: 16px 12px;
  color: var(--text-mute);
  font-size: 11px;
}
.ar-list-error { color: var(--red); }

.ar-list-item {
  padding: 8px 12px;
  border-bottom: 1px solid var(--bg-3);
  cursor: pointer;
  transition: background 80ms;
}

.ar-list-item:hover {
  background: var(--bg-3);
}

.ar-list-item.active {
  background: var(--bg-3);
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.ar-li-row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ar-li-date {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.ar-list-item.active .ar-li-date {
  color: var(--accent);
}

/* Weekly badge — week-ending date (weekly is keyed by publish date) */
.ar-li-week {
  color: var(--text-mute);
  font-size: 9px;
  letter-spacing: 0.5px;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 5px;
}

.ar-li-title {
  color: var(--text);
  font-size: 11px;
  margin: 3px 0 4px 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-li-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ar-li-size {
  color: var(--text-mute);
  font-size: 10px;
}

.ar-li-tag {
  background: var(--bg);
  color: var(--text-mute);
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 2px;
  border: 1px solid var(--border);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ar-li-tag.dash {
  color: var(--accent);
  border-color: var(--accent);
}

.ar-li-tag.ar-li-daily {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(255, 165, 0, 0.08);
  font-weight: 600;
}

.ar-li-tag.ar-li-weekly {
  color: #a78bfa;  /* purple — distinct from daily orange */
  border-color: #a78bfa;
  background: rgba(167, 139, 250, 0.08);
  font-weight: 600;
}

/* Month group header inside sidebar */
.ar-month-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent);
  background: var(--bg-2);
  padding: 8px 12px 4px 12px;
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  margin-top: 4px;
  text-transform: uppercase;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}
.ar-month-head:first-child {
  margin-top: 0;
  border-top: none;
}

/* ===== Main viewer ===== */
.ar-main {
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: calc(100vh - 200px);
}

.ar-main-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}

.ar-main-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Prev/Next nav buttons in main title bar */
.ar-nav-btn {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.12s ease;
  min-width: 28px;
  text-align: center;
}
.ar-nav-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-3);
}
.ar-nav-btn:active:not(:disabled) {
  transform: translateY(1px);
}
.ar-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.ar-main-date {
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
}

.ar-main-meta {
  color: var(--text-mute);
  font-size: 11px;
}

.ar-main-actions {
  display: flex;
  gap: 6px;
}

.ar-btn {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-hi);
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  letter-spacing: 0.5px;
}

.ar-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.ar-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ar-viewer {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) var(--bg-2);
}

.ar-viewer::-webkit-scrollbar { width: 8px; }
.ar-viewer::-webkit-scrollbar-track { background: var(--bg-2); }
.ar-viewer::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 4px; }

/* Empty state */
.ar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 60px 20px;
  color: var(--text-mute);
}

.ar-empty-glyph {
  font-size: 64px;
  color: var(--border-hi);
  margin-bottom: 16px;
}

.ar-empty-text {
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.ar-empty-sub {
  font-size: 11px;
  margin-top: 8px;
  color: var(--text-dim);
}

/* ===== One-page dashboard embed (new-format daily report) ===== */
.ar-dash {
  padding: 12px;
}

.ar-dash-frame {
  width: 100%;
  border: 0;
  display: block;
  background: var(--bg-2);
  min-height: 900px;
}

/* ===== Markdown article ===== */
.ar-md {
  padding: 20px 28px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  max-width: 920px;
}

.ar-md h1 {
  font-size: 18px;
  color: var(--accent);
  margin: 0 0 16px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.5px;
}

.ar-md h3 {
  font-size: 13px;
  color: var(--accent);
  margin: 18px 0 8px 0;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ar-md .ar-md-section {
  font-size: 14px;
  color: var(--accent);
  background: var(--bg-3);
  padding: 8px 12px;
  margin: 24px 0 12px 0;
  border-left: 3px solid var(--accent);
  letter-spacing: 0.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ar-md .ar-md-num {
  background: var(--accent);
  color: #000;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  font-family: var(--mono);
  border-radius: 2px;
  min-width: 24px;
  text-align: center;
}

.ar-md .ar-md-emoji {
  font-size: 14px;
  filter: drop-shadow(0 0 2px rgba(255,165,0,0.4));
}

.ar-md p {
  margin: 8px 0;
}

.ar-md b {
  color: var(--accent);
  font-weight: 700;
}

.ar-md .ar-md-list {
  margin: 6px 0;
  padding-left: 24px;
}

.ar-md .ar-md-list li {
  margin: 3px 0;
  list-style-type: square;
  color: var(--text);
}

/* ===== Option-flow specific ===== */
.ar-of-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.ar-of-section:last-child { border-bottom: none; }

.ar-of-head {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 1.5px;
  margin: 0 0 12px 0;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.ar-of-head-sub {
  color: var(--text-mute);
  font-size: 10px;
  letter-spacing: 0.5px;
  font-weight: 400;
  text-transform: none;
}

.ar-of-dash {
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 12px;
}

.ar-of-dash img {
  max-width: 100%;
  max-height: 80vh;
  height: auto;
  display: block;
  margin: 0 auto;
}

.ar-of-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.ar-of-chart {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 8px;
}

.ar-of-chart-wide {
  grid-column: span 2;
}

.ar-of-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.ar-of-chart-name {
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.5px;
}

.ar-of-chart-link {
  color: var(--accent);
  font-size: 10px;
  text-decoration: none;
  letter-spacing: 0.5px;
}

.ar-of-chart img {
  max-width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}

.ar-of-tickers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 6px;
}

.ar-of-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 11px;
}

.ar-of-ticker-sym {
  color: var(--accent);
  font-weight: 700;
  min-width: 56px;
  letter-spacing: 0.5px;
}

.ar-of-ticker-file {
  color: var(--text-mute);
  flex: 1;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-of-ticker-size {
  color: var(--text-dim);
  font-size: 10px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .ar-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 220px 1fr;
  }
  .ar-sidebar {
    position: static;
    height: 220px;
  }
  .ar-of-chart-wide {
    grid-column: span 1;
  }
}