/**
 * Hrad Červený Újezd - Audio průvodce
 * Kompletní CSS bez ztráty původní logiky tříd
 */

/* ============================================
   1) PROMĚNNÉ - BARVY, ROZMĚRY, STÍNY
   ============================================ */

:root {
  --color-top-line: #27552f;

  --color-gold: #b89a57;
  --color-gold-light: #dfc68d;
  --color-gold-dark: #8f7642;

  --color-text: #6f6f6f;
  --color-text-dark: #3f3f3f;
  --color-text-light: #999999;
  --color-text-muted: #b7b7b7;

  --color-bg: #f1eee7;
  --color-bg-pattern: #ece7dc;
  --color-card: #ffffff;
  --color-card-soft: #faf8f3;

  --color-border: #e5ded2;
  --color-border-soft: #f0ece5;

  --color-danger: #8a1f17;
  --color-dark: #2d120b;

  --font-main: 'Open Sans', Arial, sans-serif;
  --font-heading: 'Open Sans Condensed', 'Arial Narrow', Arial, sans-serif;

  --radius: 0;
  --radius-lg: 0;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.08);

  --container-width: 1180px;
  --card-width: 760px;

  --header-logo-height: 82px;
  --button-radius: 999px;

  --primary: var(--color-gold);
  --primary-dark: var(--color-gold-dark);
  --accent: var(--color-gold);
  --accent-hover: var(--color-gold-dark);
  --text: var(--color-text);
  --text-light: var(--color-text-light);
  --text-muted: var(--color-text-muted);
  --bg: var(--color-bg);
  --bg-card: var(--color-card);
  --border: var(--color-border);
}

/* ============================================
   2) RESET A ZÁKLAD STRÁNKY
   ============================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background:
    linear-gradient(rgba(255,255,255,0.48), rgba(255,255,255,0.48)),
    linear-gradient(90deg, rgba(0,0,0,0.025) 1px, transparent 1px),
    linear-gradient(rgba(0,0,0,0.025) 1px, transparent 1px),
    var(--color-bg-pattern);
  background-size: auto, 32px 32px, 32px 32px, auto;
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  top: 0 !important;
  position: relative !important;
}

a {
  color: var(--color-gold);
  text-decoration: none;
}

a:hover {
  color: var(--color-gold-dark);
}

/* ============================================
   3) HEADER - LOGO, TITULEK, JAZYKY
   ============================================ */

header {
  top: 0;
  z-index: 100;
  background: #ffffff;
  color: var(--color-text);
  padding: 2rem 1rem 1.75rem;
  text-align: center;
  border-top: 5px solid var(--color-top-line);
  border-bottom: 1px solid var(--color-border-soft);
  box-shadow: none;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 1rem;
  text-align: center;
}

.logo-container img,
.logo-image {
  display: block;
  max-height: var(--header-logo-height);
  width: auto;
  margin: 0 auto;
  filter: none;
}

