/* ============================================================
   DATABÁZE OSVČ – Sdílený styl článků (podnikani/ + clanek/)
   Redesign 2025 – sjednoceno s designem subjekt/style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --blue:    #1a6fa8;
  --blue-dk: #0d4f7c;
  --blue-lt: #007aae;
  --bg:      #eef2f6;
  --card:    #ffffff;
  --text:    #1a202c;
  --muted:   #64748b;
  --border:  #e2e8f0;
  --r:       12px;
  --sh:      0 1px 3px rgba(0,0,0,.07), 0 4px 14px rgba(0,0,0,.05);
  --max-w:   860px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin: 0;
  padding: 0;
}

/* ──── TOPBAR ──── */

.art-topbar {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dk) 100%);
  padding: 0.7rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.art-topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  opacity: 0.92;
  flex-shrink: 0;
}
.art-topbar-logo:hover { opacity: 1; color: #fff; }
.art-topbar-logo img { width: 20px; height: 20px; }

.art-topbar-sep {
  color: rgba(255,255,255,.35);
  margin: 0 0.15rem;
  font-size: 0.8rem;
}

.art-topbar-crumb {
  font-size: 0.8rem;
  color: rgba(255,255,255,.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ──── LAYOUT ──── */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1rem;
}

/* ──── ARTICLE CARD ──── */

.art-card {
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--sh);
  padding: 2rem 2.25rem 2rem;
  margin-bottom: 1rem;
}

@media (max-width: 580px) {
  .art-card { padding: 1.25rem 1.1rem 1.25rem; }
  .container { padding-top: 1.5rem; }
}

/* ──── TYPOGRAPHY ──── */

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.75rem 0 0.6rem;
  padding-top: 0.25rem;
}

h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.4rem 0 0.4rem;
}

h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.2rem 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h5 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin: 1rem 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

p {
  margin: 0 0 1rem;
  color: var(--text);
}

ul, ol {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
}

li {
  margin-bottom: 0.35rem;
}

a {
  color: var(--blue-lt);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--blue-dk); }

strong, b { font-weight: 600; color: var(--text); }

/* ──── ARTICLE META (datum, kategorie) ──── */

.art-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}
.art-meta-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.15rem 0.65rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ──── HERO IMAGE ──── */

.art-img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: calc(var(--r) - 2px);
  margin: 0 0 1.5rem;
  display: block;
}

/* ──── RELATED ARTICLES ──── */

.art-related {
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--sh);
  padding: 1.25rem 1.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 580px) {
  .art-related { padding: 1rem 1.1rem; }
}

.art-related-title {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin: 0 0 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.art-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.6rem;
}

.art-related-link {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--blue-lt);
  text-decoration: none;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s;
  line-height: 1.35;
}
.art-related-link:hover {
  border-color: var(--blue-lt);
  background: #fff;
  color: var(--blue-dk);
}
.art-related-link::before {
  content: '→';
  font-size: 0.75rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
  color: var(--blue);
}

/* ──── FOOTER ──── */

.art-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  padding: 1.1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.art-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.art-footer a:hover { color: var(--blue); }

.art-footer-sep {
  color: var(--border);
}

/* ──── LAYOUT S POSTRANNÍM MENU ──── */

.art-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: start;
  min-height: calc(100vh - 48px);
}

/* Sidebar */
.art-sidebar {
  position: sticky;
  top: 48px; /* výška topbaru */
  height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--card);
  border-right: 1px solid var(--border);
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

/* Hlavní obsah */
.art-main {
  min-width: 0; /* zabrání přetékání gridu */
}

/* ──── SIDENAV ──── */

.art-sidenav-toggle {
  display: none; /* skryto na desktopu */
}

.art-sidenav-nav {
  padding: 1.25rem 0 2rem;
}

.art-sidenav-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  padding: 0 1rem 0.75rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.art-sidenav-section {
  margin-top: 1.1rem;
}

.art-sidenav-cat {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0 1rem 0.4rem;
}

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

.art-sidenav-link {
  display: block;
  padding: 0.42rem 1rem 0.42rem 1.25rem;
  font-size: 0.845rem;
  color: var(--text);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1.35;
}

.art-sidenav-link:hover {
  background: var(--bg);
  color: var(--blue);
  border-left-color: var(--border);
}

.art-sidenav-link.is-active {
  background: #ebf4fb;
  color: var(--blue);
  font-weight: 600;
  border-left-color: var(--blue-lt);
}

/* ──── MOBILNÍ SIDENAV ──── */

@media (max-width: 899px) {
  .art-layout {
    grid-template-columns: 1fr;
  }

  .art-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .art-sidenav-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 1.25rem;
    background: var(--bg);
    border: none;
    border-bottom: 1px solid var(--border);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, color 0.12s;
  }

  .art-sidenav-toggle:hover,
  .art-sidenav-toggle.is-open {
    background: #ebf4fb;
    color: var(--blue);
  }

  .art-sidenav-nav {
    display: none;
    padding: 0.75rem 0 1rem;
    background: var(--card);
  }

  .art-sidenav-nav.is-open {
    display: block;
  }

  .art-sidenav-heading {
    display: none;
  }
}

