/* CSS Variablen */
:root {
  --gap: 15px;
  --max-width: 1400px;
  --transition-speed: 0.2s;
}

@media (max-width: 768px) {
  :root {
    --gap: 12px;
    --radius: 6px;
  }
}

@media (max-width: 480px) {
  :root {
    --gap: 8px;
  }
}

/* Main Container */
.photos.content {
  max-width: none;
  width: 100%;
  margin: 0;
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
}

/* Month Headers */
.month-header {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  color: var(--accent1);
  text-align: center;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.month-header:first-child {
  margin-top: 0;
}

.month-header::before,
.month-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--accent2);
  opacity: 0.3;
}

/* Instagram-Style Grid */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: var(--gap);
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .photos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Photo Tiles */
.photo-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-speed) ease,
              box-shadow var(--transition-speed) ease;
  display: block;
  text-decoration: none;
}

.photo-tile.keyboard-focused {
  outline: 3px solid var(--link);
  outline-offset: 4px;
  border-radius: var(--radius-default);
  transition: outline 0.2s ease;
}

.photo-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.photo-tile:active {
  transform: translateY(-2px);
}

/* Photo Images */
.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Hover Overlay - Bottom-to-Mid Gradient */
.photo-tile.has-title::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0.48) 35%,
    rgba(0, 0, 0, 0.18) 60%,
    rgba(0, 0, 0, 0) 80%
  );
  opacity: 0;
  transition: opacity var(--transition-speed) ease;
  pointer-events: none;
  z-index: 1;
}

.photo-tile.has-title:hover::before,
.photo-tile.has-title:focus-visible::before,
.photo-tile.has-title.show-info::before {
  opacity: 1;
}

/* Date Badge - Top Right */
.date-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.2;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--transition-speed) ease,
              transform var(--transition-speed) ease;
  pointer-events: none;
  backdrop-filter: blur(6px);
  z-index: 2;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.photo-tile:hover .date-badge,
.photo-tile:focus-visible .date-badge,
.photo-tile.show-info .date-badge {
  opacity: 1;
  transform: translateY(0);
}

/* Title Badge - Bottom mit sanftem Gradient */
.title-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-end;
  padding: 2.5rem 1rem 0.8rem;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  color: #ffffff;
  background: linear-gradient(0deg,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.4) 40%,
    rgba(0, 0, 0, 0.15) 75%,
    transparent 100%);
  border-radius: inherit;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--transition-speed) ease,
              transform var(--transition-speed) ease;
  pointer-events: none;
  z-index: 2;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-align: left;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.38);
}

.photo-tile.has-title:hover .title-badge,
.photo-tile.has-title:focus-visible .title-badge,
.photo-tile.has-title.show-info .title-badge {
  opacity: 1;
  transform: translateY(0);
}

/* Focus States für Accessibility */
.photo-tile:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 3px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .photo-tile {
    background: var(--accent1);
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .photo-tile,
  .photo-tile.has-title::before,
  .date-badge,
  .title-badge {
    transition: none;
  }
}
