/* Billedmosaik: en diamant i midten omgivet af otte fliser, hvor de to inderste søjler
   forskydes op og ned. Rent geometrisk — billederne skifter langsomt, resten står stille. */
.mosaic { max-width: var(--mosaic-w, 560px); margin: 0 auto var(--sp-5); }
.home .mosaic { --mosaic-w: 720px; margin-bottom: var(--sp-7); }
.mosaic-caption { text-align: center; color: var(--c-text-2); margin: 0 0 var(--sp-3); font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .08em; }
.mosaic-frame { position: relative; padding: 26px 0; }
.mosaic-ring { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); }
.mosaic-tile { aspect-ratio: 1; }
.mosaic-ring > li:nth-child(2), .mosaic-ring > li:nth-child(3) { transform: translateY(-26px); }
.mosaic-ring > li:nth-child(6), .mosaic-ring > li:nth-child(7) { transform: translateY(26px); }

.mosaic-link { position: absolute; inset: 0; display: block; border-radius: var(--radius); overflow: hidden; background: var(--c-surface-2); box-shadow: var(--shadow-1); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.mosaic-tile, .mosaic-diamond { position: relative; }
.mosaic-link:hover, .mosaic-link:focus-visible { transform: scale(1.03); box-shadow: var(--shadow-2); }
/* Den flise man peger på, lægger sig øverst — ellers dækker diamanten dens nederste hjørne. */
.mosaic-tile { z-index: 1; }
.mosaic-tile:hover, .mosaic-tile:focus-within { z-index: 3; }
.mosaic-photos { position: absolute; inset: 0; }
.mosaic-photos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s var(--ease); }
.mosaic-photos img.is-on { opacity: 1; }
.mosaic-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px var(--sp-3) 8px; font-size: var(--fs-0); font-weight: 700; color: #fff; background: linear-gradient(to top, rgba(23,17,26,.72), transparent); opacity: 0; transition: opacity var(--dur) var(--ease); }
.mosaic-link:hover .mosaic-name, .mosaic-link:focus-visible .mosaic-name { opacity: 1; }
/* Diamanten dækker midten, så navnene skubbes udad: højre halvdel skriver mod højre. */
.mosaic-ring > li:nth-child(3) .mosaic-name, .mosaic-ring > li:nth-child(4) .mosaic-name,
.mosaic-ring > li:nth-child(7) .mosaic-name, .mosaic-ring > li:nth-child(8) .mosaic-name { text-align: right; }

/* Diamanten: kvadratet drejes, indholdet drejes tilbage og skaleres, så billedet fylder hjørnerne. */
.mosaic-diamond { position: absolute; z-index: 2; left: 50%; top: 50%; width: 32%; aspect-ratio: 1; transform: translate(-50%, -50%) rotate(45deg); border-radius: 24px; border: 10px solid var(--c-bg); box-shadow: var(--shadow-2); overflow: hidden; }
.mosaic-diamond .mosaic-link { border-radius: 0; box-shadow: none; transform: rotate(-45deg) scale(1.42); }
.mosaic-diamond .mosaic-link:hover, .mosaic-diamond .mosaic-link:focus-visible { transform: rotate(-45deg) scale(1.48); }
.mosaic-diamond .mosaic-name { bottom: 42%; text-align: center; background: none; padding: 0; text-shadow: 0 2px 10px rgba(23,17,26,.7); }

@media (max-width: 700px) {
  .mosaic { margin-bottom: var(--sp-5); }
  .mosaic-frame { padding: 18px 0; }
  .mosaic-ring { gap: 6px; }
  .mosaic-ring > li:nth-child(2), .mosaic-ring > li:nth-child(3) { transform: translateY(-16px); }
  .mosaic-ring > li:nth-child(6), .mosaic-ring > li:nth-child(7) { transform: translateY(16px); }
  .mosaic-diamond { width: 38%; border-width: 6px; border-radius: 16px; }
  .mosaic-name { opacity: 1; font-size: 11px; padding: 18px 6px 5px; }
  /* Navnene på de inderste fliser ligger under diamanten — vis kun de yderste */
  .mosaic-ring > li:nth-child(2) .mosaic-name, .mosaic-ring > li:nth-child(3) .mosaic-name,
  .mosaic-ring > li:nth-child(6) .mosaic-name, .mosaic-ring > li:nth-child(7) .mosaic-name,
  .mosaic-diamond .mosaic-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mosaic-photos img { transition: none; }
  .mosaic-link, .mosaic-name { transition: none; }
}
