/* zhuk.css — clean, readable typography for Zola
   Inspired by Ghost’s Journal/Casper typography (serif body, system-UI UI) */

/* ---------- Root scale & variables ---------- */
:root{
  --font-serif: Inter, Georgia, "Iowan Old Style", "Times New Roman", Times, serif;
  --font-ui: Lora, -apple-system, Roboto, Helvetica, Arial, system-ui;
  --text: #111;
  --muted: #555;
  --bg: #fff;
  --link: #111;
  --link-underline: rgba(11, 87, 208, .25);
  --border: #e6e6e6;
  --code-bg: #f6f8fa;
  --code: #0f172a;
  --shadow: 0 1px 2px rgba(0,0,0,.04);

  --max-w: 68ch;
  --line: 1.7;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --radius: 10px;
}

@media (prefers-color-scheme: dark){
  :root{
    --text: #eaeaea;
    --muted: #b9b9b9;
    --bg: #0b0b0b;
    --link: #8ab4ff;
    --link-underline: rgba(138,180,255,.35);
    --border: #242424;
    --code-bg: #141414;
    --code: #e6edf3;
    --shadow: 0 1px 2px rgba(0,0,0,.6);
  }
}

/* ---------- Page base ---------- */
html{ box-sizing:border-box; -webkit-text-size-adjust:100%; }
*,*:before,*:after{ box-sizing:inherit; }

body{
  margin:0;
  color:var(--text);
  background:var(--bg);
  font-family: var(--font-serif);
  line-height: var(--line);
  font-size: clamp(1rem, 0.9rem + 0.3vw, 1.1rem);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout containers ---------- */
.wrapper{
  max-width: var(--max-w);
  padding: 0 var(--space-4);
  margin: 0 auto;
}

/* Site header/footer use UI font */
.site-header, .site-footer, nav, .meta{
  font-family: var(--font-ui);
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Headings ---------- */
h1,h2,h3,h4,h5,h6{
  font-family: var(--font-ui);
  color: var(--text);
  line-height: 1.25;
  margin: var(--space-6) 0 var(--space-3);
  letter-spacing: -0.01em;
}
h1{ font-size: clamp(1.9rem, 1.5rem + 3vw, 3rem); margin-top: var(--space-6); font-weight: 600; }
h2{ font-size: clamp(1.5rem, 1.3rem + .9vw, 2rem); font-weight: 600; }
h3{ font-size: clamp(1.25rem, 1.1rem + .5vw, 1.5rem); }
h4{ font-size: 1.1rem; }

/* ---------- Text & links ---------- */
p{ margin: 0 0 var(--space-5); }
strong,b{ font-weight: 700; }
em,i{ font-style: italic; }
a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
}

a:hover{
  color: var(--text);
  text-decoration: underline;
}

h2 a {
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}

h2 a:hover {
  text-decoration-thickness: 1px;
}


/* ---------- Lists & HR ---------- */
ul,ol{ padding-left: 1.4rem; margin: 0 0 var(--space-5); }
li + li{ margin-top: .4rem; }
hr{
  border:0; height:1px; background:var(--border);
  margin: var(--space-6) 0;
}

/* ---------- Blockquotes ---------- */
blockquote{
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-5);
  border-left: 4px solid var(--border);
  background: rgba(127,127,127,.06);
  border-radius: 0 var(--radius) var(--radius) 0;
}
blockquote p:last-child{ margin:0; }

/* ---------- Images, figures, tables ---------- */
img, video{ max-width:40%; height:auto; float: right; margin-left: 1em;  }
figure{ margin: var(--space-6) 0; }
figcaption{
  font-family: var(--font-ui);
  color: var(--muted);
  font-size: .9rem;
  margin-top: .4rem;
}

table{
  width:100%; border-collapse: collapse;
  margin: var(--space-5) 0;
  font-variant-numeric: tabular-nums;
}
th, td{ border:1px solid var(--border); padding: .6rem .7rem; }
th{ text-align:left; background: rgba(127,127,127,.05); }

/* ---------- Code ---------- */
pre, code, kbd, samp{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .95em;
}
code{ padding: .15em .35em; background: var(--code-bg); color: var(--code); border-radius: 6px; }
pre{
  background: var(--code-bg); color: var(--code);
  padding: var(--space-5);
  overflow:auto; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
pre code{ padding:0; background: none; }

/* ---------- Post meta & nav ---------- */
.post-header{
  margin: var(--space-6) 0 var(--space-5);
}
.post-meta{
  font-family: var(--font-ui);
  color: var(--muted);
  font-size: .95rem;
}
.post-meta a{ background-image:none; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Buttons (for nav/CTAs) ---------- */
.button, button, [type="submit"]{
  font-family: var(--font-ui);
  display:inline-block;
  padding: .55rem .9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
  cursor:pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.button:hover, button:hover{ background: rgba(127,127,127,.08); }
.button:active, button:active{ transform: translateY(1px); }

/* ---------- Header & footer scaffolding (optional) ---------- */
.site-header{ padding: var(--space-5) 0; border-bottom: 1px solid var(--border); }
.site-footer{ padding: var(--space-6) 0; border-top: 1px solid var(--border); margin-top: var(--space-6); }
nav a{ margin-right: 1rem; color: var(--muted); }
nav a:hover{ color: var(--text); background-image:none; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Article spacing helpers ---------- */
.article{ margin: var(--space-6) auto }
.article .wrapper{ max-width: var(--max-w); }
.article header{ margin-bottom: var(--space-5); }
.article footer{ margin-top: var(--space-6); color: var(--muted); font-family: var(--font-ui); }

/* ---------- Utilities ---------- */
.center{ text-align:center; }
.muted{ color: var(--muted); }
.lead{ font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem); color: var(--muted); }

/* ---------- Responsive tweaks ---------- */
@media (max-width: 720px){
  :root{ --line: 1.65; }
  .site-header, .site-footer{ padding: var(--space-4) 0; }
  nav a{ margin-right: .75rem; }
}