.gallery-title {
  display: block;
  width: 100%;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 300;
  line-height: 1.2;
  color: var(--color-gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
}

.subtitle {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.95rem;
  color: var(--color-text-light);
  font-weight: 400;
  margin: 0;
}

.language-switcher {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 1.35rem;
  text-align: center;
}

.flag-btn,
.guide-lang-btn {
  min-width: 86px;
  min-height: 42px;
  border: 1px solid var(--color-gold-light);
  background: #ffffff;
  color: var(--color-gold-dark);
  padding: 0.55rem 1.05rem;
  border-radius: var(--button-radius);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  appearance: none;
  transition: all 0.2s ease;
}

.flag-btn {
  min-width: 42px;
  width: 42px;
  height: 30px;
  padding: 0;
  font-size: 1.15rem;
}

.flag-btn:hover,
.guide-lang-btn:hover {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: #ffffff;
  transform: translateY(-1px);
}

.flag-btn.active,
.guide-lang-btn.active {
  background: #ffffff;
  color: var(--color-text-dark);
  border-color: var(--color-text-dark);
}

/* ============================================
   4) ÚVOD PROHLÍDKY
   ============================================ */

.tour-intro {
  background: #ffffff;
  color: var(--color-text);
  padding: 2.2rem 1.5rem;
  margin: 1.5rem auto;
  max-width: var(--card-width);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: none;
  border: 1px solid var(--color-border-soft);
}

.tour-intro h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 300;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  color: var(--color-gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tour-intro p {
  font-size: 1rem;
  color: var(--color-text);
  margin-bottom: 1.25rem;
}

/* ============================================
   5) TLAČÍTKA
   ============================================ */

.btn,
.btn-qr,
.btn-primary,
.btn-tts {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--color-gold);
  border-radius: var(--button-radius);
  background: var(--color-gold);
  color: #ffffff;
  padding: 0.72rem 1.45rem;
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  box-shadow: none;
  transition: all 0.2s ease;
}

.btn:hover,
.btn-qr:hover,
.btn-primary:hover,
.btn-tts:hover {
  background: var(--color-gold-dark);
  border-color: var(--color-gold-dark);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #8a8a8a;
  border-color: #8a8a8a;
  color: #ffffff;
}

.btn-secondary:hover {
  background: #6f6f6f;
  border-color: #6f6f6f;
}

.btn-tts:disabled {
  background: var(--color-text-muted);
  border-color: var(--color-text-muted);
  cursor: not-allowed;
  transform: none;
  opacity: 0.6;
}

.btn-tts-stop {
  background: #777777 !important;
  border-color: #777777 !important;
}

.btn-tts-stop:hover {
  background: #555555 !important;
  border-color: #555555 !important;
}

/* ============================================
   6) SEZNAM BODŮ
   ============================================ */

.exhibits-list {
  padding: 1.2rem 0.5rem 2.5rem;
  max-width: var(--container-width);
  margin: 0 auto;
}

/* ============================================
   7) KARTA EXPONÁTU
   ============================================ */

.exhibit-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: none;
  margin: 1.25rem auto 2rem;
  max-width: var(--card-width);
  transition: all 0.25s ease;
  border: 1px solid var(--color-border-soft);
}

.exhibit-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-header {
  background: #ffffff;
  padding: 1.1rem 1.35rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--color-border-soft);
}

.card-number {
  background: var(--color-gold);
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  flex-shrink: 0;
  box-shadow: none;
}

.card-title {
  color: var(--color-text-dark);
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 300;
  flex: 1;
  line-height: 1.25;
  margin: 0;
  letter-spacing: 0.03em;
}

/* ============================================
   8) OBRÁZEK KARTY
   ============================================ */

.card-image-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f4f1ea;
}

.card-image {
  display: block;
  width: 100%;
  height: 360px;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.exhibit-card:hover .card-image {
  transform: scale(1.02);
}

.card-audio-btn {
  position: absolute;
  bottom: 0.875rem;
  right: 0.875rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-gold);
  color: #ffffff;
  border: 1px solid var(--color-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.18);
  transition: all 0.2s ease;
  z-index: 2;
}

.card-audio-btn:hover {
  background: var(--color-gold-dark);
  border-color: var(--color-gold-dark);
  transform: scale(1.05);
}

.card-audio-btn i {
  margin-left: 2px;
}

/* ============================================
   9) OBSAH KARTY
   ============================================ */

.card-body {
  padding: 1.35rem;
  background: #ffffff;
}

.card-short-description {
  background: var(--color-card-soft);
  border-left: 4px solid var(--color-gold);
  border-radius: 0;
  padding: 0.95rem 1rem;
  margin-bottom: 1rem;
  color: var(--color-text);
  font-size: 0.96rem;
  line-height: 1.6;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.95rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--color-text-light);
  padding: 0.25rem 0;
}

