@charset "utf-8";
/* ============================================================
   갤러리 — 사진이 앞에 서는 앨범 목록 · 앨범 보기 흐름 격자 · 크게 보기 창 (docs/board.md)
   게시판 줄 목록 모양을 쓰지 않는다. 글은 사진 위에 얹고, 테두리·구분선은 최소로 둔다.
   ============================================================ */

/* ── 목록 위 줄: 연도 칩 + 둥근 검색창 하나 ── */
.gallery .board-search { position: relative; gap: 0; }
.gallery .board-search input {
  width: 260px;
  height: 40px;
  padding-right: 48px;
  border-radius: 999px;
  background: var(--color-bg-soft);
  border-color: transparent;
}
.gallery .board-search input:focus { background: var(--color-bg); border-color: var(--color-brand); }
/* "검색" 글자 단추 대신 돋보기 — 글자는 읽는 이를 위해 남기고 화면에서만 감춘다 */
.gallery .board-search__submit {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 32px;
  min-height: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  font-size: 0;
}
.gallery .board-search__submit::before {
  content: "";
  width: 10px;
  height: 10px;
  margin: -3px 0 0 -3px;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.gallery .board-search__submit::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 2px;
  margin: 9px 0 0 9px;
  background: currentColor;
  transform: rotate(45deg);
}

/* ── 대표 앨범: 한 앨범의 사진 여러 장을 어두운 상자 하나에 묶는다 ──
   왼쪽은 앨범 정보, 오른쪽은 그 앨범의 사진(큰 한 장 + 작은 두 장). 아래 카드들과 단위가 다름을 상자로 가른다. */
.album-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 12px;
  padding: 12px;
  border-radius: 20px;
  background: var(--color-brand-deep);
  color: var(--color-on-dark);
}
.album-feature__info { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 28px 20px 28px 28px; }
.album-feature__label {
  padding: 4px 12px;
  border: 1px solid var(--color-on-dark-line);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-gold-light);
}
.album-feature__title { margin-top: 8px; font-size: 30px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.album-feature__meta { display: flex; gap: 12px; font-size: var(--fs-small); color: var(--color-on-dark-sub); }
.album-feature__meta > * + *::before { content: "·"; margin-right: 12px; }
.album-feature__go {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 10px 18px;
  border: 1px solid var(--color-on-dark-line);
  border-radius: 999px;
  font-size: var(--fs-small);
  font-weight: 600;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.album-feature__go::after {
  content: "";
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}
.album-feature:hover .album-feature__go { border-color: var(--color-gold-light); background: var(--color-brand); }
.album-feature__photos {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  height: 440px;
}
.album-feature__photos--1 { grid-template-columns: minmax(0, 1fr); }
.album-feature__photos--2 .album-feature__photo:nth-child(2) { grid-row: span 2; }
.album-feature__photo {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: var(--color-brand);
}
.album-feature__photo:first-child { grid-row: span 2; }
.album-feature__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.album-feature__more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 27, 46, 0.55);
  color: var(--color-on-dark);
  font-size: 26px;
  font-weight: 700;
}
.album-feature:hover .album-feature__photo img { transform: scale(1.03); }

/* 대표 앨범과 나머지 앨범 사이의 제목 */
.gallery-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 56px 0 18px;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
}
.gallery-heading span { font-size: var(--fs-small); font-weight: 600; color: var(--color-gold-dark); }

/* ── 앨범 카드: 사진 위에 날짜·제목을 얹는다 ── */
.album-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; }
.album-grid li { position: relative; padding-top: 10px; }
/* 사진이 여럿인 앨범은 카드 뒤에 종이 두 장이 겹친 모양 — "이 카드 한 장 = 사진 묶음 하나" */
.album-grid__stack::before,
.album-grid__stack::after {
  content: "";
  position: absolute;
  border-radius: 14px 14px 0 0;
}
.album-grid__stack::before { top: 0; left: 24px; right: 24px; height: 20px; background: var(--color-line); }
.album-grid__stack::after { top: 5px; left: 12px; right: 12px; height: 20px; background: var(--color-line-strong); }
.album-card {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  z-index: 1; /* 뒤에 겹친 종이(li::after)보다 위 */
  background: var(--color-brand-soft);
  isolation: isolate;
}
.album-card img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.album-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--photo-shade);
  opacity: 0.85;
  transition: opacity 0.3s var(--ease);
}
.album-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(15, 27, 46, 0.16);
  border-radius: inherit;
  pointer-events: none;
}
.album-card__count {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 27, 46, 0.45);
  backdrop-filter: blur(6px);
  color: var(--color-on-dark);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.album-card__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 24px;
  color: var(--color-on-dark);
}
.album-card__date { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; color: var(--color-gold-light); }
.album-card__title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.45;
}
.album-card:hover img { transform: scale(1.06); }
.album-card:hover::after { opacity: 1; }

