/* Hexagram pages — extends site style.css */

/* Hero */
.hex-hero {
  padding: 120px 24px 60px;
  background: var(--bg-alt);
}

.hex-hero-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  max-width: 700px;
  margin: 0 auto;
}

.hex-figure { flex-shrink: 0; }

.hex-number {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.hex-title h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.hex-pinyin {
  font-size: 0.6em;
  color: var(--text-muted);
  font-weight: 400;
}

.hex-english {
  font-size: 20px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.hex-alternates {
  font-size: 14px;
  color: var(--text-muted);
  opacity: 0.7;
  margin-bottom: 8px;
}

.hex-trigrams {
  font-size: 15px;
  color: var(--gold-dim);
}

/* Text sections */
.hex-text {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.8;
  color: var(--text);
  border: none;
  margin: 0;
  padding: 0;
  font-style: italic;
}

.hex-image { color: var(--text-muted); }

/* Lines */
.hex-lines { display: flex; flex-direction: column; gap: 16px; }

.hex-line {
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.hex-line-num {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  display: block;
  margin-bottom: 6px;
}

.hex-line p, .hex-all-lines p {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-muted);
}

.hex-all-lines {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
}

/* Keywords */
.hex-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.hex-keyword {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
}

/* Pagination */
.hex-pagination {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  background: var(--bg);
}

.hex-pagination .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hex-nav-link, .hex-nav-index {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.hex-nav-link:hover, .hex-nav-index:hover { color: var(--gold); }

.hex-nav-index { font-weight: 600; }

/* Nav back arrow */
.nav-back {
  font-size: 18px;
  margin-right: 6px;
}

/* ─── Index page ──────────────────────────────────────────────────────── */

.hex-index-hero {
  padding: 120px 24px 40px;
  text-align: center;
}

.hex-index-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  margin-bottom: 16px;
}

.hex-index-subtitle {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.7;
}

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

.hex-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.hex-card:hover {
  border-color: var(--gold-dim);
  background: var(--bg-alt);
}

.hex-card-figure { margin-bottom: 8px; }

.hex-card-num {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
}

.hex-card-zh {
  font-size: 18px;
  color: var(--text);
  margin: 2px 0;
}

.hex-card-en {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

/* Responsive */
@media (max-width: 768px) {
  .hex-hero-inner {
    flex-direction: column;
    text-align: center;
  }

  .hex-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
  }

  .hex-card { padding: 10px 4px; }
  .hex-card-zh { font-size: 16px; }
  .hex-card-en { font-size: 10px; }
}
