@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@300;600&display=swap');

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: white;
  font-family: 'Barlow Condensed', sans-serif;
  overflow-x: hidden;
}

.grid-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  text-align: center;
  box-sizing: border-box;
  width: 100%;
}

.page-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 960px;
}

h1 {
  margin-bottom: 10px;
  font-size: 40px;
  font-weight: 600;
  color: #222;
}

.subtitle {
  margin: -5px 0 25px;
  font-size: 18px;
  color: #555;
  font-weight: 300;
  text-align: center;
  padding: 0 10px;
}

#search {
  margin-bottom: 30px;
  padding: 10px;
  font-size: 16px;
  width: 90%;
  max-width: 400px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-family: 'Barlow Condensed', sans-serif;
  box-sizing: border-box;
}

/* ✅ Updated for centered layout and footer margin */
.grid-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  padding: 20px;
  box-sizing: border-box;
  margin-bottom: 100px;
}

.grid-item {
  text-align: center;
  position: relative;
  width: 158px;
}

.photo-container {
  position: relative;
  width: 158px;
  height: 158px;
  border-radius: 50%;
  overflow: hidden;
  box-sizing: border-box;
  margin: 0 auto;
}

.photo-container.hover-enabled {
  cursor: pointer;
}

.photo-container.no-audio {
  cursor: default;
}

.photo-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  opacity: 0;
  transition: opacity 0.5s ease;
  position: absolute;
  top: 0;
  left: 0;
  filter: grayscale(100%);
}

.photo-container img.loaded {
  opacity: 1;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(128, 128, 128, 0.4);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 2;
}

.photo-container.hover-enabled:hover .overlay {
  opacity: 1;
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  text-align: center;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-icon svg {
  width: 24px;
  height: 24px;
}

.photo-container.hover-enabled:hover .play-icon,
.grid-item.playing .play-icon {
  opacity: 1;
}

.name {
  margin-top: 10px;
  font-size: 16px;
  color: #333;
  font-weight: 300;
  word-wrap: break-word;
  padding: 0 5px;
}

.photo-container.audio-active {
  animation: pulseBorder 1.2s ease-in-out infinite;
  outline: 3px solid #1e90ff;
  outline-offset: -3px;
  border-radius: 50%;
}

@keyframes pulseBorder {
  0% {
    box-shadow: 0 0 0 0 rgba(30, 144, 255, 0.7);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(30, 144, 255, 0.2);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(30, 144, 255, 0.7);
  }
}

.photo-container.audio-fadeout {
  animation: none !important;
  transition: outline 0.3s ease, box-shadow 0.3s ease;
  outline: 0 solid transparent;
  box-shadow: none;
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  text-align: center;
  font-size: 16px;
  color: #555;
  padding: 15px 20px;
  box-shadow: 0 -1px 5px rgba(0,0,0,0.1);
  z-index: 1000;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.footer a {
  color: #1e90ff;
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}

.mobile-only {
  display: none;
}

#end-message {
  display: none; /* hidden by default */
}

@media (max-width: 1024px) {
  .mobile-only {
    display: inline;
  }
}

/* ✅ Keep mobile layout as-is */
@media (max-width: 500px) {
  .grid-container {
    gap: 100px;
  }

  .grid-container::after {
  display: none;
  }

  .grid-item,
  .photo-container {
    width: 200px;
    height: 200px;
  }

  .photo-container img {
    width: 100%;
    height: 100%;
  }

  h1 {
    font-size: 30px;
  }

  .subtitle {
    font-size: 16px;
  }

  .name {
    font-size: 17px;
  }
}

.end-message {
  text-align: center;
  font-size: 18px;
  color: #555;
  margin-top: 20px;
  margin-bottom: 100px; /* leaves space above footer */
  font-weight: 300;
  font-family: 'Barlow Condensed', sans-serif;
}

@media (min-width: 1025px) {
  .end-message {
    display: none;
  }
}

#scroll-sentinel {
  width: 100%;
  height: 1px;
}

