body{
  margin:0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", sans-serif;
  background:#f3f6fc;
  color:#111827;
}
.g-header{
  background:linear-gradient(135deg,#050816,#0041c4);
  color:#fff;
  padding:18px 20px 32px;
  box-shadow:0 10px 30px rgba(0,0,0,0.45);
}
.g-header-inner{
  max-width:1100px;
  margin:0 auto 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.g-logo{
  font-weight:800;
  font-size:18px;
  color:#fff;
  text-decoration:none;
}
.g-nav a{
  color:#cbd5f5;
  text-decoration:none;
  margin-left:18px;
  font-size:14px;
}
.g-nav a.active{
  color:#fff;
  font-weight:600;
}
.g-hero{
  max-width:1100px;
  margin:0 auto;
}
.g-hero h1{
  margin:0 0 4px;
  font-size:26px;
}
.g-hero p{
  margin:0;
  font-size:14px;
  color:#d1d5db;
}
.g-main{
  max-width:1100px;
  margin:18px auto 40px;
  padding:0 16px 24px;
}
.upload-box{
  background:#ffffff;
  border-radius:16px;
  padding:18px 16px 16px;
  border:1px solid rgba(148,163,184,0.35);
  box-shadow:0 12px 30px rgba(15,23,42,0.85);
  margin-bottom:14px;
}
.upload-box h2{
  margin:0 0 6px;
  font-size:17px;
}
.upload-box p{
  margin:0 0 10px;
  font-size:13px;
  color:#6b7280;
}
.upload-row{
  display:flex;
  gap:10px;
  align-items:center;
}
#categorySelect{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid #1d4ed8;
  background:#ffffff;
  color:#111827;
  font-size:13px;
}
#imgUpload{
  flex:1;
  padding:6px;
  font-size:13px;
  border-radius:999px;
  border:1px dashed #4b5563;
  background:#ffffff;
  color:#6b7280;
}
.filter-box{
  margin:10px 0 6px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.gallery-filters{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.filter-btn{
  border:none;
  border-radius:999px;
  padding:6px 14px;
  font-size:12px;
  cursor:pointer;
  background:#ffffff;
  color:#6b7280;
  border:1px solid #1f2937;
}
.filter-btn.active{
  background:#2563eb;
  color:#fff;
  border-color:#2563eb;
}
.gallery-sort{
  display:flex;
  gap:8px;
  align-items:center;
}
#sortSelect{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid #374151;
  background:#ffffff;
  color:#111827;
  font-size:12px;
}
#slideshowBtn{
  padding:6px 12px;
  border-radius:999px;
  border:none;
  background:#16a34a;
  color:#ecfdf5;
  font-size:12px;
  cursor:pointer;
}
#slideshowBtn:hover{
  background:#15803d;
}
.gallery{
  column-count:3;
  column-gap:12px;
  margin-top:10px;
}
.gallery-item{
  position:relative;
  break-inside:avoid;
  margin-bottom:12px;
  border-radius:14px;
  overflow:hidden;
  background:#ffffff;
  box-shadow:0 10px 26px rgba(0,0,0,0.65);
  opacity:0;
  transform:translateY(10px);
  transition:opacity .4s ease, transform .4s ease;
}
.gallery-item.visible{
  opacity:1;
  transform:translateY(0);
}
.gallery-item img{
  width:100%;
  display:block;
  cursor:pointer;
  transition:transform .3s ease;
}
.gallery-item img:hover{
  transform:scale(1.03);
}
.gallery-item::after{
  content:"M2GOLF";
  position:absolute;
  right:8px;
  bottom:6px;
  padding:2px 6px;
  font-size:9px;
  letter-spacing:0.08em;
  border-radius:999px;
  background:rgba(15,23,42,0.7);
  color:#6b7280;
  pointer-events:none;
}
.lightbox{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  z-index:999;
}
.lightbox.active{
  display:flex;
}
.lightbox-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.75);
}
.lightbox-inner{
  position:relative;
  max-width:90vw;
  max-height:90vh;
  padding:10px;
  border-radius:16px;
  background:#ffffff;
  box-shadow:0 20px 45px rgba(0,0,0,0.9);
}
.lightbox-inner img{
  max-width:82vw;
  max-height:72vh;
  display:block;
  border-radius:12px;
}
.lightbox-meta{
  margin-top:6px;
  font-size:12px;
}
.lightbox-meta-row{
  display:flex;
  justify-content:space-between;
  gap:8px;
  margin-bottom:2px;
}
#lbCategory{
  color:#93c5fd;
}
#lbDate{
  color:#6b7280;
  font-size:11px;
}
#lbNote{
  margin:0;
  color:#111827;
  font-size:12px;
}
@media(max-width:1024px){
  .gallery{column-count:2;}
}
@media(max-width:640px){
  .g-header-inner{
    flex-direction:column;
    align-items:flex-start;
    gap:6px;
  }
  .g-nav a{
    margin-left:0;
    margin-right:10px;
    font-size:13px;
  }
  .gallery{column-count:1;}
  .filter-box{
    flex-direction:column;
    align-items:flex-start;
  }
}

