/* ============================================================
   WORK — Two-column section
   Left: sticky sidebar (heading, CTA, filters)
   Right: 3-column project card grid
   ============================================================ */

.work {
  position: relative;
  z-index: 2;
  background-color: #ffffff;
}

.work__layout {
  max-width: var(--page-max-width);
  margin-inline: auto;
  padding-inline: var(--page-padding);
  padding-bottom: 120px;
  display: grid;
  grid-template-columns: 262px 1fr;
  column-gap: 42px;
  align-items: start;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.work__sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 96px 0; /* breathing room for nav + bottom */
}

.work__heading {
  font-size: var(--text-h2);
  font-weight: 500;
  line-height: var(--leading-tight);
  color: var(--color-fg);
  margin: 0 0 32px;
}

.work__cta {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  padding: 16px 38px;
  border-radius: var(--radius-pill);
  background-color: var(--color-fg);
  color: #ffffff;
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--leading-tight);
  text-decoration: none;
  margin-bottom: 22px;
  transition: background-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.work__cta:hover {
  background-color: var(--color-accent);
  color: var(--color-fg);
  transform: translateY(-1px);
}

.work__cta-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.work__rule {
  display: block;
  border: none;
  border-top: 1px solid var(--color-stroke);
  margin: 0;
  margin-block: 0;
  padding: 0;
  height: 0;
  margin-bottom: 27px;
  width: 219px;
}

/* ------- Filters ------- */

.work__filter-group + .work__filter-group {
  margin-top: 54px;
}

.work__filter-label {
  font-size: var(--text-caption);
  font-weight: 400;
  line-height: var(--leading-tight);
  color: var(--color-muted-3);
  margin: 0 0 35px;
}

.work__filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.work__filter-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: var(--text-body-l);
  font-weight: 400;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-body-l);
  color: var(--color-fg);
  cursor: pointer;
  user-select: none;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.work__filter-item:hover {
  opacity: 0.6;
}

/* Checkbox square — sharp, 1px stroke, no radius */
.work__filter-item::before {
  content: '';
  display: inline-block;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  border-radius: 0;
  border: 1px solid var(--color-fg);
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  transition: background-color 150ms var(--ease-out);
}

/* Active = filled with checkmark */
.work__filter-item.is-active::before {
  background-color: var(--color-fg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 15'><polyline points='3,7.5 6,10.5 12,4.5' fill='none' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

/* Hidden card */
.work__card.is-hidden {
  display: none;
}

/* ============================================================
   GRID
   ============================================================ */

.work__grid {
  padding-top: 291px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 54px 22px;
  align-items: start;
}

/* ============================================================
   PROJECT CARDS
   ============================================================ */

.work__card {
  display: flex;
  flex-direction: column;
}

.work__card-link {
  position: relative;            /* kotva pro overlay + sipku */
  display: block;
  overflow: hidden;
  background-color: #484848;
  aspect-ratio: 360 / 414;
  flex-shrink: 0;
  text-decoration: none;
}

.work__card-img {
  width: 100%;
  height: 115%;           /* slightly oversized for hover-parallax */
  object-fit: cover;
  object-position: center center;
  display: block;
  transform: translateY(-6%);
  transition: transform 700ms var(--ease-out);
}

.work__card-link:hover .work__card-img {
  transform: translateY(-12%) scale(1.06);
}

/* Ztmavujici gradient odspodu — fade in na hover */
.work__card-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 55%);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 450ms var(--ease-out);
}

.work__card-link:hover::before {
  opacity: 1;
}

/* Kruhove accent tlacitko se sipkou — vyjede v pravem dolnim rohu */
.work__card-link::after {
  content: '';
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: var(--color-accent);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='7' y1='17' x2='17' y2='7'/><polyline points='7 7 17 7 17 17'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px;
  opacity: 0;
  transform: translateY(10px) scale(0.8);
  pointer-events: none;
  z-index: 2;
  transition:
    opacity 350ms var(--ease-out),
    transform 450ms cubic-bezier(0.22, 1, 0.36, 1);
}

.work__card-link:hover::after {
  opacity: 1;
  transform: translateY(0) scale(1);
}


.work__card-info {
  padding-top: 12px;
}

.work__card-name {
  font-size: var(--text-body-l);
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-body-l);
  color: var(--color-fg);
  margin: 0 0 3px;
  transition: color 300ms var(--ease-out);
}

.work__card-desc {
  font-size: var(--text-caption);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--color-muted-2);
  margin: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Hide sidebar, cards go 3-col (narrower) */
@media (max-width: 1280px) {
  .work__layout {
    grid-template-columns: 220px 1fr;
    column-gap: 32px;
  }
}

/* Sidebar collapses to heading-only row above grid */
@media (max-width: 1023px) {
  .work__layout {
    grid-template-columns: 1fr;
  }

  .work__sidebar {
    padding: 80px 0 0;
    height: auto;
    position: static;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
  }

  .work__heading {
    margin-bottom: 0;
  }

  .work__rule,
  .work__filter-group {
    display: none;
  }

  .work__grid {
    padding-top: 32px;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 16px;
  }
}

@media (max-width: 767px) {
  .work__sidebar {
    padding-top: 60px;
  }

  .work__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px 12px;
  }

  .work__card-name {
    font-size: var(--text-body);
  }
}

@media (max-width: 479px) {
  .work__grid {
    grid-template-columns: 1fr;
  }
}