@charset "utf-8";
/* ==========================================================================
   bf_masonry - 부산불꽃축제 사진갤러리 (Masonry)
   ========================================================================== */

.bfm-wrap { --bfm-gap: 16px; --bfm-cols: var(--bfm-cols-lg, 3); margin: 0 auto; max-width: 100%; box-sizing: border-box; }
.bfm-wrap *, .bfm-wrap *::before, .bfm-wrap *::after { box-sizing: border-box; }

/* ---------- 카테고리 ---------- */
.bfm-cate ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.bfm-cate li a { display: inline-block; padding: 7px 16px; border: 1px solid #ddd; border-radius: 999px; color: #555; font-size: 14px; line-height: 1.4; text-decoration: none; transition: .18s; }
.bfm-cate li a:hover { border-color: #d7263d; color: #d7263d; }
.bfm-cate li a#bo_cate_on { background: #d7263d; border-color: #d7263d; color: #fff; font-weight: 600; }

/* ---------- 상단 바 ---------- */
.bfm-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.bfm-total { color: #888; font-size: 14px; }
.bfm-total strong { color: #222; font-weight: 700; }
.bfm-btns { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.bfm-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid #ddd; border-radius: 6px; background: #fff; color: #555; font-size: 14px; text-decoration: none; cursor: pointer; transition: .18s; }
.bfm-btn:hover, .bfm-btn:focus { border-color: #d7263d; color: #d7263d; }

/* ---------- 관리자 도구 ---------- */
.bfm-adm { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 12px; background: #f7f7f9; border-radius: 6px; font-size: 13px; }
.bfm-adm button { padding: 5px 12px; border: 1px solid #ccc; border-radius: 4px; background: #fff; color: #555; font-size: 13px; cursor: pointer; }
.bfm-adm button:hover { border-color: #d7263d; color: #d7263d; }
.bfm-adm-act { display: flex; gap: 6px; }

/* ---------- Masonry 그리드 ---------- */
.bfm-grid { display: grid; grid-template-columns: repeat(var(--bfm-cols), minmax(0, 1fr)); gap: var(--bfm-gap); align-items: start; }
/* JS 활성화 시에만 row span 방식으로 전환 (JS 미사용 시 일반 그리드로 폴백) */
.bfm-grid.bfm-js { grid-auto-rows: 8px; }

.bfm-item { position: relative; margin: 0; overflow: hidden; border-radius: 8px; }
.bfm-item.bfm-in { animation: bfm-fade .45s ease both; }
@keyframes bfm-fade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.bfm-media { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; border-radius: 8px; background: #e9e9ec; text-decoration: none; }
.bfm-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.3,1); }
.bfm-item:hover .bfm-media img { transform: scale(1.06); }

.bfm-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #b9b9c0; font-size: 30px; }

/* 호버 오버레이 */
.bfm-hover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(15,15,20,.42); opacity: 0; transition: opacity .28s; }
.bfm-item:hover .bfm-hover, .bfm-media:focus-visible .bfm-hover { opacity: 1; }
.bfm-hover-ico { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; color: #fff; font-size: 17px; transform: scale(.8); transition: transform .28s; }
.bfm-item:hover .bfm-hover-ico { transform: scale(1); }

/* 배지 */
.bfm-badge { position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 4px; background: #d7263d; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.bfm-badge-new { left: auto; right: 10px; background: #f0a500; }
.bfm-item.is-notice .bfm-badge-new { top: 40px; }
.bfm-item.is-current { outline: 3px solid #d7263d; outline-offset: -3px; }

/* 관리자 체크박스 */
.bfm-chk { position: absolute; top: 8px; left: 8px; z-index: 2; }
.bfm-chk input { width: 18px; height: 18px; cursor: pointer; }

/* ---------- 빈 목록 / 더보기 ---------- */
.bfm-empty { padding: 80px 0; color: #999; text-align: center; }
.bfm-more { margin: 30px 0 0; text-align: center; min-height: 44px; }
.bfm-more-btn { padding: 12px 34px; border: 1px solid #ddd; border-radius: 999px; background: #fff; color: #444; font-size: 15px; cursor: pointer; transition: .2s; }
.bfm-more-btn:hover { border-color: #d7263d; background: #d7263d; color: #fff; }
.bfm-loading, .bfm-end { display: inline-block; padding: 12px 0; color: #999; font-size: 14px; }

/* JS 사용 시 페이지네이션 숨김 (검색엔진/노스크립트에는 그대로 노출) */
.bfm-paging { margin-top: 24px; text-align: center; }
.bfm-wrap.bfm-has-js .bfm-paging { display: none; }

/* ---------- 검색 레이어 ---------- */
.bfm-sch { position: fixed; inset: 0; z-index: 10000; }
.bfm-sch-bg { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.bfm-sch-box { position: absolute; top: 50%; left: 50%; width: min(360px, calc(100% - 32px)); transform: translate(-50%, -50%); padding: 0 0 18px; border: 0; border-radius: 10px; background: #fff; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.bfm-sch-box h3 { margin: 0; padding: 16px 18px; border-bottom: 1px solid #eee; font-size: 16px; }
.bfm-sch-box form { padding: 16px 18px 0; }
.bfm-sch-box select { width: 100%; height: 40px; border: 1px solid #ddd; border-radius: 6px; padding: 0 8px; }
.bfm-sch-bar { display: flex; margin-top: 10px; border: 1px solid #ddd; border-radius: 6px; overflow: hidden; }
.bfm-sch-bar input { flex: 1; height: 40px; border: 0; padding: 0 10px; outline: 0; min-width: 0; }
.bfm-sch-bar button { width: 44px; border: 0; background: #d7263d; color: #fff; cursor: pointer; }
.bfm-sch-cls { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 0; background: none; color: #999; font-size: 17px; cursor: pointer; }

/* ---------- 라이트박스 ---------- */
html.bfm-lb-open, html.bfm-lb-open body { overflow: hidden; }
.bfm-lb { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; }
.bfm-lb[hidden] { display: none; }
.bfm-lb-bg { position: absolute; inset: 0; background: rgba(8,8,12,.94); }
.bfm-lb-stage { position: relative; margin: 0; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 64px 68px; }
.bfm-lb-img { max-width: 100%; max-height: 100%; object-fit: contain; opacity: 0; transition: opacity .3s; border-radius: 4px; }
.bfm-lb-spin { position: absolute; color: #fff; font-size: 26px; opacity: .8; }

.bfm-lb-close, .bfm-lb-prev, .bfm-lb-next { position: absolute; z-index: 2; border: 0; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; border-radius: 50%; transition: background .2s; }
.bfm-lb-close:hover, .bfm-lb-prev:hover, .bfm-lb-next:hover { background: rgba(255,255,255,.22); }
.bfm-lb-close { top: 18px; right: 18px; width: 44px; height: 44px; font-size: 28px; line-height: 1; }
.bfm-lb-prev, .bfm-lb-next { top: 50%; width: 52px; height: 52px; margin-top: -26px; font-size: 20px; }
.bfm-lb-prev { left: 16px; }
.bfm-lb-next { right: 16px; }


/* ---------- 반응형 ---------- */
@media (max-width: 1280px) { .bfm-wrap { --bfm-cols: min(var(--bfm-cols-lg, 3), 3); } }
@media (max-width: 1024px) { .bfm-wrap { --bfm-cols: 2; --bfm-gap: 12px; } }
@media (max-width: 480px)  { .bfm-wrap { --bfm-cols: 2; --bfm-gap: 8px; }
  .bfm-lb-stage { padding: 56px 8px; }
  .bfm-lb-prev, .bfm-lb-next { width: 42px; height: 42px; margin-top: -21px; font-size: 16px; }
  .bfm-lb-prev { left: 6px; } .bfm-lb-next { right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .bfm-item.bfm-in { animation: none; }
  .bfm-media img, .bfm-hover, .bfm-hover-ico { transition: none; }
}
