/* ============================================================
   Huquq24.uz — umumiy uslublar (Siyoh brendi)
   ============================================================ */
:root {
  --bg: #FAF6EF;
  --surface: #F3ECDF;
  --ink: #1A1714;
  --body-color: #4A443C;
  --muted: #857D72;
  --line: #E2DBCE;
  --line-strong: #1A1714;
  --accent: #D8431B;
  --accent-ink: #B3360F;
  --font-head: 'Source Serif 4', Georgia, serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-meta: 'JetBrains Mono', ui-monospace, monospace;
  --maxw: 1100px;
  --maxw-read: 720px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.read { max-width: var(--maxw-read); margin: 0 auto; padding: 0 32px; }

.meta {
  font-family: var(--font-meta);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.tag {
  font-family: var(--font-meta);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.italic { font-style: italic; }

/* ===== Wordmark ===== */
.wordmark { display: inline-flex; align-items: baseline; white-space: nowrap; line-height: 1; }
.wordmark .wm-text { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.015em; }
.wordmark .wm-24 { color: var(--accent); font-family: var(--font-head); font-weight: 600; letter-spacing: -0.015em; }
.wordmark .wm-tld { font-family: var(--font-head); font-weight: 500; font-size: 0.42em; color: var(--muted); letter-spacing: 0; margin-left: 0.07em; }

/* ===== Header ===== */
header.site-header { border-bottom: 1px solid var(--line-strong); background: var(--bg); }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line);
  font-family: var(--font-meta); font-size: 11.5px; color: var(--muted);
}
.topbar .lang { display: flex; gap: 12px; }
.topbar .lang a.active { color: var(--ink); font-weight: 500; }
.masthead { text-align: center; padding: 28px 0 18px; }
.masthead .tagline { margin-top: 8px; font-style: italic; font-family: var(--font-head); font-size: 13px; color: var(--muted); }
.mainnav {
  display: flex; justify-content: center; gap: 30px; flex-wrap: wrap;
  padding: 11px 0; border-top: 1px solid var(--line);
  font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
}
.mainnav a { padding: 2px 0; border-bottom: 2px solid transparent; transition: color .15s; }
.mainnav a:hover { color: var(--accent); }
.mainnav a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ===== Buttons ===== */
.btnrow { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-head); font-weight: 600; font-size: 14.5px;
  padding: 13px 26px; background: var(--ink); color: var(--bg);
  cursor: pointer; border: 1px solid var(--ink); transition: opacity .15s;
}
.btn:hover { opacity: .88; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); opacity: 1; }
.btn.sm { padding: 9px 18px; font-size: 13px; }

/* ===== Hero ===== */
.hero { padding: 56px 0 48px; text-align: center; border-bottom: 1px solid var(--line); }
.hero h1 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.02em; font-size: 52px; line-height: 1.08; margin: 14px 0 16px; }
.hero p { font-size: 17px; line-height: 1.6; color: var(--body-color); max-width: 560px; margin: 0 auto 26px; }
.hero .btnrow { justify-content: center; }

/* ===== Section head ===== */
.sechead { display: flex; align-items: baseline; justify-content: space-between; padding: 34px 0 18px; }
.sechead h2 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.02em; font-size: 26px; margin: 0; }
.sechead a { font-size: 13px; color: var(--accent); font-weight: 600; }

/* ===== Lead ===== */
.lead { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; padding: 34px 0; border-bottom: 1px solid var(--line); }
.lead .l-main { display: flex; flex-direction: column; gap: 13px; }
.lead h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.02em; font-size: 33px; line-height: 1.14; margin: 0; }
.lead h3 a:hover { color: var(--accent); }
.lead .excerpt { font-size: 16px; line-height: 1.62; color: var(--body-color); margin: 0; }
.lead .l-side { display: flex; flex-direction: column; }
.lead .l-side .sideitem { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.lead .l-side .sideitem:first-child { padding-top: 2px; }
.lead .l-side .sideitem:last-child { border-bottom: none; }
.lead .l-side h4 { font-family: var(--font-head); font-weight: 600; font-size: 16px; line-height: 1.32; margin: 0; letter-spacing: -0.01em; }
.lead .l-side h4 a:hover { color: var(--accent); }

/* ===== Article grid / list ===== */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding-bottom: 44px; }
.card { display: flex; flex-direction: column; gap: 8px; }
.card h4 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.015em; font-size: 17.5px; line-height: 1.3; margin: 0; }
.card h4 a:hover { color: var(--accent); }
.card .excerpt { font-size: 13.5px; line-height: 1.55; color: var(--body-color); margin: 0; }

