/* SG_BOARD: limited, CSP-safe rich text formatting (no user HTML or inline styles). */
.post-text-color-black{color:#202124}
.post-text-color-gray{color:#737373}
.post-text-color-red{color:#d32f2f}
.post-text-color-orange{color:#e36400}
.post-text-color-yellow{color:#946400}
.post-text-color-green{color:#16823a}
.post-text-color-teal{color:#007d87}
.post-text-color-blue{color:#165fca}
.post-text-color-purple{color:#7927ae}
.post-text-color-pink{color:#c2185b}
.post-color-editor{min-width:0}
.post-color-toolbar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:10px 11px;margin-top:6px;border:1px solid var(--line,#dfe3e8);border-radius:5px;background:var(--panel-bg,#fff)}
.post-color-toolbar-title{font-size:12px;font-weight:700;margin:0 4px 0 7px;white-space:nowrap}
.post-color-choice{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--line,#dfe3e8);background:var(--panel-bg,#fff);color:var(--text,#222);border-radius:5px;padding:5px 7px;width:auto;margin:0;font-size:12px;cursor:pointer;line-height:1.3;min-height:29px}
.post-color-choice:hover{background:var(--hover-bg,#f4f8f6);border-color:var(--blue,#03c75a)}
.post-color-choice:focus-visible{outline:2px solid var(--blue,#03c75a);outline-offset:2px}
.post-bold-choice{min-width:78px;justify-content:center}
.post-bold-choice strong{font-weight:900;font-size:15px;line-height:1}
.post-color-swatch{width:12px;height:12px;display:inline-block;border-radius:50%;background:currentColor;border:1px solid rgba(0,0,0,.15);flex:none}
.post-color-help{font-size:12px;line-height:1.6;margin:7px 0;color:var(--muted,#777);font-weight:400}
.post-color-feedback{font-size:12px;color:var(--muted,#777);min-height:1.3em;margin:6px 0}
.post-rich-surface{min-height:240px;max-height:65vh;overflow-y:auto;border:1px solid var(--line,#dfe3e8);border-radius:5px;background:var(--input-bg,#fff);color:var(--input-text,#202124);padding:12px 13px;line-height:1.7;font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere;cursor:text;outline:none}
.post-rich-surface:focus{border-color:var(--blue,#03c75a);box-shadow:0 0 0 2px rgba(3,199,90,.12)}
.post-rich-surface[hidden]{display:none}
.post-rich-ready textarea[name="content"]{display:none}
.post-rich-surface strong{font-weight:800}

.post-rich-surface .post-text-normal,.post-content .post-text-normal{font-weight:400}

.post-inline-image{display:block;max-width:100%;height:auto;margin:9px 0;border-radius:4px}
.post-rich-surface .post-inline-image{max-height:500px;object-fit:contain}
.post-content a{color:#165fca;text-decoration:underline;overflow-wrap:anywhere}

/* Compact title options and pointer-based inline image resizing */
.sg-title-controls{display:flex;align-items:center;gap:8px;flex-wrap:nowrap;margin-top:5px;min-width:0}
.sg-title-controls>input[name=title]{flex:1 1 auto;width:0;min-width:90px;margin:0}
.sg-title-toggle,.sg-title-color-label{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;font-size:12px;font-weight:500}
.sg-title-toggle{padding:6px 9px;border:1px solid var(--line,#ddd);border-radius:6px;cursor:pointer}
.sg-title-toggle input{width:15px;height:15px;margin:0}
.sg-title-color-label select{width:auto;min-width:85px;margin:0;padding:6px 7px}
.sg-title-pin{display:inline-flex;align-items:center;gap:5px;flex:0 0 auto;white-space:nowrap;font-size:12px;font-weight:600;cursor:pointer}
.sg-title-pin input[type="checkbox"]{appearance:auto;width:16px;height:16px;min-width:16px;margin:0;padding:0;flex:0 0 16px;accent-color:#7757c6}
@media(max-width:540px){.sg-title-controls{gap:5px}.sg-title-toggle{padding:6px 5px}.sg-title-color-label select{min-width:67px;padding:6px 3px}.sg-title-pin{gap:3px;font-size:11px}.sg-title-controls>input[name=title]{min-width:65px}}
.sg-title-bold{font-weight:850!important}
.sg-resize-image{display:inline-block;vertical-align:top;max-width:100%;min-width:100px;margin:8px 0;line-height:0;border:1px solid transparent}
.sg-resize-image:focus-within,.sg-resize-image:hover{border-color:#5b9af7}
.sg-resize-image img.post-inline-image{display:block;width:100%;max-width:100%;height:auto;max-height:500px;object-fit:contain;object-position:left top;margin:0}
.sg-resize-grip{position:absolute;right:0;bottom:0;width:19px;height:19px;border-radius:5px 0 0 0;background:#287ee5;cursor:nwse-resize;touch-action:none;box-shadow:0 0 0 2px #fff inset}
.sg-resize-grip:after{content:'↘';position:absolute;inset:0;display:grid;place-items:center;color:white;font-size:13px;line-height:1}
.sg-resize-image:not([style*="width"]){width:min(100%,600px)}

/* Saved inline images preserve the width selected in the content editor. */
.post-content .sg-saved-inline-image{display:block;box-sizing:border-box;max-width:100%;min-width:0;margin:9px 0;line-height:0}
.post-content .sg-saved-inline-image>a{display:block;width:100%;max-width:100%;line-height:0}
.post-content .sg-saved-inline-image img.post-inline-image{display:block;width:100%;max-width:100%;height:auto;max-height:500px;object-fit:contain;object-position:left top;margin:0}

/* Identical sizing rules in editor and saved post; keep the original file, never a thumbnail. */
.post-rich-surface .sg-resize-image img.post-inline-image,
.post-content .sg-saved-inline-image img.post-inline-image{
  display:block;width:100%;max-width:100%;height:auto;max-height:none!important;
  object-fit:contain;object-position:left top;margin:0;
}
.post-rich-surface .sg-resize-image,
.post-content .sg-saved-inline-image{box-sizing:border-box;border:0;max-width:100%}

/* In-content image editing button */
.sg-resize-image{position:relative}
.sg-inline-image-edit{position:absolute;top:8px;left:8px;z-index:3;display:block!important;background:#175eb5!important;color:#fff!important;border:1px solid #fff!important;border-radius:6px!important;padding:7px 11px!important;font:600 13px sans-serif!important;cursor:pointer!important;opacity:.94}
.sg-inline-image-edit:hover{background:#0c417e!important}

/* Per-photo width controls and the full-post percentage display. */
.sg-photo-width-control{gap:8px;flex-wrap:wrap;margin:8px 0;padding:7px 9px;background:var(--hover-bg,#f3f6f9);border:1px solid var(--line,#dce3eb);border-radius:7px;font:500 12px/1.45 sans-serif;color:var(--text,#263548)}
.sg-photo-width-control>span{white-space:nowrap}
.sg-photo-width-control input[type=range]{flex:1 1 90px;min-width:80px;max-width:220px;margin:0;cursor:pointer}
.sg-photo-width-control input[type=number]{width:58px;max-width:58px;padding:5px;text-align:right;margin:0}
.sg-photo-width-control small{font-size:11px;color:var(--muted,#657080)}
.gallery.gallery-attachment-tiles.sg-sized-photo-gallery{display:flex;flex-wrap:wrap;align-items:flex-start;gap:14px}
.gallery.sg-sized-photo-gallery>.gallery-photo-card{box-sizing:border-box;flex:0 0 var(--sg-photo-width,70%);width:var(--sg-photo-width,70%);max-width:100%;min-width:0}
.gallery.sg-sized-photo-gallery>.gallery-video-card{flex:0 1 245px;max-width:100%}
.gallery.sg-sized-photo-gallery>.gallery-photo-card>a.gallery-item{aspect-ratio:auto;height:auto;min-height:0}
.gallery.sg-sized-photo-gallery>.gallery-photo-card>a.gallery-item img{display:block;width:100%;height:auto;max-height:none;object-fit:contain}
@media(max-width:600px){.gallery.sg-sized-photo-gallery{display:flex;gap:10px}.gallery.sg-sized-photo-gallery>.gallery-photo-card{flex:0 0 var(--sg-photo-width,70%);width:var(--sg-photo-width,70%);max-width:100%}}
/* Default applies to pasted/inline images as well; explicitly resized ones override it. */
.post-rich-surface .sg-resize-image:not([style*="width"]){width:var(--sg-post-image-default,70%)}

/* Lightbox image print control: keep it on the same row as the original-image link. */
#gallery-lightbox-original,#gallery-lightbox-print{cursor:pointer}

/* 2026-11-02: post DETAIL photos only. The displayed photo is the full-resolution
   source at a CSS-only percentage. Home/board-list thumbnails are unchanged.
   Use greater specificity than theme.php's !important 16:9 gallery overrides. */
.post-card > .gallery.gallery-attachment-tiles.sg-sized-photo-gallery {
  display:flex!important;
  flex-direction:column!important;
  flex-wrap:nowrap!important;
  align-items:flex-start!important;
  justify-content:flex-start!important;
  gap:18px!important;
  grid-template-columns:none!important;
  width:100%;box-sizing:border-box;
}
.post-card > .gallery.gallery-attachment-tiles.sg-sized-photo-gallery > .gallery-photo-card {
  display:flex!important;
  flex:0 0 auto!important;
  align-self:flex-start!important;
  width:var(--sg-photo-width,70%)!important;
  max-width:100%!important;
  min-width:0!important;
  height:auto!important;
  margin:0!important;
  box-sizing:border-box;
}
.post-card > .gallery.gallery-attachment-tiles.sg-sized-photo-gallery > .gallery-photo-card > a.gallery-item {
  display:block!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:auto!important;
  overflow:hidden!important;
  background:transparent!important;
}
.post-card > .gallery.gallery-attachment-tiles.sg-sized-photo-gallery > .gallery-photo-card > a.gallery-item > img {
  display:block!important;
  width:100%!important;
  height:auto!important;
  max-height:none!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
  object-position:left top!important;
  transform:none!important;
}
.post-card > .gallery.gallery-attachment-tiles.sg-sized-photo-gallery > .gallery-video-card {
  width:min(245px,100%)!important;
  flex:0 0 auto!important;
  align-self:flex-start!important;
}
/* Keep percentage sliders and numbers neatly aligned even on narrow upload cards. */
.sg-photo-width-control {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 58px 14px!important;
  align-items:center!important;
  column-gap:6px!important;
  row-gap:5px!important;
  width:100%!important;
  box-sizing:border-box!important;
}
.sg-photo-width-control>span:first-child {grid-column:1/-1;white-space:nowrap;}
.sg-photo-width-control>input[type=range]{grid-column:1;min-width:0!important;max-width:none!important;width:100%!important;flex:none!important;}
.sg-photo-width-control>input[type=number]{grid-column:2;width:58px!important;max-width:58px!important;min-width:0!important;margin:0!important;}
.sg-photo-width-control>span:not(:first-child){grid-column:3;white-space:nowrap;}

/* Print toolbar: three equal-height controls aligned on a shared baseline. */
.gallery-lightbox-foot {display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:9px!important;flex-wrap:wrap!important;}
.gallery-lightbox-foot > .button,
.gallery-lightbox-foot > #gallery-lightbox-original,
.gallery-lightbox-foot > #gallery-lightbox-print {box-sizing:border-box!important;height:38px!important;min-height:38px!important;max-height:38px!important;}
.gallery-lightbox-foot > .button {display:inline-flex!important;align-items:center!important;justify-content:center!important;padding:0 13px!important;line-height:1!important;margin:0!important;}

/* v38: 사진보기 하단의 마지막 동작은 닫기. 버튼은 사진 영역 바깥에 유지. */
.gallery-lightbox-foot > #gallery-lightbox-close-bottom {order:99;white-space:nowrap!important;}
@media(max-width:700px){
 .gallery-lightbox-foot > #gallery-lightbox-close-bottom {grid-column:2;display:inline-flex!important;align-items:center!important;justify-content:center!important;width:100%!important;min-height:26px!important;height:26px!important;padding:3px 5px!important;font-size:9px!important;line-height:1.1!important;}
}

/* v40: Enlarge the PHOTO inside the existing photo-viewer frame.
   The dialog width/height rules are deliberately untouched; reclaim the
   interior padding/navigation gaps without overlaying buttons on the image. */
.gallery-lightbox .gallery-lightbox-inner{padding:7px!important}
.gallery-lightbox .gallery-lightbox-head{padding:0 2px 3px!important}
.gallery-lightbox .gallery-lightbox-close{width:28px;height:28px;font-size:25px}
.gallery-lightbox .gallery-lightbox-stage{grid-template-columns:30px minmax(0,1fr) 30px!important;gap:3px!important}
.gallery-lightbox .gallery-lightbox-nav{width:30px;height:60px;font-size:34px}
.gallery-lightbox .gallery-lightbox-stage img{width:100%;max-height:min(84vh,900px);object-fit:contain}
.gallery-lightbox .gallery-lightbox-stage figcaption{padding:3px 2px 0!important}
.gallery-lightbox .gallery-lightbox-foot{padding:5px 3px 2px!important}
@media(max-width:700px){
 .gallery-lightbox .gallery-lightbox-inner{padding:5px!important}
 .gallery-lightbox .gallery-lightbox-stage{grid-template-columns:24px minmax(0,1fr) 24px!important;gap:2px!important}
 .gallery-lightbox .gallery-lightbox-nav{width:24px;height:48px;font-size:28px}
 .gallery-lightbox .gallery-lightbox-stage img{max-height:82dvh}
 }

/* v41: three same-sized compact photo-view controls on phones. */
@media(max-width:700px){
  .gallery-lightbox .gallery-lightbox-foot{
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:5px!important;width:100%!important;justify-content:stretch!important;
    padding:4px 0 2px!important;
  }
  .gallery-lightbox .gallery-lightbox-foot > #gallery-lightbox-original,
  .gallery-lightbox .gallery-lightbox-foot > #gallery-lightbox-print,
  .gallery-lightbox .gallery-lightbox-foot > #gallery-lightbox-close-bottom{
    grid-column:auto!important;order:initial!important;display:inline-flex!important;
    justify-content:center!important;align-items:center!important;
    width:100%!important;min-width:0!important;height:30px!important;
    min-height:30px!important;max-height:30px!important;
    margin:0!important;padding:0 2px!important;font-size:10px!important;
    line-height:1.1!important;white-space:nowrap!important;
  }
  .gallery-lightbox .gallery-lightbox-foot > #gallery-lightbox-close-bottom{order:3!important;}
}

/* v139: phone post editor — full-width title, options on a single second line. */
.sg-title-editor{min-width:0}
.sg-title-editor .sg-title-controls{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;column-gap:10px;row-gap:10px;min-width:0;width:100%;margin-top:7px}
.sg-title-editor .sg-title-controls>input[name="title"]{grid-column:1/-1;width:100%;min-width:0;max-width:100%;box-sizing:border-box;min-height:43px;margin:0}
.sg-title-editor .sg-title-toggle{grid-column:1;justify-self:start}
.sg-title-editor .sg-title-color-label{grid-column:2;justify-self:center;min-width:0}
.sg-title-editor .sg-title-pin{grid-column:3;justify-self:end}
@media(max-width:540px){
 .sg-title-editor .sg-title-controls{column-gap:5px;row-gap:9px}
 .sg-title-editor .sg-title-toggle{padding:7px 6px;font-size:11px}
 .sg-title-editor .sg-title-color-label{gap:4px;font-size:11px}
 .sg-title-editor .sg-title-color-label select{min-width:0;width:min(85px,21vw);max-width:100%;padding:7px 3px;font-size:12px}
 .sg-title-editor .sg-title-pin{gap:3px;font-size:11px}
 .sg-title-editor .sg-title-pin input[type="checkbox"]{width:15px;height:15px;min-width:15px;flex-basis:15px}
}