@media (max-width: 1023px) {
  .album-feature { grid-template-columns: minmax(0, 1fr); }
  .album-feature__info { order: 1; padding: 12px 16px 16px; }
  .album-feature__photos { height: 360px; }
  .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .gallery .board-search input { width: auto; }
  .album-feature { padding: 8px; border-radius: 14px; }
  .album-feature__photos { gap: 6px; height: 240px; }
  .album-feature__photo { border-radius: 8px; }
  .album-feature__info { gap: 8px; padding: 8px 10px 12px; }
  .album-feature__title { margin-top: 4px; font-size: 22px; }
  .album-feature__go { margin-top: 8px; }
  .gallery-heading { margin-top: 40px; font-size: 18px; }
  /* 좁은 화면도 두 줄로 — 한 줄이면 사진 한 장이 화면을 다 차지해 앨범을 훑기 어렵다 */
  .album-grid { gap: 8px; }
  .album-card { aspect-ratio: 4 / 5; border-radius: 10px; }
  .album-card__count { top: 8px; right: 8px; padding: 2px 8px; }
  .album-card__body { padding: 12px; }
  .album-card__title { font-size: 15px; }
}

/* ── 앨범 보기: 머리 ── */
.album-head { max-width: 760px; margin-bottom: 36px; }
.album-head__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--color-text-sub);
}
.album-head__back::before {
  content: "";
  width: 7px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.album-head__back:hover { color: var(--color-brand); }
.album-head__date { font-size: var(--fs-small); font-weight: 600; letter-spacing: 0.04em; color: var(--color-gold-dark); }
.album-head__title { margin-top: 6px; font-size: 34px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; color: var(--color-text); }
.album-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 14px; font-size: var(--fs-small); color: var(--color-text-muted); }
.album-head__play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--color-brand);
  color: var(--color-on-dark);
  font-size: var(--fs-xs);
  font-weight: 600;
  transition: background-color 0.2s var(--ease);
}
.album-head__play[hidden] { display: none; }
/* 재생 삼각형 */
.album-head__play::before {
  content: "";
  border-left: 8px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.album-head__play:hover { background: var(--color-brand-dark); }
.album-head__text { margin-top: 20px; }

/* ── 앨범 보기: 흐름 격자 ──
   사진마다 비율(--r = 가로÷세로)만큼 늘어나 한 줄 높이가 고르게 맞는다. 자르지 않고 본래 모양을 살린다.
   마지막 줄은 ::after 가 남은 자리를 차지해 사진이 억지로 늘어나지 않는다. */
.photo-flow { --row: 280px; display: flex; flex-wrap: wrap; gap: 8px; }
.photo-flow::after { content: ""; flex-grow: 999; }
.photo-flow li { flex: var(--r) 1 calc(var(--r) * var(--row)); }
.photo-flow__item {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: var(--r);
  border-radius: 10px;
  background: var(--color-brand-soft);
}
.photo-flow__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
/* 가장자리 선. 사진의 흰 곳(스크린 등)이 흰 바탕에 녹아 사진 모양이 무너지지 않게 한다.
   반투명 남색이라 밝은 곳에서만 보인다. 사진 위에 얹어야 보이므로 덧그림에 그린다(앨범 카드도 같다). */
.photo-flow__item::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(15, 27, 46, 0.16);
  border-radius: inherit;
  pointer-events: none;
}
.photo-flow__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 28px 14px 12px;
  background: var(--photo-shade);
  color: var(--color-on-dark);
  font-size: var(--fs-xs);
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.photo-flow__item:hover img { transform: scale(1.04); }
.photo-flow__item:hover .photo-flow__caption,
.photo-flow__item:focus-visible .photo-flow__caption { opacity: 1; transform: none; }

