/* Just Staff — «мозаика»: плитки разного размера для всякой всячины */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f4f1;
  --tile: #ffffff;
  --ink: #191b19;
  --muted: #6c706b;
  --faint: #8b8f8a;
  --line: #e2e4de;
  --dark: #191b19;
  --font: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 24px; }

/* ---------- header ---------- */
.site-header { padding: 22px 0; }
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.logo .mark {
  width: 30px; height: 30px; border-radius: 10px;
  background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 13px; letter-spacing: .02em;
}
.nav { display: flex; gap: 6px; font-size: 14.5px; color: var(--muted); }
.nav a { padding: 8px 13px; border-radius: 999px; }
.nav a:hover { background: var(--tile); color: var(--ink); }
.langs { display: flex; gap: 6px; font-size: 13.5px; color: var(--faint); }
.langs a.on { color: var(--ink); font-weight: 700; }

/* ---------- home ---------- */
.home { padding: 10px 0 0; }
.page-title, .page-sub, .tile h2, .tile p { overflow-wrap: break-word; }
.page-title { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.18; letter-spacing: -.02em; margin: 8px 0 6px; max-width: 760px; }
.page-sub { color: var(--muted); font-size: 16.5px; margin-bottom: 24px; max-width: 640px; }

.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.tile {
  background: var(--tile);
  border-radius: 20px;
  min-height: 180px;
  overflow: hidden;
  transition: transform .18s ease;
}
.tile:hover { transform: translateY(-2px); }
.tile-link { display: flex; flex-direction: column; height: 100%; }
.tile-body { padding: 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kind { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.tile h2 { font-size: 19px; line-height: 1.35; letter-spacing: -.01em; }
.tile p { color: var(--muted); font-size: 14px; }
.when { margin-top: auto; font-size: 13px; color: var(--faint); padding-top: 10px; }

/* ведущая плитка */
.tile:first-child { grid-column: span 2; grid-row: span 2; background: var(--dark); color: #f4f4f1; }
.tile:first-child .kind { color: #a8ada6; }
.tile:first-child h2 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.2; }
.tile:first-child p { color: #b9bdb7; font-size: 16px; }
.tile:first-child .when { color: #a8ada6; }

/* плитка с фотографией */
.tile-media { display: block; height: 150px; background-size: cover; background-position: center; }
.tile:first-child.has-img .tile-media { height: 240px; }

/* ---------- empty state ---------- */
.empty { background: var(--tile); border-radius: 20px; padding: 40px 28px; }
.empty h1 { font-size: 26px; margin-bottom: 8px; }
.empty p { color: var(--muted); }

/* ---------- pagination ---------- */
.pagination { display: flex; gap: 10px; padding: 24px 0 8px; font-size: 14px; }
.pagination a { background: var(--tile); border-radius: 999px; padding: 8px 16px; color: var(--muted); }
.pagination a:hover { color: var(--ink); }

/* ---------- article ---------- */
.post { padding-top: 6px; }
.post-head { max-width: 760px; }
.post-title { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.2; letter-spacing: -.02em; margin: 8px 0 14px; }
.post-lead { font-size: 19px; color: var(--muted); margin-bottom: 14px; }
.post-head .meta { font-size: 13.5px; color: var(--faint); }
.post-cover { margin: 24px auto 26px; max-width: 960px; }
.post-cover img { width: 100%; border-radius: 20px; }
.post-cover figcaption { font-size: 13px; color: var(--faint); margin-top: 8px; }

.post-content { max-width: 760px; font-size: 17.5px; }
.post-content > * + * { margin-top: 18px; }
.post-content h2 { font-size: 26px; line-height: 1.3; margin-top: 34px; }
.post-content h3 { font-size: 21px; margin-top: 26px; }
.post-content ul, .post-content ol { padding-inline-start: 22px; }
.post-content li + li { margin-top: 6px; }
.post-content a { color: #2f6b52; border-bottom: 1px solid currentColor; }
.post-content blockquote {
  border-inline-start: 4px solid #2f6b52; background: #e9eddf;
  padding: 16px 20px; border-radius: 0 12px 12px 0; font-size: 18px;
}
.post-content img { border-radius: 16px; }
.post-content figure figcaption { font-size: 13px; color: var(--faint); margin-top: 8px; }
.post-content code { background: #eceee8; padding: 2px 5px; border-radius: 4px; font-size: .92em; }
.post-tags { max-width: 760px; display: flex; gap: 10px; flex-wrap: wrap; padding: 26px 0 0; }
.post-tags a { font-size: 13.5px; color: var(--muted); background: var(--tile); border-radius: 999px; padding: 6px 13px; }

.tag-head { padding: 6px 0 20px; }
.tag-head h1 { font-size: 30px; letter-spacing: -.01em; }
.tag-head p { color: var(--muted); margin-top: 6px; }

/* ---------- footer ---------- */
.site-footer { margin-top: 26px; border-top: 1px solid var(--line); }
.footer-in { display: flex; justify-content: space-between; padding: 20px 0 40px; font-size: 13.5px; color: var(--faint); }

/* Ghost content cards */
.kg-width-wide { width: auto; margin-inline: -8vw; }
.kg-width-full { width: 100vw; max-width: 100vw; margin-inline: calc(50% - 50vw); border-radius: 0; }
.kg-bookmark-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .mosaic { grid-template-columns: repeat(2, 1fr); }
  .tile:first-child { grid-column: span 2; grid-row: auto; }
  .tile:first-child .tile-media { height: 200px; }
}
@media (max-width: 700px) {
  .wrap { padding-inline: 16px; }
  .site-header { padding: 14px 0 6px; }
  .header-in {
    display: grid; grid-template-columns: 1fr auto;
    gap: 8px 12px; align-items: center;
  }
  .logo { grid-column: 1; }
  .langs { grid-column: 2; justify-self: end; }
  .nav { grid-column: 1 / -1; width: 100%; overflow-x: auto; white-space: nowrap; padding-bottom: 2px; }
  .mosaic { gap: 12px; }
  .tile { min-height: 150px; border-radius: 16px; }
  .tile-body { padding: 16px; }
  .tile h2 { font-size: 17px; }
  .tile:first-child h2 { font-size: 22px; }
  .post-content { font-size: 17px; }
}
