/* strankafirmy.cz – responsive public styles (look of the original st4.css) */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: #333;
  background: #f0f2f5;
}

a { color: #5797d8; text-decoration: underline; }
a:visited { color: #5797d8; }
a:hover, a:active { color: #2f6aa8; }
a:focus-visible, input:focus-visible, button:focus-visible, .tag-upraveno:focus-visible {
  outline: 2px solid #5797d8;
  outline-offset: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* ---------- layout: slim top header, one centred column ---------- */
.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
html, body { overflow-x: hidden; }
body { display: flex; flex-direction: column; min-height: 100vh; }

/* T shape: full-width white band on top, grey page with a centred column below */
#band {
  background: #fff;
  border-bottom: 1px solid #dde1e6;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  padding: 0.75rem 0 0.5rem;
}
#band .search { margin-bottom: 0.5rem; }
#band .chips { margin-bottom: 0.25rem; }
#band .search-status { margin: 0; }
#band .back { margin: 0 0 0.25rem; }
#band .page-title { margin: 0 0 0.25rem; }

/* White centred column from the band down to the footer; grey only on the sides. */
#page {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem 16px 0;
  background: #fff;
  min-width: 0;
}
#main { flex: 1 0 auto; min-width: 0; }
.panel { padding: 0.25rem 0 0.5rem; }
#footer {
  margin-top: 1rem;
  padding: 0.75rem 0 1rem;
  border-top: 1px solid #eceff2;
  text-align: center;
  color: #777;
  font-size: 0.85rem;
}
@media (min-width: 640px) {
  #page, .wrap { padding-left: 24px; padding-right: 24px; }  /* band content aligns with the column */
}

/* ---------- headings ---------- */
.page-title {
  font-size: 1.5rem;
  font-weight: normal;
  line-height: 1.3;
  color: #333;
  margin: 0.5rem 0 0.75rem;
}
.documents h2 {
  font-size: 1.2rem;
  font-weight: normal;
  margin: 2rem 0 0.75rem;
}

/* ---------- search ---------- */
.search { display: flex; gap: 0.5rem; margin-bottom: 0.6rem; }
.search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid #bbb;
  border-radius: 4px;
}
.search button {
  font: inherit;
  padding: 0.55rem 1rem;
  border: 1px solid #5797d8;
  background: #5797d8;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}
.search button:hover { background: #2f6aa8; border-color: #2f6aa8; }
.search-status { min-height: 1.4em; font-size: 0.85rem; color: #666; }
.empty { color: #666; }

/* ---------- filter chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.chips.letters {
  flex-wrap: nowrap;            /* scrolls horizontally on small screens */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;        /* swipe to scroll; no scrollbar gap under the chips */
}
.chips.letters::-webkit-scrollbar { display: none; }
.fchip, .fchip:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 36px;
  min-width: 36px;
  padding: 0 0.8em;
  border: 1px solid #ccd6e2;
  border-radius: 999px;
  background: #fff;
  color: #333;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.fchip:hover { background: #eef4fa; border-color: #9ab8d8; }
.fchip.is-active, .fchip.is-active:visited {
  background: #5797d8;
  border-color: #5797d8;
  color: #fff;
}
.fchip.is-active:hover { background: #2f6aa8; border-color: #2f6aa8; color: #fff; }
@media (min-width: 640px) {
  .chips.letters { flex-wrap: wrap; overflow-x: visible; }
}

/* ---------- groups and company cards (no pagination: whole list is grouped) ---------- */
.group { margin-top: 0.6rem; }
.group-letter {
  font-size: 1.9rem;
  font-weight: normal;
  line-height: 1.2;
  color: #333;
  padding-bottom: 0.1rem;
  margin-bottom: 1rem;           /* room for status badges on the first card row */
  border-bottom: 1px solid #d5d9de;
}
.cards {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.1rem 0.5rem;           /* extra row gap: status badges overlap the card's top edge */
}
.card {
  position: relative;            /* no overflow:hidden here: badge and tooltip must not be clipped */
  border: 1px solid #d8dee6;
  border-radius: 8px;
  background: #f5f7fa;
  background: linear-gradient(#ffffff, #f5f7fa);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07), 0 3px 7px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.card.has-status {
  background: #f1f4f8;
  background: color-mix(in srgb, var(--st) 8%, #fafbfd);
  border-color: #d8dee6;
  border-color: color-mix(in srgb, var(--st) 30%, #d8dee6);
}
.card:hover, .card:focus-within {
  transform: translateY(-1px);
  z-index: 2;
  background: #eef4fa;
  background: linear-gradient(#fafcff, #ebf2fa);
  border-color: #aac3de;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.09), 0 5px 12px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.card.has-status:hover, .card.has-status:focus-within {
  background: #e8edf3;
  background: color-mix(in srgb, var(--st) 14%, #f3f6fa);
  border-color: #aab6c4;
  border-color: color-mix(in srgb, var(--st) 50%, #d0d8e2);
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover, .card:focus-within { transform: none; }
}
.card-edge {
  position: absolute;
  top: -0.6rem;
  left: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  display: flex;
  gap: 0.3rem;
  white-space: nowrap;
}
.card-edge .badge, .card-edge .tag-upraveno { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
/* Fixed three-row card: IČ, name (2 lines), documents (right-aligned) (tags sit on the top edge). Rows are reserved even when empty. */
.card-link, .card-link:visited {
  display: grid;
  grid-template-rows: 1.2rem 2.6em 1.2rem;
  row-gap: 0.15rem;
  height: 100%;
  padding: 0.75rem 0.65rem 0.5rem;
  color: #333;
  text-decoration: none;
  line-height: 1.3;
}
.card-link:hover, .card-link:active { color: #333; }
.card-link:focus-visible { outline: 2px solid #5797d8; outline-offset: -2px; border-radius: 6px; }
.card-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;            /* only this row clips; tags live in .card-edge */
  max-height: 2.6em;
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.card-ico, .card-docs {
  font-size: 0.8rem;
  line-height: 1.2rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-docs { text-align: right; align-self: end; }
.doc-icon { vertical-align: -1px; }

/* ---------- badges, tags ---------- */
.badge {
  display: inline-block;
  padding: 0.05em 0.65em;
  border-radius: 999px;
  background: #e67e22;
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  line-height: 1.5;
  vertical-align: middle;
  white-space: nowrap;
}
.page-title .badge { font-size: 0.85rem; }

.tag-upraveno {
  position: relative;
  display: inline-block;
  padding: 0.05em 0.65em;
  border-radius: 999px;
  background: #2e7d32;
  color: #fff;
  border: 0;
  font-size: 0.75rem;
  font-weight: bold;
  line-height: 1.5;
  vertical-align: middle;
  cursor: help;
  white-space: nowrap;
}
.tag-upraveno::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 10;
  padding: 0.3rem 0.6rem;
  background: #333;
  color: #fff;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s;
}
.tag-upraveno:hover::after,
.tag-upraveno:focus::after { opacity: 1; visibility: visible; }

.chip {
  display: inline-block;
  padding: 0 0.6em;
  border-radius: 4px;
  background: #f1f1f1;
  color: #555;
  font-size: 0.75rem;
  line-height: 1.6;
  vertical-align: middle;
}

/* ---------- company page ---------- */
.card-box {
  max-width: none;            /* full column width */
  margin: 0 0 1.25rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #e3e7ec;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.box-title { font-size: 1.15rem; font-weight: 600; line-height: 1.3; color: #222; }
.box-count { font-weight: normal; color: #6b7480; }
.box-note { margin-top: 0.15rem; font-size: 0.85rem; color: #6b7480; }

.info-list { margin-top: 0.75rem; }
.info-row {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 0 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid #eef0f3;
}
.info-row:first-child { border-top: 0; }
.info-row dt {
  padding-top: 0.2rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7480;
}
.info-row dd { font-size: 1rem; color: #222; overflow-wrap: anywhere; }
.info-row dd .copy-src { margin-right: 0.1rem; }
.info-text p + p { margin-top: 0.6rem; }
.info-text { max-width: none; }

.doc-list { list-style: none; margin-top: 0.5rem; }
.doc-list li + li { border-top: 1px solid #eef0f3; }
.doc-row, .doc-row:visited {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.5rem;
  margin: 0 -0.5rem;
  border-radius: 8px;
  color: #222;
  text-decoration: none;
  transition: background-color 0.15s;
}
.doc-row:hover, .doc-row:active { background: #f5f8fb; color: #222; }
.doc-type {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.6rem; height: 2.6rem;
  border-radius: 6px;
  color: #fff;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em;
  background: #7b8590;
}
.doc-type.is-pdf { background: #d64545; }
.doc-type.is-doc { background: #2b6cb0; }
.doc-type.is-xls { background: #2f855a; }
.doc-body { flex: 1 1 auto; min-width: 0; }
.doc-title { display: block; font-weight: 500; color: #222; line-height: 1.35; overflow-wrap: anywhere; }
.doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.5rem; margin-top: 0.15rem; font-size: 0.82rem; color: #6b7480; }
.doc-dl { flex: 0 0 auto; color: #8a95a1; }
.doc-row:hover .doc-dl { color: #2f6aa8; }

.last-update { margin-top: 0.5rem; font-size: 0.85rem; color: #6b7480; }
.back { font-size: 0.9rem; margin: 0.25rem 0 0.5rem; }
.back a { text-decoration: none; }
.back a:hover { text-decoration: underline; }

/* company band: heading, subtitle, tag pills */
.firma-title { font-size: 1.7rem; font-weight: 600; line-height: 1.25; color: #222; overflow-wrap: anywhere; }
#band .firma-title { margin: 0.1rem 0 0.15rem; }
.firma-sub { font-size: 0.95rem; color: #6b7480; }
.firma-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.firma-tags .badge { font-size: 0.78rem; }
.tag-updated { background: #2e7d32; color: #fff; }

@media (max-width: 599px) {
  .firma-title { font-size: 1.45rem; }
  .card-box { padding: 1rem; }
  .info-row { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .info-row dt { padding-top: 0; }
}

/* external link marker (justice.cz) */
.ext { font-size: 0.8em; color: #888; text-decoration: none; }

/* icon actions next to a value (map, copy) */
.cell-actions { display: inline-flex; gap: 0.25rem; vertical-align: middle; margin-left: 0.4rem; white-space: nowrap; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; padding: 0;
  border: 1px solid #d8dee6; border-radius: 6px; background: #fff;
  color: #5797d8; cursor: pointer; text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}
.icon-btn:hover, .icon-btn:focus-visible { background: #eef4fa; border-color: #b3c9e0; color: #2f6aa8; }
.icon-btn.copied { color: #2e7d32; border-color: #a5d6a7; background: #edf7ee; }
