/* ============================================================
   TECHNIKY LEZENÍ – Page styles
   ============================================================ */

/* ── Sticky toolbar ──────────────────────────────────────── */
.techniky-toolbar {
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
  background: color-mix(in srgb, var(--c-accent) 7%, var(--c-bg));
  border-bottom: 1px solid color-mix(in srgb, var(--c-accent) 18%, var(--c-border));
  padding-block: var(--s-3);
  box-shadow: 0 2px 12px rgba(12,17,24,0.06);
}

.techniky-toolbar .container {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

/* ── Toolbar row 1: search + filter toggle ───────────── */
.techniky-toolbar__row1 {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

/* ── Search input ────────────────────────────────────────── */
.techniky-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}

.techniky-search__icon {
  position: absolute;
  left: var(--s-4);
  color: var(--c-muted);
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
}

.techniky-search__input {
  width: 100%;
  height: 44px;
  padding: 0 var(--s-10) 0 calc(var(--s-4) + 1.25rem + var(--s-2));
  border: 1.5px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-white);
  color: var(--c-text);
  font-size: 0.925rem;
  line-height: 1;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

.techniky-search__input::placeholder { color: var(--c-muted); }

.techniky-search__input:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(217,119,6,0.12);
}

/* Chrome/Safari X button removal */
.techniky-search__input::-webkit-search-cancel-button { display: none; }

.techniky-search__clear {
  position: absolute;
  right: var(--s-3);
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-bg-warm);
  color: var(--c-muted);
  font-size: 0.75rem;
  transition: background var(--t-fast), color var(--t-fast);
  cursor: pointer;
  border: none;
  flex-shrink: 0;
}

.techniky-search__clear:hover { background: var(--c-bg-warmer); color: var(--c-text); }
.techniky-search--has-value .techniky-search__clear { display: flex; }

