/* FITGIRLS gallery v4. Load after fg-gallery-v2-styles.
   Archive row spans are measured by the companion runtime after image load.
   Keep sparse, row-major placement: never enable grid-auto-flow:dense. */
:root body #archive .gallery-full-container.fg-gallery-v2 {
  --fg-ink: #111;
  --fg-paper: #fff;
  --fg-rule: #dededb;
  --fg-gap: 12px;
  background: var(--fg-paper) !important;
  color: var(--fg-ink) !important;
  padding: 32px 16px 56px !important;
  max-width: 1440px !important;
}
.fg-gallery-v2 .fg-gallery-heading { margin-bottom: 24px; }
.fg-gallery-v2 .fg-gallery-heading h2 {
  font-weight: 500 !important;
  letter-spacing: -.06em !important;
}
.fg-gallery-v2 .fg-gallery-tabs { border-color: var(--fg-rule, #dededb); }
/* Top-level categories remain available even in the editorial view. */
.fg-gallery-v2.fg-editorial-active .fg-gallery-category-tabs,
.fg-gallery-v2 .fg-gallery-category-tabs {
  display: flex !important;
  visibility: visible !important;
  gap: 22px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  margin-bottom: 20px;
}
.fg-gallery-v2 .fg-gallery-category-tabs button { min-height: 44px; }

/* PICKS: cropping is deliberately confined to this editorial treatment. */
.fg-gallery-v2 .fg-editorial-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-flow: row;
  gap: var(--fg-gap, 12px) !important;
  align-items: stretch;
}
.fg-gallery-v2 .fg-editorial-grid > figure.fg-editorial-card {
  position: relative;
  display: block;
  min-width: 0;
  margin: 0 !important;
  padding: 0;
  aspect-ratio: 3 / 4;
  background: #f2f2f0;
  border: 0;
  border-radius: 0;
  isolation: isolate;
}
.fg-gallery-v2 .fg-editorial-grid > figure.fg-editorial-card.featured,
.fg-gallery-v2 .fg-editorial-grid > .fg-editorial-skeleton:first-child {
  grid-column: auto;
  grid-row: auto;
  aspect-ratio: 3 / 4;
}
.fg-gallery-v2 .fg-editorial-card > button.fg-editorial-photo {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #f2f2f0;
  overflow: hidden;
  cursor: zoom-in;
}
.fg-gallery-v2 .fg-editorial-card > .fg-editorial-photo img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
  border-radius: 0;
}
.fg-gallery-v2 .fg-editorial-photo :is(figcaption, .fg-editorial-caption, span) {
  pointer-events: none;
}

/* Explicit save actions: separate from the photo hit target, touch-sized. */
.fg-gallery-v2 button.fg-jpg-save,
.fg-gallery-v2 .masonry-item button.masonry-quick-dl-btn {
  position: absolute !important;
  inset: 8px 8px auto auto !important;
  z-index: 20 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px;
  width: auto !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 12px !important;
  border: 1px solid #d5d5d5 !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #111 !important;
  font-family: inherit;
  font-size: 11px !important;
  font-weight: 500;
  line-height: 1 !important;
  letter-spacing: .04em;
  text-decoration: none;
  white-space: nowrap;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  pointer-events: auto !important;
  cursor: pointer;
  box-shadow: 0 1px 6px #00000012 !important;
  touch-action: manipulation;
}
.fg-gallery-v2 button.fg-jpg-save:hover,
.fg-gallery-v2 .masonry-item button.masonry-quick-dl-btn:hover {
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
}
.fg-gallery-v2 :is(.fg-editorial-card, .zone-img-wrapper, .lookbook-img-wrapper,
  .masonry-item, .virtual-image-container) { position: relative; }

/* ARCHIVE: natural, uncropped images. Runtime computes grid-row-end spans
   using the same 8px row height and the computed row gap. */
