/* /instruments/ pages and the museum strip under chart pages.
   Kept out of extras.css / custom.css so adding it does not change the stylesheet that every other page links.
   Colour tokens come from custom.css (--mtp-*). */
.mtp-ins-page { min-width: 0; max-width: 100%; }
.mtp-ins-block { margin: 40px 0 0; padding-top: 6px; }
.mtp-ins-block > h2, .mtp-ins-gallery > h2, .mtp-ins-family > h2 { margin-top: 0; }
.mtp-ins-small { color: var(--mtp-muted); font-size: 13px; line-height: 1.55; max-width: 72ch; }
.mtp-ins-src {
  max-width: 72ch; margin: 14px 0 0; padding-left: 12px; border-left: 2px solid var(--mtp-line);
  color: var(--mtp-muted); font-size: 12.5px; line-height: 1.55;
}
.mtp-ins-src a { color: var(--mtp-brass-bright); }
.mtp-ins-intro { color: var(--mtp-muted); max-width: 70ch; }

/* ---- lede ---- */
.mtp-ins-lede { margin: 0 0 26px; max-width: 72ch; }
.mtp-ins-lede-text p { font-size: 19px; line-height: 1.6; color: var(--mtp-paper); margin: 0 0 8px; }
.mtp-ins-lede-text a { color: var(--mtp-brass-bright); }