/* ── 앨범 보기: 지난·최근 앨범 카드 ── */
.album-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 64px; }
.album-pager__item {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  height: 160px;
  border-radius: 14px;
  background: var(--color-brand);
  isolation: isolate;
}
.album-pager__item--empty { background: none; }
.album-pager__item img { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.album-pager__item::after { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(15, 27, 46, 0.62); transition: background-color 0.3s var(--ease); }
.album-pager__item--empty::after { content: none; }
.album-pager__text { display: flex; flex-direction: column; gap: 4px; padding: 22px 26px; color: var(--color-on-dark); }
.album-pager__item--prev .album-pager__text { margin-left: auto; text-align: right; }
.album-pager__label { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; color: var(--color-gold-light); }
.album-pager__item--prev .album-pager__label { justify-content: flex-end; }
.album-pager__label::before, .album-pager__label::after {
  width: 6px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}
.album-pager__item--next .album-pager__label::before { content: ""; transform: rotate(-135deg); }
.album-pager__item--prev .album-pager__label::after { content: ""; transform: rotate(45deg); }
.album-pager__title { font-size: var(--fs-h3); font-weight: 700; line-height: 1.4; }
.album-pager__item:hover img { transform: scale(1.05); }
.album-pager__item:hover::after { background: rgba(15, 27, 46, 0.45); }

@media (max-width: 1023px) {
  .photo-flow { --row: 220px; }
}
@media (max-width: 767px) {
  .album-head { margin-bottom: 24px; }
  .album-head__title { font-size: 26px; }
  .photo-flow { --row: 140px; gap: 6px; }
  .photo-flow__item { border-radius: 8px; }
  .photo-flow__caption { display: none; }
  .album-pager { grid-template-columns: minmax(0, 1fr); margin-top: 40px; }
  .album-pager__item { height: 120px; }
  .album-pager__item--empty { display: none; }
}

/* ── 크게 보기 창: 어두운 전체 화면 · 위 줄(번호·앨범 이름) · 아래 필름 줄 ── */
.is-lightbox-open { overflow: hidden; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  background: var(--color-brand-deep);
  color: var(--color-on-dark);
}
.lightbox[hidden] { display: none; }
.lightbox__top {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 0 88px 0 24px;
  font-size: var(--fs-small);
}
.lightbox__count { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.lightbox__title { overflow: hidden; color: var(--color-on-dark-sub); white-space: nowrap; text-overflow: ellipsis; }
.lightbox__stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 88px; }
.lightbox__img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; opacity: 0; transition: opacity 0.35s var(--ease); }
.lightbox__img.is-shown { opacity: 1; }
.lightbox__caption { min-height: 1.6em; padding: 14px 24px 0; text-align: center; font-size: var(--fs-small); color: var(--color-on-dark-sub); }
.lightbox__strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 24px 20px;
  scrollbar-width: none;
}
.lightbox__strip::-webkit-scrollbar { display: none; }
/* 필름 줄이 화면보다 짧으면 가운데로 모은다 */
.lightbox__thumb:first-child { margin-left: auto; }
.lightbox__thumb:last-child { margin-right: auto; }
.lightbox__thumb {
  flex: none;
  width: 72px;
  height: 52px;
  overflow: hidden;
  border-radius: 6px;
  opacity: 0.4;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: opacity 0.2s var(--ease), outline-color 0.2s var(--ease);
}
.lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; }
.lightbox__thumb:hover, .lightbox__thumb:focus-visible { opacity: 0.8; }
.lightbox__thumb.is-current { opacity: 1; outline-color: var(--color-gold-light); }
.lightbox--single .lightbox__strip,
.lightbox--single .lightbox__btn--prev,
.lightbox--single .lightbox__btn--next { display: none; }
.lightbox__btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-on-dark);
  transition: background-color 0.2s var(--ease);
}
.lightbox__btn:hover, .lightbox__btn:focus-visible { background: rgba(255, 255, 255, 0.2); }
.lightbox__btn::before {
  content: "";
  width: 11px;
  height: 11px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}
.lightbox__btn--prev { left: 20px; top: 50%; margin-top: -24px; }
.lightbox__btn--prev::before { transform: translateX(2px) rotate(-135deg); }
.lightbox__btn--next { right: 20px; top: 50%; margin-top: -24px; }
.lightbox__btn--next::before { transform: translateX(-2px) rotate(45deg); }
.lightbox__btn--close { top: 8px; right: 20px; }
/* 닫기는 X 모양 — 두 선을 겹친다 */
.lightbox__btn--close::before,
.lightbox__btn--close::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 0;
  border: 0;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}
.lightbox__btn--close::after { transform: rotate(-45deg); }

@media (max-width: 767px) {
  .lightbox__top { padding-right: 72px; }
  .lightbox__stage { padding: 0; }
  .lightbox__img { border-radius: 0; }
  .lightbox__thumb { width: 56px; height: 42px; }
  /* 좁은 화면은 밀어서 넘긴다. 단추는 필름 줄 위 양옆에 작게 둔다 */
  .lightbox__btn--prev, .lightbox__btn--next { top: auto; bottom: 96px; width: 40px; height: 40px; margin-top: 0; }
  .lightbox__btn--prev { left: 12px; }
  .lightbox__btn--next { right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .album-feature__photo img, .album-card img, .photo-flow__item img, .album-pager__item img, .lightbox__img { transition: none; }
}
