/* turanshell.uz/legal — huquqiy hujjatlar sahifalari. site.css ustiga qo'shiladi:
   uzun matn uchun tor ustun, avtomatik bandlar raqami, jadval, «loyiha» belgisi,
   to'ldiriladigan joylar va chop etish (PDF) ko'rinishi. */

.doc-page { padding-block: clamp(32px, 5vw, 64px) clamp(56px, 7vw, 96px); }
.doc-wrap { max-width: calc(860px + 2 * var(--gutter)); min-width: 0; }
.doc, .doc > section { min-width: 0; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--faint);
  font-size: var(--fs-sm);
  margin-bottom: 28px;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs span[aria-hidden] { color: var(--faint); }

/* ─── Hujjat boshi ─────────────────────────────────────── */

.doc-head { display: grid; gap: 16px; margin-bottom: 32px; }
.doc-head .eyebrow { margin-bottom: 0; }
.doc-head h1 {
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  /* «конфиденциальности» 320 px ekranda ustunga sig'maydi */
  hyphens: auto;
  overflow-wrap: anywhere;
}
.doc-sub { color: var(--text-2); font-size: var(--fs-md); line-height: 1.5; max-width: 60ch; }

.draft {
  display: grid;
  gap: 4px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  border: 1.5px solid rgba(255, 138, 61, 0.55);
  background: rgba(255, 138, 61, 0.08);
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.draft b {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--warn);
  font-size: var(--fs-xs);
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.doc-meta div { display: flex; gap: 8px; }
.doc-meta dt { color: var(--faint); }
.doc-meta dd { margin: 0; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }

.doc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.doc-actions .btn { cursor: pointer; }

/* ─── Mundarija ─────────────────────────────────────────── */

.toc {
  margin-bottom: 40px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
}
.toc h2 {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
}
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: t;
  display: grid;
  gap: 6px 24px;
  font-size: var(--fs-sm);
}
@media (min-width: 720px) {
  .toc ol { grid-template-columns: 1fr 1fr; }
}
.toc li { counter-increment: t; display: flex; gap: 10px; }
.toc li::before {
  content: counter(t) ".";
  color: var(--faint);
  min-width: 1.6em;
  font-variant-numeric: tabular-nums;
}
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--link-hi); text-decoration: underline; }

/* ─── Matn ──────────────────────────────────────────────── */

.doc { counter-reset: sec; font-size: var(--fs-base); line-height: 1.65; }
.doc > section { counter-reset: cl; padding-top: 8px; }
.doc > section + section { margin-top: 36px; }
.doc h2 {
  counter-increment: sec;
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  scroll-margin-top: 90px;
}
.doc h2::before { content: counter(sec) ". "; color: var(--link); }
.doc h3 {
  font-size: var(--fs-md);
  font-weight: 600;
  margin: 22px 0 10px;
}
.doc p { margin: 0 0 12px; color: var(--text-2); }
.doc p.intro { color: var(--text); }
.doc b, .doc strong { color: var(--text); font-weight: 600; }

/* Bandlar: 3.1, 3.2 … avtomatik */
.cl { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; color: var(--text-2); }
.cl > li { counter-increment: cl; position: relative; padding-inline-start: 3.2em; min-width: 0; }
.cl > li::before {
  content: counter(sec) "." counter(cl) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cl > li > p { margin: 0 0 8px; }
.cl > li > p:last-child { margin-bottom: 0; }
/* Ichki ro'yxat: a) b) v) */
.cl ol { margin: 8px 0 0; padding-inline-start: 1.6em; display: grid; gap: 6px; list-style: none; counter-reset: sub; }
.cl ol > li { counter-increment: sub; position: relative; }
.cl ol > li::before { content: counter(sub, lower-alpha) ")"; position: absolute; left: -1.6em; color: var(--faint); }
.cl ul { margin: 8px 0 0; padding-inline-start: 1.2em; display: grid; gap: 6px; }
.cl ul li::marker { color: var(--faint); }

/* Ta'riflar */
.cl > li .term { color: var(--text); font-weight: 600; }

/* To'ldiriladigan joy: [Kompaniya nomi] va h.k. Qatorga o'raladi (nowrap
   emas): uzun izohli joylar 390 px ekranda sahifani gorizontal surardi;
   clone — o'ralganda har bir bo'lak o'z foni va chetlari bilan. */
.ph {
  background: rgba(255, 138, 61, 0.16);
  color: var(--warn);
  border-radius: 4px;
  padding: 0 4px;
  font-weight: 500;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Yurist uchun izoh: nashrdan oldin olib tashlanadi */
.note-law {
  margin: 14px 0 4px;
  padding: 12px 16px;
  border-left: 3px solid var(--warn);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: rgba(255, 138, 61, 0.06);
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.note-law b { color: var(--warn); font-weight: 600; }

/* Jadval */
.tbl-wrap { margin: 16px 0; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); line-height: 1.45; min-width: 640px; }
.tbl th, .tbl td { padding: 10px 12px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line); }
.tbl th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--bg-band);
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl td { color: var(--text-2); }
.tbl td:first-child { color: var(--text); font-weight: 500; }

