/* Richpear Home — dokumentace
   Společný stylopis pro všechny stránky docs.richpear.cz */

:root {
  --accent: #3f9a4f;
  --accent-dark: #2f7a3d;
  --accent-light: #eaf6ec;
  --accent-soft: #f3faf4;
  --bg: #ffffff;
  --bg-muted: #f7f9f8;
  --sidebar-bg: #fbfdfb;
  --text: #1f2a24;
  --text-muted: #5a6b62;
  --border: #e3e9e5;
  --border-strong: #cdd8d1;
  --code-bg: #f5f7f6;
  --code-text: #1f2a24;
  --shadow-sm: 0 1px 2px rgba(31, 42, 36, 0.05);
  --shadow-md: 0 4px 16px rgba(31, 42, 36, 0.08);
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-w: 280px;
  --header-h: 64px;
  --content-max: 820px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

.header-spacer {
  flex: 1;
}

.header-link {
  font-size: 14px;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.header-link:hover {
  color: var(--accent-dark);
  background: var(--accent-soft);
  text-decoration: none;
}

.menu-toggle {
  display: none;
  appearance: none;
  border: 1px solid var(--border-strong);
  background: #fff;
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
}

/* ---------- Layout ---------- */
.layout {
  display: flex;
  align-items: flex-start;
}

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 24px 16px 48px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
}

.nav-group {
  margin-bottom: 22px;
}

.nav-group-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 6px;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: block;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.35;
}

.nav-list a:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

.nav-list a.active {
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}

/* ---------- Main content ---------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
  padding: 36px 32px 96px;
}

.content {
  width: 100%;
  max-width: var(--content-max);
}

.breadcrumb {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent-dark);
}

.breadcrumb .sep {
  opacity: 0.5;
}

.content h1 {
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.lead {
  font-size: 18px;
  color: var(--text-muted);
  margin: 0 0 28px;
}

.content h2 {
  font-size: 24px;
  letter-spacing: -0.01em;
  margin: 40px 0 14px;
  padding-top: 8px;
}

.content h3 {
  font-size: 19px;
  margin: 28px 0 10px;
}

.content p {
  margin: 0 0 16px;
}

.content ul,
.content ol {
  margin: 0 0 18px;
  padding-left: 24px;
}

.content li {
  margin-bottom: 7px;
}

.content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

/* ---------- Code ---------- */
code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 5px;
  border: 1px solid var(--border);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 20px;
  line-height: 1.55;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13.5px;
  color: var(--code-text);
}

/* ---------- Callouts ---------- */
.callout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 0 0 22px;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.callout.tip {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.callout.warn {
  border-left-color: #d9962b;
  background: #fdf6ea;
}

.callout.warn .callout-title {
  color: #9a6a12;
}

.callout.info {
  border-left-color: #3a7bd5;
  background: #eef4fc;
}

.callout.info .callout-title {
  color: #2a5a9e;
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 22px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14.5px;
}

th,
td {
  text-align: left;
  padding: 9px 14px;
  border: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--bg-muted);
  font-weight: 600;
}

tbody tr:nth-child(even) {
  background: var(--accent-soft);
}

/* ---------- Home / cards ---------- */
.hero {
  padding: 18px 0 8px;
}

.hero h1 {
  font-size: 40px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0 8px;
}

.card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  color: var(--text);
}

.card:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-title {
  font-weight: 700;
  font-size: 16.5px;
  margin-bottom: 5px;
  color: var(--text);
}

.card-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.section-label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin: 34px 0 4px;
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-light);
  border: 1px solid #cfe6d3;
  border-radius: 999px;
  padding: 2px 10px;
  vertical-align: middle;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
  padding: 28px 32px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--accent-dark);
}

/* ---------- Page nav (prev/next) ---------- */
.page-meta {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- 404 ---------- */
.notfound {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
  padding: 80px 24px;
}

.notfound .code {
  font-size: 72px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
}

/* ---------- Sidebar overlay (mobile) ---------- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: rgba(31, 42, 36, 0.4);
  z-index: 40;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .menu-toggle {
    display: flex;
  }

  .header-link.desktop-only {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    height: auto;
    z-index: 45;
    width: min(86vw, 320px);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-md);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  body.nav-open .sidebar-overlay {
    display: block;
  }

  .main {
    padding: 26px 20px 72px;
  }

  .content h1 {
    font-size: 28px;
  }

  .hero h1 {
    font-size: 32px;
  }
}