@media (max-width: 1024px) {
  .gallery {
    column-count: 2;
  }
}
@media (max-width: 640px) {
  .gallery {
    column-count: 1;
  }
  .g-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .g-hero h1 {
    font-size: 22px;
  }
  .g-hero p {
    font-size: 14px;
  }
  .filter-box {
    flex-direction: column;
    align-items: flex-start;
  }
  .filter-box > * {
    width: 100%;
  }
  .filter-box select,
  .filter-box button {
    max-width: 100%;
  }
}

.gallery {
  column-count: 4;
  column-gap: 14px;
}
@media (max-width: 1280px) {
  .gallery { column-count: 3; }
}
@media (max-width: 900px) {
  .gallery { column-count: 2; }
}
@media (max-width: 640px) {
  .gallery { column-count: 1; }
}

.banner-left h2,
.banner-left h3 {
  opacity: 0;
  transform: translateY(18px);
  animation: heroTitleUp 0.85s cubic-bezier(.16,.84,.44,1) 0.2s forwards;
}
.banner-left p {
  opacity: 0;
  transform: translateY(16px);
  animation: heroTitleUp 0.85s cubic-bezier(.16,.84,.44,1) 0.35s forwards;
}

@keyframes heroTitleUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

button,
.btn,
a.btn,
a.button-primary {
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
}
button:hover,
.btn:hover,
a.btn:hover,
a.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15,23,42,0.45);
}

.m2-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}
.m2-modal-inner {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(0,0,0,0.8);
  background: #020617;
}
.m2-modal-inner img {
  width: 100%;
  height: auto;
  display: block;
}
.m2-modal-close {
  position: absolute;
  top: 18px;
  right: 22px;
  color: #e5e7eb;
  font-size: 26px;
  cursor: pointer;
}

