/* ---------- Albums ---------- */

.album-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 640px) {
  .album-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
@media (min-width: 980px) {
  .album-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.album-card {
  display: block;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  border-radius: 14px;
  transition: transform 0.15s ease;
}
.album-card:hover { transform: translateY(-3px); }
.album-card:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.album-card__cover {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  object-fit: cover;
  overflow: hidden;
  color: var(--ink-faint);
  background: linear-gradient(135deg, var(--surface-sunken), var(--accent-soft));
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease;
}
.album-card:hover .album-card__cover { box-shadow: var(--shadow); }
.album-card__cover img,
img.album-card__cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-card__cover svg { width: 32%; height: 32%; opacity: 0.6; }

.album-card__name {
  margin: 8px 2px 0;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-card__meta {
  margin: 2px 2px 0;
  font-size: 0.82rem;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.albums__header, .album__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 16px;
  min-width: 0;
}
.albums__header > *, .album__header > *, .album__heading { min-width: 0; }
.albums__body { min-width: 0; }
.album__name { margin: 0; overflow-wrap: anywhere; }
.album__meta { color: var(--ink-faint); font-size: 0.9rem; margin: 0; }
.album__tools { display: flex; flex-wrap: wrap; gap: 8px; }
.album-card__empty { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--ink-faint); }
.album-card__empty svg { width: 32%; height: 32%; opacity: 0.6; }

.album-photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
@media (min-width: 640px) {
  .album-photos { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
  .album-photos { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.album-photo {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface-sunken);
  min-width: 0;
}
.album-photo__open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.album-photo__open:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.album-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.15s ease;
}
.album-photo__open:hover img { opacity: 0.8; }

.album-photo__tools {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.album-photo:hover .album-photo__tools,
.album-photo:focus-within .album-photo__tools,
.album-photo__tools:focus-within { opacity: 1; }
@media (hover: none) {
  .album-photo__tools { opacity: 1; }
}
.album-photo__tools button,
.album-photo__tools a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgb(0 0 0 / 0.6);
  color: #fff;
  cursor: pointer;
}
.album-photo__tools button:hover,
.album-photo__tools a:hover { background: rgb(0 0 0 / 0.8); }
.album-photo__tools button:focus-visible,
.album-photo__tools a:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff; }
.album-photo__tools svg { width: 16px; height: 16px; }

.album-picks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 640px) { .album-picks { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.album-pick {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface-sunken);
  cursor: pointer;
  min-width: 0;
}
.album-pick img { display: block; width: 100%; height: 100%; object-fit: cover; }
.album-pick:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.album-pick.is-selected { box-shadow: inset 0 0 0 3px var(--accent); }
.album-pick__check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
}
.album-pick.is-selected .album-pick__check { display: flex; }

.album-dialog__group { display: grid; gap: 8px; min-width: 0; margin: 0 0 12px; }
.album-lightbox img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.album-lightbox__source { align-self: flex-start; }

.album-upload { display: grid; gap: 10px; margin-bottom: 16px; min-width: 0; }
.album-upload__title { margin: 0; font-size: 1.05rem; }
.album-upload__previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.album-upload__item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-sunken);
  min-width: 0;
}
.album-upload__item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.album-upload__item.is-uploading img { opacity: 0.5; }
.album-upload__item.is-done { box-shadow: inset 0 0 0 2px var(--accent); }
.album-upload__item.is-failed { box-shadow: inset 0 0 0 2px var(--danger, #d33); }
.album-upload__item.is-failed img { opacity: 0.6; }
.album-upload__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgb(0 0 0 / 0.6);
  color: #fff;
  cursor: pointer;
}
.album-upload__remove:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff; }
.album-upload__progress { width: 100%; height: 6px; border: 0; border-radius: 3px; overflow: hidden; accent-color: var(--accent); }
.album-upload__progress[hidden] { display: none; }
.album-upload__status { margin: 0; }
.album-upload__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.composer__album { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.composer__album[hidden] { display: none; }

.profile__albums { margin: 8px 0 0; font-size: 0.9rem; }
.profile__albums a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent-text); text-decoration: none; }
.profile__albums a:hover { text-decoration: underline; }

.album-box__photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.album-box__all {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-text);
}
@media (prefers-reduced-motion: reduce) {
  .album-card, .album-photo__tools, .album-photo img { transition: none; }
  .album-card:hover { transform: none; }
}