/* ── Alphabet nav ────────────────────────────────────────── */
.techniky-alpha {
  display: flex;
  align-items: center;
  gap: 1px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.techniky-alpha::-webkit-scrollbar { display: none; }

.techniky-alpha__letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--f-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-muted);
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast), opacity var(--t-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.techniky-alpha__letter:hover {
  background: var(--c-bg-warm);
  color: var(--c-text);
}

.techniky-alpha__letter.is-active {
  background: var(--c-accent);
  color: #fff;
}

.techniky-alpha__letter.is-letter-hidden {
  opacity: 0.22;
  pointer-events: none;
}

/* ── Content area ────────────────────────────────────────── */
.techniky-content {
  padding-bottom: var(--s-24);
}

.techniky-count {
  padding-top: var(--s-6);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: var(--s-2);
}

/* ── Letter groups ───────────────────────────────────────── */
.techniky-group { margin-bottom: var(--s-2); }
.techniky-group.is-hidden { display: none; }

.techniky-group__letter-row {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  padding-top: var(--s-10);
  margin-bottom: var(--s-2);
}

.techniky-group__letter-row::after {
  content: '';
  flex: 1;
  border-top: 2px dotted color-mix(in srgb, var(--c-border) 100%, #000 30%);
}

.techniky-group__letter {
  font-family: var(--f-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  color: var(--c-accent);
  line-height: 1;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  user-select: none;
}

/* ── Technique item (accordion) ──────────────────────────── */
.techniky-item {
  border-bottom: 1px solid var(--c-border);
}
.techniky-item__caret {
  display: inline;
  font-size: 0.75em;
  vertical-align: middle;
  color: var(--c-muted);
  opacity: 0.45;
  transition: opacity var(--t-fast), color var(--t-fast);
}
.techniky-item__header:hover .techniky-item__caret {
  opacity: 0.85;
  color: var(--c-accent);
}
.techniky-item:nth-child(odd) {
  background: rgba(0, 0, 0, 0.03);
}

.techniky-item.is-hidden { display: none; }

.techniky-item__header {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  width: 100%;
  padding: var(--s-4) 0 var(--s-4) var(--s-1);
  text-align: left;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--c-text);
  transition: color var(--t-fast);
  min-height: 56px;
}

.techniky-item__header:hover { color: var(--c-accent); }

.techniky-item__name {
  flex: 1;
  font-family: var(--f-display);
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  font-weight: 400;
  line-height: 1.3;
}

.techniky-item__vid-count {
  font-size: 0.78em;
  font-weight: 300;
  color: var(--c-muted);
  font-family: var(--f-display);
  letter-spacing: 0.01em;
}

.techniky-item__caret {
  color: var(--c-muted);
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: transform var(--t-base), color var(--t-fast);
}

.techniky-item.is-open .techniky-item__caret {
  transform: rotate(180deg);
  color: var(--c-accent);
}

/* ── Accordion body ──────────────────────────────────────── */
.techniky-item__body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.42s cubic-bezier(0.4, 0, 0.2, 1),
              overflow 0s linear;   /* instantly hidden on close */
}

.techniky-item.is-open .techniky-item__body {
  max-height: 2400px;
  overflow: visible;
  /* delay overflow:visible until after max-height animation completes */
  transition: max-height 0.42s cubic-bezier(0.4, 0, 0.2, 1),
              overflow 0s linear 0.42s;
}


/* ── Inline reel (light grid inside accordion) ─────────── */
.techniky-reel {
  position: relative;
  /* Explicitly override the dark background inherited from .insta-reel */
  background: transparent;
  color: var(--c-text);
}

/* Kill the dark grid pattern from both .insta-reel and .techniky-reel */
.techniky-reel::before { display: none; }

/* Override .insta-reel { overflow: hidden } so card border-radius corners aren't clipped */
.techniky-reel { overflow: visible; }

.techniky-reel__inner {
  position: relative;
  padding: var(--s-4) 0 var(--s-5);
}

/* Grid track: 4 columns on desktop, row flow */
.techniky-reel .insta-reel__track {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
  overflow: visible; /* both axes visible — prevents mobile compositing boundary clip */
  scroll-snap-type: none;
  padding: 0;
  scrollbar-width: auto;
}

.techniky-reel .insta-reel__track:empty { display: none; }

/* Cards: light appearance */
.techniky-reel .insta-reel__card {
  border-color: var(--c-border);
  background: var(--c-bg-warm);
  box-shadow: var(--shadow-sm);
}

.techniky-reel .insta-reel__card:hover {
  border-color: var(--c-border);
  background: var(--c-bg-warm);
  transform: none;
}

/* Blur thumbnails — gives a "click to play" cue */
.techniky-reel .insta-reel__media-button img {
  filter: blur(2px);
  transform: scale(1.03);
}

/* Play/pause icon: always visible, dark circle style */
.techniky-reel .insta-reel__play {
  opacity: 1;
  transition: opacity var(--t-fast), transform var(--t-base), background var(--t-base);
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  width: 72px;
  height: 72px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.techniky-reel .insta-reel__play i {
  font-size: 1.6rem;
  margin-left: 4px; /* optical offset for play triangle */
}

.techniky-reel .insta-reel__media-button:hover .insta-reel__play {
  background: rgba(0, 0, 0, 0.75);
}

/* When playing: override reel.css display:none; expand circle → pill row, drop to bottom */
.techniky-reel .insta-reel__card.is-playing .insta-reel__play {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 1;
  width: auto;
  height: 40px;
  border-radius: 20px;
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  top: auto;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 3;
}

/* Speed buttons — hidden until playing */
.techniky-reel__speed-btn {
  display: none;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  font-family: var(--f-body);
  line-height: 1;
  color: #fff;
  user-select: none;
  flex-shrink: 0;
}

.techniky-reel .insta-reel__card.is-playing .techniky-reel__speed-btn {
  display: block;
}

/* Shrink icon slightly inside the pill */
.techniky-reel .insta-reel__card.is-playing .insta-reel__play i {
  font-size: 1rem;
  margin-left: 1px;
}

/* Portrait ratio matching the video content; light card background */
.techniky-reel .insta-reel__media-button {
  aspect-ratio: 9 / 16;
  background: var(--c-bg-warm);
}

/* Hide date badge, caption, and card body */
.techniky-reel .insta-reel__badge { display: none; }
.techniky-reel .insta-reel__body  { display: none; }

/* Status: light colours */
.techniky-reel .insta-reel__status {
  min-height: 6rem;
  font-size: 0.875rem;
  border-color: var(--c-border);
  background: var(--c-bg-warm);
  color: var(--c-muted);
}

/* Expanded panel: centred, light background, no info section */
.techniky-reel .insta-reel__expanded {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
  margin-bottom: var(--s-4);
  padding: var(--s-4);
  background: var(--c-bg-warm);
  border: 1px solid var(--c-border);
  border-radius: 10px;
}

.techniky-reel .insta-reel__expanded[hidden] { display: none; }

.techniky-reel .insta-reel__expanded-info { display: none; }

.techniky-reel .insta-reel__expanded-player {
  flex-shrink: 0;
  width: 160px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  position: relative;
}

.techniky-reel .insta-reel__expanded-player video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
}

/* Empty placeholder cards — ghost boxes to fill the grid row */
.techniky-reel .insta-reel__card--empty {
  aspect-ratio: 9 / 16;
  border: 2px dashed color-mix(in srgb, var(--c-border) 90%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--c-bg) 60%, var(--c-bg-warm));
  pointer-events: none;
  overflow: visible;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.techniky-reel .insta-reel__card--empty i {
  font-size: 1.75rem;
  color: var(--c-muted);
  opacity: 0.35;
}

/* ── Inside desktop detail modal: dark card appearance ─────── */
.tech-detail-modal__reel .techniky-reel .insta-reel__card {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: none;
}
.tech-detail-modal__reel .techniky-reel .insta-reel__card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
}
.tech-detail-modal__reel .techniky-reel .insta-reel__media-button {
  background: rgba(255, 255, 255, 0.03);
}
.tech-detail-modal__reel .techniky-reel .insta-reel__card--empty {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}
.tech-detail-modal__reel .techniky-reel .insta-reel__card--empty i {
  color: rgba(255, 255, 255, 0.22);
  opacity: 1;
}
.tech-detail-modal__reel .techniky-reel .insta-reel__status {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.38);
  border-color: transparent;
  border-radius: 12px;
}

