/* Archive and stock research pages, built on assets/lemon-core.css. */
:root {
  font-family: var(--lm-font-sans);
  line-height: 1.68;
}

body {
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: var(--lm-text);
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  font-weight: 650;
  line-height: 1.03;
  letter-spacing: -0.05em;
}

h2 {
  color: var(--lm-text);
  font-size: 1.35rem;
  line-height: 1.35;
}

h3 {
  color: var(--lm-text);
  font-size: 1.05rem;
  line-height: 1.48;
}

a {
  color: var(--lm-cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  min-width: 0;
  border: 1px solid var(--lm-line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--lm-text);
}

button,
select {
  cursor: pointer;
}

button {
  padding: 10px 15px;
  font-weight: 700;
}

button:hover {
  border-color: rgba(246, 211, 74, 0.48);
  background: var(--lm-lemon-soft);
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

input,
select {
  width: 100%;
  height: 46px;
  padding: 9px 12px;
}

input::placeholder {
  color: var(--lm-faint);
}

.muted {
  color: var(--lm-muted);
}

.small {
  font-size: 0.78rem;
}

.eyebrow {
  margin-bottom: 11px;
  color: var(--lm-lemon);
  font-family: var(--lm-font-mono);
  font-size: 0.68rem;
  line-height: 1.6;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

/* Header */
.research-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--lm-line);
  background: rgba(6, 8, 13, 0.80);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  backdrop-filter: blur(20px) saturate(130%);
}

.header-inner {
  display: flex;
  width: min(1180px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--lm-text);
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(246, 211, 74, 0.3);
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 28px -16px rgba(246, 211, 74, 0.8);
}

.brand span {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand strong {
  margin-left: 4px;
  color: var(--lm-lemon);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.research-header nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.84rem;
}

.research-header nav a {
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--lm-muted);
  font-weight: 600;
}

.research-header nav a:hover,
.research-header nav a:focus-visible {
  background: var(--lm-surface-soft);
  color: var(--lm-text);
  text-decoration: none;
}

.research-header nav [aria-current] {
  background: var(--lm-lemon-soft);
  color: var(--lm-lemon-bright);
}

/* Page frame */
.research-main {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 190px);
  margin: 0 auto;
  padding: clamp(54px, 7vw, 88px) 0 96px;
}

.page-heading {
  position: relative;
  display: flex;
  min-height: 190px;
  margin-bottom: 34px;
  padding: clamp(26px, 4vw, 42px);
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  border: 1px solid var(--lm-line);
  border-radius: var(--lm-radius-lg);
  background:
    radial-gradient(620px 280px at 90% 0%, rgba(107, 220, 255, 0.075), transparent 75%),
    radial-gradient(480px 240px at 0% 100%, rgba(246, 211, 74, 0.075), transparent 74%),
    var(--lm-surface);
  box-shadow: var(--lm-shadow);
}

.page-heading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 42px;
  width: 120px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lm-lemon), var(--lm-cyan));
}

.page-heading::after {
  content: "LEMON / MARKET NOTES";
  position: absolute;
  right: 26px;
  bottom: 18px;
  color: rgba(246, 211, 74, 0.09);
  font-family: var(--lm-font-mono);
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: 0.15em;
  pointer-events: none;
}

.page-heading .muted {
  margin-top: 13px;
  color: var(--lm-muted);
}

.index-meta {
  position: relative;
  z-index: 1;
  color: var(--lm-muted);
  font-family: var(--lm-font-mono);
  font-size: 0.75rem;
  text-align: right;
}

.page-status {
  padding: 32px 0;
  color: var(--lm-muted);
}

.page-status button {
  margin-left: 12px;
}

/* Archive filters */
.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
  padding: 22px;
  border: 1px solid var(--lm-line);
  border-radius: var(--lm-radius);
  background: var(--lm-surface);
  box-shadow: var(--lm-shadow);
}

.search-field {
  grid-column: 1 / 4;
}

