.mosaic {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
}
.mosaic .tile {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}
.mosaic img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Opt 1 ---------- */
.mosaic--2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ---------- Opt 2 ---------- */
.mosaic--3 {
  display: grid;
  grid-template-columns: 25% 25% 50%;
}

/* ---------- Opt 3 ---------- */
.mosaic--4 {
  display: grid;
  grid-template-columns: 25% 25% 50%;
}
.mosaic--4 .col-left {
  display: flex;
  flex-direction: column;
}
.mosaic--4 .col-left .tile {
  flex: 1 1 50%;
}

/* ---------- Opt 4 ---------- */
.mosaic--5 {
  display: grid;
  grid-template-columns: 25% 25% 25% 25%;
}
.mosaic--5 .col-left {
  display: flex;
  flex-direction: column;
}
.mosaic--5 .col-left .tile {
  flex: 1 1 50%;
}

/* ---------- Opt 5 (alt1) ---------- */
.mosaic--5-alt {
  display: grid;
  grid-template-columns: 25% 75%;
}
.mosaic--5-alt .row-top,
.mosaic--5-alt .row-bottom {
  display: flex;
}
.mosaic--5-alt .row-top .tile:nth-child(1) {
  flex: 2 1 66.6%;
}
.mosaic--5-alt .row-top .tile:nth-child(2) {
  flex: 1 1 33.3%;
}
.mosaic--5-alt .row-bottom .tile:nth-child(1) {
  flex: 1 1 33.3%;
}
.mosaic--5-alt .row-bottom .tile:nth-child(2) {
  flex: 2 1 66.6%;
}

/* ---------- Opt 6 ---------- */
.mosaic--6 {
  display: grid;
  grid-template-columns: 25% 50% 25%; /* 3 columns */
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.mosaic--6 .col-1,
.mosaic--6 .col-2,
.mosaic--6 .col-3 {
  display: flex;
  flex-direction: column;
  min-width: 0; /* ensure columns can shrink */
}

/* Left column: 1 tall image */
.mosaic--6 .col-1 .tile {
  flex: 1 1 100%;
  position: relative;
}

/* Middle column: large top + 2 small bottom */
.mosaic--6 .col-2 .tile.large {
  flex: 1 1 50%;
  position: relative;
}

.mosaic--6 .col-2 .row-bottom {
  display: flex;
  flex: 1 1 50%;
  min-width: 0;
}

.mosaic--6 .col-2 .row-bottom .tile {
  flex: 1 1 50%;
  position: relative;
}

/* Right column: 2 stacked equally */
.mosaic--6 .col-3 .tile {
  flex: 1 1 50%;
  position: relative;
}

/* ---------- Opt 7 (alt1) ---------- */
.mosaic--6-alt {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.mosaic--6-alt .col-1,
.mosaic--6-alt .col-2 {
  display: flex;
  flex-direction: column;
}
.mosaic--6-alt .row-top,
.mosaic--6-alt .row-bottom {
  display: flex;
}
.mosaic--6-alt .row-top .tile,
.mosaic--6-alt .row-bottom .tile {
  flex: 1 1 50%;
}
.mosaic--6-alt .tile.large {
  flex: 1 1 75%;
}
/* ---------- Opt 7 (7 images) ---------- */
.mosaic--7 {
  display: grid;
  grid-template-columns: 25% 50% 25%;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.mosaic--7 .col-1,
.mosaic--7 .col-2,
.mosaic--7 .col-3 {
  display: flex;
  flex-direction: column;
  min-width: 0; /* prevent overflow in flex children */
}

/* Left column: 3 stacked equally */
.mosaic--7 .col-1 .tile {
  flex: 1 1 33.333%;
  position: relative;
}

/* Middle column: large top (50%) + 2 small bottom (split) */
.mosaic--7 .col-2 .tile.large {
  flex: 1 1 50%;
  position: relative;
}
.mosaic--7 .col-2 .row-bottom {
  display: flex;
  flex: 1 1 50%;
  min-width: 0;
}
.mosaic--7 .col-2 .row-bottom .tile {
  flex: 1 1 50%;
  position: relative;
  min-width: 0;
}

/* Right column: 2 stacked equally */
.mosaic--7 .col-3 .tile {
  flex: 1 1 50%;
  position: relative;
}

/* ---------- Opt 8 (8 images) ---------- */
.mosaic--8 {
  display: grid;
  grid-template-columns: 25% 75%;
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

/* Left column: 3 tiles stacked directly as children */
.mosaic--8 > .tile:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
  position: relative;
}

.mosaic--8 > .tile:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
  position: relative;
}

.mosaic--8 > .tile:nth-child(3) {
  grid-column: 1;
  grid-row: 3;
  position: relative;
}

/* Right column wrapper */
.mosaic--8 .right-column {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mosaic--8 .right-column .row-top {
  display: flex;
  flex: 1 1 50%;
  min-width: 0;
}

.mosaic--8 .right-column .row-top .tile {
  flex: 1 1 50%;
  position: relative;
  min-width: 0;
}

.mosaic--8 .right-column .row-bottom {
  display: flex;
  flex: 1 1 50%;
  min-width: 0;
}

.mosaic--8 .right-column .row-bottom .tile {
  flex: 1 1 33.333%;
  position: relative;
  min-width: 0;
}