/* Hide footer (Sledovat na Instagramu) */
.techniky-reel__footer { display: none; }

/* ── No results ──────────────────────────────────────────── */
.techniky-empty {
  padding: var(--s-20) 0 var(--s-12);
  text-align: center;
  color: var(--c-muted);
}

.techniky-empty i {
  font-size: 2.5rem;
  opacity: 0.35;
  display: block;
  margin-bottom: var(--s-4);
}

.techniky-empty p {
  font-size: 0.95rem;
  margin-bottom: var(--s-5);
}

.techniky-empty__reset {
  display: inline-flex;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .techniky-reel__inner {
    /* 4px side buffer so outer card border-radius isn't at the exact clipping boundary */
    padding: var(--s-3) 4px var(--s-4);
  }

  .techniky-reel .insta-reel__track {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-2);
    /* Cancel reel.css full-bleed negative margin — techniky grid must stay inside the container */
    margin-inline: 0;
    padding-inline: 0;
    scroll-padding-inline: 0;
    overflow-x: visible;
    scrollbar-width: none;
  }

  /* Smaller dark play button on mobile */
  .techniky-reel .insta-reel__play {
    width: 52px;
    height: 52px;
    background: rgba(0, 0, 0, 0.58);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  }
  .techniky-reel .insta-reel__play i {
    font-size: 1.2rem;
    margin-left: 3px;
  }
  /* Playing state: pill override for mobile */
  .techniky-reel .insta-reel__card.is-playing .insta-reel__play {
    width: auto;
    height: 34px;
    border-radius: 17px;
    padding: 0 10px;
    gap: 6px;
    background: rgba(0, 0, 0, 0.58);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    bottom: 12px;
    transform: translateX(-50%);
  }
  .techniky-reel .insta-reel__card.is-playing .insta-reel__play i {
    font-size: 0.8rem;
    margin-left: 0;
  }
  .techniky-reel__speed-btn {
    font-size: 0.55rem;
  }

  .techniky-reel .insta-reel__expanded-player {
    width: 130px;
  }

  .techniky-item__header { min-height: 52px; }

  .techniky-group__letter-row { padding-top: var(--s-8); }
}

