/* Mosaic puzzle styles – minimal and theme-aware */
:root {
  --egg-gap: 0.5rem;
  --egg-radius: 6px;
  --egg-tile-bg: #e9e9e9;
  --egg-tile-bg-dark: #2a2a2a;
  --egg-tile-border: var(--border, #ddd);
  --egg-accent: var(--link, #cc0000);
}

.mosaic { margin: 1.25rem 0 2rem; }
.mosaic-status { min-height: 1.25rem; font-size: 0.95rem; opacity: 0.8; }

.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: var(--egg-gap);
}

@media (max-width: 900px) {
  .mosaic-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 520px) {
  .mosaic-grid { grid-template-columns: repeat(3, 1fr); }
}

.mosaic-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--egg-tile-border);
  border-radius: 0 !important;
  cursor: pointer;
  background-color: var(--egg-tile-bg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  filter: grayscale(100%) contrast(1.05) brightness(0.95);
}
[data-theme="dark"] .mosaic-tile { background-color: var(--egg-tile-bg-dark); filter: grayscale(100%) contrast(1.0) brightness(0.85); }

.mosaic-tile:focus-visible { outline: 2px solid var(--egg-accent); outline-offset: 2px; }
.mosaic-tile:hover { transform: translateY(-1px); }

.mosaic-tile.highlight {
  box-shadow: 0 0 0 2px var(--egg-accent) inset, 0 2px 10px rgba(0,0,0,0.12);
  filter: none;
}
.mosaic-tile.highlight.pulse { animation: eggPulse 1.3s ease-in-out 0.2s infinite alternate; }
@keyframes eggPulse { from { transform: scale(1); } to { transform: scale(1.03); } }

.mosaic-tile.shake { animation: eggShake 220ms ease-in-out; }
@keyframes eggShake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

.mosaic-headline { margin-top: 0.75rem; font-style: italic; opacity: 0.85; display: none !important; }
.mosaic-headline[data-state='shown'] { display: none !important; }

.reveal { margin-top: 1rem; display: grid; gap: 0.75rem; justify-items: center; text-align: center; }
.reveal[hidden] { display: none !important; }
.reveal-image {
  width: 100%;
  aspect-ratio: 16 / 6;
  border: 1px solid var(--egg-tile-border);
  border-radius: 0 !important;
  background: center/cover no-repeat url('../images/site/Hermes.png');
  filter: grayscale(100%) contrast(1.05) brightness(0.92);
}
.reveal-text { font-weight: 600; letter-spacing: 0.01em; text-align: center; }
.reveal-actions { display: flex; gap: 0.5rem; justify-content: center; }
.reveal-actions .btn-copy, .reveal-actions .btn-sr {
  appearance: none;
  border: none;
  background: #333;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0 !important;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

/* Reset button styling - match site buttons and keep square corners */
.mosaic-reset-btn {
  border-radius: 0 !important;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none !important;
  color: white !important;
  background: #333 !important;
  padding: 0.75rem 1.5rem !important;
  white-space: nowrap;
}
.reveal-actions .btn-copy:hover, .reveal-actions .btn-sr:hover {
  background: #333;
  color: #cc0000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.mosaic-reset-btn:hover {
  background: #333 !important;
  color: #cc0000 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Visually hidden utility for screen readers */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .mosaic-tile, .mosaic-tile.highlight.pulse, .mosaic-tile.shake, .reveal-image { animation: none; transition: none; }
}