.gallery-grid{display:grid;grid-template-columns:repeat(12,1fr);gap:12px}
.gallery-tile{grid-column:span 4;display:block;background:#fff;border:1px solid #e5e7eb;border-radius:16px;overflow:hidden;text-decoration:none;color:#111827}
.gallery-tile img{width:100%;height:220px;object-fit:cover;display:block}
.gallery-tile .cap{padding:10px 12px}
.gallery-tile .t{font-weight:900;font-size:14px}
.gallery-tile .d{margin-top:4px;color:#6b7280;font-size:12px;line-height:1.4;min-height:1.4em}
.btn{border:1px solid #e5e7eb;background:#fff;padding:10px 12px;border-radius:12px;font-weight:800;cursor:pointer}
.input{border:1px solid #e5e7eb;padding:10px 12px;border-radius:12px}
@media(max-width:860px){.gallery-tile{grid-column:span 6}.gallery-tile img{height:180px}}
@media(max-width:520px){.gallery-tile{grid-column:span 12}}


.group-link{color:inherit;text-decoration:none}
.group-link:hover{text-decoration:underline}

/* v105 slider controls */
.track-wrap{position:relative;display:flex;align-items:center;gap:10px}
.track-wrap .track{flex:1}
.track-wrap .nav{width:40px;height:40px;border-radius:999px;border:1px solid rgba(0,0,0,.08);background:#fff;box-shadow:0 6px 16px rgba(0,0,0,.08);cursor:pointer;font-size:26px;line-height:38px}
@media (max-width: 640px){ .track-wrap .nav{width:34px;height:34px;font-size:20px;opacity:.95} }


/* ===== 전체 보기 모달 ===== */
.m2modal{display:none;position:fixed;inset:0;z-index:9999;}
.m2modal__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.6);}
.m2modal__panel{position:relative;max-width:1100px;margin:40px auto;background:#0b1220;border:1px solid rgba(255,255,255,.12);border-radius:16px;box-shadow:0 30px 80px rgba(0,0,0,.6);overflow:hidden;}
.m2modal__close{position:absolute;right:14px;top:10px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.18);color:#fff;width:34px;height:34px;border-radius:12px;font-size:22px;line-height:30px;cursor:pointer}
.m2modal__head{padding:18px 18px 0 18px;}
.m2modal__title{font-weight:800;color:#fff;font-size:18px;margin-bottom:14px;}
.m2modal__body{padding:0 18px 18px 18px;display:grid;grid-template-columns:repeat(3,1fr);gap:14px;max-height:75vh;overflow:auto;}
.m2modal__item{background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.10);border-radius:14px;overflow:hidden}
.m2modal__item img{width:100%;height:220px;object-fit:cover;display:block}
.m2modal__cap{padding:10px 10px 12px 10px;color:#d0d5dd;font-size:14px;font-weight:700}
@media (max-width: 900px){ .m2modal__body{grid-template-columns:repeat(2,1fr)} .m2modal__item img{height:200px}}
@media (max-width: 520px){ .m2modal__panel{margin:16px} .m2modal__body{grid-template-columns:1fr} .m2modal__item img{height:220px}}


/* ===== 단일 이미지 전체 보기 라이트박스 ===== */
.gallery-lightbox{
  position:fixed;
  inset:0;
  z-index:9999;
  background:rgba(0,0,0,.85);
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
}
.gallery-lightbox.is-open{
  display:flex;
}
.gallery-lightbox__inner{
  position:relative;
  max-width:96vw;
  max-height:90vh;
  text-align:center;
}
.gallery-lightbox__img-wrap{
  max-width:100%;
  max-height:80vh;
}
.gallery-lightbox__img-wrap img{
  max-width:100%;
  max-height:80vh;
  display:block;
  margin:0 auto;
  border-radius:16px;
  box-shadow:0 20px 60px rgba(0,0,0,.6);
}
.gallery-lightbox__caption{
  margin-top:14px;
  font-size:14px;
  color:#e5e7eb;
  font-weight:500;
}
.gallery-lightbox__close{
  position:absolute;
  top:-6px;
  right:-6px;
  width:36px;
  height:36px;
  border-radius:999px;
  border:none;
  background:rgba(15,23,42,.9);
  color:#f9fafb;
  font-size:22px;
  cursor:pointer;
}
.gallery-lightbox__close:hover{
  background:rgba(15,23,42,1);
}
.gallery-lightbox-open{
  overflow:hidden;
}


/* ===== Row-group modal ===== */
.m2group{display:none;position:fixed;inset:0;z-index:9998;}
.m2group.is-open{display:block;}
.m2group__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.55);}
.m2group__panel{position:relative;max-width:1100px;margin:32px auto;background:#020617;border-radius:18px;box-shadow:0 30px 80px rgba(0,0,0,.7);overflow:hidden}
.m2group__head{display:flex;align-items:center;justify-content:space-between;padding:16px 18px}
.m2group__title{color:#e5e7eb;font-weight:800;font-size:16px}
.m2group__close{border:none;background:#111827;color:#f9fafb;border-radius:12px;width:32px;height:32px;font-size:18px;cursor:pointer}
.m2group__body{padding:16px;display:grid;grid-template-columns:repeat(3,1fr);gap:12px;max-height:70vh;overflow:auto}
.m2group__item{background:#020617;border:1px solid rgba(255,255,255,.06);border-radius:14px;overflow:hidden}
.m2group__item img{width:100%;height:220px;object-fit:cover;display:block}
.m2group__cap{padding:8px 10px 10px 10px;color:#e5e7eb;font-size:13px;font-weight:700}

/* ===== Single image lightbox ===== */
.m2single{display:none;position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,.85);align-items:center;justify-content:center;padding:16px}
.m2single.is-open{display:flex}
.m2single__inner{position:relative;max-width:96vw;max-height:90vh;text-align:center}
.m2single__inner img{max-width:100%;max-height:80vh;border-radius:18px;box-shadow:0 30px 80px rgba(0,0,0,.7)}
.m2single__cap{margin-top:12px;color:#e5e7eb;font-size:14px}
.m2single__close{position:absolute;top:-8px;right:-8px;width:36px;height:36px;border-radius:999px;border:none;background:#0f172a;color:#fff;font-size:22px;cursor:pointer}


/* === popup frame-fit + inner scroll === */
.popup-overlay{position:fixed;inset:0;background:rgba(0,0,0,.7);display:flex;justify-content:center;align-items:center;z-index:9999}
.popup-modal{width:100%;max-width:1200px;height:90vh;background:#0b1220;border-radius:12px;display:flex;flex-direction:column;overflow:hidden}
.popup-header,.popup-footer{flex-shrink:0}
.popup-body{flex:1;overflow-y:auto;overflow-x:hidden;display:flex;justify-content:center;padding:16px}
.price-img-wrap{width:100%;max-width:900px;margin:0 auto}
.price-img-wrap img{width:100%;height:auto;display:block}
@media(max-width:768px){
 .popup-modal{height:100vh;border-radius:0}
 .popup-body{padding:10px}
}


/* === FINAL popup fixes === */

/* footer text visibility */
.popup-footer,
.popup-footer *{
  color:#ffffff !important;
}

/* hide install-area text */
.popup-footer .install-area,
.popup-footer .install-text,
.popup-footer .region,
.popup-footer .install{
  display:none !important;
}

/* image should fit one screen, not overflow */
.popup-body{
  display:flex !important;
  align-items:center !important;
}

.price-img-wrap{
  max-width:100% !important;
  max-height:100% !important;
  display:flex !important;
  justify-content:center !important;
  align-items:center !important;
}

.price-img-wrap img{
  max-width:100% !important;
  max-height:100% !important;
  width:auto !important;
  height:auto !important;
  object-fit:contain !important;
}
