/* ==========================================================================
   letiste.knihovny.cz — design tokens
   Brand red/gray lifted from the Knihovny.cz logo (#e5004b / #838480).
   Teal is MZK's own accent, reused here as the "travel" signature color.
   ========================================================================== */

:root {
  --red:        #e5004b;
  --red-dark:   #b8003c;
  --red-tint:   #fdeaf0;
  --teal:       #0ea5a0;
  --teal-tint:  #e4f7f6;
  --ink:        #17171e;
  --ink-soft:   #4a4a52;
  --gray:       #838480;
  --line:       #e7e7ea;
  --paper:      #ffffff;
  --paper-soft: #f6f6f8;

  --genre-beletrie-1: #e5004b; --genre-beletrie-2: #ff7a9a;
  --genre-scifi-1:    #4b2e83; --genre-scifi-2:    #8767c2;
  --genre-historie-1: #8a5a2b; --genre-historie-2: #d1a25f;
  --genre-cestopis-1: #0ea5a0; --genre-cestopis-2: #6fe0d6;
  --genre-naucna-1:   #1b1b23; --genre-naucna-2:   #545462;
  --genre-poezie-1:   #a3157a; --genre-poezie-2:   #ea77c4;

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --font-ui:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper-soft);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-logo { width: 168px; height: auto; flex-shrink: 0; display: block; }
.brand-tag {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}
.brand-tag-mark {
  color: var(--red);
  margin-right: 0.28em;
  font-weight: 700;
}
.header-lang-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--teal);
  background: var(--teal-tint);
  border-radius: 999px;
  padding: 5px 10px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .brand-tag { font-size: 15px; letter-spacing: 0.02em; }
  .brand-logo { width: 142px; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding: 56px 18px 8px;
  text-align: left;
  align-self: center;
  box-sizing: border-box;
}
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--red);
  margin: 0 0 8px;
}
.hero h1 {
  font-size: clamp(28px, 6vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  font-weight: 800;
}
.hero p {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 0 24px;
}

/* ==========================================================================
   Language tabs — echoes the search-tab pattern from knihovny.cz
   ========================================================================== */

.lang-tabs {
  display: inline-flex;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 8px;
}
.lang-tabs a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-tabs a .flag { font-size: 15px; }
.lang-tabs a.is-active {
  background: var(--red);
  color: #fff;
}
.lang-tabs a:not(.is-active):hover { background: var(--paper-soft); }

/* ==========================================================================
   Tip of the day — featured book above the catalogue
   ========================================================================== */

.tip-hero {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 18px 4px;
  box-sizing: border-box;
}
.tip-hero-inner {
  display: grid;
  grid-template-columns: 152px 1fr;
  gap: 24px;
  align-items: start;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 20px 22px;
  box-shadow: none;
}

.tip-hero-cover {
  width: 152px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--paper-soft);
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.tip-hero-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tip-hero-cover-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}
.tip-hero-body {
  min-width: 0;
}
.tip-hero-eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--red);
  background: var(--red-tint);
  border: 1px solid rgba(229, 0, 75, 0.18);
  border-radius: 999px;
  padding: 6px 13px;
}
.tip-hero-title {
  margin: 0 0 4px;
  font-size: clamp(20px, 4vw, 26px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.tip-hero-author {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--ink-soft);
}
.tip-hero-annotation {
  margin: 0 0 14px;
  max-width: 62ch;
}
.tip-hero-annotation-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.tip-hero-annotation-text.is-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.tip-hero-annotation-toggle {
  appearance: none;
  border: 0;
  background: none;
  padding: 6px 0 0;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tip-hero-annotation-toggle:hover {
  color: var(--red-dark);
}
.tip-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.tip-hero-cta {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: var(--radius-s);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s ease;
}
.tip-hero-cta:hover {
  background: #2a2a34;
  color: #fff;
}
.tip-hero-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 560px) {
  .tip-hero-inner {
    grid-template-columns: 104px 1fr;
    gap: 16px;
    padding: 16px;
  }
  .tip-hero-cover { width: 104px; }
}

/* ==========================================================================
   Genre filter tags
   ========================================================================== */

.genre-filters {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 18px 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  box-sizing: border-box;
}
.genre-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.genre-tag:hover {
  border-color: var(--gray);
  color: var(--ink);
}
.genre-tag.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.genre-tag--beletrie.is-active { background: var(--genre-beletrie-1); border-color: var(--genre-beletrie-1); }
.genre-tag--scifi.is-active { background: var(--genre-scifi-1); border-color: var(--genre-scifi-1); }
.genre-tag--historie.is-active { background: var(--genre-historie-1); border-color: var(--genre-historie-1); }
.genre-tag--cestopis.is-active { background: var(--genre-cestopis-1); border-color: var(--genre-cestopis-1); }
.genre-tag--naucna.is-active { background: var(--genre-naucna-1); border-color: var(--genre-naucna-1); }
.genre-tag--poezie.is-active { background: var(--genre-poezie-1); border-color: var(--genre-poezie-1); }

.catalog-toolbar {
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding: 20px 18px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 16px;
  align-self: center;
  box-sizing: border-box;
}
.result-count {
  grid-column: 2;
  justify-self: center;
  margin: 0;
  font-size: 13px;
  color: var(--gray);
  text-align: center;
  white-space: nowrap;
}
.sort-bar {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
@media (max-width: 560px) {
  .catalog-toolbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
    row-gap: 12px;
  }
  .result-count,
  .sort-bar {
    grid-column: 1;
    justify-self: stretch;
  }
  .sort-bar {
    justify-content: space-between;
  }
  .sort-bar select {
    flex: 1 1 auto;
    min-width: 0;
  }
}
.sort-bar label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
  white-space: nowrap;
}
.sort-bar select {
  appearance: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23838480' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 8px 34px 8px 12px;
  cursor: pointer;
}
.sort-bar select:hover,
.sort-bar select:focus-visible {
  border-color: var(--gray);
}

