/* Společný styl podstránek: /api/, návody v /api/…/ a /caste-dotazy/.
   Barvy, písmo a komponenty odpovídají style.css a dokumentace.css. */
:root {
  --bg: #f7f8fc;
  --bg2: #ffffff;
  --bg3: #f0f2f8;
  --border: #e2e6f0;
  --text: #1a2035;
  --text-dim: #4f5a76;
  --text-dimmer: #5f6b86;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --green: #16a34a;
  --green-text: #15803d;
  --green-light: #f0fdf4;
  --green-mid: #dcfce7;
  --yellow: #d97706;
  --yellow-text: #b45309;
  --yellow-light: #fffbeb;
  --red: #dc2626;
  --red-text: #b91c1c;
  --red-light: #fef2f2;
  --violet-text: #6d28d9;
  --sans: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
  --radius: 14px;
  --shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-wrap: break-word;
}

.container { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }
.icon { width: 1.1em; height: 1.1em; flex-shrink: 0; }
[hidden] { display: none !important; }
a { color: var(--accent); }

/* NAV */
nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1060px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 60px;
}
.logo { font-size: 1.2rem; font-weight: 800; color: var(--accent); text-decoration: none; letter-spacing: -0.02em; }
.logo span { color: var(--text-dimmer); font-weight: 400; }
.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a { color: var(--text-dim); text-decoration: none; font-size: 0.9rem; font-weight: 600; transition: color 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--accent); }
.nav-toggle {
  display: none; align-items: center; gap: 6px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-family: var(--sans); font-size: 0.85rem; font-weight: 700;
  padding: 8px 12px; min-height: 40px; cursor: pointer;
}
@media (max-width: 600px) {
  .nav-inner { padding: 0 16px; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg2);
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 14px 24px; font-size: 1rem; }
}

/* BREADCRUMB */
nav.breadcrumb { position: static; background: none; border: 0; z-index: auto; }
.breadcrumb { font-size: 0.82rem; color: var(--text-dimmer); padding-top: 28px; font-weight: 600; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--border); }
.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* PAGE HEAD */
.page-head { padding: 20px 0 32px; }
.page-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 6px; }
.page-title { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 12px; }
.page-lead { color: var(--text-dim); font-size: 1.05rem; max-width: 680px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-light); color: var(--green-text); border: 1px solid var(--green-mid);
  font-size: 0.8rem; font-weight: 700; padding: 4px 12px; border-radius: 100px;
}

/* SECTIONS */
main { padding-bottom: 64px; }
.section { margin-bottom: 48px; scroll-margin-top: 80px; }
.section h2 {
  font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--border);
}
.section h3 { font-size: 1.02rem; font-weight: 700; margin: 24px 0 8px; }
.section p, .section li { color: var(--text-dim); font-size: 0.95rem; }
.section p { margin-bottom: 12px; }
.section p strong, .section li strong { color: var(--text); }
.section ul.list, .section ol.list { margin: 0 0 14px 22px; }
.section ul.list li, .section ol.list li { margin-bottom: 6px; }

/* CARDS */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow);
}
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.card-title .icon { color: var(--accent); }
.card p { font-size: 0.875rem; color: var(--text-dim); margin-bottom: 0; line-height: 1.55; }
a.card { display: block; text-decoration: none; transition: border-color 0.2s, background 0.2s; }
a.card:hover { border-color: var(--accent); background: var(--accent-light); }
.card-more { display: inline-block; margin-top: 10px; font-size: 0.82rem; font-weight: 700; color: var(--accent); }

.endpoint {
  background: var(--bg3); border-radius: 8px; padding: 9px 14px;
  font-family: var(--mono); font-size: 0.78rem; color: var(--text);
  display: flex; align-items: center; gap: 10px; margin-top: 6px; overflow-wrap: anywhere;
}
.method { font-weight: 700; color: var(--accent); flex-shrink: 0; font-size: 0.72rem; }
.method.sub { color: var(--green-text); }

