/* =====================================================================
   KANT — cookie lišta a nastavení (Consent Mode v2)
   Navazuje na tokeny z style.css (--cream, --ink, --sand, --brass…).
   ===================================================================== */

/* ---------- Lišta ---------- */
.cbar {
  position: fixed;
  left: clamp(12px, 4vw, 40px);
  right: clamp(12px, 4vw, 40px);
  bottom: clamp(12px, 3vw, 32px);
  z-index: 150;                 /* nad hlavičkou (100/110), pod lightboxem (200) */
  max-width: 1020px;
  margin-inline: auto;
  background: var(--cream);
  border: 1px solid var(--sand);
  border-radius: 2px;
  box-shadow: var(--shadow-lg);
  padding: clamp(20px, 2.6vw, 30px) clamp(20px, 3vw, 34px);
  animation: cbar-in .55s var(--ease-out) both;
}
.cbar[hidden] { display: none; }

@keyframes cbar-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cbar { animation: none; }
}

.cbar__inner {
  display: flex;
  align-items: center;
  gap: clamp(22px, 3.4vw, 46px);
}

.cbar__title {
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 7px;
}

.cbar__text {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 62ch;
}
.cbar__text a {
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1px solid var(--brass);
  padding-bottom: 1px;
  transition: color .3s var(--ease);
}
.cbar__text a:hover { color: var(--brass-dk); }

.cbar__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  flex-shrink: 0;
}

/* Přijmout i odmítnout mají stejnou velikost i váhu — volba musí být rovnocenná. */
.cbar__btn {
  justify-content: center;
  min-width: 190px;
  padding: 0.92em 1.5em;
  white-space: nowrap;
}

.cbar__link {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  align-self: center;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.cbar__link:hover { color: var(--ink); border-bottom-color: var(--sand); }

@media (max-width: 860px) {
  .cbar__inner { flex-direction: column; align-items: stretch; gap: 20px; }
  .cbar__actions { flex-direction: row; flex-wrap: wrap; }
  .cbar__btn { flex: 1 1 180px; min-width: 0; }
  .cbar__link { flex: 1 1 100%; }
}
@media (max-width: 460px) {
  .cbar { max-height: 82vh; overflow-y: auto; }
  .cbar__title { font-size: 1.18rem; }
  .cbar__btn { flex-basis: 100%; }
}

/* ---------- Dialog s podrobným nastavením ---------- */
.cdlg {
  margin: auto;                 /* globální reset *{margin:0} zabíjí nativní centrování <dialog> */
  width: min(560px, calc(100vw - 32px));
  max-height: min(86vh, 780px);
  padding: 0;
  border: 1px solid var(--sand);
  border-radius: 2px;
  background: var(--cream);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.cdlg::backdrop { background: rgba(31, 41, 55, 0.55); }

.cdlg__form {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  padding: clamp(22px, 3.4vw, 32px);
  padding-bottom: 0;            /* spodek si bere sticky .cdlg__actions */
  overflow-y: auto;
}

.cdlg__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.cdlg__title {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3vw, 1.65rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cdlg__close {
  color: var(--muted-2);
  padding: 4px;
  margin: -4px -4px 0 0;
  border-radius: 2px;
  transition: color .3s var(--ease);
}
.cdlg__close:hover { color: var(--ink); }

.cdlg__intro {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 10px;
}
.cdlg__intro em { font-style: normal; color: var(--ink); font-weight: 500; }

.cdlg__cats { list-style: none; margin: 24px 0 4px; }

.ccat {
  padding: 18px 0;
  border-top: 1px solid var(--sand-line);
}
.ccat:last-child { border-bottom: 1px solid var(--sand-line); }

.ccat__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.ccat__name {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  cursor: pointer;
}
.ccat__always {
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brass-dk);
  white-space: nowrap;
}
.ccat__desc {
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 7px;
  max-width: 56ch;
}

/* ---------- Přepínač ---------- */
.switch { position: relative; display: inline-flex; flex-shrink: 0; }
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.switch__track {
  display: block;
  width: 46px;
  height: 26px;
  border-radius: 13px;
  background: var(--cream-3);
  border: 1px solid var(--sand);
  transition: background .32s var(--ease), border-color .32s var(--ease);
}
.switch__knob {
  display: block;
  width: 18px;
  height: 18px;
  margin: 3px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform .32s var(--ease);
}
.switch input:checked + .switch__track {
  background: var(--ink);
  border-color: var(--ink);
}
.switch input:checked + .switch__track .switch__knob { transform: translateX(20px); }
.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

/* Akce zůstávají vidět i u dlouhého obsahu na malém displeji */
.cdlg__actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding: 16px 0 clamp(22px, 3.4vw, 32px);
  background: var(--cream);
  box-shadow: 0 -16px 20px -14px rgba(31, 41, 55, 0.12);
}
.cdlg__actions .cbar__btn { flex: 1 1 0; min-width: 0; }

@media (max-width: 480px) {
  .cdlg__actions { flex-direction: column; }
}

/* ---------- Odkaz „Nastavení cookies" v patičce ---------- */
.footer__cookies {
  font: inherit;
  color: #B8BCC4;
  padding: 0;
  border-bottom: 1px solid transparent;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.footer__cookies:hover { color: var(--white); border-bottom-color: rgba(255,255,255,0.35); }
.footer__cookies:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