label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  color: var(--lm-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.clear-button {
  grid-column: 4;
  grid-row: 1;
  min-height: 46px;
  justify-self: stretch;
}

.result-toolbar {
  display: flex;
  min-height: 28px;
  margin: 26px 0 14px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--lm-muted);
  font-family: var(--lm-font-mono);
  font-size: 0.74rem;
}

#stock-shortcut {
  padding: 7px 11px;
  border: 1px solid rgba(107, 220, 255, 0.22);
  border-radius: 999px;
  background: var(--lm-cyan-soft);
}

.month-heading {
  margin-top: 26px;
  padding: 12px 4px;
  color: var(--lm-lemon);
  font-family: var(--lm-font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.article-row {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 26px;
  margin-bottom: 10px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--lm-line);
  border-radius: var(--lm-radius);
  background: rgba(15, 21, 30, 0.72);
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.article-row::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: linear-gradient(var(--lm-lemon), rgba(107, 220, 255, 0.35));
  opacity: 0;
  transition: opacity 180ms ease;
}

.article-row:hover,
.article-row:focus-within {
  transform: translateY(-2px);
  border-color: rgba(246, 211, 74, 0.28);
  background: rgba(18, 25, 36, 0.9);
}

.article-row:hover::after,
.article-row:focus-within::after {
  opacity: 1;
}

.article-date {
  padding-top: 3px;
  color: var(--lm-faint);
  font-family: var(--lm-font-mono);
  font-size: 0.72rem;
  line-height: 1.9;
}

.article-kind {
  margin-bottom: 6px;
  color: var(--lm-lemon);
  font-family: var(--lm-font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.article-row h3 {
  font-size: 1.1rem;
}

.article-row h3 a {
  color: var(--lm-text);
}

.article-row h3 a:hover,
.article-row h3 a:focus-visible {
  color: var(--lm-lemon-bright);
  text-decoration: none;
}

.article-summary {
  max-width: 820px;
  margin-top: 8px;
  color: var(--lm-muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.article-topics,
.article-symbols {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.article-topics span,
.article-symbols a,
.article-symbols > span {
  padding: 4px 9px;
  border: 1px solid var(--lm-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--lm-muted);
  font-size: 0.68rem;
}

.article-symbols {
  font-family: var(--lm-font-mono);
}

.article-symbols a:hover {
  border-color: rgba(107, 220, 255, 0.34);
  color: var(--lm-cyan);
  text-decoration: none;
}

.empty-state {
  padding: 44px 24px;
  border: 1px dashed var(--lm-line-strong);
  border-radius: var(--lm-radius);
  color: var(--lm-muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--lm-text);
  font-size: 1.05rem;
}

/* Stock research */
.stock-picker {
  position: relative;
  z-index: 2;
  width: min(280px, 100%);
}

.featured-symbols {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--lm-line);
  border-radius: 15px;
  background: var(--lm-surface-soft);
  font-family: var(--lm-font-mono);
  font-size: 0.72rem;
}

.featured-symbols a {
  padding: 6px 10px;
  border-radius: 9px;
  color: var(--lm-muted);
}

.featured-symbols a:hover,
.featured-symbols [aria-current] {
  background: var(--lm-lemon-soft);
  color: var(--lm-lemon-bright);
  text-decoration: none;
}

.stock-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.7fr);
  gap: 24px;
  padding: 26px;
  border: 1px solid var(--lm-line);
  border-radius: var(--lm-radius-lg);
  background:
    radial-gradient(520px 220px at 0% 100%, rgba(246, 211, 74, 0.065), transparent 72%),
    var(--lm-surface);
  box-shadow: var(--lm-shadow);
}

.stock-overview h2 {
  color: var(--lm-text);
  font-family: var(--lm-font-sans);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.05em;
}

.stock-overview .muted {
  margin: 7px 0 20px;
}

.stock-overview a {
  font-size: 0.78rem;
}

.quote-block {
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--lm-line);
  border-radius: 16px;
  background:
    linear-gradient(rgba(107, 220, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(107, 220, 255, 0.025) 1px, transparent 1px),
    rgba(3, 7, 12, 0.5);
  background-size: 34px 34px;
}

.quote-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--lm-muted);
  font-size: 0.72rem;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 9px;
  place-items: center;
}

.icon-button img {
  filter: invert(1);
}

.quote-price {
  min-height: 54px;
  margin: 6px 0 0;
  color: var(--lm-text);
  font-family: var(--lm-font-mono);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

#quote-change {
  min-height: 24px;
  font-family: var(--lm-font-mono);
  font-size: 0.82rem;
}

#quote-time {
  margin-top: 8px;
}

