/* =========================================================================
   UZOb widget – banner s rozbalovacím přehledem dokumentů z RSS
   Vše je scopované pod .uzob, nekoliduje s Bootstrapem ani se stylem webu.
   Barvy splňují WCAG 2.2 AA (kontrast textu min. 4.5 : 1).
   ========================================================================= */

.uzob {
  /* ---- nastavitelné proměnné ---- */
  --uzob-green: #1f6b2e;          /* odkazy, tlačítka – 6.7 : 1 na bílé */
  --uzob-green-dark: #154d21;     /* hover */
  --uzob-green-brand: #3ca040;    /* jen dekorace (ne text) */
  --uzob-green-soft: #eef6ec;
  --uzob-ink: #10341e;            /* nadpisy – 13 : 1 */
  --uzob-text: #2f3b33;           /* běžný text – 11 : 1 */
  --uzob-muted: #56635a;          /* sekundární text – 6.2 : 1 */
  --uzob-border: #d9e6d6;
  --uzob-bg: #ffffff;
  --uzob-new: #b3261e;            /* štítek „Nové“ – 6.5 : 1 s bílým textem */
  --uzob-focus: #0b57d0;
  --uzob-radius: 14px;
  --uzob-shadow: 0 6px 24px rgba(16, 52, 30, .10);
  --uzob-speed: .3s;

  //font-family: inherit;
  color: var(--uzob-text);
  background: var(--uzob-bg);
  border: 1px solid var(--uzob-border);
  border-radius: var(--uzob-radius);
  box-shadow: var(--uzob-shadow);
  overflow: hidden;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

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

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

/* ---------- přepínač (banner + lišta) ---------- */
.uzob-toggle {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.uzob-toggle:focus-visible {
  outline: 3px solid var(--uzob-focus);
  outline-offset: -3px;
}

.uzob-banner {
  display: block;
  overflow: hidden;
}

.uzob-banner img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .6s ease;
}

.uzob-toggle:hover .uzob-banner img { transform: scale(1.015); }

.uzob-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem 1.25rem;
  background: var(--uzob-green-soft);
  border-top: 1px solid var(--uzob-border);
  font-weight: 600;
  color: var(--uzob-ink);
  transition: background-color var(--uzob-speed);
}

.uzob-toggle:hover .uzob-bar { background: #e2f0df; }

.uzob-bar__icon {
  flex: 0 0 auto;
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--uzob-green);
  color: #fff;
}

.uzob-bar__text { flex: 1 1 auto; }

.uzob-bar__chevron {
  flex: 0 0 auto;
  transition: transform var(--uzob-speed) ease;
}

.uzob-toggle[aria-expanded="true"] .uzob-bar__chevron { transform: rotate(180deg); }

/* ---------- štítky ---------- */
.uzob-badge {
  display: inline-block;
  padding: .15em .6em;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .02em;
  vertical-align: middle;
  white-space: nowrap;
}

.uzob-badge--new { background: var(--uzob-new); color: #fff; }
.uzob-badge--type { background: var(--uzob-green-soft); color: var(--uzob-green-dark); border: 1px solid var(--uzob-border); }

.uzob-bar .uzob-badge--new {
  animation: uzob-pulse 2s ease-in-out 3;
}

@keyframes uzob-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(179, 38, 30, .45); }
  50%      { box-shadow: 0 0 0 6px rgba(179, 38, 30, 0); }
}

/* ---------- panel ---------- */
.uzob-panel { border-top: 1px solid var(--uzob-border); }

.uzob-panel__inner { padding: 1.25rem 1.25rem 1.5rem; }

.uzob-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-bottom: 1rem;
}

.uzob-panel__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--uzob-ink) !important;
}

.uzob-panel__updated { font-size: .85rem; color: var(--uzob-muted); }

/* ---------- seznam dokumentů – styl úřední desky ---------- */
.uzob {
  --uzob-date-pub: #3f6212;        /* zelená „vyvěšeno“ – 7.4 : 1 s bílým textem */
  --uzob-date-meet: #a50e0e;       /* červená jako „sejmuto“ – 7.6 : 1 */
  --uzob-accent: #c28514;          /* oranžový nadpis – 5.6 : 1 na bílé */
}

.uzob-panel__title {
  display: flex;
  align-items: center;
  font-family: "Fira Sans Condensed", sans-serif;
  gap: .6rem;
  color: var(--uzob-accent) !important;
  text-decoration: underline;
  text-underline-offset: .2em;
  text-decoration-thickness: 2px;
}

.uzob-panel__icon { width: 50px; height: 2.4rem; }

.uzob-cols {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: 0 .5rem .35rem;
  font-size: .9rem;
  color: var(--uzob-text);
}

.uzob-cols span { width: 6.1rem; text-align: center; }

.uzob-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.uzob-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .7rem .5rem;
  border-bottom: 1px solid #ececec;
  border-radius: 6px;
  transition: background-color var(--uzob-speed);
  opacity: 0;
  transform: translateY(4px);
  animation: uzob-in .35s ease forwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}

