/* ── Rosé Pine — Main ───────────────────────────────────── */
:root {
  --base:    #191724;
  --surface: #1f1d2e;
  --overlay: #26233a;
  --muted:   #6e6a86;
  --subtle:  #908caa;
  --text:    #e0def4;
  --love:    #eb6f92;
  --gold:    #f6c177;
  --rose:    #ebbcba;
  --pine:    #31748f;
  --foam:    #9ccfd8;
  --iris:    #c4a7e7;
  --hl-med:  #403d52;
  --hl-high: #524f67;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--base);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ── Entrance animation ──────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  animation: fadeUp 0.4s ease forwards;
}

/* ── Header ─────────────────────────────────────────────── */
header {
  background: var(--surface);
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--overlay);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

header h1 {
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  font-weight: 700;
  color: var(--rose);
  letter-spacing: -0.01em;
}

#news-date {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 0.15rem;
}

/* ── Main layout ─────────────────────────────────────────── */
main {
  max-width: 900px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ── Section labels ──────────────────────────────────────── */
.section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid currentColor;
  opacity: 0.9;
}
.label-red    { color: var(--love); }
.label-blue   { color: var(--pine); }
.label-green  { color: var(--foam); }
.label-yellow { color: var(--gold); }

/* ── Grid ────────────────────────────────────────────────── */
.section-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr;
  margin-bottom: 0.75rem;
}

@media (min-width: 540px) {
  .section-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

/* ── Cards ───────────────────────────────────────────────── */
.article {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--overlay);
  overflow: hidden;
  transition:
    border-color 0.25s ease,
    box-shadow   0.25s ease,
    transform    0.2s ease;
  will-change: transform;
}

.article:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Accent left border per section when open */
.article[open] { border-color: var(--hl-high); }
.article.accent-love[open] { border-left: 3px solid var(--love); }
.article.accent-pine[open] { border-left: 3px solid var(--pine); }
.article.accent-foam[open] { border-left: 3px solid var(--foam); }
.article.accent-gold[open] { border-left: 3px solid var(--gold); }

/* ── Summary (collapsed state) ───────────────────────────── */
.article summary {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background 0.15s ease;
}

.article summary::-webkit-details-marker { display: none; }

.article summary:hover  { background: rgba(255,255,255,0.03); }
.article summary:active { background: var(--overlay); }

.summary-inner { flex: 1; min-width: 0; }

.article h2 {
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

.preview {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--subtle);
}

/* ── Chevron ─────────────────────────────────────────────── */
.chevron {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--muted);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
  display: flex;
  align-items: center;
}

.article[open] .chevron {
  transform: rotate(180deg);
  color: var(--subtle);
}

/* ── Expanded content ────────────────────────────────────── */
.expanded {
  overflow: hidden;
  transition: height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.expanded p {
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--subtle);
  padding: 0.75rem 1rem 0.5rem;
  border-top: 1px solid var(--overlay);
}

.source {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0 1rem 0.85rem;
  letter-spacing: 0.01em;
}

.single { grid-column: 1 / -1; }

@media (min-width: 540px) {
  .article.spanning { grid-column: 1 / -1; }
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.error {
  color: var(--love);
  font-size: 0.9rem;
  padding: 1rem;
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .fade-in { animation: none; opacity: 1; }
  .article, .chevron, .expanded { transition: none; }
  .article:hover { transform: none; }
}
