/* =========================================================
   Midnight 1911 · legal pages (terms, privacy, dmca)
   Calm long-form reading: one ~72ch column, small neon section numerals,
   sticky contents on desktop, back-to-top. Reads site.css tokens only.
   ========================================================= */

/* KA / EN chrome swap: the inactive language is [hidden] */
[data-l][hidden] { display: none !important; }

/* ---------- hero extras: date + language toggle ---------- */
.lhero { min-height: clamp(340px, 46vh, 480px); }
/* "კონფიდენციალურობა" is one long word: drop the 18ch cap and, on phones, size it to fit instead of breaking it */
.lhero .phero__title { max-width: none; }
@media (max-width: 480px) { .lhero .phero__title { font-size: 8.6vw; } }
.lmeta { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.lmeta__date {
  display: inline-flex; align-items: center; gap: 10px; min-height: 40px;
  font-size: 14.5px; color: var(--steel-1); text-shadow: 0 2px 14px var(--ink-0);
}
.lmeta__date .ico { width: 18px; height: 18px; color: var(--tube-teal); }

.lang {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--glass);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.lang__btn {
  min-height: 40px; min-width: 52px; padding: 0 12px; border: 0; border-radius: 9px;
  background: transparent; color: var(--steel-2); cursor: pointer;
  font: 600 14px/1 var(--font-sans); letter-spacing: .04em;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.lang__btn[lang="en"] { font-family: var(--font-num); font-weight: 500; letter-spacing: .1em; }
.lang__btn:hover { color: var(--steel-0); }
.lang__btn[aria-pressed="true"] {
  background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--tube-teal);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--teal) 55%, transparent), var(--glow-teal-soft);
}

/* ---------- layout: contents rail + reading column ---------- */
.legal { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; }
@media (min-width: 1024px) {
  .legal {
    grid-template-columns: minmax(220px, 270px) minmax(0, 72ch);
    gap: clamp(48px, 6vw, 104px); justify-content: center; align-items: start;
  }
  .lside {
    position: sticky; top: calc(var(--nav-h) + 28px);
    max-height: calc(100vh - var(--nav-h) - 56px); overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: var(--ink-4) transparent;
    padding-right: 4px;
  }
}

/* ---------- contents + documents lists ---------- */
.lside { display: grid; gap: 28px; align-content: start; min-width: 0; }
.ltoc__title {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--steel-2);
}
.ltoc__title .ico { width: 18px; height: 18px; color: var(--tube-teal); }
.ltoc__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ltoc__list a {
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 10px;
  min-height: 42px; padding: 7px 10px; border-radius: 10px;
  font-size: 14px; line-height: 1.35; color: var(--steel-2); text-decoration: none;
  transition: background-color .2s, color .2s;
}
.ltoc__list a::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 2px;
  background: var(--teal); box-shadow: var(--glow-teal-soft); opacity: 0; transition: opacity .2s;
}
.ltoc__list a:hover { background: var(--ink-2); color: var(--steel-0); }
.ltoc__list a.is-active, .ltoc__list a[aria-current="page"] { background: color-mix(in srgb, var(--teal) 8%, transparent); color: var(--steel-0); }
.ltoc__list a.is-active::before, .ltoc__list a[aria-current="page"]::before { opacity: 1; }
.ltoc__n { font-family: var(--font-num); font-size: 13px; font-weight: 600; color: var(--steel-3); letter-spacing: .04em; }
.ltoc__list a.is-active .ltoc__n, .ltoc__list a[aria-current="page"] .ltoc__n { color: var(--tube-teal); }
.ltoc__t { min-width: 0; }

/* phones + tablets: contents as a boxed list above the text; the documents list moves to the cards below */
@media (max-width: 1023px) {
  .ltoc:not(.ldocs) {
    padding: 18px 16px 12px; border-radius: var(--r-lg);
    border: 1px solid var(--line); background: linear-gradient(170deg, var(--ink-2), var(--ink-1));
  }
  .ldocs { display: none; }
}

/* ---------- the document ---------- */
.ldoc {
  min-width: 0; max-width: 72ch;
  font-size: 17px; line-height: 1.8; color: var(--steel-1);
  overflow-wrap: anywhere; hyphens: manual;
}
@media (max-width: 1023px) { .ldoc { margin-inline: auto; width: 100%; } }
.ldoc p { margin: 0; }
.ldoc p + p, .ldoc p + .llist, .ldoc .llist + p { margin-top: 1em; }
.ldoc strong { color: var(--steel-0); font-weight: 700; }
.ldoc .link { overflow-wrap: anywhere; }

