/* Layout editor v184 — nothing here changes the public page until editing starts
   (apart from the header banner offset variables, which are inert at 0px). */

/* ---------- launcher & panel ---------- */
.sg-layout-launch{position:fixed;right:18px;bottom:18px;z-index:100010;border:1px solid #2365af;background:#165bb4;color:#fff;border-radius:28px;padding:12px 17px;box-shadow:0 5px 23px #17345540;cursor:grab;touch-action:none;user-select:none;font:700 13px system-ui,sans-serif}
.sg-layout-launch:active{cursor:grabbing}
.sg-layout-launch:hover{background:#0d458f}
.sg-layout-panel{position:fixed;right:0;top:0;bottom:0;width:min(340px,94vw);z-index:100030;overflow-y:auto;background:#fff;color:#25374b;box-shadow:-5px 0 28px #152b4650;padding:15px;font:13px system-ui,sans-serif;display:none;box-sizing:border-box}
.sg-layout-editing .sg-layout-panel{display:block}
.sg-layout-panel h2{font-size:18px;margin:0 0 5px}
.sg-layout-panel .hint{font-size:12px;color:#65758c;line-height:1.5;margin:4px 0 11px}
.sg-layout-panel .sg-layout-banner-note{background:#fff6e5;border:1px solid #f0d49a;color:#6b4b00;border-radius:6px;padding:8px 10px}
.sg-layout-panel .tools{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:10px 0}
.sg-layout-panel .sg-layout-sidebar-position{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0;font-weight:700}
.sg-layout-panel .sg-layout-sidebar-position select{flex:1;min-width:0;padding:8px 10px;border:1px solid #bfcbd9;border-radius:6px;background:#f5f8fc;color:#243a52}
.sg-layout-panel button,.sg-layout-panel select,.sg-layout-panel input,.sg-layout-panel textarea{font:inherit;max-width:100%;box-sizing:border-box}
.sg-layout-panel button{border:1px solid #bfcbd9;background:#f5f8fc;border-radius:6px;padding:9px 5px;cursor:pointer;color:#243a52}
.sg-layout-panel button:disabled{opacity:.45;cursor:default}
.sg-layout-panel button.primary{background:#1667bd;color:#fff;border-color:#1667bd}
.sg-layout-panel button.primary.sg-dirty{background:#e8590c;border-color:#e8590c;box-shadow:0 0 0 3px #e8590c33}
.sg-layout-panel button.danger,.sg-layout-modal button.danger{color:#a33530}
.sg-layout-panel #sg-layout-status[data-kind="ok"]{color:#18794e;font-weight:650}
.sg-layout-panel #sg-layout-status[data-kind="warn"]{color:#a15c00;font-weight:650}
.sg-layout-panel #sg-layout-status[data-kind="error"]{color:#b42318;font-weight:650}
.sg-layout-panel-heading{display:flex;align-items:center;gap:8px;justify-content:space-between;margin-bottom:5px}
.sg-layout-panel .sg-layout-panel-heading h2{margin:0}
.sg-layout-panel .sg-layout-panel-heading button{white-space:nowrap;padding:7px 11px}
.sg-layout-editing.sg-layout-panel-collapsed .sg-layout-panel{display:none}
.sg-layout-editing .sg-layout-launch{display:none}
.sg-layout-editing.sg-layout-panel-collapsed .sg-layout-launch{display:block;right:0;top:38%;bottom:auto;border-radius:9px 0 0 9px;padding:13px 12px;max-width:170px}

#sg-layout-properties{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:10px 0;font:13px system-ui,sans-serif;flex-wrap:wrap}
#sg-layout-properties button{padding:7px 10px}
#sg-layout-inline-fields:not(:empty){display:grid;gap:6px;padding:10px;background:#f8faff;border:1px solid #dbe4f1;border-radius:8px}
#sg-layout-inline-fields label{display:grid;gap:5px;font-weight:650}
#sg-layout-inline-fields label.sg-checkbox{display:flex;align-items:center;flex-wrap:nowrap;white-space:nowrap;gap:8px;min-width:0}
#sg-layout-inline-fields label.sg-checkbox input[type=checkbox]{flex:0 0 auto;width:auto;min-width:0}
#sg-layout-inline-fields input:not([type=checkbox]),#sg-layout-inline-fields textarea,#sg-layout-inline-fields select{display:block;width:100%;min-width:0;padding:8px;border:1px solid #b9c8d9;border-radius:6px;background:#fff}
#sg-layout-inline-fields textarea{min-height:70px}
.sg-layout-hidden-row{display:flex;gap:6px}
.sg-layout-hidden-row button:first-child{flex:1}
.sg-layout-hidden-row button:last-child:not(:first-child){width:auto!important;white-space:nowrap}
.sg-layout-custom-manage-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;align-items:center;gap:4px;margin:5px 0}
.sg-layout-custom-manage-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.sg-layout-custom-manage-row button{font-size:11px;padding:7px 5px;white-space:nowrap}
.sg-layout-selection-actions{display:flex;gap:6px;flex-wrap:wrap}
.sg-layout-hidden-panel{border-top:1px solid #d7e0eb;margin-top:18px;padding-top:12px}
.sg-layout-hidden-panel h3{font:700 14px system-ui;margin:0 0 9px}
#sg-layout-hidden-items{display:flex;flex-direction:column;gap:6px}
#sg-layout-hidden-items button{text-align:left;width:100%}

@media(max-width:700px){
 .sg-layout-launch{right:10px;bottom:12px;padding:10px 13px}
 .sg-layout-panel{top:auto;left:0;right:0;bottom:0;width:100%;max-height:48vh;border-radius:14px 14px 0 0;box-shadow:0 -5px 28px #152b4650}
 .sg-layout-editing.sg-layout-panel-collapsed .sg-layout-launch{top:auto;bottom:65px;right:0}
 .sg-layout-custom{width:100%!important}
}

/* ---------- properties dialog ---------- */
.sg-layout-modal[hidden]{display:none!important}
.sg-layout-modal{position:fixed;inset:0;z-index:100090;background:#0b203f75;display:grid;place-items:center;padding:18px;box-sizing:border-box}
.sg-layout-modal-card{width:min(440px,100%);max-height:90vh;overflow:auto;background:#fff;color:#22384d;border-radius:12px;padding:20px;box-shadow:0 18px 65px #071a3b80;font:13px system-ui,sans-serif}
.sg-layout-modal-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.sg-layout-modal button,.sg-layout-modal input,.sg-layout-modal textarea{font:inherit}
.sg-layout-modal button{border:1px solid #bdcbdc;border-radius:7px;padding:8px 12px;background:#f5f8fc;cursor:pointer}
.sg-layout-modal label{display:block;font-weight:650;margin:12px 0 5px}
.sg-layout-modal label.sg-checkbox{display:flex;align-items:center;gap:8px}
.sg-layout-modal input:not([type=checkbox]),.sg-layout-modal textarea{box-sizing:border-box;display:block;width:100%;padding:9px;border:1px solid #b8c9da;border-radius:7px}
.sg-layout-modal textarea{min-height:86px}
.sg-layout-modal .sg-choice{padding:4px 0}
.sg-layout-manage-logo{display:inline-block;margin-top:10px;padding:9px 12px;border-radius:7px;background:#185fb5;color:#fff!important;text-decoration:none;font-weight:650}

/* ---------- edit-mode outlines (blue dashed = editable, orange solid = selected) ---------- */
.sg-layout-editing [data-sg-layout-id]{outline:1px solid #2f7de1!important;outline-offset:-1px!important;cursor:grab}
.sg-layout-editing [data-sg-layout-id].sg-layout-selected{outline:1px solid #f59d2b!important;outline-offset:-1px!important}
.sg-layout-editing [data-sg-layout-id="hero"]{outline-offset:-6px!important;touch-action:none;isolation:isolate}
.sg-layout-editing [data-sg-layout-id="hero"].sg-layout-selected{outline-offset:-6px!important}
.sg-layout-editing [data-sg-layout-id="hero"] .hero-gallery-item,
.sg-layout-editing [data-sg-layout-id="hero"] img{cursor:grab;user-select:none;-webkit-user-drag:none}
.sg-layout-editing #home-board-panels [data-sg-layout-id]{touch-action:none}
.sg-layout-editing [data-sg-layout-id]:active{cursor:grabbing}
.sg-layout-editing #home-board-panels [data-sg-layout-id].sg-layout-dragging{position:relative;cursor:grabbing;opacity:.82;box-shadow:0 5px 24px #1a4c8170;z-index:5}
[data-sg-layout-id].sg-layout-hidden{display:none!important}
/* Sidebar presentation rules below use !important; hidden must always win. */
.home-layout .home-sidebar [data-sg-layout-id].sg-layout-hidden{display:none!important}
[data-sg-layout-id="hero"]{translate:none!important}

/* ---------- header banner / logo / tagline ---------- */
/* The offset variables are 0px unless an admin saved a position, so the public header is unchanged. */
header.site-header #site-brand-row::before{translate:var(--sg-banner-x,0px) var(--sg-banner-y,0px)!important}
header.site-header #site-brand-row.sg-layout-banner-hidden::before{visibility:hidden!important}
header.site-header #site-brand-row > .sg-layout-header-item-adjust{translate:var(--sg-logo-x,0px) var(--sg-logo-y,0px)!important}
.sg-layout-editing #site-brand-row.sg-layout-banner-present{cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
.sg-layout-editing #site-brand-row.sg-layout-banner-present:active{cursor:grabbing}
.sg-layout-editing #site-brand-row.sg-layout-banner-hidden::before{visibility:hidden!important}
.sg-layout-editing #site-brand-row > a.banner-home-link{pointer-events:none!important}
.sg-layout-editing #site-brand-row > .brand[data-sg-layout-id],
.sg-layout-editing #site-brand-row > .header-tagline[data-sg-layout-id]{cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;z-index:11!important}
.sg-layout-editing #site-brand-row > .family-home-switch{z-index:11!important}
.sg-layout-editing #site-brand-row > .banner-admin-settings-link{z-index:12!important}
.sg-layout-editing #site-brand-row > .brand::before{display:none!important}

/* The frame is a real element that follows the picture, so the dotted line never depends on pseudo-element support. */
.sg-banner-frame{display:none;position:absolute;top:0;bottom:0;left:50%;width:100vw;transform:translateX(-50%);translate:var(--sg-banner-x,0px) var(--sg-banner-y,0px);box-sizing:border-box;border:1px solid #2f7de1;pointer-events:none;z-index:9}
.sg-layout-editing #site-brand-row.sg-layout-banner-present:not(.sg-layout-banner-hidden) > .sg-banner-frame{display:block}
.sg-layout-editing #site-brand-row.sg-layout-banner-selected > .sg-banner-frame{border:1px solid #f59d2b}
.sg-banner-frame-tag{position:absolute;left:8px;top:6px;background:#2f7de1;color:#fff;font:700 11px/1 system-ui,sans-serif;padding:5px 8px;border-radius:5px;white-space:nowrap}
.sg-layout-banner-selected > .sg-banner-frame > .sg-banner-frame-tag{background:#f59d2b;color:#2b1a00}
@media(max-width:700px){.sg-banner-frame{left:0;width:100%;transform:none}}

/* ---------- hide button ---------- */
.sg-layout-hide-x{position:fixed;z-index:100035;width:30px;height:30px;display:grid;place-items:center;border:1px solid #a52b32;border-radius:8px;background:#d8313d;color:#fff;font:bold 22px/1 system-ui;cursor:pointer;box-shadow:0 2px 10px #0003}
.sg-layout-hide-x[hidden]{display:none!important}

/* ---------- custom items ---------- */
.sg-layout-custom{border:1px solid #dce5f1;border-radius:9px;padding:14px;box-sizing:border-box;min-width:0;overflow-wrap:anywhere}
.sg-layout-custom a{display:inline-flex;justify-content:center;align-items:center;min-height:36px;padding:8px 16px;border-radius:7px;background:#185fb5;color:#fff!important;text-decoration:none;font-weight:700;max-width:100%;box-sizing:border-box}
.sg-layout-custom a:has(.sg-custom-button-image){padding:0;background:transparent;min-height:0;overflow:hidden}
.sg-layout-custom .sg-custom-button-image{display:block;width:100%;max-width:100%;height:auto;object-fit:contain}
.home-sidebar>.sg-layout-custom{width:100%;margin-bottom:12px}
.sg-layout-modal select{display:block;width:100%;padding:9px;border:1px solid #b8c9da;border-radius:7px;background:#fff}
.sg-layout-custom .sg-custom-title{font-weight:750;font-size:17px;margin:0 0 8px}
.sg-layout-custom .sg-custom-text{white-space:pre-wrap;line-height:1.6;margin:0}
.sg-link-tools-card[hidden]{display:none!important}
.sg-link-tools-card h2{margin:0 0 10px;font-size:14px;color:var(--heading)}
.sg-link-buttons:not(:empty){display:grid;gap:8px}
.sg-image-items:not(:empty){display:grid;gap:8px}
.sg-image-tools-card[hidden]{display:none!important}
.sg-image-items .sg-layout-image{padding:0!important;margin:0!important;border:0!important;background:transparent!important;border-radius:0!important;min-width:0}
.home-sidebar > .sg-layout-custom.sg-layout-image{display:block;box-sizing:border-box;width:100%;max-width:100%;padding:0!important;margin:0 0 12px!important;border:0!important;border-radius:0!important;background:transparent!important;min-width:0}
.sg-layout-image > .sg-image-placeholder{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;min-height:115px;padding:1px;border:1px dashed #6d96bf;border-radius:6px;background:#f7fbff;color:#386186;font-size:13px;font-weight:600;text-align:center;cursor:pointer}
.sg-layout-editing .sg-layout-image > .sg-image-placeholder{cursor:grab}
.sg-layout-image > div:has(.sg-custom-button-image){display:block;box-sizing:border-box;width:100%;height:auto;min-height:0;padding:1px;border:1px solid #b9c7d5;border-radius:6px;background:#fff;overflow:hidden;cursor:zoom-in}
.sg-layout-image > div .sg-custom-button-image{display:block;width:100%;max-width:100%;height:auto;object-fit:contain}
.sg-layout-editing .sg-layout-image{touch-action:none;cursor:grab}
.sg-layout-editing .sg-layout-image > div:has(.sg-custom-button-image){cursor:grab}
.sg-link-buttons .sg-layout-custom{padding:0!important;margin:0!important;border:0!important;background:transparent!important;border-radius:0!important;width:100%;min-width:0}
.sg-link-buttons .sg-layout-custom a{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;max-width:100%;height:39px;min-height:39px;padding:9px 8px;border:1px solid #b9c7d5;border-radius:6px;background:#fff;color:#243d55!important;font-size:14px;font-weight:600;line-height:1.35;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sg-link-buttons .sg-layout-custom a:hover{background:#eef6ff;border-color:#4b91cf}
.sg-link-buttons .sg-layout-custom a:has(.sg-custom-button-image){padding:0!important;background:#fff;overflow:hidden}
.sg-link-buttons .sg-custom-button-image{display:block;width:100%!important;height:100%!important;min-height:0;max-height:none!important;max-width:none!important;object-fit:contain}
.sg-layout-image a:has(.sg-custom-button-image){display:block;box-sizing:border-box;width:100%;height:auto;min-height:0;padding:1px!important;border:1px solid #b9c7d5;border-radius:6px;background:#fff;overflow:hidden}
.sg-layout-image:has(.sg-custom-button-image){padding:0;border:0;background:transparent}
.sg-layout-image .sg-custom-button-image,.sg-link-buttons .sg-layout-image .sg-custom-button-image{display:block;width:100%!important;height:auto!important;min-height:0;max-width:100%!important;max-height:none!important;object-fit:contain}
.sg-link-buttons .sg-layout-custom.sg-layout-image a:has(.sg-custom-button-image){height:auto;min-height:0;padding:1px!important}
.sg-layout-image a:hover{border-color:#4b91cf}
.sg-layout-image{position:relative;max-width:100%;min-width:0}
.sg-layout-image.sg-image-framed,
.home-sidebar > .sg-layout-custom.sg-layout-image.sg-image-framed,
.sg-image-items > .sg-layout-image.sg-image-framed{
 border:var(--sg-image-frame-width,1px) solid var(--sg-image-frame-border,#dce5f1)!important;
 background:var(--sg-image-frame-background,#ffffff)!important;
 padding:var(--sg-image-frame-padding,10px)!important;
 border-radius:var(--sg-image-frame-radius,9px)!important;
 box-sizing:border-box;
}
.sg-layout-image.sg-image-framed > div:has(.sg-custom-button-image){border:0!important;background:transparent!important;padding:0!important}
.home-sidebar > .sg-layout-custom.sg-layout-image,
.sg-image-items > .sg-layout-image,
#home-board-panels > .sg-layout-image{margin-left:auto!important;margin-right:auto!important;justify-self:center}
.sg-image-resize-handle{display:none;position:absolute;right:0;bottom:0;width:19px;height:19px;z-index:5;cursor:nwse-resize;border-radius:4px 0 5px 0;background:#1976d2;border:2px solid white;box-sizing:border-box;touch-action:none;box-shadow:0 0 0 1px #1976d2}
.sg-layout-editing .sg-layout-image .sg-image-resize-handle{display:block}
.sg-image-viewer[hidden]{display:none!important}
.sg-image-viewer{position:fixed;inset:0;z-index:200000;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(0,0,0,.76);box-sizing:border-box}
.sg-image-viewer-content{position:relative;display:flex;flex-direction:column;align-items:center;gap:12px;width:min(640px,100%);max-height:calc(100vh - 40px)}
.sg-image-viewer-photo{display:block;max-width:100%;max-height:calc(100vh - 80px);width:auto;height:auto;object-fit:contain;border-radius:5px;background:#fff}
.sg-image-viewer-close{position:absolute;top:-15px;right:-12px;width:36px;height:36px;border:1px solid #fff;border-radius:50%;background:#25364b;color:white;font:26px/1 sans-serif;cursor:pointer;z-index:1}
.sg-image-viewer-link{background:#fff;color:#173e67!important;border-radius:6px;padding:9px 15px;text-decoration:none;font-weight:700}
.sg-image-viewer-link[hidden]{display:none!important}
.sg-layout-save-popup[hidden]{display:none!important}
.sg-layout-save-popup{position:fixed;inset:0;z-index:210000;background:rgba(9,26,49,.55);display:grid;place-items:center;padding:15px}
.sg-layout-save-popup-card{width:min(360px,100%);background:#fff;color:#26394c;border-radius:12px;box-shadow:0 15px 45px #0004;padding:25px;text-align:center;font:14px system-ui,sans-serif}
.sg-layout-save-popup-card strong{display:block;font-size:20px;margin-bottom:8px}
.sg-layout-save-popup-card p{line-height:1.55;color:#526174}
.sg-layout-save-popup-card button{margin-top:12px;padding:10px 30px;background:#1867ba;color:white;border:0;border-radius:8px;cursor:pointer}
@media(max-width:700px){.home-sidebar .sg-link-tools-card.sg-has-links,.home-sidebar .sg-image-tools-card.sg-has-images{display:block!important}}
.sg-layout-alert{border:1px solid #eebc70;background:#fff8e9;color:#503b20}
.sg-layout-alert .sg-custom-title{padding-left:10px;border-left:3px solid #e59b35;color:#8c4c08}
.sg-layout-alert .sg-custom-text{font-size:14px}

/* ---------- real 2-column grid is preserved; 100% spans both columns ---------- */
.sg-layout-width-custom{max-width:100%;box-sizing:border-box}
@media(min-width:701px){
 #home-board-panels>[data-sg-layout-id].sg-layout-width-custom[data-layout-span="2"]{grid-column:span 2}
 #home-board-panels>[data-sg-layout-id].sg-layout-width-custom[data-layout-span="1"]{grid-column:span 1}
}
@media(max-width:700px){#home-board-panels>[data-sg-layout-id].sg-layout-width-custom{grid-column:auto!important}}
#home-board-panels>[data-sg-layout-id].sg-layout-width-custom{width:auto!important;max-width:none!important}
#home-board-panels > [data-sg-layout-id="hero"]{grid-column:1 / -1;width:100%;min-width:0;box-sizing:border-box;margin-bottom:0}

/* v204: 회원 로그인 카드 — 제목 잘림 방지 + 정돈된 디자인.
   회원가입 링크가 켜지면(비밀번호 찾기 · 회원가입 신청) 같은 줄에 나란히, 좁으면 자동 줄바꿈. 하나뿐이면 가운데 정렬. */
.home-sidebar .login-card{overflow:visible!important;min-width:0}
.home-sidebar .login-card>h2{flex:0 0 auto!important;min-width:max-content!important;max-width:none!important;overflow:visible!important;text-overflow:clip!important;white-space:nowrap!important;line-height:1.45!important;padding:1px 0!important}
@media(min-width:701px){
 .home-layout .home-sidebar .login-card{display:block!important;padding:18px 16px 16px!important}
 .home-layout .home-sidebar .login-card>h2{display:block;margin:0 0 8px!important;font-size:15px!important}
 .home-layout .home-sidebar .login-card>p{margin:0 0 14px!important;font-size:12px!important;line-height:1.65!important;color:var(--muted,#74777c)!important;word-break:keep-all}
 .home-layout .home-sidebar .login-card .sg-login-actions{display:flex!important;flex-direction:column!important;align-items:stretch!important;width:100%!important;max-width:100%!important;gap:11px}
 .home-layout .home-sidebar .login-card .sg-login-actions>.sg-home-login-button{height:40px!important;min-height:40px!important;max-height:none!important;width:100%!important;padding:0 12px!important;border-radius:8px!important;font-size:14px!important;line-height:1!important;letter-spacing:.02em}
 .home-layout .home-sidebar .login-card .sg-login-actions>.login-help{display:flex!important;flex-wrap:wrap!important;align-items:center!important;justify-content:center!important;width:100%!important;margin:0!important;padding-top:11px;border-top:1px solid var(--line-soft,#edf0f2);gap:4px 9px!important;font-size:12px!important;white-space:normal!important}
 .home-layout .home-sidebar .login-card .login-help a{color:var(--muted,#74777c);text-decoration:none;white-space:nowrap}
 .home-layout .home-sidebar .login-card .login-help a:hover{color:var(--blue-dark,#009d46);text-decoration:underline}
 .home-layout .home-sidebar .login-card .login-help a.sg-login-register{color:var(--blue-dark,#009d46);font-weight:700}
 .home-layout .home-sidebar .login-card .login-help span{color:#c3c8ce}
}
@media(max-width:700px){
 .home-sidebar .login-card .sg-login-actions{flex:1 1 0!important;min-width:0!important;width:auto!important}
 .home-sidebar .login-card .login-help{overflow:hidden}
}
