/* Unit Materials & Resources (materials.html?c=...&u=...) */
.m-hero { position: relative; margin-top: 14px; border-bottom: 1px solid var(--line-soft);
  background: var(--navy-800) var(--m-img, none) right center / cover no-repeat; }
.m-hero::before { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(6,13,28,0.97) 0%, rgba(6,13,28,0.9) 42%, rgba(6,13,28,0.45) 74%, rgba(6,13,28,0.15) 100%); }
.m-hero-inner { position: relative; padding-top: 44px; padding-bottom: 34px; }
.m-eyebrow { font-family: var(--caps); font-size: 16px; letter-spacing: 0.16em; color: var(--gold-400); margin: 0 0 6px; }
.m-hero h1 { font-family: var(--serif); font-size: clamp(38px, 5.4vw, 64px); line-height: 1.04; margin: 0; max-width: 820px; }
.m-hero .amp { color: var(--gold-400); }
.m-tag { font-family: var(--serif); font-size: 26px; color: var(--gold-400); margin: 8px 0 10px; }
.m-lede { max-width: 620px; color: var(--ink-soft); margin: 0 0 16px; }
.m-lede b { color: var(--ink); font-weight: 600; }
.m-back { margin: 0; }

.m-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 26px; }
.m-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 44%; gap: 14px; padding: 20px 20px 18px;
  border: 1px solid rgba(226,166,59,0.55); border-radius: 12px; background: linear-gradient(180deg, rgba(14,26,50,0.92), rgba(8,16,33,0.96)); min-height: 220px; }
.m-card .txt { display: flex; flex-direction: column; min-width: 0; }
.m-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.m-ring { flex: none; width: 50px; height: 50px; border-radius: 50%; border: 1.5px solid var(--gold-500); display: grid; place-items: center; }
.m-ring .mi { width: 28px; height: 28px; }
.m-card h2 { font-family: var(--serif); font-size: 25px; line-height: 1.05; font-weight: 600; margin: 0; }
.m-card p.d { color: var(--ink-soft); font-size: 14px; line-height: 1.45; margin: 0 0 14px; }
.m-count { font-size: 12px; color: var(--ink-mute); margin: -8px 0 12px; }
.m-btn { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border: 1.5px solid var(--gold-500);
  border-radius: 6px; background: transparent; color: var(--gold-400); font: 600 12px var(--caps); letter-spacing: 0.12em; cursor: pointer; text-decoration: none; }
.m-btn:hover, .m-btn:focus-visible { background: rgba(226,166,59,0.12); }
.m-btn[aria-disabled="true"] { opacity: 0.55; }
.mi { width: 24px; height: 24px; }

