/* ==========================================================================
   Dönüştür.net — KİNETİK shared system, LATE part (every public page).
   Everything here is invisible at first paint: the mega menu / mobile sheet internals, the detail panel,
   the language list, the consent banner and the QA badge. base.html preloads this file (<link rel=preload
   as=style id=dn-late>) and site.js switches it to a stylesheet, then adds html.late; until then site.css keeps
   #mega display:none and site.js keeps the consent banner hidden. Same rules as site.css: radii 0 / 2 px,
   1 px hairlines, hard ink shadows, logical properties.
   ========================================================================== */

/* ---------- language list (native <details>) ---------- */
.lang__list { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 60; min-width: 200px; padding: 6px 0; background: var(--paper); border: 1px solid var(--ink); border-radius: var(--r-1); box-shadow: var(--shadow); }
.lang__list a { display: flex; align-items: center; gap: 12px; padding: 9px 14px; font-size: 15px; text-decoration: none; }
.lang__list a:hover, .lang__list a:focus-visible { background: var(--paper-2); }
.lang__list a[aria-current="true"] { font-weight: 650; }
.lang__list a[aria-current="true"] .lang__code { background: var(--ink); color: var(--paper); }
.lang__code { font: 500 11px/1 var(--f-code); padding: 4px 5px 3px; border: 1px solid var(--ink); border-radius: var(--r-1); min-width: 28px; text-align: center; }

/* ---------- mega menu frame (site.css keeps it display:none until html.late) + veil ---------- */
.mega {
  position: absolute; inset-inline: 0; top: 100%;
  background: var(--paper); border-bottom: 1px solid var(--rule);
  clip-path: inset(0 0 100% 0); visibility: hidden;
  transition: clip-path .7s var(--e-out), visibility 0s linear .7s;
  contain: layout;   /* its (re)layouts never reach the page: switching this file on lays out the menu only */
}
.mega.is-open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .7s var(--e-out), visibility 0s; }
.mega.no-tr, .is-still .mega, .is-reduced .mega { transition: none; }
.veil { position: fixed; inset: 0; z-index: 40; background: rgba(15, 15, 14, .32); opacity: 0; pointer-events: none; transition: opacity .5s var(--e-out); }
.veil.is-on { opacity: 1; pointer-events: auto; }

/* ---------- toast (DN.toast waits for this file) ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate3d(-50%, 150%, 0);
  display: flex; align-items: center; gap: 14px; max-width: min(560px, calc(100vw - 32px)); width: max-content;
  background: var(--ink); color: var(--paper); padding: 14px 18px; border-radius: var(--r-1);
  font-size: 15px; line-height: 1.4; transition: transform .6s var(--e-out); pointer-events: none;
}
.toast:empty { visibility: hidden; }
.toast.is-on { transform: translate3d(-50%, 0, 0); }
.toast svg { width: 28px; height: 28px; flex: none; }
.toast strong { color: #fff; }

/* ---------- Lenis (home only; home-more.js starts it on the first pointer move / wheel / key) ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- mega menu (desktop) internals ---------- */
/* 2026-09-25 minimal menu: 4 balanced columns (2 groups each) + the animated detail panel; one-line names; a search
   row on top (site.js filters the list, the panel follows the first match); menu ≈ 470–540 px tall */
.mega__in { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--cg); padding: 26px var(--g) 0; }
.mega__search { grid-column: 1 / -1; display: flex; align-items: flex-end; margin-bottom: 22px; }
.mega__sl { flex: 1; min-width: 0; }
.mega__si { width: 100%; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink);
  font: 520 20px/1.3 var(--f-sans); letter-spacing: -.01em; padding: 4px 0 9px; -webkit-appearance: none; appearance: none; }