/* ==========================================================================
   Book grid + boarding-pass style cover cards
   ========================================================================== */

.book-grid {
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding: 14px 18px 56px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
  align-self: center;
  box-sizing: border-box;
}
@media (min-width: 640px) {
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 22px; }
}

.book-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(23,23,30,0.06);
  border: 1px solid var(--line);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.book-card.is-hidden { display: none; }
.book-card:hover,
.book-card:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(23,23,30,0.12);
}
.book-card-link {
  display: block;
  color: inherit;
  flex: 1 1 auto;
}
.book-card-link:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
}

.cover {
  position: relative;
  aspect-ratio: 2 / 3;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  overflow: hidden;
}
.cover::after {
  /* subtle diagonal sheen so flat gradients don't look too flat */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0) 45%);
  pointer-events: none;
}
.cover.has-image {
  padding: 0;
}
.cover.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cover.has-image .cover-fallback-text {
  display: none;
}
.cover:not(.has-image) .cover-genre-tag {
  display: none;
}
.cover-fallback-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 1;
}
.cover-genre-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: rgba(23,23,30,0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}
.cover-genre {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  z-index: 1;
}
.cover-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.18;
  z-index: 1;
  text-shadow: 0 1px 8px rgba(0,0,0,0.12);
}

.genre-beletrie { background: linear-gradient(160deg, var(--genre-beletrie-1), var(--genre-beletrie-2)); }
.genre-scifi    { background: linear-gradient(160deg, var(--genre-scifi-1), var(--genre-scifi-2)); }
.genre-historie { background: linear-gradient(160deg, var(--genre-historie-1), var(--genre-historie-2)); }
.genre-cestopis { background: linear-gradient(160deg, var(--genre-cestopis-1), var(--genre-cestopis-2)); }
.genre-naucna   { background: linear-gradient(160deg, var(--genre-naucna-1), var(--genre-naucna-2)); }
.genre-poezie   { background: linear-gradient(160deg, var(--genre-poezie-1), var(--genre-poezie-2)); }

