.hero-section {
  padding: 3rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 3rem;
}

.hero-content {
  max-width: 690px;
  text-align: center;
}

.hero-title {
  font-family: "Manrope", sans-serif;
  font-weight: 600; 
  font-size: 4.2rem; 
  line-height: 1.05; 
  color: var(--color-black);
  margin: 0 auto;
  letter-spacing: -0.04em;
  line-height: 1.1;
  max-width: 900px;
}

.subtitle-section {
  text-align: center;
  margin: 0 auto 4rem auto;
  padding: 0rem 2rem;
  max-width: 650px;
}

.subtitle {
  font-family: "Manrope", sans-serif;
  font-size: 1.1875rem;
  font-weight: 500;
  line-height: 1.6;
  color: #555;
  margin: 0 auto;
  max-width: 580px;
}

.search-section {
  margin: 3rem auto 4rem auto;
  padding: 0 2rem;
}

.search-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 0 auto;
  max-width: 800px;
  background: transparent;
  border: none;
  box-shadow: none;
  height: auto;
}

.search-input-wrapper {
  flex: 1;
  background-color: var(--color-white);
  border-radius: 12px;
  padding: 0.5rem 1.75rem;
  height: 60px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--color-gray-border);
  transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.search-input {
  all: unset;
  font-family: inherit;
  font-size: 1.125rem;
  width: 100%;
  color: var(--color-black);
  caret-color: var(--color-primary);
  background: transparent;
}

.search-input::placeholder {
  color: var(--color-text-gray);
}

.filter-dropdown {
  display: flex;
  align-items: center;
}

.filter-button {
  all: unset;
  font-family: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 30px;
  color: var(--color-black);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease;
}

.filter-button:hover {
  color: var(--color-text-dark);
}

.dropdown-icon {
  font-size: 12px;
}

.search-button-wrapper {
  display: flex;
  align-items: center;
}

.search-button {
  all: unset;
  background-color: var(--color-black);
  color: var(--color-white);
  border-radius: 12px;
  padding: 0 2.5rem;
  height: 60px;
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  font-size: 1.125rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.search-button:hover {
  background-color: #333;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.search-button:active {
  transform: translateY(0);
}

.search-icon {
  display: none;
}

.trending-section {
  max-width: 900px;
  margin: 4rem auto 5rem auto;
  padding: 2rem 2rem;
  border-bottom: 1px solid rgba(231, 231, 233, 0.5);
  padding-bottom: 3rem;
}

.trending-label {
  font-family: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 30px;
  color: var(--color-text-dark);
  margin-bottom: 1.5rem;
}

.trending-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.trending-tag {
  padding: 0.5rem 1.25rem;
  background-color: var(--color-white);
  border: 2px solid var(--color-gray-border);
  border-radius: 9px;
  font-family: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-black);
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.trending-tag:hover {
  background-color: var(--color-gray-border);
  color: var(--color-black);
}

.grey {
  background-color: var(--color-gray-border);
  color: var(--color-black);
}

.gallery-section {
  max-width: 1400px;
  margin: 5rem auto 6rem auto;
  padding: 0 2rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 2rem;
  margin-top: 3rem;
  row-gap: 3rem;
}

@media (min-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr); /* Reduced from 3 to 2 for wider cards */
  }
}

.gallery-item {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--color-gray-border);
  background: var(--color-white);
  cursor: pointer;
  padding: 12px;
}

.author-name a {
  color: var(--color-primary) !important;
  transition: all 0.3s ease-in-out;
}

.author-name a:hover {
  text-decoration: underline;
  color: var(--color-primary-hover) !important;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.1);
}

.gallery-item:hover .gallery-image {
  transform: scale(1.05);
}

.gallery-image-wrapper {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 62%;
  overflow: hidden;
  background: var(--color-bg-sand);
  border-radius: 12px;
}

.gallery-image-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.05) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.gallery-item:hover .gallery-image-wrapper::before {
  opacity: 1;
}

.gallery-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.shot-actions-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 12px;
  opacity: 0; /* Only visible on hover as per user's latest request */
  transition: opacity 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

