/* Finished work is presented as an editorial gallery, with the original
   six-cell image sheet retained as the source of every creation. */
.finished {
  color: var(--ink, #183d32);
  background: var(--sage, #e5e9dc);
}

.finished .section-heading {
  align-items: end;
  margin-bottom: clamp(42px, 5vw, 76px);
}

.finished .section-heading > p {
  max-width: 350px;
  color: var(--muted, #73796d);
  font-size: 15px;
  line-height: 1.85;
}

.finished .section-heading > .text-link {
  margin-bottom: 8px;
}

.finished .filter-row {
  margin-bottom: 42px;
}

.finished .craft-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 68px clamp(24px, 3vw, 46px);
}

.craft-card {
  min-width: 0;
}

.craft-card[hidden] {
  display: none;
}

.craft-image-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 1;
  border: 0;
  border-radius: 1px;
  background: #e3ddd1;
  color: var(--ink, #183d32);
  cursor: pointer;
  isolation: isolate;
}

.craft-photo {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 1;
  background-image: none;
  background-size: 300% 203.578529%;
  background-repeat: no-repeat;
}

.craft-image-button .craft-photo {
  height: 100%;
  transition: transform 850ms cubic-bezier(.2, .7, .2, 1);
}

/* The 1536 × 1024 source has three 512px columns and its row boundary at
   y=503. Scale each row independently so adjacent artwork cannot bleed in. */
.craft-photo img {
  position: absolute;
  inset: 0;
  display: block;
  max-width: none;
  width: 300%;
  height: 203.578529%;
  object-fit: fill;
  transform-origin: top left;
}

.craft-image-button .craft-photo img {
  width: 300%;
  height: 203.578529%;
}

.craft-photo img[style*="0% 0%"] { left: 0; top: 0; }
.craft-photo img[style*="50% 0%"] { left: -100%; top: 0; }
.craft-photo img[style*="100% 0%"] { left: -200%; top: 0; }
.craft-photo img[style*="0% 100%"] { left: 0; }
.craft-photo img[style*="50% 100%"] { left: -100%; }
.craft-photo img[style*="100% 100%"] { left: -200%; }
.craft-photo img[style*="% 100%"] {
  height: 196.545106%;
  top: -96.545106%;
}

.craft-image-label {
  position: absolute;
  z-index: 1;
  top: 18px;
  left: 18px;
  max-width: calc(100% - 36px);
  padding: 9px 11px;
  background: rgba(247, 246, 240, .91);
  color: var(--ink, #183d32);
  font-family: var(--sans, 'DM Sans', Arial, sans-serif);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .1em;
}

.craft-zoom {
  position: absolute;
  z-index: 1;
  right: 18px;
  bottom: 18px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(24, 61, 50, .18);
  border-radius: 50%;
  background: var(--cream, #f7f6f0);
  font-size: 21px;
  line-height: 1;
  transition: background 250ms, color 250ms, transform 400ms;
}

.craft-card-copy {
  padding-top: 25px;
}

.craft-card-copy .eyebrow {
  color: var(--muted, #73796d);
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: .15em;
}

.craft-card-copy h3 {
  margin: 12px 0 9px;
  color: var(--ink, #183d32);
  font-family: var(--sans, 'DM Sans', Arial, sans-serif);
  font-size: clamp(19px, 1.55vw, 24px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.craft-card-copy p {
  margin: 0;
  color: var(--muted, #73796d);
  font-size: 13px;
  line-height: 1.8;
}

.craft-link {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  min-height: 44px;
  margin-top: 15px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid rgba(24, 61, 50, .32);
  border-radius: 0;
  background: transparent;
  color: var(--ink, #183d32);
  font-family: var(--sans, 'DM Sans', Arial, sans-serif);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: border-color 250ms, color 250ms;
}

.craft-link span {
  font-size: 18px;
  transition: transform 250ms;
}

.craft-link:hover {
  border-color: var(--accent, #b66b4d);
  color: var(--accent, #b66b4d);
}

.craft-link:hover span {
  transform: translate(2px, -2px);
}

.craft-image-button:focus-visible,
.craft-link:focus-visible {
  outline: 2px solid var(--ink, #183d32);
  outline-offset: 6px;
}

/* The home page has a generous leading image and two quieter, staggered cards. */
.finished .craft-grid:not(#craft-grid) {
  grid-template-columns: 1.32fr .85fr .85fr;
  gap: clamp(24px, 3.5vw, 56px);
}

.finished .craft-grid:not(#craft-grid) .craft-card:nth-child(2) {
  margin-top: clamp(70px, 8vw, 128px);
}

.finished .craft-grid:not(#craft-grid) .craft-card:nth-child(3) {
  margin-top: clamp(25px, 3vw, 48px);
}

.finished .craft-grid:not(#craft-grid) .craft-card:first-child h3 {
  max-width: 360px;
  font-size: clamp(23px, 2vw, 30px);
}

.finished #craft-grid .craft-card:nth-child(3n + 2) {
  margin-top: 60px;
}

.gallery-note {
  display: flex;
  align-items: start;
  gap: 18px;
  margin-top: clamp(52px, 6vw, 88px);
  padding-top: 25px;
  border-top: 1px solid rgba(24, 61, 50, .2);
}

.gallery-note > span {
  color: var(--accent, #b66b4d);
  font-size: 28px;
  line-height: 1.15;
}

.gallery-note p {
  max-width: 760px;
  margin: 0;
  color: var(--muted, #73796d);
  font-size: 13px;
  line-height: 1.85;
}

.finished > .sample-note {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid rgba(24, 61, 50, .2);
  font-size: 13px;
  line-height: 1.8;
}

.craft-dialog {
  width: min(1180px, calc(100vw - 64px));
  max-width: 1180px;
  max-height: calc(100dvh - 64px);
  overflow: auto;
  border: 1px solid var(--line, #d7dbd0);
  border-radius: 2px;
  background: var(--cream, #f7f6f0);
  color: var(--ink, #183d32);
}

.craft-dialog[open] {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  align-items: center;
  gap: clamp(30px, 4vw, 58px);
  padding: clamp(32px, 3.5vw, 50px);
}

#craft-preview {
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  background-image: url('/assets/finished-crafts.webp');
  background-size: 300% 203.578529%;
  border-radius: 1px;
}

#craft-preview[style*="% 100%"] {
  background-size: 300% 196.545106%;
}

.craft-dialog .dialog-copy {
  min-width: 0;
  padding: 14px 0;
}

.craft-dialog .dialog-copy > .eyebrow {
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: .12em;
}

.craft-dialog .dialog-copy h2 {
  margin: 18px 0 20px;
  font-family: var(--serif, 'Cormorant Garamond', Georgia, serif);
  font-size: clamp(36px, 3.4vw, 50px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.035em;
}

.craft-dialog .dialog-copy > p,
.craft-detail p {
  color: var(--muted, #73796d);
  font-size: 14px;
  line-height: 1.8;
}

.craft-detail {
  margin-top: 27px;
  padding-top: 24px;
  border-top: 1px solid var(--line, #d7dbd0);
}

.craft-detail strong {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}

.craft-detail p {
  margin: 10px 0 0;
}

.craft-dialog .dialog-copy .sample-note {
  margin: 20px 0 24px;
  font-size: 13px;
  line-height: 1.7;
}

.craft-dialog .btn {
  width: 100%;
  justify-content: space-between;
  font-size: 13px;
}

@media (hover: hover) {
  .craft-image-button:hover .craft-photo { transform: scale(1.035); }
  .craft-image-button:hover .craft-zoom {
    background: var(--ink, #183d32);
    color: var(--cream, #f7f6f0);
    transform: rotate(-8deg);
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .finished .craft-grid,
  .finished .craft-grid:not(#craft-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px 24px;
  }

  .finished .craft-grid .craft-card:nth-child(n) { margin-top: 0; }
  .finished .craft-grid:not(#craft-grid) .craft-card:nth-child(2) { margin-top: 72px; }
  .finished #craft-grid .craft-card:nth-child(even) { margin-top: 45px; }
  .finished .craft-grid:not(#craft-grid) .craft-card:first-child h3 { font-size: 24px; }

  .craft-dialog { width: calc(100vw - 40px); }
  .craft-dialog[open] { gap: 24px; padding: 32px; }
  .craft-dialog .dialog-copy h2 { font-size: 36px; }
}

@media (max-width: 600px) {
  .finished .section-heading { align-items: start; margin-bottom: 36px; }
  .finished .section-heading > p { max-width: none; font-size: 14px; }
  .finished .filter-row { margin-bottom: 30px; }
  .finished .filters { gap: 6px 15px; }
  .finished .filters button { min-height: 44px; padding: 10px 0; font-size: 12px; }

  .finished .craft-grid,
  .finished .craft-grid:not(#craft-grid) {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .finished .craft-grid .craft-card:nth-child(n) { margin-top: 0; }
  .craft-image-label { top: 16px; left: 16px; padding: 8px 10px; font-size: 10px; }
  .craft-zoom { right: 16px; bottom: 16px; width: 42px; height: 42px; }
  .craft-card-copy { padding-top: 22px; }
  .craft-card-copy h3,
  .finished .craft-grid:not(#craft-grid) .craft-card:first-child h3 { font-size: 23px; }
  .craft-card-copy p { font-size: 14px; }
  .craft-link { margin-top: 12px; font-size: 13px; }
  .gallery-note { gap: 14px; margin-top: 44px; padding-top: 22px; }
  .gallery-note > span { font-size: 25px; }
  .gallery-note p { font-size: 13px; }

  .craft-dialog {
    width: calc(100vw - 28px);
    max-height: calc(100dvh - 28px);
  }

  .craft-dialog[open] {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 48px 22px 26px;
  }

  .craft-dialog .dialog-copy { padding: 0; }
  .craft-dialog .dialog-copy h2 { margin: 16px 0; font-size: 38px; }
  .craft-dialog .dialog-copy > .eyebrow { font-size: 10px; }
  .craft-detail { margin-top: 24px; padding-top: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .craft-image-button .craft-photo,
  .craft-zoom,
  .craft-link,
  .craft-link span { transition: none; }
}
