/* ===========================================================================
   COOKIE CONSENT — lišta + modal předvoleb
   Consent-first: nic sledovacího se nenačte, dokud návštěvník nesvolí.
   Tmavý brand povrch = vysoký kontrast a jasné odlišení od stránky.
   Barvy a rozestupy z tokenů v style.css.
   =========================================================================== */

/* Skryté stavy nechává řídit JS přes atribut [hidden] — funguje i než se
   načte tenhle stylesheet (žádný FOUC nesmyslně zobrazené lišty). */
.tr-consent[hidden],
.tr-consent-modal[hidden] { display: none !important; }

/* ---- Spodní lišta ---------------------------------------------------- */
.tr-consent {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1000;
    background: var(--bg-dark-surface, #1B1810);
    color: var(--text-dark-main, #F3EEE3);
    border-top: 1px solid var(--border-dark-line, #2A2418);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.28);
    padding: var(--space-md, 20px) 0;
}

.tr-consent__inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--space-lg, 32px);
    display: flex;
    align-items: center;
    gap: var(--space-lg, 32px);
    flex-wrap: wrap;
}
.tr-consent__text { flex: 1 1 380px; min-width: 260px; }
.tr-consent__title {
    font-family: var(--font-serif, Georgia, serif);
    font-size: clamp(16px, 0.5vw + 15px, 19px);
    margin: 0 0 4px;
    color: var(--text-dark-main, #F3EEE3);
}
.tr-consent__desc {
    font-size: var(--fs-base, 15px);
    line-height: 1.55;
    margin: 0;
    color: var(--text-dark-muted, #A69C86);
}
.tr-consent__desc a {
    color: var(--color-gold-hi, #E7C878);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.tr-consent__desc a:hover { color: #fff; }

.tr-consent__actions {
    display: flex;
    gap: var(--space-sm, 10px);
    flex-wrap: wrap;
    align-items: center;
}

/* ---- Tlačítka (sdílená lištou i modalem) ----------------------------- */
.tr-c-btn {
    font-family: var(--font-sans, sans-serif);
    font-size: var(--fs-base, 15px);
    font-weight: 600;
    line-height: 1;
    padding: 12px 20px;
    border-radius: var(--radius-control, 4px);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    white-space: nowrap;
}
/* Primární = gold gradient s tmavým textem (kontrast OK: ink na gold). */
.tr-c-btn--primary {
    background: var(--grad-gold, #C9A24B);
    color: var(--color-ink, #12100B);
}
.tr-c-btn--primary:hover { filter: brightness(1.06); }
/* Sekundární = obrys ve světlé na tmavém pozadí (odmítnutí stejně viditelné
   jako přijetí — žádné dark patterns). */
.tr-c-btn--ghost {
    background: transparent;
    color: var(--text-dark-main, #F3EEE3);
    border-color: rgba(243, 238, 227, 0.35);
}
.tr-c-btn--ghost:hover { border-color: #F3EEE3; background: rgba(243, 238, 227, 0.08); }
/* Textový (Přizpůsobit) */
.tr-c-btn--link {
    background: transparent;
    color: var(--text-dark-muted, #A69C86);
    padding: 12px 8px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.tr-c-btn--link:hover { color: var(--text-dark-main, #F3EEE3); }

.tr-c-btn:focus-visible {
    outline: 2px solid var(--color-gold-hi, #E7C878);
    outline-offset: 2px;
}

/* ---- Modal předvoleb -------------------------------------------------- */
.tr-consent-modal {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md, 20px);
    background: rgba(18, 16, 11, 0.62);
    animation: tr-fade-in 0.2s ease both;
}
@keyframes tr-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tr-consent-modal { animation: none; } }

.tr-consent-modal__panel {
    background: var(--bg-surface, #FBF8F1);
    color: var(--text-main, #211E17);
    width: min(560px, 100%);
    max-height: min(86vh, 720px);
    overflow-y: auto;
    border-radius: var(--radius-card, 8px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
    padding: var(--space-lg, 32px);
}
.tr-consent-modal__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md, 16px);
    margin-bottom: var(--space-md, 16px);
}
.tr-consent-modal__title {
    font-family: var(--font-serif, Georgia, serif);
    font-size: clamp(20px, 1vw + 18px, 26px);
    margin: 0;
}
.tr-consent-modal__close {
    background: none; border: none; cursor: pointer;
    font-size: 26px; line-height: 1;
    color: var(--text-muted, #6E695C);
    padding: 4px 8px; border-radius: var(--radius-control, 4px);
}
.tr-consent-modal__close:hover { color: var(--text-main, #211E17); }
.tr-consent-modal__close:focus-visible { outline: 2px solid var(--color-gold-shadow); outline-offset: 2px; }
.tr-consent-modal__intro {
    font-size: var(--fs-base, 15px);
    line-height: 1.6;
    color: var(--text-muted, #6E695C);
    margin: 0 0 var(--space-md, 16px);
}

/* ---- Jedna kategorie (řádek s přepínačem) ---------------------------- */
.tr-cat {
    display: flex;
    gap: var(--space-md, 16px);
    padding: var(--space-md, 16px) 0;
    border-top: 1px solid var(--border-line, #E3DCCC);
}
.tr-cat__body { flex: 1 1 auto; }
.tr-cat__name {
    font-weight: 700;
    font-size: var(--fs-base, 15px);
    margin: 0 0 3px;
    color: var(--text-main, #211E17);
}
.tr-cat__desc {
    font-size: var(--fs-sm, 13px);
    line-height: 1.5;
    color: var(--text-muted, #6E695C);
    margin: 0;
}

/* Přepínač (switch) postavený na checkboxu */
.tr-switch { position: relative; flex: 0 0 auto; width: 46px; height: 26px; }
.tr-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tr-switch__track {
    position: absolute; inset: 0;
    background: #CFC7B4;
    border-radius: 999px;
    transition: background 0.18s ease;
    pointer-events: none;
}
.tr-switch__track::after {
    content: "";
    position: absolute; top: 3px; left: 3px;
    width: 20px; height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.18s ease;
}
.tr-switch input:checked + .tr-switch__track { background: var(--teal-dark-accent, #3E9E8E); }
.tr-switch input:checked + .tr-switch__track::after { transform: translateX(20px); }
.tr-switch input:focus-visible + .tr-switch__track { outline: 2px solid var(--color-gold-shadow); outline-offset: 2px; }
/* Vždy zapnutá kategorie (Nezbytné) */
.tr-switch input:disabled + .tr-switch__track { background: var(--teal-dark-accent, #3E9E8E); opacity: 0.55; cursor: not-allowed; }
.tr-switch input:disabled { cursor: not-allowed; }

.tr-consent-modal__actions {
    display: flex;
    gap: var(--space-sm, 10px);
    flex-wrap: wrap;
    margin-top: var(--space-lg, 24px);
    padding-top: var(--space-md, 16px);
    border-top: 1px solid var(--border-line, #E3DCCC);
}
/* V modalu jsou tlačítka na světlém pozadí → tmavá varianta ghost. */
.tr-consent-modal .tr-c-btn--ghost {
    color: var(--text-main, #211E17);
    border-color: var(--border-line, #C9C0AC);
}
.tr-consent-modal .tr-c-btn--ghost:hover { border-color: var(--text-main); background: rgba(0, 0, 0, 0.04); }
.tr-consent-modal__actions .tr-c-btn--primary { margin-left: auto; }

/* ---- Placeholder pro blokovaný externí obsah (mapa, video) ----------- */
.tr-embed-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm, 10px);
    text-align: center;
    height: 100%;
    min-height: 240px;
    padding: var(--space-lg, 32px);
    background: var(--bg-sunken, #ECE6D6);
    border: 1px dashed var(--border-line, #C9C0AC);
    border-radius: var(--radius-card, 8px);
    color: var(--text-muted, #6E695C);
}
.tr-embed-block__icon { color: var(--color-gold-shadow, #9C7A34); }
.tr-embed-block__title { font-weight: 700; color: var(--text-main, #211E17); margin: 0; font-size: var(--fs-base); }
.tr-embed-block__desc { font-size: var(--fs-sm, 13px); line-height: 1.5; margin: 0; max-width: 42ch; }
.tr-embed-block__actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.tr-embed-block .tr-c-btn--primary { color: var(--color-ink); }
.tr-embed-block .tr-c-btn--link { color: var(--color-gold-shadow); }
.tr-embed-block .tr-c-btn--link:hover { color: var(--text-main); }

/* „Cookie preferences" v patičce vypadá jako ostatní právní odkazy (jsou <a>) */
.legal-links .legal-link-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--fs-sm);
    color: #625B4D;
    transition: color var(--trans-fast, 0.15s ease);
}
.legal-links .legal-link-btn:hover { color: var(--color-gold-hi, #E7C878); }
.legal-links .legal-link-btn:focus-visible { outline: 2px solid var(--color-gold-shadow); outline-offset: 2px; }

/* Responsivita lišty na úzkých displejích */
@media (max-width: 640px) {
    .tr-consent__inner { flex-direction: column; align-items: stretch; gap: var(--space-md); }
    /* Ve sloupci se z flex-basis 380px stává VÝŠKA → obří mezera. Zpět na obsahovou výšku. */
    .tr-consent__text { flex: 0 0 auto; }
    .tr-consent__actions { justify-content: stretch; }
    .tr-consent__actions .tr-c-btn { flex: 1 1 auto; text-align: center; }
    .tr-consent__actions .tr-c-btn--link { flex-basis: 100%; }
    .tr-consent-modal__actions .tr-c-btn { flex: 1 1 auto; }
    .tr-consent-modal__actions .tr-c-btn--primary { margin-left: 0; }
}