.gallery-item:hover .shot-actions-overlay {
  opacity: 1;
  /* Overlay itself should NOT capture clicks, only the badges inside do */
  pointer-events: none; 
}



.shot-actions-overlay .stat-badge {
  background: var(--color-white);
  border-radius: 40px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  color: var(--color-black);
  cursor: pointer;
  transition: all 0.2s ease;
  pointer-events: auto;
  border: 1px solid var(--color-gray-border);
}

.shot-actions-overlay .stat-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.shot-actions-overlay .stat-badge i {
  font-size: 14px;
}

.shot-actions-overlay .stat-badge.liked {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.gallery-content {
  padding: 16px 4px 8px 4px;
  background: var(--color-white);
  position: relative;
}

.gallery-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.shot-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 4px;
}

.shot-title {
  font-family: "Manrope", sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-black);
  margin: 0;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.external-link-badge {
  width: 32px;
  height: 32px;
  background-color: var(--color-black);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--color-white);
  flex-shrink: 0;
  transition: all 0.3s ease;
  cursor: pointer;
}

.gallery-item:hover .external-link-badge {
  transform: translateY(-2px);
  background-color: var(--color-primary);
}

.metadata-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Manrope", sans-serif;
  font-size: 0.875rem;
  color: var(--color-text-gray);
}

.category {
  font-weight: 500;
}

.separator {
  color: var(--color-text-form);
}

.reading-time {
  opacity: 0.8;
}

.gallery-item:hover .shot-title {
  color: var(--color-primary);
}

.shot-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  color: var(--color-text-gray);
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.gallery-item:hover .author-avatar {
  transform: scale(1.1);
}

.author-name {
  font-weight: 500;
  color: var(--color-text-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pro-badge {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 600;
}

.shot-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  opacity: 0.7;
  transform: translateY(2px);
  transition: all 0.3s ease;
}

.bookmark-btn {
  all: unset;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-white);
  border: 1px solid var(--color-gray-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.875rem;
  color: var(--color-text-gray);
}

.bookmark-btn:hover {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

/* Removed old stat-badge styles that were replaced by overlay */

.gallery-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.view-stats {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-text-gray);
}

.view-stats i {
  font-size: 0.875rem;
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-section {
    padding: 2rem 1rem;
    margin-bottom: 1.5rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .subtitle-section {
    margin: 0 auto 2rem auto;
    padding: 0 1rem;
  }

  .search-section {
    margin: 1.5rem auto 2rem auto;
    padding: 0 0.75rem;
  }

  .trending-section {
    margin: 2rem auto 3rem auto;
    padding: 1rem;
    padding-bottom: 2rem;
  }

  .gallery-section {
    margin: 2rem auto 3rem auto;
    padding: 0 0.75rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    row-gap: 2rem;
    margin-top: 1.5rem;
  }

  .gallery-item {
    padding: 8px;
    border-radius: 14px;
  }

  .search-container {
    flex-direction: column;
    height: auto;
    padding: 0;
    gap: 1rem;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .search-input-wrapper {
    width: 100%;
    height: 55px;
    padding: 0.5rem 1.5rem;
    background-color: var(--color-white);
    border: 2px solid var(--color-gray-border);
    border-radius: 12px;
  }

  .search-input {
    font-size: 1rem;
  }

  .search-button-wrapper {
    width: 100%;
  }

  .search-button {
    width: 100%;
    height: 55px;
    border-radius: 12px;
    padding: 0;
    font-size: 1.1rem;
    justify-content: center;
  }

  .trending-tags {
    justify-content: center;
  }

  .trending-tag {
    font-size: 13px;
    padding: 0.4rem 1rem;
  }

  .shot-title {
    font-size: 1rem;
  }

  .gallery-content {
    padding: 12px 4px 6px 4px;
  }
}

@media (min-width: 601px) and (max-width: 1024px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-container {
    max-width: 600px;
  }
}

@media (min-width: 1400px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr); /* Reduced from 4 to 3 for wider cards */
  }
}