@media (max-width: 640px) {
  /* Wrap alphabet to two rows so all letters are visible without scrolling */
  .techniky-alpha {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 2px;
    padding-bottom: 0;
  }

  .techniky-alpha__letter {
    min-width: 30px;
    height: 28px;
    font-size: 0.72rem;
    padding: 0 4px;
  }
}

@media (max-width: 480px) {
  .techniky-reel .insta-reel__track {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-2);
  }

  .techniky-reel .insta-reel__expanded-player {
    width: 120px;
  }

  .techniky-item__name { font-size: 0.875rem; }
}

/* Smaller cards when expanded (hide clicked card, keep others visible) */
.techniky-reel .insta-reel__card.is-expanded { display: none; }

/* ============================================================
   TAG FILTER SYSTEM
   ============================================================ */

/* ── Filter toggle button + clear ───────────────────────── */
.techniky-filters__bar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-shrink: 0;
}

.techniky-filters__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 44px;
  padding: 0 var(--s-4);
  border-radius: 999px;
  border: 1.5px solid var(--c-border);
  background: transparent;
  color: var(--c-muted);
  font-size: 0.8rem;
  font-family: var(--f-body);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}

.techniky-filters__toggle:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
}

.techniky-filters__toggle.is-active {
  background: rgba(217,119,6,.1);
  border-color: var(--c-accent);
  color: var(--c-accent);
}

.techniky-filters__badge {
  display: none; /* hidden by default; [hidden] attribute overridden by inline-flex so we flip the default */
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--c-accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}

.techniky-filters__badge:not([hidden]) {
  display: inline-flex;
}

.techniky-filters__clear {
  font-size: 0.75rem;
  font-family: var(--f-body);
  color: var(--c-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--t-fast);
  white-space: nowrap;
}

.techniky-filters__clear:hover { color: var(--c-text); }

/* ── Expandable filter panel ─────────────────────────────── */
.techniky-filters__panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease;
  opacity: 0;
  pointer-events: none;
}

.techniky-filters__panel.is-open {
  max-height: 600px;
  opacity: 1;
  pointer-events: auto;
}

.techniky-filter-cat {
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
  padding: var(--s-2) 0;
}

.techniky-filter-cat + .techniky-filter-cat {
  border-top: 1px solid color-mix(in srgb, var(--c-border) 55%, transparent);
}

.techniky-filter-cat__label {
  flex-shrink: 0;
  width: 72px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--c-muted);
  padding-top: 6px;
}

.techniky-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1;
}

/* ── Individual chips ─────────────────────────────────────── */
.techniky-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--chip-color) 35%, transparent);
  background: color-mix(in srgb, var(--chip-color) 7%, transparent);
  color: var(--chip-color);
  font-size: 0.72rem;
  font-family: var(--f-body);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
  --chip-color: var(--c-accent);
}

.techniky-chip:hover {
  border-color: var(--chip-color);
  background: color-mix(in srgb, var(--chip-color) 14%, transparent);
}

.techniky-chip.is-active {
  background: color-mix(in srgb, var(--chip-color) 22%, transparent);
  border-color: var(--chip-color);
  color: var(--chip-color);
  font-weight: 700;
}