/* ---- gallery ---- */
.mtp-ins-gallery { margin: 8px 0 0; }
.mtp-ins-gal-sum { color: var(--mtp-muted); font-size: 14.5px; max-width: 72ch; margin: 0 0 14px; }
.mtp-ins-grid {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense;
}
.mtp-ins-fig { margin: 0; padding: 0; min-width: 0; }
.mtp-ins-fig figure { margin: 0; height: 100%; display: flex; flex-direction: column; background: var(--mtp-raised); border: 1px solid var(--mtp-line); }
.mtp-ins-fig.is-hero { grid-column: span 2; grid-row: span 2; }
.mtp-ins-pic { display: block; aspect-ratio: 1 / 1; background: #0c0817; overflow: hidden; }
.mtp-ins-pic img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mtp-ins-pic:hover img, .mtp-ins-pic:focus-visible img { opacity: .92; }
.mtp-ins-pic:focus-visible { outline: 2px solid var(--mtp-brass-bright); outline-offset: -2px; }
.mtp-ins-fig figcaption { padding: 8px 10px 10px; font-size: 12.5px; line-height: 1.4; color: var(--mtp-muted); overflow-wrap: anywhere; }
.mtp-ins-fig figcaption strong { display: block; color: var(--mtp-paper); font-weight: 600; font-size: 13px; }
.mtp-ins-fig figcaption span { display: block; }
.mtp-ins-fig.is-hero figcaption { font-size: 13.5px; }

/* ---- tables ---- */
.mtp-ins-table { width: 100%; max-width: 76ch; border-collapse: collapse; font-size: 15px; }
.mtp-ins-table th, .mtp-ins-table td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--mtp-line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.mtp-ins-table tbody th { width: 13em; color: var(--mtp-muted); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.mtp-ins-table thead th { color: var(--mtp-muted); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.mtp-ins-table a { color: var(--mtp-brass-bright); }
.mtp-ins-langs { max-width: 64ch; }
.mtp-ins-langs tbody th { width: 8em; }
.mtp-ins-langs td:nth-child(2) { font-size: 17px; color: var(--mtp-paper); }

/* ---- excerpted text ---- */
.mtp-ins-text { max-width: 72ch; }
.mtp-ins-text p { margin: 0 0 14px; font-size: 16.5px; line-height: 1.65; }
.mtp-ins-text h3 { margin: 28px 0 8px; font-size: 1.45rem; color: var(--mtp-brass-bright); }
.mtp-ins-text h4 { margin: 20px 0 8px; font-size: 1.15rem; color: var(--mtp-paper); }
.mtp-ins-text ul, .mtp-ins-text ol { margin: 0 0 14px; padding-left: 1.3em; line-height: 1.6; }
.mtp-ins-text li { margin: 0 0 4px; }
.mtp-ins-text a { color: var(--mtp-brass-bright); text-decoration-color: rgba(224, 189, 114, .45); text-underline-offset: 2px; }
.mtp-ins-text a:hover { color: var(--mtp-paper); }
.mtp-ins-old p { font-size: 15.5px; color: var(--mtp-paper); }

/* ---- chips ---- */
.mtp-ins-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; padding: 0; list-style: none; }
.mtp-ins-chips li { margin: 0; }
.mtp-ins-chips a {
  display: inline-block; padding: 6px 12px; background: var(--mtp-raised); border: 1px solid var(--mtp-line); border-radius: 2px;
  color: var(--mtp-paper); text-decoration: none; font-size: 14px;
}
.mtp-ins-chips a:hover, .mtp-ins-chips a:focus-visible { background: var(--mtp-raised-2); color: var(--mtp-brass-bright); }
.mtp-ins-chips a span { color: var(--mtp-muted); font-size: 12px; margin-left: 4px; }
.mtp-ins-relgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 28px; }
.mtp-ins-relgrid h3 { margin: 14px 0 8px; font-size: 1.1rem; color: var(--mtp-brass-bright); }

/* ---- credits list ---- */
.mtp-ins-creditlist { margin: 0 0 12px; padding-left: 1.2em; font-size: 13px; line-height: 1.55; color: var(--mtp-muted); max-width: 90ch; }
.mtp-ins-creditlist li { margin: 0 0 6px; overflow-wrap: anywhere; }
.mtp-ins-creditlist strong { color: var(--mtp-paper); font-weight: 600; }
.mtp-ins-creditlist a { color: var(--mtp-brass-bright); }
.mtp-ins-back { margin-top: 36px; }

/* ---- section front page ---- */
.mtp-ins-famnav { margin: 4px 0 8px; }
.mtp-ins-family { margin: 46px 0 0; }
.mtp-ins-family > h2 small { font-family: "Source Sans 3", sans-serif; font-size: 14px; font-weight: 400; color: var(--mtp-muted); margin-left: 8px; letter-spacing: 0; }
.mtp-ins-famblurb { margin-bottom: 18px; }
.mtp-ins-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; }
.mtp-ins-cards li { margin: 0; min-width: 0; }
.mtp-ins-card {
  display: flex; flex-direction: column; height: 100%; background: var(--mtp-raised); border: 1px solid var(--mtp-line);
  color: var(--mtp-paper) !important; text-decoration: none;
}
.mtp-ins-card:hover, .mtp-ins-card:focus-visible { background: var(--mtp-raised-2); }
.mtp-ins-card-pic { display: block; aspect-ratio: 4 / 3; background: #0c0817; overflow: hidden; }
.mtp-ins-card-pic img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mtp-ins-card-body { display: flex; flex-direction: column; padding: 14px 16px 16px; flex: 1; }
.mtp-ins-card h3 { margin: 0 0 6px; font-size: 24px; line-height: 1.05; }
.mtp-ins-card p { margin: 0 0 10px; color: var(--mtp-muted); font-size: 14px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.mtp-ins-card small { margin-top: auto; color: var(--mtp-brass); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }

/* ---- strip under a chart page ---- */
.mtp-ins-chartgal { margin: 44px 0 8px; padding: 22px 22px 14px; background: var(--mtp-raised); border: 1px solid var(--mtp-line); border-top: 3px solid var(--mtp-brass); border-radius: 2px; }
.mtp-ins-chartgal > h2 { margin: 0 0 14px; }
.mtp-ins-minigrid { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.mtp-ins-minigrid li { margin: 0; min-width: 0; }
.mtp-ins-minigrid figure { margin: 0; }
.mtp-ins-minigrid a { display: block; aspect-ratio: 1 / 1; background: #0c0817; overflow: hidden; border: 1px solid var(--mtp-line); }
.mtp-ins-minigrid img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mtp-ins-minigrid figcaption { padding-top: 6px; font-size: 12px; line-height: 1.35; color: var(--mtp-muted); }
.mtp-ins-minigrid figcaption strong { display: block; color: var(--mtp-paper); font-weight: 600; }
.mtp-ins-minigrid figcaption span { display: block; }
.mtp-ins-more { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.mtp-ins-more a { color: var(--mtp-brass-bright); }

/* ---- viewer (static/js/instruments.js) ---- */
.mtp-ins-dialog { border: 1px solid var(--mtp-line); background: #0c0817; color: var(--mtp-paper); padding: 0; max-width: min(96vw, 1000px); width: 96vw; max-height: 96vh; }
.mtp-ins-dialog::backdrop { background: rgba(5, 3, 10, .88); }
.mtp-ins-dialog-in { display: flex; flex-direction: column; max-height: 96vh; }
.mtp-ins-dialog img { display: block; max-width: 100%; max-height: 68vh; margin: 0 auto; object-fit: contain; }
.mtp-ins-dialog-pic { padding: 12px 12px 0; text-align: center; overflow: auto; }
.mtp-ins-dialog-cap { padding: 10px 16px 14px; font-size: 14px; line-height: 1.5; color: var(--mtp-muted); overflow: auto; }
.mtp-ins-dialog-cap strong { color: var(--mtp-paper); }
.mtp-ins-dialog-cap a { color: var(--mtp-brass-bright); }
.mtp-ins-dialog-bar { display: flex; gap: 8px; justify-content: flex-end; padding: 8px 12px 0; }
.mtp-ins-dialog-bar button {
  background: transparent; color: var(--mtp-brass-bright); border: 1px solid var(--mtp-brass); border-radius: 2px; padding: 8px 14px;
  font: inherit; font-size: 14px; cursor: pointer; min-height: 40px;
}
.mtp-ins-dialog-bar button:hover, .mtp-ins-dialog-bar button:focus-visible { background: rgba(196, 154, 73, .16); color: var(--mtp-paper); }

/* ---- narrow screens: nothing on these pages may widen the page ---- */
@media screen and (max-width: 900px) {
  .mtp-ins-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mtp-ins-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mtp-ins-minigrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media screen and (max-width: 560px) {
  .mtp-ins-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mtp-ins-fig.is-hero { grid-column: span 2; grid-row: auto; }
  .mtp-ins-cards { grid-template-columns: 1fr; }
  .mtp-ins-minigrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mtp-ins-table tbody th { width: 7.5em; font-size: 11px; }
  .mtp-ins-chartgal { padding: 16px 12px 10px; }
  .mtp-ins-text p { font-size: 16px; }
  .mtp-ins-lede-text p { font-size: 17.5px; }
}
/* The mobile shell is a column flexbox that lets the page column shrink to its content (see extras.css); pin it. */
@media screen and (max-width: 720px) {
  .mtp-page:has(.mtp-ins-page), .mtp-page:has(.mtp-ins-chartgal) { width: 100%; max-width: 100%; box-sizing: border-box; }
  .mtp-ins-table { display: block; max-width: 100%; overflow-x: auto; }
}
@media print { .mtp-ins-chartgal { display: none !important; } }

/* ---- theme overrides: the theme's .markdown rules indent lists and size tables ---- */
.mtp-ins-page ul.mtp-ins-grid, .mtp-ins-page ul.mtp-ins-cards, .mtp-ins-page ul.mtp-ins-chips, .mtp-ins-chartgal ul.mtp-ins-minigrid {
  padding: 0; padding-inline-start: 0; margin-left: 0; margin-right: 0; list-style: none;
}
.mtp-ins-page ul.mtp-ins-grid { margin-bottom: 0; }
.mtp-ins-page table.mtp-ins-table { display: table; width: 100%; max-width: 76ch; }
.mtp-ins-page .mtp-ins-langs th:first-child { white-space: nowrap; }
.mtp-ins-page .mtp-ins-langs td:nth-child(2) { min-width: 9em; }
.mtp-ins-page .mtp-ins-fig { list-style: none; }
.mtp-ins-page .mtp-ins-fig figure { margin: 0; }

/* image boxes: the picture is taken out of the flow so its intrinsic size cannot stretch the box (flex min-height:auto) */
.mtp-ins-pic, .mtp-ins-card-pic, .mtp-ins-minigrid a { position: relative; min-height: 0; }
.mtp-ins-pic img, .mtp-ins-card-pic img, .mtp-ins-minigrid a img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.mtp-ins-card-pic { flex: 0 0 auto; }
.mtp-ins-dialog-cap strong, .mtp-ins-dialog-cap span { display: block; }

/* very narrow phones: let the language table scroll inside its own box */
@media (max-width: 420px) {
  .mtp-ins-langs, .mtp-ins-page table.mtp-ins-langs { display: block; max-width: 100%; overflow-x: auto; }
}