/* previews */
.m-pv { align-self: center; border-radius: 8px; overflow: hidden; min-height: 132px; position: relative; font-size: 11px; }
.m-pv.img { background: var(--navy-900) center / cover no-repeat; border: 1px solid var(--line-soft); }
.m-pv.paper { background: linear-gradient(160deg, #e9d9b5, #cdb88d); color: #3a2c17; padding: 12px; transform: rotate(2deg);
  box-shadow: 0 8px 18px rgba(0,0,0,0.45); }
.m-pv.paper b { display: block; font-family: var(--caps); font-size: 13px; letter-spacing: 0.06em; margin-bottom: 6px; }
.m-pv.paper i { display: block; height: 6px; margin: 7px 0; border-radius: 2px; background: rgba(58,44,23,0.25); }
.m-pv.paper i.s { width: 60%; }
.m-pv.paper span { display: block; font-weight: 600; margin-top: 8px; font-size: 11px; }
.m-pv.dark { background: rgba(4,9,20,0.75); border: 1px solid var(--line-soft); padding: 10px; }
.m-pv.voc dl { margin: 0; }
.m-pv.voc dt { color: var(--gold-400); font-weight: 600; font-size: 12px; }
.m-pv.voc dd { margin: 1px 0 8px; color: var(--ink-soft); font-size: 11px; line-height: 1.3; }
.m-pv.voc dd:last-child { margin-bottom: 0; }
.m-pv.org { display: grid; place-items: center; }
.m-pv.org svg { width: 100%; height: 120px; }
.m-pv.map { background: linear-gradient(160deg, #d9c49a, #b89d6a); padding: 10px 10px 8px; display: flex; flex-direction: column; justify-content: flex-end; }
.m-pv.map .era { color: #3a2c17; font-family: var(--caps); font-size: 12px; letter-spacing: 0.06em; margin-bottom: auto; }
.m-pv.map .tl { position: relative; height: 22px; margin-top: 10px; background: rgba(6,13,28,0.85); border-radius: 4px; }
.m-pv.map .tl::before { content: ""; position: absolute; left: 10px; right: 10px; top: 11px; height: 2px; background: var(--gold-500); }
.m-pv.map .tl b { position: absolute; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold-400); }
.m-pv.slide { background: linear-gradient(180deg, #0e1c37, #08122a); border: 1px solid var(--line-soft); padding: 12px; display: flex; flex-direction: column; }
.m-pv.slide b { font-family: var(--serif); font-size: 16px; line-height: 1.15; font-weight: 600; }
.m-pv.slide hr { width: 40px; border: 0; border-top: 2px solid var(--gold-500); margin: 8px 0; }
.m-pv.slide small { margin-top: auto; color: var(--ink-mute); }
.m-pv.video { background: #0a0f1c center / cover no-repeat; border: 1px solid var(--line-soft); display: grid; place-items: center; }
.m-pv.video::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18px; background: rgba(0,0,0,0.7); }
.m-pv.video .pl { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.88); display: grid; place-items: center; z-index: 1; }
.m-pv.video .pl::before { content: ""; border-left: 14px solid #0b1222; border-top: 9px solid transparent; border-bottom: 9px solid transparent; margin-left: 4px; }
.m-pv.rub { background: linear-gradient(160deg, #e9d9b5, #cdb88d); color: #3a2c17; padding: 8px; }
.m-pv.rub b { display: block; text-align: center; font-family: var(--caps); font-size: 12px; margin-bottom: 4px; }
.m-pv.rub table { width: 100%; border-collapse: collapse; font-size: 8px; }
.m-pv.rub td, .m-pv.rub th { border: 1px solid rgba(58,44,23,0.45); padding: 3px; text-align: center; }
.m-pv.rub td:first-child { text-align: left; }

/* quote card */
.m-quote { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 28px 30px;
  border: 1px solid rgba(226,166,59,0.55); border-radius: 12px; background: linear-gradient(180deg, rgba(14,26,50,0.92), rgba(8,16,33,0.96)); }
.m-quote .mark { font-family: var(--serif); font-size: 56px; line-height: 0.6; color: var(--gold-500); }
.m-quote blockquote { margin: 6px 0 12px; font-family: var(--serif); font-style: italic; font-size: 23px; line-height: 1.3; }
.m-quote cite { font-style: normal; color: var(--gold-400); font-family: var(--serif); font-size: 18px; }

/* strip */
.m-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 22px 0 40px; padding: 18px 10px; }
.m-strip > div { display: flex; gap: 12px; align-items: flex-start; padding: 0 18px; border-right: 1px solid var(--line-soft); }
.m-strip > div:last-child { border: 0; }
.m-strip .mi { flex: none; width: 34px; height: 34px; }
.m-strip p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.4; }
.m-strip b { display: block; font-family: var(--serif); color: var(--gold-400); font-size: 17px; font-weight: 600; }

/* dialog */
.m-dialog { width: min(760px, 94vw); max-height: 86vh; border: 1px solid var(--gold-500); border-radius: 12px; padding: 0; color: var(--ink);
  background: var(--navy-900, #0b1428); }
.m-dialog::backdrop { background: rgba(2,6,16,0.72); }
.m-dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; background: inherit; }
.m-dlg-head h2 { font-family: var(--serif); font-size: 28px; margin: 0; }
.m-x { background: transparent; border: 1px solid var(--line-soft); color: var(--ink); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 16px; }
#m-dlg-body { padding: 14px 22px 22px; }
.m-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.m-list li { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 8px;
  background: rgba(6,13,28,0.5); }
.m-list b { display: block; font-weight: 600; }
.m-list small { display: block; color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.m-list .tag { display: inline-block; font-size: 11px; color: var(--gold-400); border: 1px solid rgba(226,166,59,0.5); border-radius: 99px; padding: 1px 8px; margin-top: 6px; }
.m-list a.go { white-space: nowrap; }
.m-none { color: var(--ink-soft); }
.m-vocab { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.m-vocab div { padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 8px; }
.m-vocab b { color: var(--gold-400); display: block; }
.m-vocab span { color: var(--ink-soft); font-size: 14px; }

@media (max-width: 1080px) { .m-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .m-grid { grid-template-columns: 1fr; }
  .m-card { grid-template-columns: 1fr; }
  .m-pv { min-height: 110px; }
  .m-strip { grid-template-columns: 1fr 1fr; row-gap: 16px; }
  .m-strip > div:nth-child(2) { border: 0; }
  .m-vocab { grid-template-columns: 1fr; }
}
.m-btn { white-space: nowrap; /* btn */ letter-spacing: 0.08em; padding: 9px 14px; }

.m-pv.art { align-self: stretch; min-height: 190px; background-position: center top; border-color: rgba(226,166,59,0.35); }
/* same-size graphics */
.m-card { grid-template-columns: minmax(0, 1fr) 46%; }
.m-pv { align-self: center; width: 100%; min-height: 0; aspect-ratio: 900 / 640; transform: none; }
.m-pv.paper { transform: none; }
/* card art: show the top of the picture and crop just above where it fades to navy */
.m-pv.art { align-self: center; min-height: 0; background-size: 100% auto; background-position: center top; border-color: rgba(226,166,59,0.35); }
.m-pv.voc dd { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
@media (max-width: 720px) { .m-pv { width: 100%; } }
