/* ==========================================================================
   Album kỉ niệm — thẻ album xếp chồng + ảnh lẻ, chia theo năm học
   (duyệt 14/11, xem-truoc/album-v1/trang-bang-vang.html).
   ========================================================================== */
.album { background: var(--card); }
.album__empty { color: var(--ink-soft); }

.ayear-block + .ayear-block { margin-top: 12px; }
.ayear {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 14px;
  font-family: var(--f-display);
  font-size: 1.15rem;
  color: var(--gold-deep);
}
.ayear::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(201, 79, 0, .35), transparent);
}

/* ---- Lưới chung: album trước, ảnh lẻ nối tiếp cùng hàng ---- */
.agallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
  align-items: start;
}
.agallery > [hidden] { display: none; }

/* ---- Thẻ album ---- */
.acard {
  display: grid;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.acard__stack {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  margin: 6px 8px 10px 0;
}
.acard__stack img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 4px solid #fff;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(120, 50, 0, .18);
  transition: transform .35s ease;
}
.acard__stack i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(201, 79, 0, .2);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(120, 50, 0, .1);
}
.acard__stack i:nth-of-type(1) { z-index: 1; background: #ffe9d2; transform: rotate(3.5deg) translate(8px, 4px); }
.acard__stack i:nth-of-type(2) { z-index: 0; background: var(--gold-tint); transform: rotate(-2.5deg) translate(-4px, 6px); }
.acard:hover .acard__stack img,
.acard:focus-visible .acard__stack img { transform: translateY(-4px) rotate(-1deg); }
.acard b { font-family: var(--f-display); font-size: 1.02rem; color: var(--ink); }
.acard small { font-size: .9rem; color: var(--ink-soft); }
.album-more { margin-top: 14px; }

/* ---- Ảnh lẻ ---- */
.asingle { margin: 0; padding-top: 6px; } /* thẳng hàng với ảnh bìa album */
.asingle__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper-2);
  aspect-ratio: 4 / 3;
  box-shadow: 0 6px 16px rgba(120, 50, 0, .12);
  cursor: zoom-in;
}
.asingle__btn img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.asingle__btn:hover img { transform: scale(1.03); }
.asingle figcaption { margin-top: 10px; font-size: .9rem; color: var(--ink-soft); }

/* ---- Hộp album đang mở ---- */
.adlg {
  width: min(1100px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 24px;
  border: 0;
  border-radius: 20px;
  background: #fffaf5;
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(43, 20, 6, .4);
  overflow: auto;
}
.adlg::backdrop { background: rgba(70, 30, 0, .45); backdrop-filter: blur(4px); }
.adlg[open] { animation: dialog-in .22s ease-out; }
.adlg__head { margin: 0 52px 16px 0; }
.adlg__head h2 { margin: 0; font-family: var(--f-display); font-size: 1.6rem; color: var(--gold-deep); }
.adlg__head p { margin: 4px 0 0; color: var(--ink-soft); }
.adlg__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.adlg__item { display: block; padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--paper-2); cursor: zoom-in; }
.adlg__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.adlg__item:hover img { transform: scale(1.04); }

@media (max-width: 900px) {
  .agallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .adlg { padding: 16px; }
  .adlg__grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .adlg__head h2 { font-size: 1.3rem; }
}
@media (max-width: 600px) {
  .agallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .acard b { font-size: .95rem; }
}
