/* Works — all projects (Figma 32:1506, 1440 × 4183) */

.works-layout {
  display: grid;
  grid-template-columns: 347px minmax(0, 1fr);
  max-width: var(--page);
  margin: 0 auto;
}

/* ---------- Left column (sticky until the grid ends) ---------- */
.works-side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  min-height: 460px;
  padding: 110px 0 26px var(--edge);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.works-side button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
  transition: opacity .2s;
}
.works-side button:hover { opacity: .55; }
.works-side__title button { line-height: 55px; }

.works-filters {
  margin: 23px 0 0 -4px;          /* filters sit 4px left of the title in the design */
  width: 153px;
  font-weight: 200;
}
.works-filters li {
  height: 45px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--ink);
}
.works-filters li:first-child { height: 44px; }
.works-filters button { width: 100%; padding: 10px 0; }
.works-filters button[aria-pressed="true"] { font-weight: 400; }

.works-side__back { margin-top: auto; line-height: 20px; }

/* ---------- Grid ---------- */
.works-grid {
  padding: 138px var(--edge) 0;
  display: grid;                   /* fallback before JS builds the two columns */
  grid-template-columns: 1fr 1fr;
  gap: 0 21px;
  align-items: start;
  transition: opacity .25s ease;
}
.works-grid.is-fading { opacity: 0; }
.works-col { display: flex; flex-direction: column; }

.card { margin-bottom: 45px; }
.card__link { display: block; }
.card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--ar);
  background: #f3f2f0;
}
.card__media img { transition: transform .6s var(--ease); }
.card__link:hover .card__media img { transform: scale(1.03); }

/* image cropped exactly like its Figma mask: --x/--y offset, --w/--h size (all % of the card) */
.crop {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  max-width: none;
  object-fit: cover;
}
.card__overlay, .card__print, .card__band { position: absolute; max-width: none; }
.card__overlay { height: auto; }
.card__band { background: #5574ed; }
.card__print { object-fit: cover; box-shadow: 0 5px 10.7px rgba(0, 0, 0, 0.25); }

.card__media--kohkret { background: var(--kohkret); }
.card__logo { position: absolute; left: 21.64%; top: 33.86%; width: 56.8%; height: auto; }
.card__media--placeholder { background: #c4c4c4; }
.card__media--paper { background: #efefef; }

.card__caption { margin-top: 17px; line-height: 22px; }
.card__name, .card__type { display: block; }
.card__type { font-size: 14px; font-weight: 200; }

.works-empty { padding: 138px var(--edge) 0; font-weight: 200; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .works-layout { grid-template-columns: 1fr; }
  .works-side {
    position: static;
    height: auto;
    min-height: 0;
    padding: calc(var(--nav-h) + 24px) var(--edge) 0;
  }
  .works-filters { display: flex; flex-wrap: wrap; gap: 0 24px; width: auto; margin-left: 0; margin-top: 4px; }
  .works-filters li, .works-filters li:first-child { height: 40px; }
  .works-filters button { width: auto; }
  .works-side__back { display: none; }
  .works-grid { padding-top: 40px; }
  .works-empty { padding-top: 40px; }
}
@media (max-width: 700px) {
  .works-grid { grid-template-columns: 1fr; }
}