/* ──── ŽIVNOST LIST (seznam živností) ──── */

.zivnost-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}
.zivnost-list li {
  padding: 0.35rem 0 0.35rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  position: relative;
}
.zivnost-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--blue-lt);
  font-weight: 700;
}
.zivnost-list li:last-child { border-bottom: none; }

/* ──── ŽIVNOST KATEGORIE TABS ──── */

.zivnost-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.zivnost-tab {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-size: 0.825rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--border);
  color: var(--muted);
  background: var(--bg);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.zivnost-tab:hover,
.zivnost-tab.active {
  border-color: var(--blue-lt);
  color: var(--blue);
  background: #fff;
}

/* ──── TABULKY ──── */

.art-table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  border-radius: var(--r);
  border: 1px solid var(--border);
}

.art-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.art-table th {
  background: var(--bg);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.art-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.45;
}

.art-table tr:last-child td { border-bottom: none; }

.art-table tr:hover td { background: #fafcff; }

.art-table .td-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
  color: var(--blue);
}

.art-table .td-em {
  font-weight: 600;
  color: var(--text);
}

/* ──── CALLOUT BOX ──── */

.art-callout {
  display: flex;
  gap: 0.75rem;
  background: #ebf4fb;
  border-left: 3px solid var(--blue-lt);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  line-height: 1.55;
}

.art-callout-icon { flex-shrink: 0; font-size: 1rem; }

.art-callout.warn {
  background: #fffbeb;
  border-left-color: #f59e0b;
}

.art-callout.ok {
  background: #f0fdf4;
  border-left-color: #22c55e;
}

/* ──── YEAR BADGE (zobrazí se v nadpisu h1) ──── */

.art-year-badge {
  display: inline-block;
  background: #f0fdf4;
  color: #166534;
  font-size: 0.55em;
  font-weight: 700;
  padding: 0.2em 0.55em;
  border-radius: 6px;
  vertical-align: middle;
  letter-spacing: 0.02em;
  border: 1px solid #86efac;
  margin-left: 0.3em;
  line-height: 1.4;
}

/* ──── ARTICLE CTA ──── */

.art-cta {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dk) 100%);
  border-radius: var(--r);
  padding: 1.75rem 2rem;
  margin: 2rem 0 0;
  text-align: center;
}

.art-cta-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #fff;
}

.art-cta-desc {
  font-size: 0.875rem;
  color: rgba(255,255,255,.82);
  margin: 0 0 1.25rem;
  line-height: 1.55;
}

.art-cta-btn {
  display: inline-block;
  background: #fff;
  color: var(--blue-dk);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.6rem 1.6rem;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.art-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  color: var(--blue-dk);
}

/* ============================================================
   DARK MODE
   ============================================================ */

body.dark-mode {
  --bg:     #0f172a;
  --card:   #1e293b;
  --text:   #e2e8f0;
  --muted:  #94a3b8;
  --border: #334155;
  --blue:   #60a5fa;
  --blue-dk:#3b82f6;
  --blue-lt:#60a5fa;
  --sh:     0 1px 3px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25);
}

/* Sidebar active link & open toggle */
body.dark-mode .art-sidenav-link.is-active {
  background: #1e3a5f;
  color: #60a5fa;
  border-left-color: #3b82f6;
}
body.dark-mode .art-sidenav-toggle.is-open {
  background: #1e3a5f;
  color: #60a5fa;
}

/* Callout boxes */
body.dark-mode .art-callout {
  background: #1e3a5f;
  border-left-color: #3b82f6;
}
body.dark-mode .art-callout.warn {
  background: #2d2206;
  border-left-color: #f59e0b;
}
body.dark-mode .art-callout.ok {
  background: #052e16;
  border-left-color: #22c55e;
}
/* Standalone .warn / .ok (without .art-callout) */
body.dark-mode .warn {
  background: #2d2206;
}
body.dark-mode .ok {
  background: #052e16;
}

/* Table hover */
body.dark-mode .art-table tr:hover td {
  background: #263144;
}

/* Related links hover */
body.dark-mode .art-related-link:hover {
  background: #1e293b;
}

/* Živnost tabs */
body.dark-mode .zivnost-tab.active {
  background: #1e293b;
  color: #e2e8f0;
}
body.dark-mode .zivnost-tab {
  color: #94a3b8;
}
body.dark-mode .zivnost-tab:hover {
  color: #e2e8f0;
}
body.dark-mode .zivnost-tabs {
  border-bottom-color: #334155;
}
body.dark-mode .zivnost-content {
  border-color: #334155;
}

/* Year badge */
body.dark-mode .art-year-badge {
  background: #052e16;
  color: #86efac;
  border-color: #166534;
}

/* Inputs / selects in article forms */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #334155;
}
body.dark-mode input::placeholder {
  color: #64748b;
}
