/* Stranka Transparentnost (transparentnost.html) - vsetko je obmedzene na main.tis */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.tis {
  --period-blue: #2e6da4;
  --period-red: #c0392b;
  --negative: #c0392b;
  --positive: #256029;
  --bar-old: #a9bccf;
  --bar-now: var(--primary);
}
.tis section[id] { scroll-margin-top: 64px; }
.tis h3 { margin: 0; font-size: 1.05rem; }
.tis p { margin: 0; }
.tis p + p { margin-top: 12px; }
.tis .negative { color: var(--negative); }
.tis .positive { color: var(--positive); }
.tis .period-blue { --period-color: var(--period-blue); }
.tis .period-red  { --period-color: var(--period-red); }
.tis .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.tis [hidden] { display: none !important; }

/* Nadpis stranky */
.tis .tis-hero > h2 { border: 0; padding: 0; margin: 0; font-size: 1.9rem; line-height: 1.2; color: var(--primary); }
.tis .tis-subtitle {
  margin-top: 10px; max-width: 60ch;
  font-size: 1.3rem; line-height: 1.4; font-style: italic; color: #2a3a49;
}

/* Spolocne drobnosti */
.tis .eyebrow {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  font-size: .72rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted);
}
.tis .eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); }
.tis .section-lead { max-width: 75ch; color: #2a3a49; margin-bottom: 18px; }
.tis .note { font-size: .85rem; color: var(--muted); }
.tis .source-line { margin-top: 14px; font-size: .82rem; color: #8a98a6; }
.tis .source-line a { margin-right: 14px; white-space: nowrap; }
.tis .panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* Legenda */
.tis .legend { display: flex; flex-wrap: wrap; gap: 20px; font-size: .85rem; }
.tis .legend span { display: flex; align-items: center; gap: 8px; }
.tis .swatch { display: inline-block; width: 20px; height: 6px; border-radius: 3px; background: var(--bar-old); }
.tis .swatch.current { background: var(--bar-now); }
.tis .period-legend span { color: var(--period-color); font-weight: 700; }
.tis .period-legend .swatch { background: var(--period-color); }

/* Casova os */
.tis .timeline {
  list-style: none; padding: 0; margin: 26px 0 16px;
  display: grid; grid-template-columns: repeat(7, 1fr);
}
.tis .timeline li {
  position: relative; padding: 20px 10px 12px 0;
  border-top: 2px solid var(--period-color); color: var(--period-color);
}
.tis .timeline li::before {
  content: ""; position: absolute; top: -6px; left: 0;
  width: 10px; height: 10px; border-radius: 50%; background: var(--period-color);
}
.tis .timeline li:last-child::before { box-shadow: 0 0 0 5px rgba(192, 57, 43, .18); }
.tis .timeline .year { font-size: .85rem; font-weight: 700; color: var(--ink); }
.tis .timeline .place { display: block; margin-top: 8px; font-size: 2rem; line-height: 1.1; }
.tis .timeline .score { display: block; font-size: .85rem; }
.tis .timeline a { display: inline-block; margin-top: 10px; font-size: .75rem; }

/* Graf poradia */
.tis .chart-card { margin: 22px 0 0; padding: 20px; }
.tis .chart-card h3 { margin-bottom: 8px; }
.tis svg.chart { display: block; width: 100%; max-width: 760px; height: auto; margin: 0 auto; overflow: visible; }
.tis .chart text { font: 12px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; fill: var(--muted); }
.tis .chart .value { font-size: 13px; font-weight: 700; }
.tis .chart .grid { stroke: var(--border); stroke-width: 1; }
.tis .chart .line { fill: none; stroke-width: 3; stroke-linecap: round; stroke: var(--period-color); }
.tis .chart .line.period-transition { stroke: var(--period-red); }
.tis .chart .dot { fill: var(--period-color); stroke: #fff; stroke-width: 2; }
.tis .chart g text { fill: var(--period-color); }
.tis .chart-card figcaption { margin-top: 8px; font-size: .78rem; color: var(--muted); }

/* Tabulky */
.tis .table-scroll { overflow-x: auto; }
.tis table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tis th, .tis td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.tis thead th { background: var(--primary); color: #fff; font-size: .8rem; font-weight: 600; }
.tis .data-detail { margin-top: 16px; }
.tis .data-detail summary { cursor: pointer; font-weight: 600; padding: 8px 0; color: var(--primary); }
.tis .data-detail table { background: var(--surface); }
.tis .data-detail tbody tr { color: var(--period-color); }

/* Zhrnutie */
.tis .hero-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: end; }
.tis .lead { font-size: 1.12rem; line-height: 1.65; max-width: 680px; }
.tis .hero-aside { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; }
.tis .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tis .button {
  display: inline-flex; align-items: center; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--primary); color: var(--primary); font-weight: 600; font-size: .9rem; text-decoration: none;
}
.tis .button.primary { background: var(--primary); color: #fff; }
.tis .button:hover { background: #eaf1f8; color: var(--primary); }
.tis .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.tis .stat { padding: 20px 22px; }
.tis .stat-label { font-size: .72rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.tis .stat-number { margin: 4px 0; font-size: 2.8rem; font-weight: 700; line-height: 1.15; color: var(--primary); }
.tis .stat-number small { font-size: 1.2rem; }
.tis .stat-caption { font-size: .85rem; color: var(--muted); }
.tis .change { margin-top: 10px; font-size: .85rem; font-weight: 600; }

/* Porovnanie 11 oblasti */
.tis .comparison-tools { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 10px 0 14px; }
.tis .comparison-tools label { display: none; font-size: .85rem; }
.js .tis .comparison-tools label { display: block; }
.tis select { font: inherit; font-size: .85rem; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.tis .comparison { overflow: hidden; }
.tis .comparison th:first-child { width: 35%; font-weight: 600; }
.tis .comparison td:nth-child(2), .tis .comparison td:nth-child(3) { width: 24%; }
.tis .comparison td:last-child { width: 17%; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tis .area-id { display: block; font-size: .7rem; letter-spacing: 1px; color: var(--muted); }
.tis .barcell { display: flex; align-items: center; gap: 10px; }
.tis .barcell .number { width: 44px; flex-shrink: 0; text-align: right; font-size: .85rem; font-variant-numeric: tabular-nums; }
.tis .bartrack { display: block; flex: 1; height: 7px; border-radius: 4px; background: #e8edf3; overflow: hidden; }
.tis .bar { display: block; height: 100%; background: var(--bar-old); }
.tis .bar.current { background: var(--bar-now); }
.tis .insights { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 24px; }
.tis .insight { padding: 18px 20px; }
.tis .insight.negative { border-top: 4px solid var(--negative); }
.tis .insight.positive { border-top: 4px solid var(--positive); }
.tis .insight ul { list-style: none; padding: 0; margin: 12px 0 0; }
.tis .insight li {
  display: flex; justify-content: space-between; gap: 16px; padding: 9px 0;
  border-top: 1px solid var(--border); font-size: .92rem; color: var(--ink);
}
.tis .insight strong { white-space: nowrap; }
.tis .callout {
  margin-top: 20px; padding: 12px 16px; font-size: .92rem;
  background: #fff8e6; border: 1px solid #f0e0b0; border-radius: var(--radius); color: #6b5a2a;
}

/* Historia oblasti */
.tis .history-buttons { display: none; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.js .tis .history-buttons { display: flex; }
.tis .history-buttons button {
  font: inherit; font-size: .82rem; cursor: pointer; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff; color: var(--ink);
}
.tis .history-buttons button:hover { border-color: var(--primary-2); }
.tis .history-buttons [aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.tis .history-panel { padding: 20px; }
.tis .history-panel + .history-panel { margin-top: 16px; }
.js .tis .history-panel + .history-panel { margin-top: 0; }
.tis .history-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin: 16px 0; }
.tis .history-cell small { display: block; font-size: .8rem; color: var(--muted); }
.tis .history-cell strong { display: block; font-size: 1.6rem; color: var(--primary); }
.tis .history-cell .bartrack { margin-top: 6px; }
.tis .historical-note { font-size: .82rem; color: var(--muted); }

/* Metodika */
.tis .method {
  padding: 26px 28px; border-radius: var(--radius); box-shadow: var(--shadow);
  background: linear-gradient(135deg, var(--primary) 0%, #163a5a 100%); color: #dbe7f2;
}
.tis .method > h2 { color: #fff; border-bottom-color: rgba(255,255,255,.2); }
.tis .method .eyebrow, .tis .method .section-lead, .tis .method .source-line { color: #cfe0f0; }
.tis .method a { color: #fff; }
.tis .method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 40px; margin-top: 8px; }
.tis .method-grid article { border-top: 1px solid rgba(255,255,255,.25); padding-top: 16px; }
.tis .method-grid h3 { color: #fff; margin-bottom: 8px; }
.tis .method-grid p { font-size: .92rem; }

/* Zdroje */
.tis .source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.tis .source { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.tis .source b { min-width: 56px; font-size: 1.3rem; color: var(--primary); }
.tis .source small { display: block; font-size: .78rem; color: var(--muted); }

@media (max-width: 850px) {
  .tis .hero-body { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 640px) {
  .tis .tis-hero > h2 { font-size: 1.5rem; }
  .tis .tis-subtitle { font-size: 1.1rem; }
  .tis .timeline { grid-template-columns: repeat(4, 1fr); row-gap: 24px; }
  .tis .timeline .place { font-size: 1.6rem; }
  /* graf sa na mobile zmensi na ~60 %, preto vacsie pismo v jednotkach SVG */
  .tis .chart-card { padding: 16px 12px; }
  .tis .chart text { font-size: 18px; }
  .tis .chart .value { font-size: 20px; }
  .tis .stats, .tis .insights, .tis .method-grid, .tis .source-grid { grid-template-columns: 1fr; }
  .tis .stat-number { font-size: 2.3rem; }
  .tis .method { padding: 20px 18px; }
  .tis .comparison-tools { flex-direction: column; align-items: flex-start; }
  .tis .comparison th, .tis .comparison td { padding: 10px 5px; }
  .tis .comparison th:first-child { width: 41%; font-size: .82rem; line-height: 1.35; }
  .tis .comparison td:nth-child(2), .tis .comparison td:nth-child(3) { width: 17%; }
  .tis .comparison td:last-child { width: 25%; font-size: .82rem; text-align: right; }
  .tis .comparison .barcell { display: block; }
  .tis .comparison .barcell .number { display: block; width: auto; text-align: left; font-size: .8rem; margin-bottom: 5px; }
  .tis .history-grid { grid-template-columns: repeat(4, 1fr); }
  .tis .history-cell strong { font-size: 1.35rem; }
}

@media print {
  .main-nav, .tis .actions, .tis .comparison-tools, .tis .history-buttons { display: none !important; }
  .tis .history-panel[hidden] { display: block !important; }
  .tis .method { background: #fff; color: #111; box-shadow: none; }
  .tis .method > h2, .tis .method h3, .tis .method p, .tis .method a, .tis .method .eyebrow { color: #111; }
}
