*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #071016;
  --text: #f7fbff;
  --muted: #bed0dc;
  --sun: #ffc24a;
  --aqua: #44d6c6;
  --bar-offset: clamp(12px, 2vw, 22px);
}

html {
  min-height: 100%;
  /* Mobilní prohlížeče (iOS Safari naležato) jinak samy zvětšují písmo u osamocených krátkých bloků. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Baloo 2', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 23% 25%, rgba(255, 194, 74, 0.2), transparent 27rem),
    radial-gradient(circle at 78% 72%, rgba(68, 214, 198, 0.16), transparent 24rem),
    linear-gradient(145deg, #071016 0%, #0d1f27 52%, #131719 100%);
}

/* Plovoucí lišty: navigace vlevo nahoře, jazyk vpravo dole, stejné odsazení od krajů. */
.language-toggle,
.site-nav,
.top-action {
  position: fixed;
  z-index: 20;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(7, 16, 22, 0.72);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
}

.site-nav,
.top-action {
  top: var(--bar-offset);
}

.language-toggle {
  right: var(--bar-offset);
  bottom: calc(var(--bar-offset) + env(safe-area-inset-bottom, 0px));
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  padding: 3px;
}

.language-toggle button {
  min-width: 42px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: rgba(247, 251, 255, 0.72);
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.language-toggle button[aria-pressed="true"] {
  color: #1b1205;
  background: var(--sun);
}

.site-nav {
  left: var(--bar-offset);
  max-width: calc(100vw - 2 * var(--bar-offset) - 104px);
  padding: 3px;
}

.site-nav ol {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-nav li:last-child {
  flex-shrink: 1;
  min-width: 0;
}

.site-nav li + li::before {
  content: '›';
  padding: 0 2px;
  color: rgba(247, 251, 255, 0.4);
  font-weight: 800;
}

.site-nav a,
.site-nav [aria-current="page"] {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.site-nav a {
  flex-shrink: 0;
  color: rgba(247, 251, 255, 0.72);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.site-nav [aria-current="page"] {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 34px;
  color: #1b1205;
  background: var(--sun);
}

.site-nav .crumb-home {
  width: 38px;
  padding: 0;
  justify-content: center;
}

.site-nav .crumb-home svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.subpage {
  position: relative;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: calc(var(--bar-offset) + 40px + clamp(28px, 6vw, 64px)) 20px calc(var(--bar-offset) + 40px + clamp(24px, 4vw, 40px));
}

.subpage-heading {
  margin: 0;
  color: var(--sun);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  font-weight: 800;
}

.subpage-lead {
  margin: 14px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.35;
  font-weight: 500;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 14px;
  margin-top: clamp(24px, 4vw, 38px);
}

.catalog-card {
  position: relative;
  min-height: 190px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 194, 74, 0.17);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.045));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

a.catalog-card:hover,
a.catalog-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(255, 194, 74, 0.36);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.24), 0 0 24px rgba(255, 194, 74, 0.1);
}

.catalog-card .card-index {
  color: rgba(255, 194, 74, 0.72);
  font-size: 0.92rem;
  font-weight: 700;
}

.catalog-card h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  line-height: 1.08;
  font-weight: 700;
}

.catalog-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 500;
}

.catalog-card .card-arrow {
  justify-self: end;
  color: var(--sun);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.catalog-card.is-soon {
  cursor: default;
  opacity: 0.55;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.18);
}

.catalog-card .card-badge {
  justify-self: end;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.empty-panel {
  margin-top: clamp(24px, 4vw, 38px);
  padding: clamp(24px, 5vw, 48px);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 520px) {
  .language-toggle button {
    min-width: 38px;
    min-height: 32px;
  }

  /* Na mobilu se aktuální stránka nezobrazuje (je v nadpisu), zůstávají jen nadřazené úrovně. */
  .site-nav {
    max-width: calc(100vw - 2 * var(--bar-offset));
  }

  .site-nav ol {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav ol::-webkit-scrollbar {
    display: none;
  }

  .site-nav li:last-child {
    display: none;
  }

  .site-nav a {
    min-height: 32px;
    padding: 0 8px;
    font-size: 0.85rem;
  }

  .site-nav .crumb-home {
    width: 34px;
    padding: 0;
  }

  .catalog-grid {
    gap: 10px;
  }

  .catalog-card {
    min-height: 150px;
    padding: 14px;
  }
}
