.section__travelphotogallery {
  --travelphotogallery-card-size: 18rem;
  --travelphotogallery-card-radius: 16px;
  --travelphotogallery-card-border: var(--color-border);
  --travelphotogallery-card-focus: var(--color-focus);
  --travelphotogallery-card-shadow: var(--shadow-color);
  --travelphotogallery-card-focus-ring: color-mix(in srgb, var(--color-focus) 28%, transparent);
  --travelphotogallery-card-focus-shadow: color-mix(in srgb, var(--color-primary) 20%, transparent);
  --travelphotogallery-card-title-shadow: var(--color-surface);
  --travelphotogallery-card-text-shadow: var(--color-surface);
}

.section__travelphotogallery .travelphotogallery-card-group {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 1rem;
  padding: 12px;
}

.section__travelphotogallery .travelphotogallery-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex: 0 1 var(--travelphotogallery-card-size);
  flex-direction: column;
  width: min(100%, var(--travelphotogallery-card-size));
  max-width: var(--travelphotogallery-card-size);
  height: var(--travelphotogallery-card-size);
  min-width: 0;
  overflow: hidden;
  color: var(--trip-card-text);
  background: var(--trip-card-bg);
  border: 1px solid var(--travelphotogallery-card-border);
  border-radius: var(--travelphotogallery-card-radius);
  box-shadow: 0 4px 14px var(--travelphotogallery-card-shadow);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.section__travelphotogallery .travelphotogallery-card::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, var(--trip-card-overlay-top) 0%, var(--trip-card-overlay-middle) 42%, var(--trip-card-overlay-bottom) 100%);
  pointer-events: none;
}

.section__travelphotogallery .travelphotogallery-card:hover,
.section__travelphotogallery .travelphotogallery-card:focus-within {
  border-color: var(--travelphotogallery-card-focus);
  box-shadow: 0 0 0 3px var(--travelphotogallery-card-focus-ring), 0 14px 32px var(--travelphotogallery-card-focus-shadow);
  transform: translateY(-2px);
}

.section__travelphotogallery .travelphotogallery-card-photo {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
}

.section__travelphotogallery .travelphotogallery-card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.section__travelphotogallery .travelphotogallery-card-overlay,
.section__travelphotogallery .travelphotogallery-card-body {
  position: relative;
  z-index: 3;
}

.section__travelphotogallery .travelphotogallery-card-overlay {
  padding: 1rem 1rem 0.75rem;
  pointer-events: none;
}

.section__travelphotogallery .travelphotogallery-card-body {
  flex: 0 1 auto;
  margin-top: auto;
  padding: 1rem;
  overflow: hidden;
}

.section__travelphotogallery .travelphotogallery-card-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--trip-card-text);
  text-shadow: 0 2px 8px var(--travelphotogallery-card-title-shadow);
}

.section__travelphotogallery .travelphotogallery-card-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--trip-card-muted);
  text-shadow: 0 1px 6px var(--travelphotogallery-card-title-shadow);
}

.section__travelphotogallery .travelphotogallery-card-text {
  display: -webkit-box;
  max-height: 4.5em;
  margin: 0;
  overflow: hidden;
  color: var(--trip-card-text);
  font-size: 0.8rem;
  line-height: 1.5;
  text-shadow: 0 1px 6px var(--travelphotogallery-card-text-shadow);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.section__travelphotogallery .travelphotogallery-card-group-header {
  padding: 0 12px 1rem;
}

.section__travelphotogallery .travelphotogallery-card-group-title {
  margin: 0;
  padding: 0;
  color: var(--trip-surface-text);
  font-size: 1rem;
  line-height: 1.2;
}

.section__travelphotogallery .travelphotogallery-card-group-title:empty {
  display: none;
}

@media (max-width: 420px) {
  .section__travelphotogallery {
    --travelphotogallery-card-size: min(18rem, calc(100vw - 2rem));
  }
}

@media (prefers-reduced-motion: reduce) {
  .section__travelphotogallery .travelphotogallery-card {
    transition: none;
  }

  .section__travelphotogallery .travelphotogallery-card:hover,
  .section__travelphotogallery .travelphotogallery-card:focus-within {
    transform: none;
  }
}