/* Category chip accent colors */
.techniky-chip[data-cat="tag_skupina"] { --chip-color: #60a5fa; }
.techniky-chip[data-cat="tag_typ"]     { --chip-color: #4ade80; }
.techniky-chip[data-cat="tag_telo"]    { --chip-color: #fb923c; }
.techniky-chip[data-cat="tag_cil"]     { --chip-color: #c084fc; }

/* Chips that would produce zero results if added to current selection */
.techniky-chip.is-unavailable {
  opacity: 0.28;
  pointer-events: none;
  cursor: not-allowed;
}

/* ============================================================
   TECHNIQUE ITEM ENHANCEMENTS
   ============================================================ */

/* ── Tag pills row in collapsed header ───────────────────── */
/* Both variants hidden by default; each breakpoint enables only the right one */
.techniky-item__header-tags--full,
.techniky-item__header-tags--brief {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-right: auto;
}

/* ── Description inside accordion ────────────────────────── */
.techniky-item__desc {
  padding: var(--s-2) var(--s-1) 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--c-muted);
}
.techniky-item__desc--brief { display: none; }
.techniky-item__desc--full  { display: block; }

.techniky-desc-more-btn {
  display: inline;
  background: none;
  border: none;
  outline: none;
  padding: 0;
  color: var(--c-accent);
  font-size: inherit;
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Description detail modal (mobile only) ───────────────── */
.techniky-desc-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
}
.techniky-desc-modal.is-open { pointer-events: auto; }
.techniky-desc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.32s ease;
}
.techniky-desc-modal.is-open .techniky-desc-modal__backdrop { opacity: 1; }
.techniky-desc-modal__sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--c-bg);
  border-radius: 20px 20px 0 0;
  padding: var(--s-3) var(--s-5) var(--s-8);
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
}
.techniky-desc-modal.is-open .techniky-desc-modal__sheet { transform: translateY(0); }
.techniky-desc-modal__sheet::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--c-border);
  margin: 0 auto var(--s-5);
}
.techniky-desc-modal__close {
  position: absolute;
  top: var(--s-4);
  right: var(--s-3);
  background: rgba(255,255,255,.06);
  border: none;
  border-radius: 50%;
  color: var(--c-muted);
  font-size: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}
.techniky-desc-modal__name {
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: var(--s-3);
  padding-right: var(--s-8);
  line-height: 1.35;
}
.techniky-desc-modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: var(--s-4);
}
.techniky-desc-modal__desc {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--c-muted);
}

/* ── Tag pills row inside accordion ──────────────────────── */
.techniky-item__tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: var(--s-2) var(--s-1) var(--s-2);
}

.techniky-item__tagpill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  cursor: pointer;
  transition: filter var(--t-fast);
}

.techniky-item__tagpill:hover { filter: brightness(1.2); }