.fg-gallery-v2 .gallery-masonry-grid {
  display: grid !important;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)) !important;
  grid-auto-rows: 8px !important;
  grid-auto-flow: row !important;
  gap: 16px !important;
  align-items: start !important;
}
.fg-gallery-v2 .gallery-masonry-grid > .masonry-item {
  min-width: 0 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  break-inside: avoid;
  border-radius: 0 !important;
  overflow: visible !important;
  transform: none !important;
}
.fg-gallery-v2 .masonry-item > .virtual-image-container,
.fg-gallery-v2 :is(.zone-img-wrapper, .lookbook-img-wrapper),
.fg-gallery-v2 :is(.zone-img-wrapper, .lookbook-img-wrapper) .virtual-image-container {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  padding: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
  background: #f3f3f1;
}
.fg-gallery-v2 .masonry-item > .virtual-image-container img,
.fg-gallery-v2 :is(.zone-img-wrapper, .lookbook-img-wrapper) img {
  display: block !important;
  position: static !important;
  inset: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  max-width: 100% !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  transform: none !important;
  pointer-events: auto !important;
  user-select: auto;
  -webkit-user-drag: element;
}
/* Reserve space only when there is no sourced image in the container. */
.fg-gallery-v2 .masonry-item > .virtual-image-container:not(:has(img[src]:not([src=""]))),
.fg-gallery-v2 :is(.zone-img-wrapper, .lookbook-img-wrapper):not(:has(img[src]:not([src=""]))) {
  min-height: 200px !important;
}
/* Decorative overlays must not steal image dragging or obscure save actions. */
.fg-gallery-v2 :is(.masonry-overlay, .masonry-item-overlay, .image-overlay,
  .zone-overlay, .zone-img-overlay, .lookbook-overlay, .lookbook-img-overlay) {
  pointer-events: none !important;
  z-index: 1 !important;
}

/* ZONES / LOOKBOOK: preserve image proportions and existing name/size text. */
.fg-gallery-v2 :is(.zone-grid, .lookbook-grid) {
  display: grid !important;
  grid-template-columns: repeat(var(--mobile-cols, 2), minmax(0, 1fr)) !important;
  gap: 24px 12px !important;
  align-items: start !important;
}
.fg-gallery-v2 :is(.zone-grid, .lookbook-grid) > * { min-width: 0; }
.fg-gallery-v2 .zone-more-gallery-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 16px;
  padding: 10px 16px;
  border: 1px solid #111;
  border-radius: 0;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.fg-gallery-v2 button:focus-visible {
  outline: 2px solid #111 !important;
  outline-offset: 3px;
}
.fg-gallery-v2 .fg-editorial-photo:focus-visible { outline-offset: -4px; }

/* PhotoSwipe lives outside the gallery subtree. */
.pswp .pswp__button--fg-jpg {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 110px;
  width: 110px !important;
  min-width: 110px !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 8px 4px;
  padding: 0 10px;
  border: 1px solid #ffffff99;
  border-radius: 999px;
  background: #111 !important;
  color: #fff !important;
  opacity: 1 !important;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .04em;
  white-space: nowrap;
  cursor: pointer;
}
.pswp .pswp__button--fg-jpg:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.pswp .pswp__fg-caption {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px max(16px, env(safe-area-inset-right))
    calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(17, 17, 17, .9);
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: .015em;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
}