.meta-item i {
  color: var(--color-gold);
  font-size: 0.95rem;
}

.card-body > span,
.badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: var(--color-card-soft);
  border-radius: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.meta-item.audio-available {
  color: var(--color-gold-dark);
  font-weight: 700;
}

.meta-item.audio-available i {
  color: var(--color-gold);
}

/* ============================================
   10) AUDIO SEKCE
   ============================================ */

.card-audio,
.audio-section {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--color-card-soft);
  border-radius: var(--radius);
  border: 1px solid var(--color-border-soft);
  box-shadow: none;
}

.audio-section {
  margin: 1.25rem auto;
  max-width: var(--card-width);
  padding: 1.35rem;
}

.audio-label,
.audio-section-title,
.audio-lang-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-gold-dark);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-audio audio,
.audio-player-container audio {
  width: 100%;
  height: 42px;
  border-radius: 0;
  outline: none;
}

.audio-player-container {
  background: #ffffff;
  padding: 1.2rem;
  border-radius: var(--radius);
  box-shadow: none;
  border: 1px solid var(--color-border-soft);
}

.audio-not-available {
  text-align: center;
  padding: 1rem;
  color: var(--color-text-muted);
  font-style: italic;
  font-size: 0.88rem;
}

.audio-loading {
  text-align: center;
  color: var(--color-text-light);
  padding: 0.875rem;
  font-size: 0.9rem;
}

/* ============================================
   11) TTS OVLÁDÁNÍ
   ============================================ */

.card-tts {
  text-align: center;
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  justify-content: center;
}

.tts-controls {
  display: flex;
  justify-content: center;
  gap: 0.875rem;
  margin: 1.5rem 1rem;
  flex-wrap: wrap;
}

/* ============================================
   12) DETAIL EXPONÁTU
   ============================================ */

.section-title {
  background: #ffffff;
  color: var(--color-text-dark);
  padding: 1.75rem 1rem;
  border-radius: var(--radius-lg);
  margin: 1.25rem auto;
  max-width: var(--card-width);
  text-align: center;
  box-shadow: none;
  border: 1px solid var(--color-border-soft);
}

.section-title h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 0.5rem;
  color: var(--color-gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-title p {
  color: var(--color-text-light);
  font-size: 0.95rem;
}

.exhibit-image-container {
  width: 100%;
  max-width: 820px;
  margin: 1.25rem auto;
  padding: 0 1rem;
}

.exhibit-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: none;
  display: block;
  margin: 0 auto;
  max-height: 560px;
  object-fit: contain;
  background: #f4f1ea;
  border: 1px solid var(--color-border-soft);
}

.detail-card .card-image {
  height: 360px;
}

.exhibit-meta {
  margin: 1rem auto;
  max-width: var(--card-width);
  padding: 0 1rem;
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.exhibit-meta .meta-item,
.exhibit-meta .badge {
  margin: 0;
}

/* ============================================
   13) NAVIGACE
   ============================================ */

.navigation {
  text-align: center;
  margin: 2rem 1rem 1.5rem;
}

/* ============================================
   14) PATIČKA
   ============================================ */

footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.86rem;
  color: #ffffff;
  border-top: none;
  margin-top: 2.5rem;
  background: var(--color-gold);
}

/* ============================================
   15) MODAL PRO QR ČTEČKU
   ============================================ */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal > div,