.book-meta {
  padding: 10px 12px 0;
}
.book-meta .title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-meta .author {
  font-size: 12.5px;
  color: var(--gray);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-card > .formats {
  margin-top: 10px;
  padding: 0 12px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fmt-chip {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 10px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
a.fmt-chip:hover,
a.fmt-chip:focus-visible {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}
a.fmt-chip:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.load-more-wrap {
  max-width: 1100px;
  margin: -28px auto 40px;
  padding: 0 18px;
  display: flex;
  justify-content: center;
}
.load-more-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 22px;
  min-height: 52px;
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.load-more-btn:hover,
.load-more-btn:focus-visible {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.load-more-btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.no-more {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Knihovny.cz portal promo
   ========================================================================== */

.portal-promo {
  max-width: 1100px;
  margin: 8px auto 48px;
  padding: 0 18px;
}
.portal-promo-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: center;
  overflow: hidden;
  border-radius: var(--radius-l);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(229,0,75,0.28), transparent 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(14,165,160,0.22), transparent 50%),
    linear-gradient(145deg, #1a1a24 0%, #12121a 55%, #0e0e14 100%);
  color: #fff;
  padding: 36px 34px;
}
.portal-promo-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 18px,
      rgba(255,255,255,0.015) 18px,
      rgba(255,255,255,0.015) 19px
    );
  pointer-events: none;
}
.portal-promo-copy,
.portal-promo-board {
  position: relative;
  z-index: 1;
}
.portal-promo-eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #ff7a9a;
}
.portal-promo-copy h2 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.portal-promo-lead {
  margin: 0 0 18px;
  max-width: 36em;
  font-size: 16px;
  line-height: 1.55;
  color: #c8c8ce;
}
.portal-promo-pills {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.portal-promo-pills li {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  padding: 7px 12px;
}
.portal-promo-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: var(--radius-s);
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.portal-promo-cta:hover {
  background: var(--red-dark);
  transform: translateX(2px);
}
.portal-promo-cta svg {
  transition: transform 0.15s ease;
}
.portal-promo-cta:hover svg {
  transform: translateX(3px);
}

.portal-promo-board {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-m);
  padding: 14px;
  backdrop-filter: blur(4px);
}
.portal-board-row {
  display: grid;
  grid-template-columns: 36px 1fr 40px auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: #b8b8c0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  animation: boardPulse 4.8s ease-in-out infinite;
}
.portal-board-row:nth-child(2) { animation-delay: 0.4s; }
.portal-board-row:nth-child(3) { animation-delay: 0.8s; }
.portal-board-row:nth-child(4) { animation-delay: 1.2s; }
.portal-board-row.is-accent {
  background: rgba(229,0,75,0.18);
  color: #fff;
  border: 1px solid rgba(229,0,75,0.35);
}
.board-code { color: #7fe0da; }
.board-dest { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-gate { text-align: center; color: #9c9ca4; }
.board-status {
  justify-self: end;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
}
.board-status.is-go {
  background: rgba(14,165,160,0.22);
  color: #6fe0d6;
}
.board-status.is-now {
  background: var(--red);
  color: #fff;
  animation: statusBlink 1.6s ease-in-out infinite;
}

@keyframes boardPulse {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}
@keyframes statusBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@media (max-width: 780px) {
  .portal-promo-inner {
    grid-template-columns: 1fr;
    padding: 28px 22px;
    gap: 22px;
  }
}
@media (max-width: 480px) {
  .portal-board-row {
    grid-template-columns: 32px 1fr auto;
    gap: 8px;
  }
  .board-gate { display: none; }
  .portal-promo-lead { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-board-row,
  .board-status.is-now { animation: none; }
  .portal-promo-cta:hover,
  .portal-promo-cta:hover svg { transform: none; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--ink);
  color: #c8c8ce;
  padding: 30px 18px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-logo { width: 158px; height: auto; display: block; filter: brightness(0) invert(1); opacity: 0.9; margin-bottom: 8px; }
.footer-brand p { margin: 0; font-size: 12.5px; color: #9c9ca4; }

.footer-partners {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
@media (min-width: 640px) {
  .footer-partners { align-items: flex-end; }
}
.footer-partners-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a7a82;
}
.footer-partners-logos {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.partner-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 168px;
  height: 64px;
  padding: 0 12px;
  background: #fff;
  border-radius: 8px;
  line-height: 0;
  box-sizing: border-box;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.partner-link:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.partner-logo {
  width: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
}
.partner-logo--mzk { height: 32px; }
.partner-logo--mlp { height: 54px; max-width: 100%; }
  .partner-logo--brno { height: 40px; }
.partner-logo--prg { height: 34px; max-width: 148px; }
@media (max-width: 640px) {
  .footer-partners-logos { gap: 8px; }
  .partner-link {
    width: 140px;
    height: 56px;
    padding: 0 10px;
  }
  .partner-logo--mzk { height: 28px; }
  .partner-logo--mlp { height: 48px; }
  .partner-logo--brno { height: 34px; }
  .partner-logo--prg { height: 28px; max-width: 124px; }
}

/* ==========================================================================
   Book detail page — boarding pass
   ========================================================================== */

.detail-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 26px 18px 60px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.back-link:hover { color: var(--red); }

.boarding-pass {
  background: var(--paper);
  border-radius: var(--radius-l);
  box-shadow: 0 20px 44px rgba(23,23,30,0.14);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .boarding-pass { grid-template-columns: 260px 1fr; }
}

.pass-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-height: 260px;
  color: #fff;
}
.pass-aside.has-image {
  background: linear-gradient(160deg, var(--red), var(--red-dark));
}
.pass-cover {
  position: relative;
  color: #fff;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1 1 auto;
  min-height: 200px;
  background: transparent;
}
.pass-cover::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.18), rgba(255,255,255,0) 50%);
  pointer-events: none;
}
.pass-cover.has-image {
  padding: 0;
  flex: 0 0 auto;
  min-height: 0;
  justify-content: flex-start;
  overflow: hidden;
}
.pass-cover.has-image::after {
  display: block;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.12) 100%);
  z-index: 1;
  pointer-events: none;
}
.pass-cover.has-image img {
  position: relative;
  inset: auto;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: center top;
  display: block;
  flex-shrink: 0;
  z-index: 0;
}
@media (max-width: 719px) {
  .pass-cover.has-image img {
    max-height: min(520px, 70vh);
    width: 100%;
    margin: 0 auto;
  }
}
.pass-portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: auto 14px 16px;
  padding: 11px 14px;
  border-radius: var(--radius-s);
  background: rgba(255,255,255,0.96);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  line-height: 1.25;
  box-shadow: 0 6px 16px rgba(23,23,30,0.16);
  transition: transform 0.15s ease, background 0.15s ease;
  position: relative;
  z-index: 2;
}
.pass-portal-btn:hover,
.pass-portal-btn:focus-visible {
  background: #fff;
  transform: translateY(-1px);
  color: var(--red);
}
.pass-portal-btn svg {
  flex-shrink: 0;
}
.pass-cover-fallback {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 1;
}
.pass-cover.has-image .pass-cover-fallback {
  display: none;
}
.pass-cover:not(.has-image) .pass-eyebrow.over-image {
  display: none;
}
.pass-eyebrow.over-image {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 1;
  background: rgba(23,23,30,0.5);
  padding: 5px 10px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}
.pass-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.85;
  z-index: 1;
}
.pass-cover-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.12;
  z-index: 1;
  text-shadow: 0 1px 10px rgba(0,0,0,0.14);
}
.pass-cover-genre {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
  z-index: 1;
}

