.work-main {
  padding-block: clamp(22px, 3.4vw, 52px) clamp(50px, 6vw, 84px);
}
.work-main > .builder-back {
  margin-bottom: 8px;
  font-size: 14px;
}
.work-main > h1 {
  margin: 0 0 clamp(28px, 3.5vw, 48px);
  color: var(--black);
  font-size: clamp(38px, 5.2vw, 70px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.045em;
}
.work-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 4.4vw, 58px) clamp(20px, 3vw, 40px);
}
.work-group {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: start;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.work-group-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  column-gap: 16px;
}
.work-group h2 {
  margin: 0;
  color: var(--black);
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.035em;
}
.work-location {
  color: #535960;
  font-size: 15px;
}
.work-scope {
  margin: 6px 0 15px;
  color: #45494e;
  font-size: 16px;
  line-height: 1.45;
}
.work-photos {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 5px;
  aspect-ratio: 6 / 5;
  overflow: hidden;
  border-radius: 8px;
}
.work-photo {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: block;
  background: #191c1e;
  cursor: zoom-in;
}
.work-photo:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: -3px;
  z-index: 1;
}
.work-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-expand {
  position: absolute;
  inset: auto 9px 9px auto;
  width: 30px;
  height: 30px;
  padding: 5px;
  color: white;
  background: rgb(12 14 16 / .74);
  border-radius: 50%;
}
.work-photo:hover .photo-expand,
.work-photo:focus-visible .photo-expand {
  background: var(--black);
}
.work-help {
  display: flex;
  justify-content: center;
  margin-top: clamp(32px, 4.5vw, 64px);
  border-top: 1px solid var(--line);
  padding-top: clamp(24px, 3vw, 40px);
}
.work-help a { gap: 20px; }
.work-viewer:not([open]), .work-viewer [hidden] { display: none; }
.work-viewer[open] {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(100%, 1200px);
  height: min(92vh, 940px);
  height: min(92dvh, 940px);
  max-height: none;
  max-width: none;
  margin: auto;
  padding: 8px 16px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #101214;
  color: white;
  overscroll-behavior: contain;
}
.work-viewer::backdrop { background: rgb(0 0 0 / .85); }
html:has(.work-viewer[open]) { overflow: hidden; }
.viewer-bar, .viewer-controls {
  display: flex;
  flex: none;
  align-items: center;
}
.viewer-bar {
  gap: 12px;
  justify-content: space-between;
  padding: 0 0 8px 5px;
}
.viewer-bar h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  color: white;
}
.viewer-stage {
  min-height: 0;
  flex: 1;
  display: grid;
  place-items: center;
  touch-action: pan-y pinch-zoom;
}
.viewer-image {
  display: block;
  height: 100%;
  width: 100%;
  min-height: 0;
  min-width: 0;
  object-fit: contain;
}
.viewer-controls {
  justify-content: center;
  gap: 14px;
  padding-top: 6px;
}
.viewer-count {
  min-width: 48px;
  color: white;
  font-size: 15px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.viewer-button {
  touch-action: manipulation;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: white;
  background: #282b2d;
  border-radius: 50%;
}
.viewer-button:hover, .viewer-button:focus-visible { background: #42464a; }
.viewer-button:focus-visible { outline: 2px solid #87c7ff; }
@media (min-width: 721px) {
  .work-photos:has(> :nth-child(3)):not(:has(> :nth-child(4))) {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
  .work-photos:has(> :nth-child(3)):not(:has(> :nth-child(4))) > :first-child {
    grid-row: 1 / 3;
  }
}
@media (min-width: 721px) {
  #orkla .work-photos {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: minmax(0, 3fr) minmax(0, 1fr);
    aspect-ratio: 4 / 3;
  }
  #orkla .work-photo:first-child {
    grid-column: 1 / -1;
  }
  #orkla .work-photo:not(:first-child) .photo-expand {
    inset: auto 4px 4px auto;
    width: 23px;
    height: 23px;
  }
  #skoleforestilling .work-photos {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto minmax(0, 1fr);
  }
  #skoleforestilling .work-photos > :first-child {
    grid-column: 1 / -1;
    grid-row: 1;
    aspect-ratio: 16 / 9;
  }
}
@media (max-width: 720px) {
  .work-list { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .work-group { padding-top: 12px; }
  .work-photos {
    grid-auto-columns: 87%;
    aspect-ratio: 5 / 4;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }
  .work-photos:has(> :only-child) { grid-auto-columns: 100%; }
  #orkla .work-photos { aspect-ratio: 3 / 2; }
  #skoleforestilling .work-photos { aspect-ratio: 2 / 1; }
  .work-photo { scroll-snap-align: start; }
  .work-viewer[open] {
    width: 100%;
    height: 100%;
    height: 100dvh;
    padding: max(10px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    border-radius: 0;
  }
}
@media (max-width: 360px) {
  .work-scope { font-size: 15px; }
}