.lsec { --tube: var(--teal); padding: 40px 0 44px; border-top: 1px solid var(--line); }
.lsec:first-child { padding-top: 0; border-top: 0; }
.lsec:nth-child(even) { --tube: var(--red); }
.lsec__h {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 4px 16px;
  margin: 0 0 18px;
  font-size: clamp(21px, 2.1vw, 26px); font-weight: 700; line-height: 1.3; color: var(--steel-0);
  text-wrap: balance;
}
.lsec__h .sr-only { position: absolute; }
.lsec__no {
  font-family: var(--font-num); font-weight: 600; font-size: 15px; letter-spacing: .12em;
  color: color-mix(in srgb, var(--tube) 50%, var(--white));
  text-shadow: 0 0 12px color-mix(in srgb, var(--tube) 45%, transparent);
  padding: 2px 8px; border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--tube) 45%, transparent);
  transform: translateY(-2px);
}

/* lists: neon dash bullets, numbered steps for the DMCA notice */
.llist { list-style: none; margin: 0; padding: 0; display: grid; gap: .6em; }
.llist li { position: relative; padding-left: 28px; }
.llist li::before {
  content: ""; position: absolute; left: 4px; top: .86em; width: 12px; height: 2px; border-radius: 2px;
  background: color-mix(in srgb, var(--tube) 70%, var(--white));
  box-shadow: 0 0 8px color-mix(in srgb, var(--tube) 50%, transparent);
}
.llist--num { counter-reset: lnum; }
.llist--num li { counter-increment: lnum; padding-left: 44px; }
.llist--num li::before {
  content: counter(lnum, decimal-leading-zero); top: .15em; width: auto; height: auto; left: 0;
  background: none; box-shadow: none;
  font-family: var(--font-num); font-weight: 600; font-size: 14px; line-height: 1.8; letter-spacing: .08em;
  color: color-mix(in srgb, var(--tube) 50%, var(--white));
  text-shadow: 0 0 10px color-mix(in srgb, var(--tube) 45%, transparent);
}

.ldoc__foot {
  margin-top: 8px !important; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 14px; line-height: 1.7; color: var(--steel-3);
}
.ldoc__top { margin-top: 20px !important; }
.ldoc__top .link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 15px; }
.ldoc__top .ico { width: 18px; height: 18px; }

/* ---------- the other documents ---------- */
.lcards { list-style: none; margin: 0; padding: 0; }
.lcards > li { display: flex; min-width: 0; }
.lcard { flex: 1; display: flex; flex-direction: column; }
.lcard .card__text { flex: 1; }
.lcard__go { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: color-mix(in srgb, var(--tube) 45%, var(--white)); }
.lcard__go .ico { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.lcard:hover .lcard__go .ico { transform: translateX(3px); }
.lnext .display { font-size: clamp(34px, 4.6vw, 64px); }

/* phones: keep the floating back-to-top button off the last footer line */
@media (max-width: 640px) { .page-legal .foot__bottom { padding-bottom: calc(72px + env(safe-area-inset-bottom)); } }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .lang__btn, .ltoc__list a, .ltoc__list a::before, .lcard__go .ico { transition: none; }
  .lcard:hover .lcard__go .ico { transform: none; }
}

/* ---------- print: just the text ---------- */
@media print {
  .nav, .overlay, .skip, .foot, .lside, .lnext, .totop, .lang, .ldoc__top, .phero .mn-street, .phero .grain, .sprite { display: none !important; }
  body { background: var(--white); color: var(--ink-0); }
  .phero { min-height: 0; padding-top: 0; border: 0; }
  .phero::after { display: none; }
  .phero__title, .phero__lead, .lmeta__date, .ldoc, .lsec__h, .ldoc strong { color: var(--ink-0); text-shadow: none; }
  .phero__title em { color: var(--ink-0); text-shadow: none; }
  .lsec__no, .llist li::before { color: var(--ink-0); text-shadow: none; box-shadow: none; border-color: var(--ink-0); }
  .llist:not(.llist--num) li::before { background: var(--ink-0); }
  .legal { display: block; }
  .ldoc { max-width: none; }
}