/* Rekvizitlar / aloqa */
.reqs { margin: 0; display: grid; gap: 8px 24px; font-size: var(--fs-sm); }
@media (min-width: 600px) { .reqs { grid-template-columns: 200px 1fr; } }
.reqs dt { color: var(--faint); }
.reqs dd { margin: 0; color: var(--text); }

/* Hujjat oxiri */
.doc-end {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: var(--fs-xs);
  line-height: 1.6;
}
.doc-end a { color: var(--muted); }

/* ─── Ro'yxat sahifasi (legal/index.html) ───────────────── */

.doc-plain { margin-top: 48px; }
.doc-plain h2::before { content: none; }

.law-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.law-card {
  display: grid;
  gap: 10px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
}
.law-card h2 { font-size: var(--fs-md); font-weight: 600; line-height: 1.3; }
.law-card h2 a { color: var(--text); text-decoration: none; }
.law-card h2 a:hover { color: var(--link-hi); }
.law-card p { color: var(--text-2); font-size: var(--fs-sm); }
.law-card .who { color: var(--faint); font-size: var(--fs-xs); }
.law-card .row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: var(--fs-sm); margin-top: 4px; }
.law-card .row .ver { color: var(--faint); font-variant-numeric: tabular-nums; }

/* ─── Chop etish / PDF ──────────────────────────────────── */

@media print {
  /* Google Fonts'dagi Geologica va Golos Text o'zgaruvchan (variable) shrift:
     Chrome ularni PDF'ga Type3 (kontur) sifatida joylaydi — fayl 3–4 barobar
     kattalashadi va matn qidiruvi buziladi. Chop etishda statik tizim shrifti. */
  :root {
    color-scheme: light;
    --font-display: "Segoe UI", "Noto Sans", Arial, sans-serif;
    --font-body: "Segoe UI", "Noto Sans", Arial, sans-serif;
  }
  @page { size: A4; margin: 18mm 16mm 20mm; }
  html, body { background: #fff !important; color: #111 !important; font-size: 11pt; line-height: 1.5; }
  .skip, .site-head, .site-foot, .crumbs, .doc-actions, .toc { display: none !important; }
  .doc-page { padding: 0; }
  .doc-wrap { max-width: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
  .eyebrow { color: #1e3fbf; }
  .eyebrow::before { border-color: #1e3fbf; }
  .doc-head { gap: 10px; margin-bottom: 18px; }
  .doc-head h1 { color: #000; font-size: 22pt; }
  .doc-sub { color: #333; font-size: 12pt; }
  .draft {
    border-color: #c2410c;
    background: #fff4ea !important;
    color: #333;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .draft b { color: #c2410c; }
  .doc-meta { border-color: #bbb; font-size: 10pt; }
  .doc-meta dt { color: #666; }
  .doc-meta dd { color: #000; }
  .doc { font-size: 11pt; }
  .doc h2 { color: #000; font-size: 15pt; break-after: avoid; margin-top: 6pt; }
  .doc h2::before { color: #1e3fbf; }
  .doc h3 { color: #000; font-size: 12pt; break-after: avoid; }
  .doc p, .cl, .cl ol, .cl ul { color: #222; }
  .cl > li { break-inside: avoid; }
  .cl > li::before, .doc b, .doc strong, .cl > li .term { color: #000; }
  .cl ol > li::before { color: #555; }
  .doc > section + section { margin-top: 22pt; }
  .ph {
    background: #fff1c2 !important;
    color: #7a4a00;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .note-law {
    border-left-color: #c2410c;
    background: #fff8f2 !important;
    color: #444;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    break-inside: avoid;
  }
  .note-law b { color: #c2410c; }
  .tbl-wrap { border-color: #bbb; overflow: visible; break-inside: auto; }
  .tbl { min-width: 0; font-size: 9.5pt; }
  .tbl th { background: #f1f3f7 !important; color: #333; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tbl th, .tbl td { border-color: #ccc; color: #222; }
  .tbl td:first-child { color: #000; }
  .tbl tr { break-inside: avoid; }
  .reqs dt { color: #555; }
  .reqs dd { color: #000; }
  .doc-end { border-color: #bbb; color: #555; }
  .doc-end a { color: #555; }
  .doc-end a[href]::after { content: " (" attr(href) ")"; }
}
