/* Malfoid Index sub page: extends ../style.css (same palette, chips, search and cards). */

.index-page .hero-text { flex-wrap: wrap; flex-direction: column; align-items: flex-start; gap: 2px; }
.index-page .lede { white-space: normal; overflow: visible; }
.crumb { margin: 0 0 2px; font-size: 13px; }
.crumb a { color: var(--silver-2); }

.index-intro { margin: 18px 0 8px; padding: 0; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.intro-toggle > summary { cursor: pointer; list-style: none; padding: 12px 20px; font-weight: 600; color: var(--silver); display: flex; align-items: center; gap: 10px; }
.intro-toggle > summary::-webkit-details-marker { display: none; }
.intro-toggle > summary::before { content: "▸"; color: var(--emerald); transition: transform .2s; }
.intro-toggle[open] > summary::before { transform: rotate(90deg); }
.intro-body { padding: 4px 20px 18px; }
.index-intro p { margin: 0 0 10px; color: var(--silver); }
.index-intro a { color: var(--emerald); }
.index-how { color: var(--muted) !important; font-size: 14px; }
.index-submit { margin-top: 6px; }
.what-is { margin: 0 0 14px; }
.what-is summary { cursor: pointer; font-weight: 600; color: var(--emerald); list-style: none; }
.what-is summary::-webkit-details-marker { display: none; }
.what-is summary::before { content: "▸ "; }
.what-is[open] summary::before { content: "▾ "; }
.what-is p { margin: 10px 0 0; }
.what-is-dates { font-size: 14px; color: var(--muted) !important; }
.index-rules { margin-top: 12px !important; font-size: 14px; color: #c9f5e2 !important; }

.intro-row { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; align-items: start; }
.intro-row .index-intro { margin: 0; }
/* When the About box is folded away, the name chart widens across the row into the space it leaves,
   and the folded About bar sits under it. Desktop only; on small screens the chart stays below About. */
@media (min-width: 901px) {
  .intro-row:has(#intro-toggle:not([open])) .names-chart { grid-column: 1 / -1; grid-row: 1; }
  .intro-row:has(#intro-toggle:not([open])) .index-intro { grid-row: 2; }
}
.names-chart { border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); padding: 14px 18px 16px; }
.names-chart { container-type: inline-size; }
.names-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left; color: inherit; font: inherit; }
.names-head:focus-visible { outline: 2px solid var(--emerald); outline-offset: 4px; border-radius: 4px; }
.names-title { font: 600 17px/1.3 var(--serif); color: #f2f5f4; }
.names-chev { color: var(--emerald); font-size: 14px; }
.names-body { margin-top: 10px; }
.names-body[hidden] { display: none; }
/* Wide chart (the About box is folded): a bigger ring beside the legend, with up to three names per row. */
@container (min-width: 700px) {
  .names-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 24px; }
  .names-chart .names-ring { width: 100%; max-width: none; }
  .names-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; column-gap: 14px; font-size: 13px; }
  .names-legend .names-num { font-size: 12px; }
}
.names-empty, .names-foot { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.names-wrap { display: grid; gap: 14px; }
.names-ring { position: relative; width: 100%; max-width: 380px; margin: 0 auto; }
.names-pie { width: 100%; height: auto; display: block; overflow: visible; }
.names-label { fill: var(--silver); }
.names-label-pct { fill: var(--silver-2); }
.names-donut { width: 100%; height: 100%; display: block; }
.names-seg { cursor: pointer; transition: opacity .2s; }
.names-seg:hover { opacity: .85; }
.names-seg.is-off { opacity: .35; }
.names-seg.is-on { stroke-width: 40; }
.names-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; padding: 0 44px; }
.names-centre strong { font: 600 19px/1.1 var(--serif); color: #f2f5f4; overflow-wrap: anywhere; }
.names-centre span { font-size: 12px; color: var(--silver-2); margin-top: 4px; }
.names-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.names-row { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 1px solid transparent; border-radius: 8px; padding: 5px 8px; color: var(--silver); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.names-row:hover, .names-row.is-on { border-color: rgba(52, 211, 153, .4); }
.names-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.names-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.names-num { color: var(--silver-2); font-size: 13px; white-space: nowrap; }

.index-controls { margin-top: 14px; }
.index-controls .chips { margin-top: 10px; }
.index-controls .chips[hidden] { display: none; }

.index-count { color: var(--muted); font-size: 13px; margin: 14px 2px 6px; }

.index-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.work { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.work:hover { border-color: rgba(52, 211, 153, .4); }
.work-thumb { display: block; width: calc(100% + 32px); max-width: none; margin: -14px -16px 6px; height: 170px; object-fit: cover; object-position: 50% 8%; background: var(--panel-2); border-radius: var(--radius) var(--radius) 0 0; }
.work-top {display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kind { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #c9f5e2; border: 1px solid rgba(52, 211, 153, .45); border-radius: 999px; padding: 1px 8px; }
.work-date { font-size: 12px; color: var(--silver-2); margin-left: auto; }
.name-tag { font-size: 11px; letter-spacing: .02em; color: var(--tag, #c9f5e2); border: 1px solid var(--tag, rgba(52, 211, 153, .45)); border-radius: 999px; padding: 1px 8px; }
.work h2 { margin: 2px 0 0; font: 600 19px/1.25 var(--serif); letter-spacing: .01em; color: #f2f5f4; overflow-wrap: anywhere; }
.work h2 a { color: inherit; }
.work h2 a:hover { color: #8ff0c8; }
.work-meta { margin: 0; font-size: 13px; color: var(--silver-2); }
.work-summary { margin: 2px 0 0; color: var(--silver); font-size: 14.5px; }
.work-platforms { margin: 0; font-size: 13px; color: var(--silver-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.work-platforms-label { color: var(--silver-2); }
.platform { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); color: var(--silver); }
.platform:hover { color: #8ff0c8; border-color: rgba(52, 211, 153, .5); }
.platform svg { display: block; }
.platform-text { width: auto; padding: 0 8px; font-size: 12px; }
.work-tags {display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 6px; }
.work-tags span { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }

.index-controls[hidden] { display: none; }
.work-more { margin-top: 2px; font-size: 14px; color: #8ff0c8; text-decoration: none; }
.work-more:hover { text-decoration: underline; }
.work-watch { display: inline-block; margin: 2px 0 8px; font-size: 15px; font-weight: 600; color: #8ff0c8; text-decoration: none; }
.work-watch:hover { text-decoration: underline; }
.work-back { grid-column: 1 / -1; margin: 6px 0 0; font-size: 14px; }
.work-back a { color: var(--emerald); }
.creator-head { grid-column: 1 / -1; border-color: rgba(52, 211, 153, .35); }
.index-empty { grid-column: 1 / -1; color: var(--muted); padding: 30px 20px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); }

.index-footer { max-width: 1440px; margin: 0 auto; padding: 0 clamp(12px, 3vw, 32px) 40px; color: var(--silver-2); font-size: 13px; }

@media (max-width: 900px) {
  .intro-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .intro-toggle > summary { padding: 12px 16px; }
  .intro-body { padding: 4px 16px 16px; }
  .index-list { grid-template-columns: 1fr; }
}

/* Expandable cards: the links and video of a work */
.work-toggle { align-self: flex-start; margin-top: 4px; background: none; border: 1px solid rgba(52, 211, 153, .45); color: #8ff0c8; border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.work-toggle:hover { border-color: rgba(52, 211, 153, .8); }
.work.is-open { border-color: rgba(52, 211, 153, .6); }
.work-panel { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.work-panel[hidden] { display: none; }
.work-links { margin: 0; padding-left: 18px; font-size: 14px; overflow-wrap: anywhere; }
.work-links a { color: #8ff0c8; }
.work-player { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.work-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* A local clip keeps its own shape: the box follows the video, nothing is cropped. */
.work-player:has(> video) { aspect-ratio: auto; background: #000; }
.work-player > video { display: block; width: 100%; height: auto; max-height: 80vh; background: #000; }
.work-video { display: flex; flex-direction: column; gap: 4px; }
.work-video-label { margin: 0; font-size: 13px; color: var(--silver-2); }
.work-video-page { gap: 8px; }
.work-video-also { margin: 0; font-size: 13px; color: var(--silver-2); overflow-wrap: anywhere; }
.work-video-also a { color: #8ff0c8; }

.grey-toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 0.9em; opacity: 0.85; }
.grey-flag { opacity: 0.7; font-style: italic; }