.pass-body {
  padding: 26px 24px 24px;
  position: relative;
}
.pass-body::before {
  /* perforation, desktop: vertical line on the left edge */
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 0;
  border-left: 2px dashed var(--line);
  display: none;
}
@media (min-width: 720px) {
  .pass-body::before { display: block; }
}

.pass-title-row h1 {
  font-size: clamp(22px, 4vw, 28px);
  line-height: 1.15;
  margin: 0 0 4px;
  font-weight: 800;
}
.pass-author {
  font-size: 15px;
  color: var(--gray);
  margin: 0 0 18px;
}

.pass-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.pass-stat .label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray);
  margin: 0 0 3px;
}
.pass-stat .value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.pass-about h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 8px;
}
.pass-about p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 22px;
}

.pass-downloads h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 10px;
}
.download-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.download-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-s);
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  transition: background 0.15s ease, transform 0.1s ease;
}
.download-btn:hover { background: var(--red-dark); }
.download-btn:active { transform: scale(0.99); }
.download-btn .fmt {
  display: flex;
  align-items: center;
  gap: 10px;
}
.download-btn .fmt-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.22);
  border-radius: 5px;
  padding: 3px 7px;
  letter-spacing: 0.03em;
}
.download-btn .fmt-size {
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0.85;
}
.download-btn svg { flex-shrink: 0; }

/* ==========================================================================
   Simple states — 404, download landing
   ========================================================================== */