@media (min-width: 768px) {
  :root body #archive .gallery-full-container.fg-gallery-v2 {
    --fg-gap: 16px;
    padding: 64px 40px 72px !important;
  }
  .fg-gallery-v2 .fg-editorial-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .fg-gallery-v2 .fg-editorial-grid > figure.fg-editorial-card.featured,
  .fg-gallery-v2 .fg-editorial-grid > .fg-editorial-skeleton:first-child {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: auto;
  }
  .fg-gallery-v2 .gallery-masonry-grid {
    grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)) !important;
  }
  .fg-gallery-v2 :is(.zone-grid, .lookbook-grid) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 32px 16px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fg-gallery-v2 *, .fg-gallery-v2 *::before, .fg-gallery-v2 *::after,
  .pswp .pswp__button--fg-jpg, .pswp .pswp__fg-caption {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.pswp .pswp__img{-webkit-user-drag:element!important;user-select:auto!important}.fg-gallery-v2 .masonry-hover-overlay{pointer-events:none!important}.fg-gallery-v2 .fg-gallery-heading h2{font-weight:750!important}.fg-reference-surface{background:#fff!important;color:#111!important}.fg-reference-surface .zone-img-wrapper,.fg-reference-surface .lookbook-img-wrapper{position:relative;cursor:zoom-in}.fg-reference-surface .zone-name{font-size:clamp(14px,1.8vw,20px);line-height:1.25;letter-spacing:-.025em}.fg-reference-surface .lookbook-name{font-size:13px;line-height:1.5}.fg-reference-surface .lookbook-size{font-size:12px;line-height:1.5}.fg-reference-surface .tag-circles-scroll{justify-content:flex-start!important;flex-wrap:nowrap!important;overflow-x:auto!important}.fg-photo-keyboard:focus-visible{outline:2px solid #e22!important;outline-offset:3px}

/* Reference-saving actions never cover faces, outfits or background details. */
.fg-gallery-v2 .gallery-masonry-grid > .masonry-item{aspect-ratio:auto!important}
.fg-gallery-v2 .fg-editorial-grid > figure.fg-editorial-card{aspect-ratio:auto!important;display:flex;flex-direction:column;background:#fff}
.fg-gallery-v2 .fg-editorial-card > button.fg-editorial-photo{aspect-ratio:3/4;height:auto;flex:1}
.fg-gallery-v2 .fg-editorial-card.featured > button.fg-editorial-photo{aspect-ratio:auto;min-height:0}
.fg-gallery-v2 .fg-editorial-card > button.fg-jpg-save,.fg-gallery-v2 .masonry-item > button.masonry-quick-dl-btn,.fg-reference-surface .zone-card > button.fg-jpg-save,.fg-reference-surface .lookbook-item > button.fg-jpg-save{position:static!important;inset:auto!important;align-self:flex-end;min-width:68px!important;width:max-content!important;height:44px!important;min-height:44px!important;margin:6px 0 0 auto!important;padding:0 10px!important;border:0!important;border-bottom:1px solid #111!important;border-radius:0!important;box-shadow:none!important;background:#fff!important;color:#111!important;float:none!important}
.fg-gallery-v2 .masonry-item > button.masonry-quick-dl-btn,.fg-reference-surface .zone-card > button.fg-jpg-save,.fg-reference-surface .lookbook-item > button.fg-jpg-save{display:flex!important}
.fg-reference-surface .zone-card,.fg-reference-surface .lookbook-item{position:relative;border-radius:0!important;overflow:visible!important}
@media(max-width:767px){.fg-gallery-v2 .fg-editorial-card.featured > button.fg-editorial-photo{aspect-ratio:3/4;min-height:0}.fg-gallery-v2 .gallery-masonry-grid{gap:12px!important}}

/* Mobile review editorial pass. Scoped to the existing review component.
   No data/markup changes. Desktop (769px+) is untouched.
   Stacked cards expose every review without carousel navigation. Existing
   arrow elements/handlers remain intact and return on desktop.
   Text only clamps when that same wrapper contains its live More button. */
@media (max-width: 768px) {
  .review-section-container {
    width: 100%; max-width: 100%; min-width: 0; margin: 0 auto;
    color: #171717; background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Noto Sans KR', sans-serif;
    text-align: left; letter-spacing: 0;
  }
  .review-section-container, .review-section-container * { box-sizing: border-box; }
  .review-section-container .review-section-header { margin: 0 0 28px; padding: 0; text-align: left; }
  .review-section-container .section-subtitle { display: block; margin: 0 0 10px; color: #686868; font-size: 10px; line-height: 1.5; font-weight: 600; letter-spacing: .12em; }
  .review-section-container .section-title { margin: 0; color: #111; font-size: 36px; line-height: 1.08; font-weight: 750; letter-spacing: -.045em; }
  .review-section-container .review-stats-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 20px; width: 100%; height: auto; margin: 0 0 24px; padding: 24px 20px; background: #f6f6f5; border: 0; border-radius: 0; }
  .review-section-container .stat-divider { display: none; }
  .review-section-container .stat-item { min-width: 0; padding: 0; text-align: left; }
  .review-section-container .stat-value { margin: 0 0 6px; color: #171717; font-size: 25px; line-height: 1.15; font-weight: 700; letter-spacing: -.04em; white-space: nowrap; }
  .review-section-container .stat-label { color: #686868; font-size: 11px; line-height: 1.4; font-weight: 500; letter-spacing: .02em; text-transform: none; }
  .review-section-container .review-filter-tabs { display: flex; flex-flow: row nowrap; justify-content: flex-start; gap: 8px; width: 100%; min-width: 0; margin: 0 0 24px; padding: 0 0 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .review-section-container .review-filter-tab { flex: 0 0 auto; min-height: 44px; margin: 0; padding: 11px 14px; border: 1px solid #dededb; border-radius: 0; background: #fff; color: #585858; font-family: inherit; font-size: 12px; line-height: 20px; font-weight: 500; letter-spacing: 0; white-space: nowrap; }
  .review-section-container .review-filter-tab.active { color: #fff !important; background: #171717 !important; border-color: #171717 !important; font-weight: 600; }
  .review-section-container .review-slider-wrapper { position: relative; width: 100%; margin: 0; padding: 0; }
  .review-section-container .review-slider-container { width: 100%; margin: 0; padding: 0; overflow: visible; }
  .review-section-container .review-slider-track { display: flex; flex-direction: column; gap: 16px; width: 100%; height: auto; max-height: none; margin: 0; padding: 0; overflow: visible; scroll-snap-type: none; transform: none; }
  .review-section-container .slider-arrow { display: none; }
  .review-section-container .review-card { display: flex; flex-direction: column; align-items: stretch; flex: 0 0 auto; width: 100%; min-width: 0; max-width: 100%; height: auto; min-height: 0; margin: 0; padding: 20px; border: 1px solid #e2e2df; border-radius: 0; background: #fff; color: #171717; box-shadow: none; text-align: left; scroll-snap-align: none; }
  .review-section-container .card-header { order: 0; display: block; width: 100%; margin: 0 0 18px; padding: 0; }
  .review-section-container .user-profile-group { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
  .review-section-container .naver-avatar { flex: 0 0 32px; width: 32px; height: 32px; margin: 0; border-radius: 50%; background: #f1f1ee; color: #333; font-size: 13px; line-height: 32px; text-align: center; }
  .review-section-container .user-info { display: block; flex: 1; min-width: 0; }
  .review-section-container .user-name-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 7px; margin: 0 0 6px; }
  .review-section-container .user-name { color: #171717; font-size: 13px; line-height: 1.5; font-weight: 650; overflow-wrap: anywhere; }
  .review-section-container :is(.source-badge, .brand-badge, .verified-badge) { display: inline-block; margin: 0; padding: 2px 4px; border: 0; border-radius: 2px; background: #f4f4f2; color: #686868; font-size: 9px; line-height: 1.4; font-weight: 500; letter-spacing: .01em; }
  .review-section-container .user-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 11px; line-height: 1.5; color: #767676; }
  .review-section-container .rating-stars { color: #222; font-size: 11px; line-height: 1.5; letter-spacing: .08em; }
  .review-section-container .review-date { margin: 0; color: #767676; font-size: 11px; line-height: 1.5; }
  .review-section-container .review-content-body { order: 1; flex: none; width: 100%; min-width: 0; margin: 0; padding: 0; }
  .review-section-container .review-item-title { margin: 0 0 10px; color: #222; font-size: 15px; line-height: 1.55; font-weight: 650; letter-spacing: -.02em; word-break: keep-all; overflow-wrap: anywhere; }
  .review-section-container .review-text-wrapper { position: static; margin: 0; padding: 0; }
  .review-section-container .review-text-content { display: block; height: auto; max-height: none; margin: 0; padding: 0; overflow: visible; -webkit-line-clamp: unset; color: #505050; font-size: 14px; line-height: 1.7; font-weight: 400; letter-spacing: -.015em; word-break: keep-all; overflow-wrap: anywhere; white-space: pre-line; }
  .review-section-container .review-text-wrapper:has(> .btn-show-more) > .review-text-content:not(.expanded) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
  .review-section-container .btn-show-more { display: inline-flex; align-items: center; min-width: 60px; min-height: 44px; margin: 8px 0 0; padding: 8px 0; color: #222; background: transparent; border: 0; font-family: inherit; font-size: 12px; line-height: 1.5; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
  .review-section-container .review-image-wrapper { order: 2; position: relative; flex: none; align-self: flex-start; width: 88px; height: 104px; min-height: 0; max-height: none; margin: 16px 0 0; padding: 0; aspect-ratio: auto; overflow: hidden; border-radius: 2px; }
  .review-section-container .review-image-wrapper img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
  .review-section-container .photo-count-badge { right: 4px; bottom: 4px; padding: 3px 5px; font-size: 10px; line-height: 1.2; background: rgba(0,0,0,.72); color: #fff; }
  .review-section-container .ai-summary-card { gap: 12px; background: #f6f6f5; }
  .review-section-container .ai-badge { align-self: flex-start; margin: 0; padding: 0; background: none; color: #686868; font-size: 10px; line-height: 1.5; letter-spacing: .1em; }
  .review-section-container .ai-title { margin: 0; color: #171717; font-size: 20px; line-height: 1.3; letter-spacing: -.025em; }
  .review-section-container .ai-desc { margin: 0; color: #686868; font-size: 12px; line-height: 1.6; }
  .review-section-container .ai-points { margin: 0; padding: 0; }
  .review-section-container .ai-points li { margin: 0 0 10px; color: #505050; font-size: 14px; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
  .review-section-container .ai-points .dot { background: #686868; }
  .review-section-container .review-footer-actions { display: flex; flex-direction: column; gap: 20px; width: 100%; margin: 28px 0 0; padding: 0; }
  .review-section-container .review-guide-container { width: 100%; margin: 0; }
  .review-section-container .guide-toggle-btn { min-height: 44px; font-size: 13px; }
  .review-section-container .guide-desc, .review-section-container .guide-questions li { font-size: 13px; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
  .review-section-container .review-write-buttons { display: flex; flex-direction: column; gap: 8px; width: 100%; }
  .review-section-container .btn-review { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; margin: 0; padding: 12px 16px; border: 1px solid #d6d6d2; border-radius: 0; background: #fff; color: #222; font-size: 13px; line-height: 1.5; font-weight: 600; }
  .review-section-container :is(button, a):focus-visible { outline: 2px solid #171717; outline-offset: 3px; }
}

.fg-review-more{display:none}@media(max-width:768px){.review-section-container{scroll-margin-top:92px}.review-section-container .review-card[data-fg-review-hidden]{display:none!important}.review-section-container .fg-review-more{display:block;width:100%;min-height:48px;margin:24px 0 0;border:1px solid #111;border-radius:0;background:#fff;color:#111;font:inherit;font-size:13px;cursor:pointer}.review-section-container .fg-review-more[hidden]{display:none!important}}