.modal-content {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

.modal h3,
.modal-title {
  margin-bottom: 1rem;
  color: var(--color-text-dark);
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal p,
.modal-help {
  margin-top: 1rem;
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.9rem;
}

.modal-footer {
  text-align: center;
  margin-top: 1rem;
}

#qr-reader,
.qr-reader {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}

/* ============================================
   16) FLOAT TLAČÍTKA - QR A NAHORU
   ============================================ */

.scroll-top,
.qr-float {
  position: fixed;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--color-gold);
  color: #ffffff;
  padding: 0;
  font-size: 1.1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 99999;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.3s ease;
}

.scroll-top {
  right: 20px;
  display: none;
  opacity: 0;
}

.scroll-top.is-visible {
  display: flex;
  opacity: 1;
}

.qr-float {
  left: 20px;
  display: flex;
}

.qr-float span {
  display: none;
}

.scroll-top:hover,
.qr-float:hover {
  background: var(--color-gold-dark);
}

.scroll-top:active,
.qr-float:active {
  transform: scale(0.92);
}

/* ============================================
   17) GOOGLE TRANSLATE SKRYTÍ
   ============================================ */

.goog-te-banner-frame,
iframe.goog-te-banner-frame,
.goog-te-gadget,
#google_translate_element,
.goog-te-ftab,
.skiptranslate {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
}

body.translated-ltr,
body.translated-rtl {
  top: 0 !important;
  margin-top: 0 !important;
}

/* ============================================
   18) ANIMACE
   ============================================ */

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.fa-spinner {
  animation: spin 1s linear infinite;
}

/* ============================================
   19) RESPONSIVE - MOBIL
   ============================================ */

@media (max-width: 640px) {
  header {
    padding: 1.5rem 0.85rem 1.35rem;
  }

  .logo-container img,
  .logo-image {
    max-height: 70px;
  }

  .gallery-title {
    font-size: 1.18rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .language-switcher {
    gap: 0.5rem;
    margin-top: 1.1rem;
  }

  .guide-lang-btn,
  .flag-btn {
    min-width: 76px;
    min-height: 38px;
    padding: 0.5rem 0.85rem;
    font-size: 0.86rem;
  }

  .tour-intro {
    padding: 1.5rem 1.15rem;
    margin: 0.85rem 0.5rem;
  }

  .tour-intro h2 {
    font-size: 1.45rem;
  }

  .exhibit-card {
    margin: 0.8rem 0.5rem 1.4rem;
  }

  .card-header {
    padding: 0.95rem 1rem;
  }

  .card-number {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }

  .card-title {
    font-size: 1.25rem;
  }

  .card-body {
    padding: 1rem;
  }

  .card-image,
  .detail-card .card-image {
    height: 340px;
  }

  .card-audio-btn {
    width: 46px;
    height: 46px;
    bottom: 0.75rem;
    right: 0.75rem;
  }

  .meta-item {
    font-size: 0.82rem;
  }

  .section-title {
    margin: 0.85rem 0.5rem;
    padding: 1.35rem 1rem;
  }

  .section-title h2 {
    font-size: 1.55rem;
  }

  .scroll-top,
  .qr-float {
    width: 46px;
    height: 46px;
    bottom: 16px;
  }

  .scroll-top {
    right: 16px;
  }

  .qr-float {
    left: 16px;
  }
}

/* ============================================
   20) RESPONSIVE - TABLET A DESKTOP
   ============================================ */

@media (min-width: 641px) {
  .exhibits-list {
    padding: 1.25rem 1rem 2.5rem;
  }

  .tour-intro {
    max-width: var(--card-width);
  }
}

@media (min-width: 1000px) {
  header {
    padding-top: 2.25rem;
    padding-bottom: 2rem;
  }

  .gallery-title {
    font-size: 1.6rem;
  }
}

/* ============================================
   21) PŘÍSTUPNOST
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

/* ============================================
   22) TISK
   ============================================ */

@media print {
  header,
  .language-switcher,
  .navigation,
  .btn,
  .btn-qr,
  .btn-tts,
  .card-audio,
  .audio-section,
  footer,
  .card-audio-btn,
  .scroll-top,
  .qr-float {
    display: none !important;
  }

  body {
    background: #ffffff !important;
  }

  .exhibit-card {
    box-shadow: none !important;
    border: 1px solid #cccccc !important;
    page-break-inside: avoid;
  }
}