/* blog full-width list rows */
.list { display: flex; flex-direction: column; padding-bottom: 30px; }
.list .row {
  display: grid; grid-template-columns: 90px 1fr auto; gap: 26px; align-items: baseline;
  padding: 24px 0; border-bottom: 1px solid var(--line);
}
.list .row .idx { font-family: var(--font-meta); font-size: 13px; color: var(--muted); }
.list .row h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.015em; font-size: 23px; line-height: 1.2; margin: 0 0 8px; }
.list .row h3 a:hover { color: var(--accent); }
.list .row .excerpt { font-size: 14.5px; line-height: 1.55; color: var(--body-color); margin: 0; max-width: 620px; }
.list .row .rmeta { text-align: right; white-space: nowrap; }

/* ===== Filter chips ===== */
.chips { display: flex; gap: 10px; flex-wrap: wrap; padding: 24px 0 4px; }
.chip {
  font-family: var(--font-meta); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 7px 14px; border: 1px solid var(--line-strong); cursor: pointer; background: transparent; color: var(--ink);
}
.chip:hover { background: var(--surface); }
.chip.active { background: var(--ink); color: var(--bg); }

/* ===== Page header (sub-pages) ===== */
.pagehead { padding: 48px 0 30px; border-bottom: 1px solid var(--line); }
.pagehead h1 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.02em; font-size: 42px; line-height: 1.1; margin: 12px 0 0; }
.pagehead p { font-size: 16px; line-height: 1.6; color: var(--body-color); max-width: 600px; margin: 14px 0 0; }

/* ===== Ruknlar band ===== */
.ruknlar { background: var(--ink); color: var(--bg); }
.rukn-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.rukn { padding: 30px 24px; display: flex; flex-direction: column; gap: 8px; border-left: 1px solid rgba(250,246,239,.18); }
.rukn:first-child { border-left: none; }
.rukn .num { font-family: var(--font-meta); font-size: 12px; color: var(--accent); }
.rukn h5 { font-family: var(--font-head); font-weight: 600; font-size: 17px; margin: 0; letter-spacing: -0.01em; }
.rukn p { font-size: 12.5px; line-height: 1.5; margin: 0; opacity: .62; }
.rukn:hover h5 { color: #fff; }

/* ===== Telegram band ===== */
.tgband { padding: 46px 0; border-bottom: 1px solid var(--line); }
.tgband .inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.tgband h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.02em; font-size: 24px; margin: 0 0 6px; }
.tgband p { font-size: 14.5px; color: var(--body-color); margin: 0; max-width: 480px; line-height: 1.55; }

/* ===== Suggest form ===== */
.suggest { padding: 46px 0 54px; }
.suggest .inner { max-width: 620px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.suggest h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.02em; font-size: 24px; margin: 0; }
.suggest p { font-size: 14.5px; color: var(--body-color); margin: 0; line-height: 1.55; }
.suggest form { display: flex; width: 100%; max-width: 520px; margin-top: 6px; }
.field { flex: 1; padding: 13px 16px; font-size: 14px; font-family: var(--font-body); color: var(--ink); background: transparent; border: 1px solid var(--ink); outline: none; }
.field::placeholder { color: var(--muted); }
.suggest input.field { border-right: none; }