.uzob-row:last-child { border-bottom: 0; }
.uzob-row:hover, .uzob-row:focus-within { background: #f6f8f4; }

@keyframes uzob-in { to { opacity: 1; transform: none; } }

.uzob-row__main { flex: 1 1 auto; min-width: 0; }

.uzob-row__title {
  margin: 0;
  //font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.4;
}

.uzob-row__link {
  font-size: 1.3rem;
  color: #1d1d1d;
  text-decoration: none !important;
}

.uzob-row__link:hover {
  color: var(--uzob-green);
  text-decoration: underline !important;
  text-underline-offset: .15em;
}

.uzob-row__link:focus-visible,
.uzob-pdf:focus-visible {
  outline: 3px solid var(--uzob-focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.uzob-row__title .uzob-badge { margin-left: .35rem; font-size: .7rem; }

.uzob-row__sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem 1rem;
  margin-top: .2rem;
  font-size: .85rem;
}

.uzob-type {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--uzob-muted);
}

.uzob-type svg { width: 15px; height: 15px; }
.uzob-row--usneseni .uzob-type { color: var(--uzob-green); font-weight: 600; }
.uzob-row--priprava .uzob-type { color: #7a4200; }

.uzob-pdf {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  color: var(--uzob-green);
  font-weight: 600;
  text-decoration: none;
}

.uzob-pdf:hover { color: var(--uzob-green-dark); text-decoration: underline; }

.uzob-row__dates {
  flex: 0 0 auto;
  display: flex;
  gap: .5rem;
}

.uzob-date {
  display: inline-block;
  width: 6.1rem;
  padding: .3rem .25rem;
  border-radius: 3px;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.uzob-date--pub  { background: var(--uzob-date-pub); }
.uzob-date--meet { background: var(--uzob-date-meet); }

.uzob-more { margin: -.75rem 0 1rem .5rem; font-size: .85rem; color: var(--uzob-muted); }

/* ---------- skeleton při načítání ---------- */
.uzob-skeleton {
  height: 4.6rem;
  border-radius: calc(var(--uzob-radius) - 4px);
  background: linear-gradient(90deg, #f1f5f0 25%, #e4ede2 37%, #f1f5f0 63%);
  background-size: 400% 100%;
  animation: uzob-shimmer 1.4s ease infinite;
}

@keyframes uzob-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- prázdný stav / chyba ---------- */
.uzob-state {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: calc(var(--uzob-radius) - 4px);
  background: #f6f8f5;
  border: 1px dashed var(--uzob-border);
  color: var(--uzob-text);
}

.uzob-state--error { background: #fdf3f2; border-color: #f0c9c6; }

/* ---------- patička panelu ---------- */
.uzob-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
}

.uzob-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.2rem;
  border-radius: 999px;
  background: var(--uzob-green);
  border: 2px solid var(--uzob-green);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none !important;
  transition: background-color var(--uzob-speed), border-color var(--uzob-speed), transform var(--uzob-speed);
}

.uzob-btn:hover {
  background: var(--uzob-green-dark);
  border-color: var(--uzob-green-dark);
  color: #fff !important;
  transform: translateY(-1px);
}

.uzob-btn:focus-visible,
.uzob-link:focus-visible {
  outline: 3px solid var(--uzob-focus);
  outline-offset: 3px;
}

.uzob-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--uzob-green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .15em;
}

.uzob-link:hover { color: var(--uzob-green-dark); }

.uzob-retry {
  margin-left: .25rem;
  padding: .2rem .7rem;
  border: 1px solid var(--uzob-green);
  border-radius: 999px;
  background: #fff;
  color: var(--uzob-green);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.uzob svg { display: block; flex-shrink: 0; }

/* ---------- mobil ---------- */
@media (max-width: 575.98px) {
  .uzob-bar { padding: .7rem 1rem; font-size: .95rem; }
  .uzob-panel__inner { padding: 1rem; }
  .uzob-cols { display: none; }
  .uzob-row { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .uzob-row__title { font-size: 1rem; }
  /* na mobilu chybí hlavička sloupců → popisek u data zviditelníme */
  .uzob-date .uzob-sr {
    position: static !important; width: auto; height: auto; margin: 0;
    overflow: visible; clip: auto; font-weight: 400;
  }
  .uzob-row__dates { flex-wrap: wrap; }
  .uzob-date { width: auto; padding: .25rem .5rem; }
  .uzob-btn { width: 100%; justify-content: center; text-align: center; }
}

/* ---------- přístupnost ---------- */
@media (prefers-reduced-motion: reduce) {
  .uzob *,
  .uzob *::before,
  .uzob *::after {
    animation: none !important;
    transition: none !important;
  }
  .uzob-row { opacity: 1; transform: none; }
}

@media (forced-colors: active) {
  .uzob-date, .uzob-btn, .uzob-badge { border: 1px solid CanvasText; }
}

@media print {
  .uzob { box-shadow: none; }
  .uzob-bar, .uzob-banner { display: none; }
  .uzob-panel { display: block !important; }
}