.mega__si::placeholder { color: var(--ink-3); opacity: 1; }
.mega__si:focus { outline: none; border-bottom-width: 2px; padding-bottom: 8px; }
.mega__si::-webkit-search-cancel-button { cursor: pointer; }
.mega__sn { color: var(--ink-3); white-space: nowrap; padding-bottom: 11px; margin-inline-start: 18px; }
.mega__sn:empty { margin-inline-start: 0; }   /* 2026-09-26: no count yet → the rule runs to the column edge (was a gap: 18 px short) */
.mega__none { grid-column: 1 / -1; color: var(--ink-2); font-size: 15px; padding: 6px 0 12px; }   /* inside .mega__cols */
.mega__none[hidden], .mega__li[hidden], .mega__grp[hidden] { display: none; }
.mega__cols { grid-column: 1 / 10; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--cg); align-content: start; }
.mega__grp + .mega__grp { margin-top: 22px; }
.mega__h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: var(--ink-3); padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--rule); }
.mega__li { position: relative; display: flex; align-items: center; flex-wrap: wrap; }
.mega__item {
  display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0;
  padding: 6px 0; font-size: 15px; font-weight: 520; line-height: 1.25; letter-spacing: -.01em; white-space: nowrap;
  text-decoration: none; transition: color .35s var(--e-out), transform .5s var(--e-out);
}
.mega__nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }   /* safety only: ui_site.menu_name keeps names short */
.mega__item::before { content: ""; width: 6px; height: 6px; flex: none; background: var(--c); box-shadow: inset 0 0 0 1px var(--key, transparent); transition: width .5s var(--e-out); } /* the family square */
.mega__item .badge { margin-inline-start: 2px; flex: none; }
.mega__item .badge--maint { display: none; }   /* names stay on one line; the panel + description say "bakımda" */
.mega__item[aria-current="page"] { font-weight: 650; }
.mega__cols:hover .mega__item, .mega__cols.has-active .mega__item { color: var(--ink-3); }
.mega__cols .mega__item:hover, .mega__cols .mega__item.is-active, .mega__cols .mega__item:focus-visible { color: var(--ink); transform: translate3d(4px, 0, 0); }
[dir="rtl"] .mega__cols .mega__item:hover, [dir="rtl"] .mega__cols .mega__item.is-active, [dir="rtl"] .mega__cols .mega__item:focus-visible { transform: translate3d(-4px, 0, 0); }
.mega__item:hover::before, .mega__item.is-active::before, .mega__item:focus-visible::before { width: 18px; }
.mega__item--soon .mega__n { font-size: 13px; color: var(--ink-3); margin-inline-start: auto; padding-inline-start: 8px; white-space: nowrap; }
.mega__more, .mega__inline, .mega__aux { display: none; }

.mega__detail { grid-column: 10 / 13; border-inline-start: 1px solid var(--rule); padding-inline-start: var(--cg); position: relative; }
.mega__foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); margin-top: 22px; padding: 12px 0 14px; border-top: 1px solid var(--rule); color: var(--ink-2); }
.mega__facts { font-size: var(--t-meta); }
.mega__foot a { color: var(--ink); }

/* detail panel: bar · group·idx · pixel sheet → pixel sheet · coloured formula · name · description · Girdi/Çıktı/Sınır · Aracı aç */
.md { min-width: 0; }
.md__bar { height: 3px; background: var(--c); transform-origin: 0 50%; }
[dir="rtl"] .md__bar { transform-origin: 100% 50%; }
.md__k { color: var(--ink-3); margin-top: 14px; }
.md__flow { display: flex; align-items: flex-end; gap: 14px; margin: 16px 0 12px; height: 90px; }
.md__arr { position: relative; width: 48px; height: 1.5px; background: var(--ink); margin-bottom: 44px; transform-origin: 0 50%; flex: none; }
.md__arr::after { content: ""; position: absolute; right: -1px; top: -4.25px; width: 10px; height: 10px; border-top: 1.5px solid var(--ink); border-right: 1.5px solid var(--ink); transform: rotate(45deg); }
.md__fx { font-size: 26px; margin-bottom: 6px; }
.md__name { font-size: 20px; line-height: 1.1; font-weight: 700; font-stretch: 108%; letter-spacing: -.02em; }
.md__name .badge { margin-inline-start: 6px; transform: translateY(-2px); }
.md__desc { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--ink-2); max-width: 40ch; }
.md__meta { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; column-gap: 28px; margin-top: 16px; }
.md__meta dt { color: var(--ink-3); }
.md__meta dd { color: var(--ink); margin: 0; direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .md__meta dd { text-align: right; }
[dir="rtl"] .md__arr { transform: scaleX(-1); transform-origin: 50% 50%; }
.md__list { margin-top: 12px; }
.md__list li { font: 500 13px/1 var(--f-mono); padding: 9px 0; border-top: 1px solid var(--rule); letter-spacing: .02em; }
.md__cta { margin-top: 18px; }
.md__empty { padding-top: 6px; }
.md__trio { display: flex; align-items: flex-end; gap: 8px; margin-top: 18px; }
.md__empty-big { font-size: 28px; line-height: .95; font-weight: 780; font-stretch: 118%; letter-spacing: -.035em; margin-top: 16px; }
.md__empty-big em { font-style: normal; color: var(--signal); }
.md__empty-t { margin-top: 10px; font-size: 14px; max-width: 34ch; color: var(--ink-2); }
.md__empty .legend { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--rule); max-width: 36ch; }
.md.is-anim .md__bar { animation: mdBar .7s var(--e-out) both; }
.md.is-anim .md__in { animation: mdIn .5s var(--e-out) both; }
.md.is-anim .md__arr { animation: mdBar .45s var(--e-out) .1s both; }
.md.is-anim .md__out { animation: pxPaint .48s steps(12, end) .16s both; }
.md.is-anim .md__fx, .md.is-anim .md__name, .md.is-anim .md__desc, .md.is-anim .md__meta, .md.is-anim .md__list { animation: mdTxt .55s var(--e-out) both; }
.md.is-anim .md__desc { animation-delay: .05s; }
.md.is-anim .md__meta, .md.is-anim .md__list { animation-delay: .1s; }
@keyframes mdBar { from { transform: scaleX(0); } }
@keyframes mdIn { from { transform: translate3d(0, 12px, 0); opacity: 0; } }
@keyframes mdTxt { from { transform: translate3d(0, 10px, 0); opacity: 0; } }

