/* Page wrapper spacing under fixed header — match About/Contact */
#work-page .work-wrap {
  padding: calc(var(--header-h-desktop,72px) + 40px) 60px 80px;
  color: #fff;
  background: #000;
}
@media (max-width: 768px) {
  #work-page .work-wrap {
    padding: calc(var(--header-h-mobile,56px) + 24px) 24px 60px;
  }
}

/* Hero */
.work-hero h1 {
  font-family: 'FuturaCyrillicDemi', sans-serif;
  font-size: 44px;
  text-align: center;
  margin-bottom: 18px;
}
.work-hero .work-intro {
  max-width: 900px;
  margin: 0 auto 40px;
  line-height: 1.6;
  font-size: 18px;
  text-align: center;
  color: #fff;
}

/* Filters */
.work-filters {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 10px auto 30px;
}
.work-filters .filter {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 8px 14px;
  border-radius: 999px;
  color: #fff;
  letter-spacing: .08em;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.work-filters .filter:hover { border-color: #fff; }
.work-filters .filter.active { background: #fff; color: #000; }

/* Table-ish grid */
.work-table {
  max-width: 980px;
  margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.25);
}
.work-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 140px 90px;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255,255,255,0.25);
}
.work-head {
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Rows (click to expand) */
.work-item {
  color: #fff;
  text-decoration: none;
  position: relative;
  cursor: pointer;
}

/* Underline only under the Title cell on hover */
.work-item .col-title {
  position: relative;
  display: inline-block;
}
.work-item .col-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  height: 1px; width: 0%;
  background: #fff;
  transition: width .25s ease, opacity .25s ease;
  opacity: 0;
}
.work-item .col-title:hover::after { width: 100%; opacity: 1; }

/* Details (collapsed by default) */
.work-details {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .5s ease, opacity .4s ease;
  border-bottom: 1px solid rgba(255,255,255,0.25);
}
.work-item.open + .work-details { opacity: 1; }

.details-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 18px 0 24px;
}

.details-wrap .desc p {
  color: #fff;
  line-height: 1.6;
  margin-bottom: 14px;
}

.details-wrap .explore {
  display: inline-block;
  font-size: 14px;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid #fff;
}

.covers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Placeholder images */
.cover.ph {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #1d1d1d;
  border: 1px dashed rgba(255,255,255,0.25);
  display: grid;
  place-items: center;
}
.cover.ph span {
  font-size: 12px;
  letter-spacing: .08em;
  color: rgba(255,255,255,0.7);
}

/* Hidden when filtered */
.work-item[hidden],
.work-details[hidden] {
  display: none;
}

/* Responsive */
@media (max-width: 920px) {
  .work-row { grid-template-columns: 60px 1fr 1fr 120px 70px; }
}
@media (max-width: 800px) {
  .details-wrap { grid-template-columns: 1fr; }
  .covers { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .work-row { grid-template-columns: 60px 1fr 120px 70px; }
  .col-client { display: none; }
}

/* Limit the underline to the text width */
.work-table .work-item .col-title {
  justify-self: start;
  width: max-content;
  display: inline-block;
  white-space: nowrap;
}
.work-table .work-item .col-title:hover::after { width: 100%; opacity: 1; }

/* ===== WORK — mobile layout (no horizontal scroll) ===== */
@media (max-width: 700px) {
  html, body { max-width: 100%; overflow-x: hidden; }

  /* tighten page spacing + type */
  .work-hero h1 { font-size: 36px; }
  .work-hero .work-intro { font-size: 16px; }

  .work-row {
    grid-template-columns: 44px 1fr auto;
    grid-template-areas:
      "num title year"
      ".   type  year";
    gap: 8px 12px;
    align-items: baseline;
  }
  .work-row .col-num   { grid-area: num; }
  .work-row .col-title { grid-area: title; min-width: 0; }
  .work-row .col-type  { grid-area: type; font-size: 12px; opacity: .85; }
  .work-row .col-year  { grid-area: year; justify-self: end; }
  .work-row .col-client { display: none !important; }

  .work-head {
    grid-template-columns: 44px 1fr auto;
    grid-template-areas:
      "dash title year"
      ".    type  year";
  }
  .work-head .col-client { display: none !important; }
  .work-head .col-num   { grid-area: dash; }
  .work-head .col-title { grid-area: title; }
  .work-head .col-type  { grid-area: type; }
  .work-head .col-year  { grid-area: year; justify-self: end; }

  .work-table .work-item .col-title {
    justify-self: start;
    width: max-content;
    display: inline-block;
    white-space: nowrap;
    min-width: 0;
  }
}

/* Work intro left-aligned option (kept if you want it) */
#work-page .work-hero .work-intro {
  hyphens: auto;
}
@media (min-width: 901px) {
  #work-page .work-hero .work-intro { padding: 0; }
}

/* Kill hyphenation hard if needed */
#work-page .work-hero .work-intro,
#work-page .work-hero .work-intro * {
  -webkit-hyphens: none !important;
  hyphens: none !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

/* Work row covers */
.covers .cover {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.covers .cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
