/* Static hexagram pages (hexagrams/*.html), generated by scripts/build-hexagram-pages.js.
   They reuse the about page styles (.about, .anatomy, .lede, .note) and
   .keywords / .hexagram-svg from iching.css. */
.hex-page {
  max-width: 720px;
}
.crumbs {
  margin: 0 0 14px;
  font-size: 0.8em;
  opacity: 0.85;
  /* one line whatever the hexagram name, so the page below doesn't jump */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hex-hero {
  display: flex;
  gap: 26px;
  align-items: center;
  margin: 6px 0 18px;
}
.hex-hero .hex-figure {
  flex-shrink: 0;
}
.hex-facts {
  margin: 0 0 10px;
  line-height: 1.4;
  opacity: 0.9;
}
.hex-facts .hf-char {
  font-size: 1.5em;
  vertical-align: middle;
}
.hex-page .fortune {
  font-style: italic;
}
.hex-page .anatomy {
  margin-top: 16px;
}
.hex-page .interpret-btn {
  margin: 4px 0 0;
}
.hex-lines {
  margin: 0 0 12px;
}
.hex-lines .line-kind {
  opacity: 0.75;
  font-size: 0.9em;
}

/* nuclear / opposite / inverse */
.hex-related {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
}
.hex-related li {
  margin: 0;
}
.about a.hex-pick,
.about a.hex-row {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background-color: var(--card-bg);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.about a.hex-pick:hover,
.about a.hex-pick:focus-visible,
.about a.hex-row:hover,
.about a.hex-row:focus-visible {
  border-color: color-mix(in srgb, var(--card-border), white 40%);
}
.hex-pick svg,
.hex-row svg {
  flex-shrink: 0;
}
.hex-pick .hp-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}
.hex-pick .hp-label {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.75;
}
.hex-pick .hp-name {
  font-weight: bold;
  color: var(--card-strong);
}
.hex-pick .hp-note {
  font-size: 0.8em;
  opacity: 0.85;
}

/* previous / next */
.hex-nav {
  /* three fixed columns, so "All 64 hexagrams" stays in place whatever the names */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 12px;
  margin: 28px 0 8px;
  font-size: 0.95em;
}
/* the links stay on one line at every width (long names get "..."),
   so the page below doesn't jump from hexagram to hexagram */
.hex-nav > span,
.hex-nav > span a {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hex-nav.top {
  margin: 0 0 12px;
}
.hex-nav > span:last-child {
  text-align: right;
}

/* the list of all hexagrams (hexagrams/index.html) */
.hex-list {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
}
.hex-list li {
  margin: 0;
}
.hex-row .hr-text {
  min-width: 0;
  line-height: 1.4;
}
.hex-row .hr-name {
  font-weight: bold;
  color: var(--card-strong);
}
.hex-row .hr-sub {
  opacity: 0.75;
  font-size: 0.9em;
}
.hex-row .hr-line {
  display: block;
  font-size: 0.85em;
  opacity: 0.85;
}

@media only screen and (max-width: 480px) {
  /* on phones, keep the title at two lines and the hero at one height, whatever the hexagram */
  h2.hex-title {
    min-height: 2.5em;
  }
  .hex-hero {
    gap: 16px;
    min-height: 162px; /* the tallest hero (keywords on three lines) */
  }
}
@media only screen and (max-width: 370px) {
  .hex-hero {
    min-height: 190px; /* narrow Androids: the tallest hero gets one more line */
  }
}