/* CODE */
.code {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); margin: 14px 0 18px;
}
.code-header {
  background: var(--bg3); border-bottom: 1px solid var(--border);
  padding: 6px 8px 6px 16px; font-size: 0.72rem; font-weight: 700; min-height: 38px;
  color: var(--text-dimmer); text-transform: uppercase; letter-spacing: 0.08em;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.copy-btn {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-dim); font-family: var(--sans); font-size: 0.75rem; font-weight: 700;
  text-transform: none; letter-spacing: 0; padding: 4px 10px; cursor: pointer; flex-shrink: 0;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.code pre {
  padding: 18px 22px; font-family: var(--mono);
  font-size: 0.8rem; line-height: 1.7; color: var(--text);
  overflow-x: auto; white-space: pre; tab-size: 2;
}
.kw  { color: #7c3aed; font-weight: 600; }
.fn  { color: #1d4ed8; }
.str { color: #15803d; }
.num { color: #b45309; }
.key { color: #1d4ed8; }
.cmt { color: var(--text-dimmer); font-style: italic; }

code {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px;
  font-family: var(--mono); font-size: 0.85em; color: var(--accent);
  overflow-wrap: anywhere;
}
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

/* TABLE */
.table-wrap { overflow-x: auto; margin: 14px 0; border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: var(--bg2); font-size: 0.875rem; }
thead tr { background: var(--bg3); }
th {
  padding: 10px 14px; text-align: left; font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-dimmer);
  border-bottom: 1px solid var(--border);
}
td { padding: 10px 14px; border-bottom: 1px solid var(--bg3); color: var(--text-dim); vertical-align: top; font-variant-numeric: tabular-nums; }
td.mono, td:first-child { font-family: var(--mono); color: var(--text); font-size: 0.82rem; }
tr:last-child td { border-bottom: none; }
td.neg { color: var(--violet-text); font-weight: 700; }
tr.now td { background: var(--accent-light); color: var(--accent); font-weight: 700; }

/* ALERTS */
.alert {
  border-radius: var(--radius); padding: 14px 18px; margin: 16px 0;
  font-size: 0.9rem; line-height: 1.6; display: flex; gap: 12px; align-items: flex-start;
}
.alert.info    { background: var(--accent-light); border-left: 3px solid var(--accent); }
.alert.warning { background: var(--yellow-light); border-left: 3px solid var(--yellow); }
.alert.success { background: var(--green-light);  border-left: 3px solid var(--green); }
.alert-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.alert.info .alert-icon    { color: var(--accent); }
.alert.warning .alert-icon { color: var(--yellow-text); }
.alert.success .alert-icon { color: var(--green-text); }
.alert p { color: var(--text); margin: 0; font-size: 0.9rem; }

/* LIVE EXAMPLE (/api/) */
.live {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow);
}
.live-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.live-label { font-size: 0.75rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.07em; }
.live-value { font-size: 2.2rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; color: var(--accent); font-variant-numeric: tabular-nums; }
.live-value.neg { color: var(--violet-text); }
.live-unit { font-size: 0.85rem; color: var(--text-dim); font-weight: 600; }
.live-sub { font-size: 0.82rem; color: var(--text-dimmer); font-weight: 600; font-variant-numeric: tabular-nums; }
.live-status { font-size: 0.9rem; color: var(--text-dim); }
.live-status.error { color: var(--red-text); font-weight: 600; }

/* BUTTON LINKS */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent); font-weight: 700; font-size: 0.9rem; text-decoration: none;
  padding: 10px 18px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg2); box-shadow: var(--shadow); transition: border-color 0.2s, background 0.2s;
}
.btn:hover { border-color: var(--accent); background: var(--accent-light); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: #1d4ed8; }

/* FAQ */
.faq-item {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.faq-item summary {
  cursor: pointer; list-style: none; padding: 16px 48px 16px 20px; position: relative;
  font-weight: 700; font-size: 1rem; color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 1.3rem; font-weight: 700; color: var(--accent);
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item summary:hover { color: var(--accent); }
.faq-body { padding: 0 20px 16px; }
.faq-body p { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 10px; }
.faq-body p:last-child { margin-bottom: 0; }

/* FOOTER */
footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 32px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.footer-logo { font-size: 1rem; font-weight: 800; color: var(--accent); }
.footer-text { font-size: 0.8rem; color: var(--text-dimmer); }
.footer-text a { color: var(--text-dim); text-decoration: none; font-weight: 600; }
.footer-text a:hover { color: var(--accent); }

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .breadcrumb { padding-top: 18px; }
  .page-head { padding: 14px 0 24px; }
  .card, .live { padding: 18px 16px; }
  .code pre { padding: 14px 14px; font-size: 0.75rem; }
  th, td { padding: 9px 10px; }
  .section h2 { font-size: 1.25rem; }
}