.positive {
  color: var(--lm-green);
}

.negative {
  color: var(--lm-red);
}

.research-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.research-section {
  min-width: 0;
  margin-top: 16px;
  padding: 24px;
  border: 1px solid var(--lm-line);
  border-radius: var(--lm-radius);
  background: rgba(15, 21, 30, 0.72);
}

.research-columns .research-section {
  margin-top: 0;
}

.section-title {
  display: flex;
  margin-bottom: 20px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title h2 {
  font-size: 1.08rem;
}

.level-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.level-grid > div {
  padding: 14px;
  border: 1px solid var(--lm-line);
  border-radius: 12px;
  background: var(--lm-surface-soft);
}

.level-grid dt {
  margin-bottom: 8px;
  color: var(--lm-muted);
  font-size: 0.7rem;
}

.level-grid dd {
  margin: 0;
  color: var(--lm-green);
  font-family: var(--lm-font-mono);
  font-size: 0.9rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.level-grid div:last-child dd {
  color: var(--lm-red);
}

.level-source {
  font-size: 0.78rem;
}

.level-source a {
  display: block;
  margin-top: 7px;
}

.caution {
  margin: 20px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--lm-lemon);
  border-radius: 0 10px 10px 0;
  background: var(--lm-lemon-soft);
  color: var(--lm-amber);
}

.event-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--lm-line);
}

.event-row:first-child {
  padding-top: 0;
}

.event-row:last-child {
  border-bottom: 0;
}

.event-row time {
  color: var(--lm-cyan);
  font-family: var(--lm-font-mono);
  font-size: 0.7rem;
}

.event-row h3 {
  margin: 5px 0;
  font-size: 0.9rem;
}

.event-row p {
  color: var(--lm-muted);
  font-size: 0.78rem;
}

#stock-events + p {
  margin-top: 16px;
}

.research-footer {
  display: flex;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 38px;
  justify-content: space-between;
  gap: 14px 28px;
  flex-wrap: wrap;
  border-top: 1px solid var(--lm-line);
  color: var(--lm-muted);
  font-size: 0.72rem;
}

@media (max-width: 850px) {
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .clear-button {
    grid-column: 2;
    grid-row: auto;
  }

  .research-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .header-inner {
    width: calc(100% - 32px);
    min-height: 64px;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .research-header nav {
    width: 100%;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .research-header nav a {
    flex: 1 0 auto;
    text-align: center;
  }

  .research-main,
  .research-footer {
    width: calc(100% - 32px);
  }

  .research-main {
    padding: 34px 0 62px;
  }

  .page-heading {
    min-height: 0;
    padding: 28px 22px;
    align-items: flex-start;
    flex-direction: column;
  }

  .page-heading::before {
    left: 22px;
  }

  .page-heading::after {
    display: none;
  }

  .index-meta {
    text-align: left;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
    gap: 14px 10px;
    padding: 18px;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .clear-button {
    grid-column: 2;
  }

  .result-toolbar {
    align-items: flex-start;
  }

  .article-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 20px;
  }

  .article-date br {
    display: none;
  }

  .article-date span {
    margin-left: 12px;
  }

  .stock-picker {
    width: 100%;
  }

  .featured-symbols {
    gap: 4px;
  }

  .stock-overview {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .quote-block {
    min-height: 0;
  }

  .research-section {
    padding: 20px;
  }

  .level-grid {
    grid-template-columns: 1fr;
  }

  .research-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-row:hover {
    transform: none;
  }
}