.techniky-item__tagpill--skupina { color: #60a5fa; background: rgba(96,165,250,.12); }
.techniky-item__tagpill--typ     { color: #4ade80; background: rgba(74,222,128,.12); }
.techniky-item__tagpill--telo    { color: #fb923c; background: rgba(251,146,60,.12); }
.techniky-item__tagpill--cil     { color: #c084fc; background: rgba(192,132,252,.12); }

/* ============================================================
   RESPONSIVE — filter & enhancements
   ============================================================ */

@media (min-width: 768px) {
  .techniky-item__header { padding-right: calc(var(--s-5) / 2); }

  /* Collapsed desktop: brief (1st per group + +N); expanded: all tags */
  .techniky-item__header-tags--full  { display: none; }
  .techniky-item__header-tags--brief { display: flex; }
  .techniky-item.is-open .techniky-item__header-tags--full  { display: flex; }
  .techniky-item.is-open .techniky-item__header-tags--brief { display: none; }
  .techniky-item__tags-row { display: none; }
  /* Expanded: accent heading for separation */
  .techniky-item.is-open .techniky-item__header { color: var(--c-accent); }
}

/* ── A-Z button & modal (mobile only elements) ─────────── */
.techniky-az-toggle        { display: none; }
.techniky-filter-backdrop  { display: none; }
.techniky-az-modal         { display: none; }
.techniky-filters__modal-header,
.techniky-filters__modal-footer { display: none; }

@media (max-width: 767px) {
/* Uniform 8px gap: heading→tags (header pb 8px + tags top 0), tags→desc (tags bottom 8px + desc top 0) */
  /* Tighter side margins on mobile for more content width */
  .techniky-toolbar .container,
  .techniky-content .container {
    padding-inline: var(--s-3); /* 12px instead of global 20px */
  }

  /* Hide alphabet bar (shown only in A-Z modal on mobile) */
  .techniky-alpha { display: none; }

  /* Show tags under the name in collapsed header on mobile */
  .techniky-item__header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--s-1) var(--s-4);
    padding-top: var(--s-3);
    padding-bottom: var(--s-3);
    min-height: 0;
  }
  .techniky-item__name { order: 1; align-self: center; }
  .techniky-item__caret { order: 2; align-self: center; flex-shrink: 0; }
  /* Mobile: show only brief (abbreviated) tags in header */
  .techniky-item__header-tags--full  { display: none; }
  .techniky-item__header-tags--brief {
    display: flex;
    order: 3;
    flex: 0 0 100%;
    flex-wrap: nowrap;
    overflow: hidden;
    gap: 3px;
    padding-bottom: var(--s-1);
  }
  .techniky-item__header-tags--brief .techniky-item__tagpill {
    height: 18px;
    font-size: 0.62rem;
    padding: 0 6px;
    white-space: nowrap;
  }
  /* Body tags-row: hidden by default */
  .techniky-item__tags-row { display: none; }
  /* Expanded mobile: hide brief header tags, show full body tags-row */
  .techniky-item.is-open .techniky-item__header-tags--brief { display: none; }
  .techniky-item.is-open .techniky-item__tags-row { display: flex; }
  /* Mobile description: show brief, hide full */
  .techniky-item__desc--full  { display: none; }
  .techniky-item__desc--brief { display: block; }


  /* ── A-Z toggle button ── */
  .techniky-az-toggle {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 var(--s-3);
    border-radius: 999px;
    border: 1.5px solid var(--c-border);
    background: transparent;
    color: var(--c-muted);
    font-size: 0.8rem;
    font-family: var(--f-body);
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: border-color var(--t-fast), color var(--t-fast);
  }
  .techniky-az-toggle:hover { border-color: var(--c-accent); color: var(--c-accent); }

  /* ── Filter panel → fullscreen modal on mobile ── */
  /* JS portals panel to document.body before open, so position:fixed escapes toolbar stacking context */
  .techniky-filters__panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    max-height: none;            /* cancel desktop max-height: 0 */
    overflow: hidden;            /* panel itself clips — scroll-body scrolls inside */
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    z-index: 200;
    padding: 0;
    opacity: 1;
    pointer-events: none;
    visibility: hidden;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0.32s;
    /* flex column: header / scrollable-body / footer */
    display: flex;
    flex-direction: column;
  }
  .techniky-filters__panel.is-open {
    max-height: none;            /* override desktop .is-open max-height: 600px (higher specificity) */
    pointer-events: auto;
    visibility: visible;
    transform: translateX(0);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0s;
  }

  /* Modal header */
  .techniky-filters__modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--s-4) var(--s-4) var(--s-3);
    border-bottom: 1px solid var(--c-border);
    flex-shrink: 0;
    background: var(--c-bg);
  }
  .techniky-filters__modal-title {
    font-family: var(--f-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--c-text);
  }
  .techniky-filters__modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: color-mix(in srgb, var(--c-border) 50%, transparent);
    color: var(--c-muted);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Scrollable chips area — grows to fill space between header and footer */
  .techniky-filters__scroll-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
    background: #fff;
  }

  /* Chips area */
  .techniky-filters__panel .techniky-filter-cat {
    padding: var(--s-2) var(--s-4);
    flex-direction: column;
    gap: var(--s-1);
  }
  .techniky-filters__panel .techniky-filter-cat + .techniky-filter-cat {
    border-top: 1px solid color-mix(in srgb, var(--c-border) 55%, transparent);
  }
  .techniky-filters__panel .techniky-filter-cat__label { width: auto; padding-top: 0; font-size: 0.65rem; }
  .techniky-filters__panel .techniky-filter-chips { gap: var(--s-1); }
  .techniky-filters__panel .techniky-chip { height: 28px; font-size: 0.75rem; padding: 0 var(--s-3); }

  /* Footer — pinned to bottom of the flex column */
  .techniky-filters__modal-footer {
    display: flex;
    gap: var(--s-3);
    padding: var(--s-4);
    border-top: 1px solid var(--c-border);
    flex-shrink: 0;
    background: var(--c-bg);
  }
  .techniky-filters__modal-clear-btn {
    flex: 1;
    height: 46px;
    border-radius: 999px;
    border: 1.5px solid var(--c-border);
    background: transparent;
    color: var(--c-muted);
    font-size: 0.85rem;
    font-family: var(--f-body);
    font-weight: 600;
    cursor: pointer;
  }
  .techniky-filters__modal-confirm {
    flex: 2;
    height: 46px;
    border-radius: 999px;
    border: none;
    background: var(--c-accent);
    color: #fff;
    font-size: 0.85rem;
    font-family: var(--f-body);
    font-weight: 700;
    cursor: pointer;
  }

  /* No backdrop needed for fullscreen modal */
  .techniky-filter-backdrop { display: none !important; }

  /* ── A-Z modal ── */
  .techniky-az-modal {
    display: block; /* visibility toggled via [hidden] attribute */
    position: fixed;
    inset: 0;
    z-index: 700;
  }
  .techniky-az-modal[hidden] { display: none; }
  .techniky-az-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
  }
  .techniky-az-modal__sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--c-bg);
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    max-height: 70vh;
    overflow-y: auto;
  }
  .techniky-az-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--s-4);
    border-bottom: 1px solid var(--c-border);
    position: sticky;
    top: 0;
    background: var(--c-bg);
  }
  .techniky-az-modal__title {
    font-family: var(--f-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--c-text);
  }
  .techniky-az-modal__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: color-mix(in srgb, var(--c-border) 40%, transparent);
    color: var(--c-muted);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .techniky-az-modal__grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--s-2);
    padding: var(--s-4);
  }
  .techniky-az-modal__letter {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    border-radius: 10px;
    border: 1.5px solid var(--c-border);
    background: transparent;
    color: var(--c-text);
    font-family: var(--f-display);
    font-size: 1.1rem;
    font-weight: 300;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  }
  .techniky-az-modal__letter:hover,
  .techniky-az-modal__letter:active {
    background: rgba(217,119,6,0.1);
    border-color: var(--c-accent);
    color: var(--c-accent);
  }

  .techniky-item.is-open .techniky-item__header { padding-bottom: var(--s-2); }
  .techniky-item__tags-row { padding-top: 0; }
  .techniky-item__desc { padding-top: 0; }
  .techniky-filters__toggle-label { display: none; }
  .techniky-filters__toggle {
    width: 44px;
    padding: 0;
    justify-content: center;
    position: relative; /* badge overlay anchor */
  }
  /* Badge as notification dot in top-right corner of the icon button */
  .techniky-filters__badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 15px;
    height: 15px;
    font-size: 0.56rem;
    padding: 0 3px;
    box-shadow: 0 0 0 2px var(--c-bg); /* "cutout" ring between badge and button */
  }
  /* Active state: orange ring instead of just a tint — easier to notice on mobile */
  .techniky-filters__toggle.is-active {
    box-shadow: 0 0 0 2px var(--c-accent);
    border-color: var(--c-accent);
    background: rgba(217,119,6,.12);
    color: var(--c-accent);
  }
  /* Vymazat: make it feel like a tappable action, not a dead link */
  .techniky-filters__clear {
    color: var(--c-accent);
    font-weight: 600;
    font-size: 0.78rem;
    text-decoration: none;
    border: 1px solid rgba(217,119,6,.35);
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    transition: background var(--t-fast);
  }
  .techniky-filters__clear:hover { background: rgba(217,119,6,.08); color: var(--c-accent); }
  .techniky-filter-cat {
    flex-direction: column;
    gap: var(--s-2);
  }
  .techniky-filter-cat__label { width: auto; padding-top: 0; }
  .techniky-chip { height: 26px; font-size: 0.7rem; padding: 0 9px; }
}

