/* Shared portfolio tile image constraints — all agency example cities */

/* Grid/flex children must shrink below intrinsic image width */
[class$='-tile__body'],
[class$='-tile__frame'],
[class$='-tile__art'],
[class$='-tile__art-inner'],
[class$='-tile'] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.fra-work__grid > .fra-tile,
.prs-work__track > .prs-tile,
.tky-work__grid > .tky-tile,
.ldn-work__grid > .ldn-tile,
.syd-work__track > .syd-tile,
.nyc-work__grid > .nyc-tile,
[class$='-work__grid'] > [class$='-tile'],
[class$='-work__track'] > [class$='-tile'] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.fra-work__grid,
.prs-work__track,
.tky-work__grid,
.ldn-work__grid,
.syd-work__track,
.nyc-work__grid {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

[class$='-tile__img-wrap'] {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

img[class$='-tile__img'] {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  object-fit: contain;
  object-position: center;
}

/* Tokyo: override legacy 1:1 square frames */
.tky-tile__img-wrap {
  aspect-ratio: 3 / 2;
}

/* NYC art tiles use slightly different campaign proportions */
.nyc-tile__img-wrap {
  aspect-ratio: 1448 / 1086;
}

/* NYC: mat lives on art-inner; img-wrap stays flush at all breakpoints */
.nyc-tile__img-wrap {
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

/* Horizontal swipe work tracks (Paris, Sydney) — right-edge scroll hint */
@media (max-width: 1023px) {
  .prs-work__track,
  .syd-work__track {
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
  }
}

/* Pending-art placeholders fill the aspect box */
[class$='-tile__img-wrap'].ae-art-pending,
[class$='__img-wrap'].ae-art-pending {
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}

/* Mobile: light mat so swipe cards stay compact */
@media (max-width: 1023px) {
  [class$='-tile__img-wrap'] {
    padding: 0.25rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.92);
  }
}

/* Desktop: thick mat/board frame around portfolio art */
@media (min-width: 1024px) {
  [class$='-tile__frame'] {
    padding: 0.875rem;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.96);
    border: 3px solid var(--ae-tile-frame-border, rgba(0, 0, 0, 0.14));
    border-radius: var(--ae-tile-frame-radius, 4px);
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.12),
      inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  }

  [class$='-tile__img-wrap'] {
    padding: 0.875rem;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.96);
    border: 3px solid var(--ae-tile-frame-border, rgba(0, 0, 0, 0.14));
    border-radius: var(--ae-tile-frame-radius, 4px);
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.12),
      inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  }

  /* Cities with outer frame: mat lives on frame, img-wrap stays flush */
  [class$='-tile__frame'] [class$='-tile__img-wrap'] {
    padding: 0;
    border: none;
    border-radius: 2px;
    box-shadow: none;
    background: transparent;
  }

  img[class$='-tile__img'] {
    border-radius: 2px;
  }
}

/* Per-city accent borders and radius */
.syd-tile__img-wrap {
  --ae-tile-frame-border: var(--syd-teal, #1a6b7a);
  --ae-tile-frame-radius: 10px;
}

.ldn-tile__frame {
  --ae-tile-frame-border: var(--ldn-green, #1e3a2f);
  --ae-tile-frame-radius: 2px;
}

.prs-tile__frame {
  --ae-tile-frame-border: var(--prs-accent, #8b5a4a);
  --ae-tile-frame-radius: 0;
}

.fra-tile__img-wrap {
  --ae-tile-frame-border: var(--fra-amber, #d4a03c);
  --ae-tile-frame-radius: 0;
}

.tky-tile__img-wrap {
  --ae-tile-frame-border: rgba(228, 231, 236, 0.35);
  --ae-tile-frame-radius: 0;
  background: var(--tky-panel, #161a20);
}

@media (min-width: 1024px) {
  .tky-tile__img-wrap {
    background: #1c2129;
  }
}

/* NYC: enhance existing art-inner mat without double border */
@media (min-width: 1024px) {
  .nyc-tile__art-inner {
    padding: 0.875rem;
    border: 3px solid rgba(244, 246, 251, 0.22);
    border-radius: 6px;
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.28),
      inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  }
}
