/* Zaklad noveho designu (prototyp-zahlavi/index.html, servis.css). Vlastnik: K1 / integrator.
   Kazde pravidlo zacina .rd: stary main.css zustava nacteny a ma kolizni tridy (btn, page-width, header …)
   i globalni pravidla na p, h1–h6, a, b, label, button a input. Nativni CSS nesting nepouzivat (starsi prohlizece). */

/* Prvky, ktere stary CSS styluje globalne, vrati uvnitr .rd na vychozi styly prohlizece, aby pravidla z prototypu
   platila 1:1. :where() drzi specificitu na jedne tride, takze kazde pravidlo .rd .trida nebo .rd prvek ma prednost.
   Jen prvky bez prezentacnich atributu: all: revert by zrusil i width/height u img a svg nebo type u ol.
   .rd-legacy obaluje stary obsah (zalozky pred prevodem): pravidla, ktera koliduji se starymi prvky a tridami,
   z nej vylucuje :where(:not(.rd-legacy *)) bez zmeny specificity, aby stary obsah vypadal jako ve starem designu. */
.rd :where(p, h1, h2, h3, h4, h5, h6, a, b, label, button, input, select, textarea):where(:not(.rd-legacy *)) {
  all: revert;
}

/* dedene vlastnosti starych stranek (body v main.css) */
.rd .rd-legacy {
  line-height: 1.5;
  color: initial;
}

.rd input[type="file"] {
  display: revert;
}

.rd {
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 400;
  line-height: normal;
  color: var(--primary-text-color);
  text-align: left;
}

.rd *,
.rd *::before,
.rd *::after {
  box-sizing: border-box;
}

.rd.rd-main {
  display: block;
  flex: 1 0 auto;
  background: #fff;
}

/* stary CSS vypina outline vsem prvkum (* { outline: none }) */
.rd :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rd a:where(:not(.rd-legacy *)) {
  color: inherit;
  text-decoration: none;
}

.rd button,
.rd input,
.rd select,
.rd textarea {
  font-family: inherit;
}

/* prototyp nacita jen rezy 400/500/600, tucne pismo je tam vzdy 600 */
.rd b:where(:not(.rd-legacy *)),
.rd strong:where(:not(.rd-legacy *)),
.rd h1:where(:not(.rd-legacy *)),
.rd h2:where(:not(.rd-legacy *)),
.rd h3:where(:not(.rd-legacy *)),
.rd h4:where(:not(.rd-legacy *)),
.rd h5:where(:not(.rd-legacy *)),
.rd h6:where(:not(.rd-legacy *)) {
  font-weight: 600;
}

.rd img:where(:not(.rd-legacy *)) {
  max-width: 100%;
  vertical-align: baseline;
}

.rd [hidden] {
  display: none !important;
}

/* ---------- pomocne tridy ---------- */
.rd .page-width:where(:not(.rd-legacy *)) {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 15px;
}

.rd .muted {
  color: var(--muted-text-color);
}

.rd .mono {
  font-family: var(--font-mono);
  font-size: .92em;
}

.rd .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* textovy odkaz nebo tlacitko vzhledu odkazu */
.rd .link:where(:not(.rd-legacy *)) {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent-link);
  cursor: pointer;
}

.rd .link:where(:not(.rd-legacy *)):hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- tlacitka ---------- */
.rd .btn:where(:not(.rd-legacy *)) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  min-width: 220px;
  height: 52px;
  padding: 0 26px;
  border: 2px solid var(--accent);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--navy);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: normal;
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s, background .15s;
}

.rd .btn.filled {
  background: var(--accent-button, var(--accent));
  border-color: var(--accent-button, var(--accent));
  color: var(--accent-text);
}

.rd .btn.filled:hover {
  filter: brightness(1.07);
}

/* obrys v barve akcentu na svetlem pozadi (obsah stranek) */
.rd .btn.outline {
  background: transparent;
  color: var(--navy);
}

.rd .btn.outline:hover {
  background: var(--light-gray-color);
}

/* obrys na tmavem pozadi (hero, navy bloky) */
.rd .btn.outline.on-dark {
  color: #fff;
}

.rd .btn.outline.on-dark:hover {
  background: rgba(255, 255, 255, .06);
}

/* sedy obrys servisnich stranek (servis.css .btn.outline) */
.rd .btn.outline.neutral {
  background: #fff;
  border-color: var(--border-color);
  color: var(--navy);
}

.rd .btn.outline.neutral:hover {
  border-color: var(--navy);
  background: var(--light-gray-color);
}

.rd .btn.navy {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.rd .btn.navy:hover {
  filter: brightness(1.15);
}

.rd .btn.danger {
  background: #fff;
  border-color: #f1c4c4;
  color: var(--err);
}

.rd .btn.danger:hover {
  background: var(--err-soft);
  border-color: var(--err);
}

.rd .btn.md {
  min-width: 0;
  height: 42px;
  padding: 0 18px;
  font-size: 14px;
}

.rd .btn.sm {
  min-width: 0;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.rd .btn.block {
  width: 100%;
}

.rd .btn[disabled]:where(:not(.rd-legacy *)),
.rd .btn.is-disabled {
  background: #e9ebf0;
  border-color: #e9ebf0;
  color: #9aa0ad;
  cursor: not-allowed;
  filter: none;
}

.rd .btn .spin {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: rd-spin .8s linear infinite;
}

@keyframes rd-spin {
  to {
    transform: rotate(360deg);
  }
}

.rd .btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.rd .btn-row.end {
  justify-content: flex-end;
}