@media (max-width: 480px) {
  .techniky-filters__clear { font-size: 0.7rem; }
  .techniky-chip { height: 24px; font-size: 0.68rem; padding: 0 8px; }
  .techniky-item__desc { font-size: 0.85rem; }
}

/* ═══════════════════════════════════════════════════════════
   DESKTOP TECHNIQUE DETAIL MODAL
   ═══════════════════════════════════════════════════════════ */
.tech-detail-modal { display: none; }

@media (min-width: 768px) {
  .tech-detail-modal {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 800;
    pointer-events: none;
  }
  .tech-detail-modal.is-open { pointer-events: auto; }

  .tech-detail-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 5, 10, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.28s ease;
  }
  .tech-detail-modal.is-open .tech-detail-modal__backdrop { opacity: 1; }

  .tech-detail-modal__panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% + 18px));
    width: min(880px, 90vw);
    max-height: 88vh;
    background: #15131f;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.34, 1.1, 0.64, 1);
  }
  .tech-detail-modal.is-open .tech-detail-modal__panel {
    opacity: 1;
    transform: translate(-50%, -50%);
  }

  .tech-detail-modal__close {
    position: absolute;
    top: var(--s-4);
    right: var(--s-4);
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
  }
  .tech-detail-modal__close:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

  .tech-detail-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--s-8) var(--s-8) var(--s-6);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
  }

  .tech-detail-modal__name {
    font-family: var(--f-display);
    font-size: clamp(1.35rem, 2.5vw, 1.7rem);
    font-weight: 600;
    color: #fff;
    margin-bottom: var(--s-4);
    padding-right: var(--s-12);
    line-height: 1.2;
  }

  .tech-detail-modal__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: var(--s-5);
  }

  .tech-detail-modal__desc {
    font-size: 0.95rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.52);
    margin-bottom: var(--s-7);
    max-width: 68ch;
  }

  .tech-detail-modal__nav {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-4) var(--s-6);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.22);
  }

  .tech-detail-modal__nav-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-2) var(--s-4);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-family: var(--f-body);
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  }
  .tech-detail-modal__nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.28);
  }
  .tech-detail-modal__nav-btn:disabled { opacity: 0.22; cursor: default; }

  .tech-detail-modal__nav-pos {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.32);
    font-family: var(--f-display);
    letter-spacing: 0.06em;
  }

  /* Reel inside modal: inherit existing insta-reel styles, just reset top margin */
  .tech-detail-modal__reel .techniky-reel { margin-top: 0; }
}