/* consent (KVKK) banner rules moved to site.css on 2026-09-26: the banner is server-rendered visible for visitors
   without a stored choice and must paint with the first frame (it was the LCP element, painted late) */

.qa-badge { position: fixed; right: 8px; bottom: 8px; z-index: 999; background: #000; color: #0f0; font: 600 12px/1 var(--f-mono); padding: 6px 8px; }

/* ---------- 1024–1279: no room for a badge beside the name — the detail panel shows it (md__name) ---------- */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .mega__item .badge { display: none; }
  /* 2026-09-26: the longest group label ("Optimize Et ve Koru", "Optimieren & schützen") fits one line, so all four
     column rules stay on one height (it wrapped at 1024 and sat 18 px lower) */
  .mega__h { font-size: 11px; letter-spacing: .01em; }
}
/* ---------- 1024–1439: the same 4 columns, a touch smaller (names stay on one line; ui_site.menu_name) ---------- */
@media (min-width: 1024px) and (max-width: 1439.98px) {
  .mega__item { font-size: 14px; }
  .md__fx { font-size: 22px; }
  .md__name { font-size: 18px; }
}

/* ---------- < 1024: the same nav#mega becomes a full-height sheet ---------- */
@media (max-width: 1023.98px) {
  .mega { position: fixed; top: var(--hh); bottom: 0; overflow-y: auto; overscroll-behavior: contain; clip-path: inset(0 0 100% 0); border-bottom: 0; }
  html.sheet-open, html.sheet-open body { overflow: hidden; }
  .mega__in { display: block; padding: var(--s-3) var(--g) var(--s-7); }
  .mega__cols { display: block; }
  /* groups fold into an accordion (8 rows instead of 33; site.js makes each heading a button); a search opens the
     groups that have matches (.mega.is-q) */
  .mega__search { margin: 4px 0 6px; }
  .mega__si { font-size: 18px; }
  .mega__h { cursor: pointer; align-items: center; min-height: 54px; padding: 14px 0; margin: 0; font: 600 17px/1.2 var(--f-sans);
    letter-spacing: -.01em; text-transform: none; color: var(--ink); -webkit-tap-highlight-color: transparent; }
  .mega__h > span:last-child { display: inline-flex; align-items: center; gap: 12px; font: 500 12px/1 var(--f-mono); color: var(--ink-3); }
  .mega__h > span:last-child::after { content: "+"; width: 14px; text-align: center; font: 400 22px/1 var(--f-sans); color: var(--ink); transition: transform .35s var(--e-out); }
  .mega__grp.is-open .mega__h > span:last-child::after, .mega.is-q .mega__h > span:last-child::after { transform: rotate(45deg); }
  .mega__h:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
  .mega__grp > ul { display: none; padding: 4px 0 12px; }
  .mega__grp.is-open > ul, .mega.is-q .mega__grp > ul { display: block; }
  .mega__col + .mega__col, .mega__grp + .mega__grp { margin-top: 0; }
  .mega__item { font-size: 17px; padding: 11px 0; }
  .mega__cols:hover .mega__item, .mega__cols.has-active .mega__item { color: var(--ink); }
  .mega__cols .mega__item:hover, [dir="rtl"] .mega__cols .mega__item:hover { transform: none; }
  .mega__more { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-inline-end: -12px; flex: none; }
  .mega__more .ico { width: 16px; height: 16px; transition: transform .45s var(--e-out); }
  .mega__more[aria-expanded="true"] .ico { transform: rotate(45deg); }
  .mega__inline:not([hidden]) { display: block; flex-basis: 100%; padding: 4px 0 16px 16px; padding-inline: 16px 0; border-inline-start: 3px solid var(--c); margin-bottom: 8px; }
  .mega__inline .md__fx { font-size: 22px; margin: 4px 0 8px; }
  .mega__inline .md__desc { margin-top: 0; }
  .mega__inline .md__meta { margin-top: 10px; }
  .mega__inline .md__list { margin-top: 8px; }
  .mega__inline .link-arrow { margin-top: 12px; font-size: 15px; }
  .mega__detail { display: none; }
  .mega__aux { display: block; margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--ink); }
  .mega__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--cg); }
  .mega__links a { display: block; padding: 11px 0; font-size: 16px; text-decoration: none; border-bottom: 1px solid var(--rule); }
  /* one row for any language count: chips are 44 px, shrinking together on narrow phones (never a lone chip on row 2) */
  .mega__langs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 44px); gap: 6px; margin-top: var(--s-5); }
  .mega__langs a { display: block; font: 500 12px/1 var(--f-code); padding: 12px 0; text-align: center; border: 1px solid var(--rule); border-radius: var(--r-1); text-decoration: none; }
  .mega__langs abbr { text-decoration: none; }
  .mega__langs a[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  .mega__foot { display: block; }
  .mega__foot > * + * { margin-top: 12px; }
}
