/* =============================================
   album.css – Album photos BBruzoise
   Dépend de assets/css/style.css
   ============================================= */

/* ---- Topbar ---- */
.albums-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.albums-title {
  margin: 0;
  font-size: 1.6rem;
}

.albums-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.album-search-input {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.95rem;
  min-width: 200px;
  background: var(--bg);
  color: var(--text);
}

/* ---- Login card ---- */
.login-card {
  max-width: 460px;
  margin: 2rem auto;
}

.login-card h2 { margin-top: 0; }

.login-error {
  min-height: 1.2em;
  color: #b00020;
  margin: 0;
}

/* ---- Status / erreur ---- */
.albums-status {
  text-align: center;
  color: var(--muted);
  padding: 2rem 0;
  font-style: italic;
}

.albums-error {
  color: #b00020;
  background: #fff0f0;
  border: 1px solid #f5c1c1;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  font-style: normal;
}

/* ---- Grille des albums ---- */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.album-card {
  cursor: pointer;
  transition: box-shadow 0.18s, transform 0.18s;
  overflow: hidden;
  padding: 0;
}

.album-card:hover {
  box-shadow: 0 4px 18px rgba(20, 99, 165, 0.13);
  transform: translateY(-2px);
}

.album-thumb-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 90px);
  gap: 2px;
  background: var(--bg-alt);
}

.album-thumb-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album-thumb-grid img:first-child {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  height: 182px;
}

.album-thumb-placeholder {
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--muted);
}

.album-info {
  padding: 0.75rem 1rem;
}

.album-info-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.album-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.3;
}

.album-count {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.album-date {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---- Vue détail d'un album ---- */
.album-detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.album-detail-header h2 { margin: 0; }

.album-detail-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.photo-thumb {
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 0.5rem;
  cursor: pointer;
  display: block;
  width: 100%;
  transition: opacity 0.15s;
}

.photo-thumb:hover { opacity: 0.85; }

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox.hidden { display: none; }

.lb-img-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(1000px, 96vw);
  max-height: 88vh;
}

.lb-img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 0.5rem;
  display: block;
}

.lb-caption {
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  margin: 0.6rem 0 0;
  text-align: center;
}

.lb-counter {
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

.lb-close {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  opacity: 0.8;
}

.lb-close:hover { opacity: 1; }

.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  line-height: 1;
  transition: background 0.15s;
}

.lb-nav:hover { background: rgba(255,255,255,0.22); }
.lb-prev { left: 0.75rem; }
.lb-next { right: 0.75rem; }