.state-page {
  max-width: 560px;
  margin: 60px auto;
  padding: 0 20px;
  text-align: center;
}
.state-page h1 { font-size: 22px; margin: 14px 0 8px; }
.state-page p { color: var(--gray); font-size: 15px; line-height: 1.55; }
.state-page .icon {
  width: 56px; height: 56px; margin: 0 auto;
  border-radius: 50%;
  background: var(--teal-tint);
  display: flex; align-items: center; justify-content: center;
  color: var(--teal);
}
.state-page .back-link { display: inline-flex; margin-top: 18px; }

/* ==========================================================================
   Statistics
   ========================================================================== */

.stats-page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 18px 72px;
  box-sizing: border-box;
}
.stats-head h1 {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  font-weight: 800;
}
.stats-head p {
  margin: 0;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.5;
}
.stats-head .lang-tabs { margin-top: 22px; }
.stats-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}
.stats-kpi {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 16px 18px 14px;
  border-top: 3px solid var(--red);
  min-width: 0;
}
.stats-kpi--brq { border-top-color: var(--teal); }
.stats-kpi--prg { border-top-color: #123a5c; }
.stats-kpi-label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.stats-kpi-hint {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--gray);
  line-height: 1.35;
}
.stats-kpi-value {
  margin: 14px 0 0;
  font-family: var(--font-mono);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stats-kpi-share {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.stats-share {
  display: flex;
  height: 10px;
  margin-top: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line);
}
.stats-share-brq { background: var(--teal); height: 100%; }
.stats-share-prg { background: #123a5c; height: 100%; }
.stats-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--ink-soft);
}
.stats-legend li { display: flex; align-items: center; gap: 7px; }
.stats-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}
.stats-swatch--brq { background: var(--teal); }
.stats-swatch--prg { background: #123a5c; }

.stats-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 18px 18px 16px;
  margin-top: 12px;
  min-width: 0;
}
.stats-card h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.stats-trend {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.stats-note {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.stats-chart-scroll {
  overflow-x: auto;
  margin-top: 16px;
  padding-bottom: 4px;
}
.stats-chart {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 560px;
  height: 196px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stats-chart-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stats-chart-plot {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}
.stats-chart-stack {
  width: min(100%, 22px);
  display: flex;
  flex-direction: column-reverse;
  border-radius: 5px 5px 2px 2px;
  overflow: hidden;
}
.stats-bar { display: block; width: 100%; }
.stats-bar--brq { background: var(--teal); }
.stats-bar--prg { background: #123a5c; }
.stats-chart-label {
  margin-top: 8px;
  font-size: 11px;
  color: var(--gray);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stats-chart-col.is-current .stats-chart-label {
  color: var(--ink);
  font-weight: 700;
}
.stats-chart.is-empty {
  height: 48px;
}

.stats-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.8fr);
  gap: 12px;
  align-items: start;
}
.stats-columns .stats-card { margin-top: 0; }
.stats-columns { margin-top: 12px; }

.stats-top {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}
.stats-top li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.stats-top-rank {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--gray);
}
.stats-top-title {
  display: inline;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.35;
}
a.stats-top-title:hover { color: var(--red); }
.stats-lang {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--teal);
  background: var(--teal-tint);
  border-radius: 999px;
  padding: 2px 6px;
  vertical-align: 1px;
}
.stats-top-author {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.stats-top-meter {
  display: block;
  height: 4px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--paper-soft);
  overflow: hidden;
}
.stats-top-meter span {
  display: block;
  height: 100%;
  background: var(--red);
  border-radius: inherit;
}
.stats-top-count {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.stats-more {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
}
.stats-more strong {
  font-family: var(--font-mono);
  color: var(--ink);
  font-weight: 700;
}

.stats-formats { list-style: none; margin: 16px 0 0; padding: 0; }
.stats-formats li + li { margin-top: 14px; }
.stats-format-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.stats-format-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.stats-format-count {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stats-meter {
  height: 8px;
  border-radius: 999px;
  background: var(--paper-soft);
  overflow: hidden;
}
.stats-meter span {
  display: block;
  height: 100%;
  background: #123a5c;
  border-radius: inherit;
}
.stats-formats li:nth-child(1) .stats-meter span { background: var(--red); }
.stats-formats li:nth-child(2) .stats-meter span { background: var(--teal); }
.stats-formats li:nth-child(3) .stats-meter span { background: #123a5c; }
.stats-empty {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

@media (max-width: 800px) {
  .stats-kpis,
  .stats-columns { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .stats-page { padding-top: 28px; }
  .stats-kpi-value { font-size: 30px; }
}