/* ── Mobile: bottom-sheet variant ───────────────────────────── */
@media (max-width: 767px) {
  .tech-detail-modal {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 800;
    pointer-events: none;
  }
  .tech-detail-modal.is-open { pointer-events: auto; }

  .tech-detail-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 5, 10, 0.72);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .tech-detail-modal.is-open .tech-detail-modal__backdrop { opacity: 1; }

  .tech-detail-modal__panel {
    position: absolute;
    inset: 0;
    max-height: 100vh;
    background: #15131f;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .tech-detail-modal.is-open .tech-detail-modal__panel { transform: translateY(0); }

  .tech-detail-modal__close {
    position: absolute;
    top: var(--s-3);
    right: var(--s-3);
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.65);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
  }

  .tech-detail-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--s-4) var(--s-5) var(--s-3);
    scrollbar-width: none;
  }

  .tech-detail-modal__name {
    font-family: var(--f-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: var(--s-3);
    padding-right: var(--s-10);
    line-height: 1.3;
  }

  .tech-detail-modal__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: var(--s-4);
  }

  .tech-detail-modal__desc {
    font-size: 0.88rem;
    line-height: 1.7;
    color: rgba(255,255,255,.52);
    margin-bottom: var(--s-5);
  }

  .tech-detail-modal__nav {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-top: 1px solid rgba(255,255,255,.07);
    background: rgba(0,0,0,.2);
  }

  .tech-detail-modal__nav-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-2) var(--s-3);
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 8px;
    background: transparent;
    color: rgba(255,255,255,.6);
    font-size: 0.82rem;
    font-family: var(--f-body);
    cursor: pointer;
  }
  .tech-detail-modal__nav-btn:disabled { opacity: 0.22; }
  .tech-detail-modal__nav-btn span { display: none; }

  .tech-detail-modal__nav-pos {
    font-size: 0.8rem;
    color: rgba(255,255,255,.32);
    font-family: var(--f-display);
  }
}
