/* 3D model pages (site/3d-*.html): the look of the original design canvases.
   .m3d-app-k = Kandariya (light, Cormorant Garamond + Inter); .m3d-app-bj = Bhaja (dark, Spectral + Inter). */

/* ---------- page header, in the canvas's own type and colours ---------- */
.m3d-head { padding: 22px 0 6px; }
.m3d-head-in { box-sizing: border-box; max-width: 1480px; margin: 0 auto; padding: 0 28px; display: flex; flex-direction: column; gap: 6px; }
.m3d-head .crumbs { margin: 0 0 4px; font-size: 13px; }
.m3d-head h1 { margin: 0; text-transform: none; letter-spacing: 0; }
.m3d-eyebrow { margin: 0; font: 600 13px Inter, system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; }
.m3d-intro { margin: 0; font: 400 15px/1.5 Inter, system-ui, sans-serif; max-width: 980px; }
.m3d-meta { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; font: 400 13px Inter, system-ui, sans-serif; margin-top: 4px; }
.m3d-meta .share-btn { margin: 0; }
.m3d-head-k { background: #f3ede3; color: #2a2118; }
.m3d-head-k h1 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; font-size: 46px; line-height: 1.05; color: #2a2118; }
.m3d-head-k .m3d-eyebrow { color: #7a3f1f; }
.m3d-head-k .m3d-intro, .m3d-head-k .m3d-meta { color: #5a4a3a; }
.m3d-head-k a { color: #7a3f1f; }
.m3d-head-bj { background: #14110f; color: #efe7dc; padding-bottom: 14px; }
.m3d-head-bj h1 { font-family: Spectral, Georgia, serif; font-weight: 600; font-size: 40px; line-height: 1.1; color: #f6efe4; }
.m3d-head-bj .m3d-eyebrow { color: #c9b9a4; }
.m3d-head-bj .m3d-intro, .m3d-head-bj .m3d-meta { color: #c9b9a4; }
.m3d-head-bj a { color: #e0b07a; }
.m3d-head-bj .share-btn { color: #efe7dc; border-color: #4a3f36; background: transparent; }

/* ---------- Kandariya app (canvas styles, scoped) ---------- */
.m3d-app-k { background: #f3ede3; color: #2a2118; font-family: Inter, system-ui, sans-serif; }
.m3d-app-k a { color: #7a3f1f; } .m3d-app-k a:hover { color: #4f2812; }
.m3d-app-k .vbtn { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid #c9b79d; background: #fffaf2; color: #2a2118; font: 500 14px Inter, system-ui, sans-serif; cursor: pointer; }
.m3d-app-k .vbtn:hover { background: #f1e6d4; }
.m3d-app-k .vbtn.on { background: #2a2118; color: #fffaf2; border-color: #2a2118; }
.m3d-app-k .tab { min-height: 44px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #5a4a3a; font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; }
.m3d-app-k .tab.on { color: #2a2118; border-bottom-color: #7a3f1f; }
.m3d-app-k .pad { width: 56px; height: 56px; border-radius: 12px; border: 1px solid rgba(255,250,242,0.5); background: rgba(34,26,19,0.78); color: #fffaf2; display: flex; align-items: center; justify-content: center; cursor: pointer; touch-action: none; user-select: none; }
.m3d-app-k .tag { display: inline-block; padding: 2px 7px; border-radius: 5px; font: 600 10.5px Inter, system-ui, sans-serif; letter-spacing: 0.04em; color: #fff; white-space: nowrap; }
.m3d-app-k .t-MEASURED { background: #1f5f8b; } .m3d-app-k .t-DOCUMENTED { background: #2f6b3a; } .m3d-app-k .t-COMPARATIVE { background: #6e4790; }
.m3d-app-k .t-HYPOTHETICAL { background: #93520f; } .m3d-app-k .t-RECONSTRUCTED { background: #8a2d2d; } .m3d-app-k .t-ESTIMATED { background: #5f5f5f; } .m3d-app-k .t-ILLUSTRATIVE { background: #9c2f64; }
.m3d-app-k input[type=range] { accent-color: #7a3f1f; }
.m3d-app-k select { width: auto; max-width: 100%; }
.m3d-app-k h3 { font-family: Inter, system-ui, sans-serif; text-transform: none; letter-spacing: 0; }
.m3d-app-k svg { display: inline-block; }

/* ---------- Bhaja app (canvas styles, scoped) ---------- */
.m3d-app-bj { --app-h: calc(100svh - 72px); scroll-margin-top: 72px; background: #14110f; color: #efe7dc; }
.m3d-app-bj a { color: #e0b07a; } .m3d-app-bj a:hover { color: #f3d2a8; }
.m3d-app-bj .bj-scroll::-webkit-scrollbar { width: 6px; }
.m3d-app-bj .bj-scroll::-webkit-scrollbar-thumb { background: #4a3f36; border-radius: 3px; }
.m3d-app-bj .bj-facts-btn { display: none !important; }
.m3d-app-bj canvas { touch-action: none; }

/* ---------- the rest of the page ---------- */
.m3d-page .guide { padding-top: 1.5rem; }
.m3d-page .guide-text { padding-top: 0.5rem; margin-bottom: 0; padding-bottom: 0; }
.m3d-noscript { width: 100%; height: auto; border-radius: 10px; margin: 1rem 0 .5rem; }
.m3d-facts-text { margin: 1.4rem 0 0; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; }
.m3d-facts-text summary { cursor: pointer; font-weight: 600; }
.m3d-facts { width: 100%; border-collapse: collapse; font-size: .92rem; margin: .6rem 0 .4rem; }
.m3d-facts th, .m3d-facts td { text-align: left; vertical-align: top; padding: .45rem .5rem; border-bottom: 1px solid var(--line); }
.m3d-facts th { width: 34%; font-weight: 600; }
.m3d-tag { display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 0 4px; border-radius: 3px; color: #fff; vertical-align: 1px; margin-right: .35rem; }
.tag-measured { background: #1f5f8b; } .tag-documented { background: #2f6b3a; } .tag-comparative { background: #6e4790; }
.tag-hypothetical { background: #93520f; } .tag-reconstructed { background: #8a2d2d; } .tag-estimated { background: #5f5f5f; } .tag-illustrative { background: #9c2f64; }
.m3d-visit { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; margin: 1.6rem 0 2rem; background: var(--paper); }
.m3d-visit h2 { margin-top: 0; }
.m3d-more { margin: 2.5rem 0; }
.m3d-card .card-art { aspect-ratio: 16 / 9; height: auto; }
.m3d-card .card-art img { width: 100%; height: 100%; object-fit: cover; }
.m3d-follow { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 1.5rem 0; }
.m3d-follow img { width: 34px; height: 34px; object-fit: contain; }
.m3d-sources li { margin-bottom: .35rem; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 760px) {
  .m3d-head-in { padding: 0 16px; }
  .m3d-head-k h1 { font-size: 32px; }
  .m3d-head-bj h1 { font-size: 30px; }
  .m3d-intro { font-size: 14px; }
  .m3d-app-k .k-root { padding: 8px 16px 28px !important; }
  .m3d-app-k { --k-h: 64svh; }
  .m3d-app-k .vbtn { padding: 0 12px; font-size: 13px; }
  .m3d-app-bj { --app-h: calc(100svh - 124px); }
  .m3d-app-bj .bj-facts-btn { display: inline-block !important; }
  .m3d-app-bj .bj-panel { display: none !important; }
  .m3d-app-bj .bj-panel.open { display: flex !important; left: 10px !important; right: 10px !important; top: 10px !important; width: auto !important; max-height: calc(100% - 46%) !important; z-index: 3; }
  .m3d-app-bj .bj-bar { left: 10px !important; right: 10px !important; bottom: 10px !important; max-height: 44%; overflow-y: auto; padding: 10px !important; gap: 8px !important; }
  .m3d-app-bj .bj-brand { top: 10px !important; right: 10px !important; }
  .m3d-app-bj .bj-brand img { width: 34px !important; height: 34px !important; }
  .m3d-app-bj .bj-hint { display: none; }
  .m3d-app-bj .bj-brand { max-width: 72% !important; }
  .m3d-facts, .m3d-facts tbody, .m3d-facts tr, .m3d-facts th, .m3d-facts td { display: block; width: auto; }
  .m3d-facts tr { border-bottom: 1px solid var(--line); padding: .5rem 0; }
  .m3d-facts th, .m3d-facts td { border: 0; padding: .1rem .2rem; }
}

/* ---------- the whole content area takes the canvas palette, in light and dark site themes ---------- */
.m3d-k main { --plaster: #f3ede3; --plaster-deep: #efe5d6; --paper: #fffaf2; --ink: #2a2118; --ink-soft: #5a4a3a; --line: #e2d5c1; --verdigris: #c9b79d; --verdigris-dark: #7a3f1f; background: #f3ede3; color: #2a2118; color-scheme: light; }
.m3d-bj main { --plaster: #14110f; --plaster-deep: #1c1815; --paper: #201b17; --ink: #efe7dc; --ink-soft: #c9b9a4; --line: #3a322b; --verdigris: #4a3f36; --verdigris-dark: #e0b07a; background: #14110f; color: #efe7dc; color-scheme: dark; }
.m3d-k main h1, .m3d-k main h2, .m3d-k main h3 { color: #2a2118; }
.m3d-k main .guide-text h2, .m3d-k main .m3d-visit h2, .m3d-k main .section-head h2, .m3d-k main .guide-related h2, .m3d-k main #src-title { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; text-transform: none; letter-spacing: 0; font-size: 30px; }
.m3d-bj main .guide-text h2, .m3d-bj main .m3d-visit h2, .m3d-bj main .section-head h2, .m3d-bj main .guide-related h2, .m3d-bj main #src-title { font-family: Spectral, Georgia, serif; font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 28px; color: #f6efe4; }
.m3d-k main a { color: #7a3f1f; } .m3d-bj main a { color: #e0b07a; }
.m3d-k main .btn-primary, .m3d-bj main .btn-primary { color: #1c1b19; }
@media (max-width: 760px) {
  /* on phones the model comes first, then the view and layer buttons */
  .m3d-app-k .k-root > div:nth-child(4) { order: -1; }
  .m3d-app-k .k-root > div:nth-child(1), .m3d-app-k .k-root > div:nth-child(2) { gap: 6px !important; }
  .m3d-app-k .vbtn { min-height: 40px; }
}
@media (max-width: 760px) {
  .m3d-app-k .k-panel-body { max-height: 52svh !important; }
  .m3d-app-bj .bj-bar { flex-direction: column; flex-wrap: nowrap !important; align-items: stretch !important; max-height: none; overflow: visible; }
  .m3d-app-bj .bj-bar > div { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .m3d-app-bj .bj-bar > div > * { flex: 0 0 auto; }
  .m3d-app-bj .bj-bar button { min-height: 36px !important; white-space: nowrap; }
  .m3d-app-bj .bj-bar input[type=range] { width: 120px !important; }
}

/* Phones and tablets: a vertical swipe on the model scrolls the page; a sideways drag turns it,
   two fingers pinch to zoom. Full screen keeps every gesture for the model. */
@media (pointer: coarse) {
  .m3d-app canvas { touch-action: pan-y !important; }
  .m3d-app:fullscreen canvas, .m3d-app :fullscreen canvas { touch-action: none !important; }
}
.m3d-app .bj-scroll:focus-visible, .m3d-app .k-panel-body:focus-visible { outline: 2px solid #e0a526; outline-offset: -2px; }
