.figures-hero {
  padding-block: clamp(40px, 6vw, 76px);
  background: linear-gradient(270deg, #121c27 8%, #121c27e6 46%, #121c2766),
    url("assets/istanbul.webp") center 59% / cover, var(--navy);
  border-bottom: 3px solid var(--gold);
  color: #fff9ee;
}
.figures-hero h1 { font-size: clamp(1.9rem, 4vw, 3.15rem); line-height: 1.55; }
.figures-hero p { max-width: 39ch; margin-top: 10px; color: #f3e7d6; font-size: 1.12rem; }
.figures-body { padding-block: 26px 54px; }
.figure-search { margin-bottom: 16px; }
.figure-search label { display: block; font-weight: 700; margin-bottom: 5px; }
.figure-search input {
  width: min(100%, 440px);
  min-height: 42px;
  padding: 7px 12px;
  border: 1px solid #b8a483;
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink);
}
#figure-count { margin-top: 5px; color: var(--muted); font-size: .9rem; }
.figures-index { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 24px; }
.figures-index a {
  border: 1px solid #ded5c7;
  background: #fffdf7;
  color: var(--ink);
  padding: 5px 12px;
  min-height: 36px;
  border-radius: 6px;
  font-weight: 600;
  font-size: .9rem;
}
.figures-index a:hover { background: var(--paper-deep); border-color: var(--bronze); }
.figure-group { scroll-margin-top: 22px; padding-block: 23px 30px; border-top: 1px solid var(--line); }
.figure-group:last-child { padding-bottom: 0; }
.figure-group-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: 24px;
  row-gap: 6px;
  margin-bottom: 17px;
}
.figure-group-heading h2 { font-size: clamp(1.25rem, 2vw, 1.7rem); }
.figure-period, .figure-role { color: var(--tone); font-weight: 700; font-size: .92rem; }
.figure-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.figure-card {
  scroll-margin-top: 22px;
  padding: 15px 16px 16px;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--tone);
  border-radius: 8px;
}
.figure-card:target { outline: 2px solid var(--tone); outline-offset: 2px; background: #fff8e9; }
.figure-group:target .figure-group-heading h2 { color: var(--tone); }
.figure-card h3 { font-size: 1rem; line-height: 1.65; }
.figure-role { margin-top: 3px; }
.figure-summary { margin-top: 7px; color: var(--muted); }
.figure-details-button {
  margin-top: 12px;
  min-height: 36px;
  padding: 3px 11px;
  border: 1px solid #d9cbb7;
  border-radius: 6px;
  background: var(--paper);
  color: var(--tone);
  font-weight: 700;
}
.figure-details-button:hover { background: var(--paper-deep); }
.figure-dialog { width: 790px; }
#figure-network { padding: clamp(16px, 4vw, 30px); }
.figure-network-center {
  position: relative;
  width: fit-content;
  max-width: calc(100% - 76px);
  margin: 0 auto 17px;
  padding: 12px clamp(16px, 4vw, 28px);
  border: 1px solid var(--tone);
  border-radius: 9px;
  background: #fffdf7;
  text-align: center;
}
.figure-network-center::after {
  content: "";
  position: absolute;
  top: 100%;
  left: calc(50% - 1px);
  height: 17px;
  border-left: 1px solid var(--tone);
}
.figure-network-center h2 { margin: 0; color: var(--tone); font-size: clamp(1.15rem, 3vw, 1.65rem); }
.figure-network-center p { margin: 2px 0 0; color: var(--muted); }
.figure-save { margin-top: 10px; }
.figure-dialog .close-button { z-index: 1; }
.figure-network {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  align-items: start;
  padding: 10px 0 0;
  margin: 0;
  background: linear-gradient(var(--tone), var(--tone)) center / 1px 100% no-repeat;
  list-style: none;
}
.figure-network-branch {
  position: relative;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-deep);
}
.figure-network-branch::before {
  content: "";
  position: absolute;
  top: 25px;
  inset-inline-end: 100%;
  width: 13px;
  border-top: 1px solid var(--tone);
}
.figure-network-branch:nth-child(even)::before { inset-inline: 100% auto; }
.figure-network-branch:only-child { grid-column: 1 / -1; }
.figure-network-branch:only-child::before { content: none; }
.figure-network-branch h3 { margin: 0 0 8px; font-size: 1rem; color: var(--tone); }
.figure-network-branch ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.figure-network-node { padding: 7px 9px; border-radius: 5px; background: #fffdf7; }
.figure-network-node p { margin: 1px 0 0; color: var(--muted); }
.figure-connection-source { font-size: .88rem; color: var(--bronze); text-decoration: underline; text-underline-offset: 3px; }
.figure-reading {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.figure-reading h4 { margin: 0 0 4px; font-size: .95rem; }
@media (max-width: 900px) { .figure-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 550px) {
  .figure-grid, .figure-network, .figure-reading { grid-template-columns: 1fr; }
  .figure-network-center { max-width: 100%; margin-top: 24px; }
  .figure-network { background: none; border-top: 1px solid var(--tone); }
  .figure-network-branch::before { content: none; }
}
