/* Tematik page (tematik.html), mockup V54: the circular theme diagram from the client's graphic, drawn as SVG by
   the tematik-*.js files in this folder (entry: tematik-diagram.js) from window.TEMATIK (config/tematik.js). Load after
   dasar.css and shared/dialog.css (font and colour variables, the lightbox). Hover lifts a slice, a click opens it in
   #tmt-dialog. */
body[data-halaman="tematik"]{background:#fff;display:flex;flex-direction:column;min-height:100vh;min-height:100svh}   /* the page fills the window, so the footer sits at the bottom on tall screens (the header and skip link are fixed, outside the flow) */
body[data-halaman="tematik"] .tmt-halaman{flex:1 0 auto}
.tmt-halaman{padding:calc(var(--head-h) + 32px) 0 var(--section-space,64px) /* R1 */;font-family:var(--nk-font);color:var(--nk-ink);overflow-x:clip}

/* ---------- page head: the open head, left-aligned at the gutter (styling guide 9.2) ---------- */
.tmt-kepala{margin:0 0 32px;padding:0 var(--nk-tepi)}
.tmt-kepala__intro{margin:16px 0 0;max-width:640px;font:400 18px/28px var(--nk-font) /* --fs-lede */;color:var(--nk-ink-soft);text-wrap:pretty}
.tmt-kepala__petunjuk{display:flex;align-items:flex-start;gap:8px;margin:16px 0 0;max-width:640px;font:400 14px/20px var(--nk-font) /* --fs-sm */;color:var(--nk-ink-soft);text-wrap:balance}
.tmt-kepala__petunjuk svg{flex:none;width:20px;height:20px;color:var(--nk-forest)}

/* ---------- diagram: as large as the screen allows ---------- */
.tmt-diagram{position:relative;margin:0;padding:0 var(--nk-tepi)}
.tmt-lingkar{width:min(100%,980px);aspect-ratio:1;margin:0 auto}
/* wide screens: title and intro on the left at the container edge, the whole circle in one screen, centred in the rest
   (the circle's width cap uses the column width, min(100vw - 2 gutters, --nk-wadah), so wider screens don't overflow it) */
@media (min-width:1100px){
  .tmt-halaman{--tmt-kiri:clamp(280px,24vw,400px);--tmt-sela:clamp(40px,4.5vw,96px);display:grid;grid-template-columns:var(--tmt-kiri) minmax(0,1fr);align-items:center;column-gap:var(--tmt-sela);padding:calc(var(--head-h) + 24px) max(var(--nk-tepi), (100% - var(--nk-wadah)) / 2) var(--section-space,64px) /* R1; the Kabar and Proyek column: --nk-wadah 1300 with the --nk-tepi gutter (dasar.css; user, 20 Oct 2026) */}
  .tmt-kepala{margin:0;padding:0}
  .tmt-diagram{padding:0}
  /* the circle fits the screen between the header (+24) and 40 px above the bottom edge (R10: vh first, then svh) */
  .tmt-lingkar{width:min(980px,max(560px,calc(100vh - var(--head-h) - 64px)),calc(min(100vw - 2 * var(--nk-tepi), var(--nk-wadah)) - var(--tmt-kiri) - var(--tmt-sela) - 16px));
    width:min(980px,max(560px,calc(100svh - var(--head-h) - 64px)),calc(min(100vw - 2 * var(--nk-tepi), var(--nk-wadah)) - var(--tmt-kiri) - var(--tmt-sela) - 16px))}
}
.tmt-svg{display:block;width:100%;height:100%;overflow:visible;font-family:var(--tmt-huruf,var(--font));-webkit-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.tmt-bagian{cursor:pointer;outline:none}
.tmt-t{fill:#fff}
.tmt-sorot{fill:#fff;opacity:0}
.tmt-garis{fill:none;stroke-width:3.5;pointer-events:none}
.tmt-cincin{fill:none;pointer-events:none;stroke-linejoin:round}
/* focus ring: ochre, as on dark surfaces; it runs over the coloured slices, where a forest ring would vanish */
.tmt-cincin--fokus{stroke:var(--nk-ochre,#C98B3A);stroke-width:7}

/* a copy of one slice (the lifted slice, the dialog) */
.tmt-irisan{display:block;overflow:visible;font-family:var(--tmt-huruf,var(--font))}
.tmt-irisan__garis{fill:none;stroke:#fff;stroke-width:4;stroke-linejoin:round;pointer-events:none}
.tmt-angkat.is-fokus .tmt-irisan__garis{stroke:var(--nk-ochre,#C98B3A);stroke-width:7}
/* forced colours (Windows contrast themes) leave SVG strokes alone: the focus rings take the system highlight colour (R14) */
@media (forced-colors:active){ .tmt-cincin--fokus,.tmt-angkat.is-fokus .tmt-irisan__garis{stroke:Highlight} }

/* the lift: a copy of the slice rises above the circle. The circle keeps its colours (no dimming, user 20 Oct 2026);
   the slice's own place darkens a little, so it reads as the gap the slice rose out of */
.tmt-angkat{pointer-events:none;transform-box:fill-box;transform-origin:center}
.tmt-svg.is-angkat .tmt-bagian.is-aktif{filter:brightness(.72)}
@media (prefers-reduced-motion:no-preference){ .tmt-bagian{transition:filter .3s ease} }   /* --dur-2 */

/* ---------- the dialog: the theme in the Sejarah-style lightbox (shared/dialog.css .nk-dialog--foto, data-tema="gelap"):
   the slice on the left, the title and description on the right; ‹ › on the sides as in sejarah-linimasa.css ---------- */
.tmt-dialog__isi{position:relative;display:grid;place-items:center;width:100%;height:100%;padding:64px 88px 40px}
.tmt-dialog__badan{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);align-items:center;gap:clamp(32px,4vw,64px);width:min(1280px,100%)}   /* the slice gets 3/5 (user, 20 Oct 2026: bigger) */
.tmt-dialog__irisan{display:flex;justify-content:center}
.tmt-dialog__irisan .tmt-irisan{width:100%;height:auto;max-height:calc(100vh - 160px);max-height:calc(100dvh - 160px);filter:drop-shadow(0 16px 28px rgba(0,0,0,.35))}
.tmt-dialog__teks{max-width:560px}
.tmt-dialog__teks::before{content:"";display:block;width:48px;height:5px;margin-bottom:16px;border-radius:2px /* --r-xs */;background:var(--tmt-warna,#B9D88F /* --leaf-light */)}   /* the theme's colour */
.tmt-dialog__judul{margin:0 0 16px;font:700 28px/36px var(--font-head,var(--font));font-weight:var(--font-head-w,700);font-synthesis:none;letter-spacing:-.01em;color:var(--paper);text-wrap:balance;overflow-wrap:anywhere}   /* --fs-h3 */
html:not([data-judul-serif~="tematik"]) .tmt-dialog__judul{--font-head:var(--font-normal,var(--font));--font-head-w:700}   /* huruf.judulPerBagian.tematik: 'normal' (core/huruf.js) */
.tmt-dialog__deskripsi{margin:0;font:400 18px/28px var(--font);color:var(--paper);text-wrap:pretty}   /* --fs-lede */
.tmt-dialog__nav{position:absolute;top:50%;transform:translateY(-50%)}
.tmt-dialog__nav--prev{left:20px}
.tmt-dialog__nav--next{right:20px}
/* the opening (tematik-diagram.js bukaAnimasi): the circle folds into the chosen slice, which then moves to the dialog. No
   shared 8 px rise or fade on the dialog, which would move the circle; the backdrop still darkens (dialog.css) and the
   buttons fade in as the slice lands */
html.nk-gerak .tmt-dialog[open]{animation:none}
html.nk-gerak .tmt-dialog[open] .nk-dialog__tutup,html.nk-gerak .tmt-dialog[open] .tmt-dialog__nav{animation:tmt-pudar .3s ease .8s backwards}
/* the circle redrawn over the backdrop while it folds, exactly where the page's circle is */
.tmt-dialog__lipat{position:fixed;inset:0;z-index:2;pointer-events:none}
.tmt-dialog__lipat svg{position:absolute;overflow:visible;font-family:var(--tmt-huruf,var(--font))}

@media (max-width:760px){
  /* phones: the slice on top, the text under it, together in the middle of the screen (user, 20 Oct 2026); auto margins
     centre them while they fit and fall back to the top when a long text scrolls; ‹ › stay at the bottom */
  .tmt-dialog__isi{display:flex;flex-direction:column;align-items:center;overflow-y:auto;overscroll-behavior:contain;padding:72px 16px 112px}
  .tmt-dialog__badan{margin:auto 0}
  .tmt-dialog__badan{grid-template-columns:minmax(0,1fr);gap:24px}
  .tmt-dialog__irisan .tmt-irisan{max-height:38vh;max-height:38dvh}
  .tmt-dialog__judul{font-size:24px;line-height:32px}
  .tmt-dialog__deskripsi{font-size:16px;line-height:24px}
  .tmt-dialog__nav{position:fixed;top:auto;bottom:calc(24px + env(safe-area-inset-bottom));transform:none}
  .tmt-dialog__nav--prev{left:calc(50% - 60px)}
  .tmt-dialog__nav--next{right:calc(50% - 60px)}
  .tmt-halaman{padding-top:calc(var(--head-h) + 24px)}   /* the bottom: --section-space is 48 here (R1) */
  .tmt-kepala{margin-bottom:24px}
  .tmt-kepala__intro{font-size:16px;line-height:24px}
  .tmt-diagram{padding:0 12px}   /* the circle runs a little past the gutter on phones: its text is small */
}

/* motion: the lift and the flight are animated in tematik-diagram.js (fades with reduced motion) */
@keyframes tmt-pudar{from{opacity:0}}
