/* ── Layout ── */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.main-content {
  flex: 1;
  padding: var(--sp-12) 0;
}

/* ── Nav ── */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  max-width: 1100px;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
  min-height: 64px;
  padding-block: var(--sp-2);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text);
  flex: 1;
}

.nav-brand:hover { color: var(--primary); text-decoration: none; }

.nav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
}

.nav-links a {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.4em 0.5em;
  border-radius: var(--radius);
  min-height: 44px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--primary); text-decoration: none; }

@media (max-width: 700px) {
  .nav-brand {
    order: 1;
  }

  .theme-toggle {
    order: 2;
  }

  .nav-links {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    gap: var(--sp-1) var(--sp-2);
  }

  .nav-links a {
    font-size: 0.9rem;
    padding: 0.3em 0.4em;
    min-height: 40px;
  }
}

.theme-toggle {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}

.theme-toggle:hover { color: var(--primary); border-color: var(--primary); }

/* ── Footer ── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-6) 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ── Homepage ── */

.home-hero {
  padding: var(--sp-8) 0 var(--sp-8);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-12);
}

.hero-title {
  font-size: clamp(2.8rem, 9vw, 5rem);
  font-style: italic;
  margin-bottom: var(--sp-4);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.7;
}

.home-section {
  margin-bottom: var(--sp-12);
}

.section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: var(--sp-6);
}

.link-more {
  display: inline-block;
  margin-top: var(--sp-6);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ── Post cards ── */

.post-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.post-card {
  padding: var(--sp-6);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s;
}

.post-card:hover { border-color: var(--primary); }

.post-card h2,
.post-card h3 {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--sp-2);
  line-height: 1.35;
}

.post-card h2 a,
.post-card h3 a { color: var(--text); }

.post-card h2 a:hover,
.post-card h3 a:hover { color: var(--primary); text-decoration: none; }

.post-card-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: var(--sp-3);
}

.post-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ── Tags ── */

.tag {
  display: inline-block;
  padding: 0.2em 0.55em;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: var(--radius);
  font-size: 0.78rem;
  border: 1px solid var(--border);
  font-family: var(--font-body);
  line-height: 1.6;
}

button.tag {
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

button.tag:hover,
button.tag.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.tag-list {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
}

/* ── Tag filter bar ── */

.tag-filter {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
  min-height: 28px;
}

/* ── Pagination ── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}

.pagination-info { color: var(--text-muted); font-size: 0.9rem; }

/* ── Page header ── */

.page-header {
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border);
}

.page-header h1 { margin-bottom: var(--sp-2); }

.page-desc { color: var(--text-muted); }

/* ── Blog post ── */

.post-header {
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.back-link { color: var(--text-muted); }
.back-link:hover { color: var(--primary); text-decoration: none; }

.read-time::before { content: '·'; margin-right: var(--sp-4); }

.post-title { margin-bottom: var(--sp-4); }

.post-tags { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.post-body {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.post-body h2,
.post-body h3,
.post-body h4 { margin-top: var(--sp-8); margin-bottom: var(--sp-3); }

.post-body p   { margin-bottom: var(--sp-4); }
.post-body ul,
.post-body ol  { margin-bottom: var(--sp-4); }
.post-body li  { margin-bottom: var(--sp-2); }

.post-footer {
  margin-top: var(--sp-12);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}

/* ── Empty state ── */

.empty-state {
  color: var(--text-muted);
  padding: var(--sp-12) 0;
  text-align: center;
}

/* ── Music player ── */

.player-wrapper {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--sp-6);
}

.player {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-6);
  position: sticky;
  top: calc(64px + var(--sp-4));
}

.player-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-4);
  margin-bottom: var(--sp-3);
}

.player-track-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-time {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.time-sep { margin: 0 2px; }

.player-progress-wrap { margin-bottom: var(--sp-3); }

.player-progress {
  width: 100%;
  cursor: pointer;
  height: 20px;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  outline: none;
}

.player-progress::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}

.player-progress::-webkit-slider-fill {
  background: var(--primary);
  border-radius: 2px;
}

.player-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

.player-progress::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}

.player-progress::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--primary);
}

.player-progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  cursor: pointer;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-variant-emoji: text;
  cursor: pointer;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--sp-2);
  border-radius: var(--radius);
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.12s, background 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ctrl-btn:hover { color: var(--primary); background: var(--bg-elevated); }

.ctrl-btn.active { color: var(--primary); }

.play-btn {
  background: var(--bg-elevated);
  color: var(--primary);
  font-size: 1.3rem;
}

.play-btn:hover { background: var(--border); }

.volume-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.volume-slider {
  width: 80px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ── Track list ── */

.track-list { display: flex; flex-direction: column; }

.track-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
  outline-offset: 2px;
}

.track-item:hover { background: var(--bg-elevated); }

.track-item:focus-visible {
  outline: 2px solid var(--primary);
}

.track-item.playing {
  background: var(--bg-elevated);
  color: var(--primary);
}

.track-num {
  color: var(--text-muted);
  font-size: 0.8rem;
  width: 2ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.track-item.playing .track-num { color: var(--primary); }

.track-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
}

.track-dur {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
