/* Palette: https://coolors.co/cdc392-e8e5da-483d3f-9eb7e5-648de5 */

body {
  background: #e8e5da;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* --- Navbar --- */
.navbar {
  background: #483d3f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.navbar .navbar-brand {
  color: #f4ebd9;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.2s;
}

.navbar .navbar-brand:hover {
  color: #f4ebd9;
  opacity: 0.8;
}

.navbar .nav-link {
  color: #cdc392;
  transition: color 0.2s;
}

.navbar .nav-link:hover {
  color: #f4ebd9;
}

/* --- Header row --- */
.header-row {
  background: #483d3f;
  color: #f4ebd9;
  padding: 0.5rem 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 1020;
}

/* --- Age labels --- */
.age-label-col {
  display: flex;
  align-items: flex-start;
}

.age-label {
  /* biome-ignore lint/complexity/noImportantStyles: overrides Bootstrap sticky-top */
  top: 4rem !important;
  background: #f4ebd9;
  border-left: 4px solid #648de5;
  padding: 0.25rem 0.6rem;
  border-radius: 0 4px 4px 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: #483d3f;
  white-space: normal;
  z-index: 100;
}

/* --- Photo rows --- */
.photo-row {
  margin-top: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #cdc392;
}

/* --- Collapsible rows --- */
.photo-row.collapsed .image-gallery .thumbnail-container:nth-child(n + 9) {
  display: none;
}

.expand-overlay {
  position: absolute;
  inset: 0;
  background: rgba(72, 61, 63, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f4ebd9;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 3;
  border-radius: 4px;
  transition: background 0.2s;
}

.expand-overlay:hover {
  background: rgba(100, 141, 229, 0.8);
}

/* --- Gallery grid --- */
.image-gallery {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  align-content: flex-start;
  gap: 3px;
  padding: 0 0.5rem;
}

/* --- Loading spinner --- */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.thumbnail-container.loading::after {
  background: none;
  inset: 0;
  margin: auto;
  width: 24px;
  height: 24px;
  border: 3px solid #cdc392;
  border-top-color: #648de5;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  opacity: 1;
  z-index: 1;
}

/* --- Thumbnails --- */
.thumbnail-container {
  position: relative;
  aspect-ratio: 1 / 1;
  width: calc(25% - 3px);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: #ddd;
}

.thumbnail-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

.thumbnail-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(100, 141, 229, 0.15), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.thumbnail-container:hover img {
  transform: scale(1.08);
  filter: brightness(1.05);
}

.thumbnail-container:hover::after {
  opacity: 1;
}

/* --- Selection --- */
.thumbnail-container.selected::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid #648de5;
  border-radius: 4px;
  z-index: 2;
  pointer-events: none;
}

/* --- Enlarge button --- */
.enlarge-btn {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1100;
  background: #648de5;
  color: #fff;
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: background 0.2s;
}

.enlarge-btn.visible {
  display: block;
}

.enlarge-btn:hover {
  background: #4a73cc;
}

/* --- Fullscreen overlay --- */
.fullscreen-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.fullscreen-overlay.open {
  display: flex;
}

.fullscreen-content {
  display: flex;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  align-items: center;
  justify-content: center;
}

.fullscreen-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  max-height: 100%;
  transition: opacity 0.8s ease;
}

.fullscreen-item img {
  max-height: 85vh;
  max-width: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.fullscreen-label {
  color: #f4ebd9;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.5rem;
  text-align: center;
}

/* --- Highlight overlay --- */
.highlight {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  height: 40%;
  width: fit-content;
  margin: 0.5rem;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.highlight.visible {
  opacity: 1;
}

.highlight p {
  position: absolute;
  top: 0;
  color: #fff;
  background: #648de5;
  width: 100%;
  border-radius: 0.75rem 0.75rem 0 0;
  margin: 0;
  padding: 0.25rem 0.5rem;
  text-align: center;
}

.highlight img {
  position: relative;
  height: 100%;
  border-radius: 0.75rem;
  border: 3px solid #648de5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