/* ===== Article page ===== */
.article-hero { padding: 50px 0 30px; border-bottom: 1px solid var(--line); }
.article-hero .ah-inner { max-width: var(--maxw-read); margin: 0 auto; padding: 0 32px; display: flex; flex-direction: column; gap: 16px; }
.article-hero h1 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.02em; font-size: 40px; line-height: 1.12; margin: 0; }
.article-hero .byline { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.article-body { padding: 36px 0 20px; font-size: 18px; line-height: 1.75; color: #2c2823; }
.article-body p { margin: 0 0 22px; }
.article-body h2 { font-family: var(--font-head); font-weight: 600; font-size: 26px; letter-spacing: -0.015em; margin: 38px 0 14px; }
.article-body h3 { font-family: var(--font-head); font-weight: 600; font-size: 21px; margin: 30px 0 12px; }
.article-body blockquote { margin: 28px 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--accent); font-style: italic; color: var(--ink); }
.article-body ul, .article-body ol { margin: 0 0 22px; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }
.article-body > p:first-of-type::first-letter {
  font-family: var(--font-head); font-weight: 600; float: left; font-size: 76px; line-height: .82;
  padding: 6px 12px 0 0; color: var(--accent);
}
.article-foot { border-top: 1px solid var(--line); margin-top: 16px; padding: 24px 0 10px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.share { display: flex; gap: 10px; }
.share a { width: 38px; height: 38px; border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; }
.share a:hover { background: var(--ink); color: var(--bg); }

/* ===== Footer ===== */
footer.site-footer { border-top: 1px solid var(--line-strong); padding: 40px 0 30px; margin-top: 10px; }
.f-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; }
.f-grid h6 { margin: 0 0 12px; font-family: var(--font-meta); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.f-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.f-grid ul a:hover { color: var(--accent); }
.f-about { font-size: 13.5px; line-height: 1.6; color: var(--body-color); max-width: 300px; margin: 14px 0 0; }
.f-bottom { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-family: var(--font-meta); font-size: 11.5px; color: var(--muted); }
.f-bottom a:hover { color: var(--accent); }

/* ===== Admin ===== */
.admin-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.login-screen { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.login-card { width: 100%; max-width: 380px; border: 1px solid var(--line-strong); background: var(--bg); padding: 40px 34px; }
.login-card .wordmark { font-size: 30px; justify-content: center; display: flex; margin-bottom: 6px; }
.login-card h2 { font-family: var(--font-head); font-weight: 600; font-size: 20px; text-align: center; margin: 14px 0 4px; }
.login-card p.sub { text-align: center; font-size: 13px; color: var(--muted); margin: 0 0 24px; }
.login-card label { display: block; font-family: var(--font-meta); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.login-card .field { width: 100%; border: 1px solid var(--line-strong); margin-bottom: 16px; }
.login-card .btn { width: 100%; justify-content: center; }
.login-err { color: var(--accent); font-size: 13px; margin: -6px 0 14px; min-height: 18px; }

.admin-bar { background: var(--ink); color: var(--bg); }
.admin-bar .inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.admin-bar .wordmark { font-size: 22px; }
.admin-bar .wordmark .wm-text { color: var(--bg); }
.admin-bar .wordmark .wm-tld { color: rgba(250,246,239,.5); }
.admin-bar nav { display: flex; gap: 18px; align-items: center; font-family: var(--font-meta); font-size: 12px; }
.admin-bar nav a { color: rgba(250,246,239,.7); }
.admin-bar nav a:hover, .admin-bar nav a.active { color: #fff; }

.dash-head { display: flex; justify-content: space-between; align-items: center; padding: 38px 0 22px; }
.dash-head h1 { font-family: var(--font-head); font-weight: 600; font-size: 30px; letter-spacing: -0.02em; margin: 0; }
.atable { width: 100%; border-collapse: collapse; }
.atable th { text-align: left; font-family: var(--font-meta); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-strong); padding: 0 14px 12px 0; }
.atable td { padding: 16px 14px 16px 0; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14.5px; }
.atable td.title { font-family: var(--font-head); font-weight: 600; font-size: 16px; line-height: 1.3; }
.atable .acts { display: flex; gap: 8px; white-space: nowrap; }
.linkbtn { font-family: var(--font-meta); font-size: 12px; cursor: pointer; background: none; border: none; color: var(--accent); padding: 0; }
.linkbtn.danger { color: #9a2a13; }
.linkbtn:hover { text-decoration: underline; }
.empty { padding: 60px 0; text-align: center; color: var(--muted); font-style: italic; }

/* editor */
.editor { max-width: 760px; margin: 0 auto; padding: 30px 0 60px; display: flex; flex-direction: column; gap: 18px; }
.editor .grp { display: flex; flex-direction: column; gap: 7px; }
.editor label { font-family: var(--font-meta); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.editor .field, .editor select, .editor textarea {
  width: 100%; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; padding: 12px 14px; outline: none;
}
.editor textarea { resize: vertical; line-height: 1.6; }
.editor .field.big { font-family: var(--font-head); font-weight: 600; font-size: 22px; }
.editor .hint { font-family: var(--font-meta); font-size: 10.5px; color: var(--muted); }
.editor .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.editor .bar { display: flex; gap: 12px; align-items: center; padding-top: 6px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 22px; font-family: var(--font-meta); font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; }

/* editor: WYSIWYG (Word/Notes uslubi) */
.ed-toolbar { display: flex; gap: 4px; flex-wrap: wrap; border: 1px solid var(--line-strong); border-bottom: none; padding: 8px; background: var(--surface); position: sticky; top: 0; z-index: 5; }
.ed-toolbar button {
  font-family: var(--font-head); font-size: 14px; cursor: pointer; min-width: 34px;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  padding: 7px 11px; line-height: 1;
}
.ed-toolbar button:hover { background: var(--ink); color: var(--bg); }
.ed-toolbar button.on { background: var(--ink); color: var(--bg); }
.ed-toolbar .sep { width: 1px; background: var(--line); margin: 2px 4px; }
.rte {
  border: 1px solid var(--line-strong); background: #fff; color: #2c2823;
  padding: 26px 30px; min-height: 360px; outline: none;
  font-family: var(--font-head); font-size: 18px; line-height: 1.7;
}
.rte:focus { border-color: var(--ink); }
.rte:empty::before { content: attr(data-placeholder); color: var(--muted); font-style: italic; }
.rte > *:first-child { margin-top: 0; }
.rte p { margin: 0 0 16px; }
.rte h2 { font-family: var(--font-head); font-weight: 600; font-size: 25px; letter-spacing: -0.015em; margin: 26px 0 10px; }
.rte h3 { font-family: var(--font-head); font-weight: 600; font-size: 20px; margin: 22px 0 8px; }
.rte blockquote { margin: 18px 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); font-style: italic; color: var(--ink); }
.rte ul, .rte ol { margin: 0 0 16px; padding-left: 26px; }
.rte li { margin-bottom: 6px; }
.ed-count { font-family: var(--font-meta); font-size: 11px; color: var(--muted); margin-top: 8px; }
.mode-badge { font-family: var(--font-meta); font-size: 11px; padding: 3px 9px; border: 1px solid currentColor; }
.mode-badge.live { color: #1F8A5B; }
.mode-badge.local { color: var(--accent); }

/* Quill — sayt uslubiga moslash */
.grp .ql-toolbar.ql-snow { border: 1px solid var(--line-strong); border-bottom: none; background: var(--surface); border-radius: 0; padding: 9px 10px; position: sticky; top: 0; z-index: 5; }
.grp .ql-container.ql-snow { border: 1px solid var(--line-strong); border-radius: 0; font-family: var(--font-head); }
.grp .ql-editor { min-height: 340px; font-family: var(--font-head); font-size: 18px; line-height: 1.7; color: #2c2823; padding: 24px 28px; }
.grp .ql-editor.ql-blank::before { font-family: var(--font-head); font-style: italic; color: var(--muted); left: 28px; right: 28px; }
.grp .ql-editor h2 { font-family: var(--font-head); font-weight: 600; font-size: 25px; letter-spacing: -0.015em; margin: 24px 0 10px; }
.grp .ql-editor h3 { font-family: var(--font-head); font-weight: 600; font-size: 20px; margin: 20px 0 8px; }
.grp .ql-editor p { margin: 0 0 16px; }
.grp .ql-editor blockquote { border-left: 3px solid var(--accent); padding-left: 18px; margin: 18px 0; font-style: italic; color: var(--ink); }
.grp .ql-snow .ql-stroke { stroke: var(--ink); }
.grp .ql-snow .ql-fill { fill: var(--ink); }
.grp .ql-snow .ql-picker { color: var(--ink); }
.grp .ql-snow.ql-toolbar button:hover .ql-stroke, .grp .ql-snow .ql-toolbar button:hover .ql-stroke { stroke: var(--accent); }
.grp .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--accent); }
.grp .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--accent); }
.grp .ql-snow a { color: var(--accent); }
@media (max-width: 760px) { .grp .ql-editor { padding: 18px 18px; font-size: 16px; } }
@media (max-width: 760px) { .rte { padding: 18px 18px; font-size: 16px; } }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .hero h1 { font-size: 38px; }
  .lead { grid-template-columns: 1fr; gap: 26px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .rukn-grid { grid-template-columns: 1fr 1fr; }
  .rukn:nth-child(3) { border-left: none; }
  .f-grid { grid-template-columns: 1fr 1fr; }
  .list .row { grid-template-columns: 1fr; gap: 8px; }
  .list .row .idx, .list .row .rmeta { text-align: left; }
  .article-hero h1 { font-size: 30px; }
  .article-body { font-size: 17px; }
}
@media (max-width: 560px) {
  .wrap, .read { padding: 0 20px; }
  .hero h1 { font-size: 30px; }
  .grid { grid-template-columns: 1fr; }
  .rukn-grid { grid-template-columns: 1fr; }
  .rukn { border-left: none; border-top: 1px solid rgba(250,246,239,.18); }
  .rukn:first-child { border-top: none; }
  .f-grid { grid-template-columns: 1fr; }
  .editor .row2 { grid-template-columns: 1fr; }
  .mainnav { gap: 18px; }
}
