/* ============================================
   GALÉRIA – ZJEDNOTENÁ S HLAVNOU PALETOU WEBU
   ============================================ */

:root {
  --gallery-gap: 2rem;
  --gallery-min-card: 260px;
  --gallery-min-photo: 350px;

  --gallery-radius-s: 4px;
  --gallery-radius-m: 6px;
  --gallery-radius-l: 8px;

  --gallery-shadow-s: 0 1px 4px rgba(0,0,0,0.10);
  --gallery-shadow-m: 0 2px 8px rgba(0,0,0,0.12);
  --gallery-shadow-l: 0 6px 16px rgba(0,0,0,0.18);

  --gallery-t-fast: 0.15s ease;
  --gallery-t-med: 0.25s ease;
  --gallery-t-slow: 0.35s ease;
}

/* ============================================
   GRID UTILITIES
   ============================================ */

.gallery,
.grid-auto {
  display: grid;
  gap: var(--gallery-gap);
  grid-template-columns: repeat(auto-fit, minmax(var(--gallery-min-card), 1fr));
}

.grid-2 {
  display: grid;
  gap: var(--gallery-gap);
  grid-template-columns: repeat(2, 1fr);
}

/* ============================================
   ALBUM LISTING
   ============================================ */

.album a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.album figure {
  margin: 0;
  width: 100%;
  aspect-ratio: 4 / 2.67;
  background: var(--bg-wrapper);
  border-radius: var(--gallery-radius-m);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--gallery-shadow-m);
  transition: transform var(--gallery-t-med), box-shadow var(--gallery-t-med);
}

.album img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album:hover figure {
  transform: translateY(-3px);
  box-shadow: var(--gallery-shadow-l);
}

.album figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.album h3 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-dark);
  position: relative;
  padding-bottom: 6px;
  transition: color var(--gallery-t-slow);
}

.album h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent);
  opacity: 0.35;
  transition: opacity var(--gallery-t-slow), height var(--gallery-t-slow);
}

.album:hover h3 {
  color: var(--accent-dark);
}

.album:hover h3::after {
  opacity: 0.9;
  height: 3px;
}

.album time {
  font-family: "Lora", serif;
  font-size: 0.95rem;
  color: var(--text-grey);
  text-align: center;
}

/* ============================================
   BACK LINK
   ============================================ */

.back-link {
  margin: 0 0 1.2rem 0;
}

.back-link a {
  position: relative;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 0 0 3px 1.2em;
  transition: color var(--gallery-t-fast);
}

.back-link a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  background-color: var(--accent-light);
  opacity: 0.7;
  transition: width var(--gallery-t-med);
}

.back-link a::before {
  content: "←";
  position: absolute;
  left: 0;
  opacity: 0;
  transform: translateX(5px);
  transition: opacity var(--gallery-t-fast), transform var(--gallery-t-fast);
}

.back-link a:hover {
  color: var(--accent-dark);
}

.back-link a:hover::before {
  opacity: 1;
  transform: translateX(0);
}

.back-link a:hover::after {
  width: 100%;
}

/* ============================================
   ALBUM DETAIL
   ============================================ */

.album-detail h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-dark);
  margin-bottom: 0.2em;
  text-align: left;
}

.album-detail .album-photos {
  display: grid;
  gap: var(--gallery-gap);
  grid-template-columns: repeat(auto-fit, minmax(var(--gallery-min-photo), 1fr));
  margin-top: 1.5rem;
}

.album-detail .album-photos figure {
  margin: 0;
  padding: 0.8rem;
  background: var(--bg-wrapper);
  border-radius: var(--gallery-radius-l);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--gallery-shadow-s);
  transition: transform var(--gallery-t-med), box-shadow var(--gallery-t-med);
}

.album-detail .album-photos figure:hover {
  transform: translateY(-4px);
  box-shadow: var(--gallery-shadow-l);
}

.album-detail .album-photos img {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 3 / 2;
  height: auto;
  object-fit: cover;
  border-radius: var(--gallery-radius-s);
  display: block;
  transition: transform var(--gallery-t-med), filter var(--gallery-t-med);
}

.album-detail .album-photos img:hover {
  transform: scale(1.03);
  filter: brightness(1.05);
}

.album-detail .album-photos figcaption {
  margin-top: 0.6rem;
  text-align: center;
  font-family: "Lora", serif;
  font-size: 0.95rem;
  color: var(--text-grey);
}

/* ============================================
   YEAR GRID
   ============================================ */

.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.year-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: var(--bg-body2);
  border-radius: var(--gallery-radius-l);
  font-family: "Cormorant Garamond", serif;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-main);
  border: 1px solid var(--border-light);
  transition: background var(--gallery-t-fast), transform var(--gallery-t-fast), box-shadow var(--gallery-t-fast);
}

.year-card:hover {
  background: var(--bg-wrapper);
  color: var(--accent-dark);
  transform: translateY(-3px);
  box-shadow: var(--gallery-shadow-s);
}

/* ============================================
   MEDIA QUERIES – MOBIL
   ============================================ */

@media (max-width: 480px) {
  :root {
    --gallery-min-card: 160px;
    --gallery-min-photo: 200px;
  }

  .gallery {
    gap: 1.4rem;
  }

  .album h3 {
    font-size: 1.05rem;
  }

  .album-detail .album-photos {
    gap: 1.2rem;
  }
}
