/* FRAMEHOUSE — 클래스 앞머리 fh- · 다크 기본, 라이트는 오른쪽 위 단추 */
:root {
  --ac: #ff6a3d;
  --bg: #0f1114; --head: #15181c; --line: #262b31; --hero: #262c34; --card: #181b20; --card2: #20242a;
  --tx: #eceef1; --mu: #98a1ac; --chip: #22272e; --sh: 0 10px 30px rgba(0,0,0,.35);
  --r: 12px; --wrap: 1440px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f1f1ef; --head: #ffffff; --line: #e4e4e1; --hero: #474d56; --card: #ffffff; --card2: #f6f6f4;
  --tx: #1b1d20; --mu: #6b7178; --chip: #f0f0ee; --sh: 0 10px 28px rgba(20,24,30,.10);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 15px/1.6 "Pretendard Variable", Pretendard, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.fh-lock { overflow: hidden; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }

/* ── 머리 ── */
.fh-head { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--head) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.fh-head-in { max-width: 1200px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; gap: 28px; }
.fh-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.fh-mark { width: 52px; height: 52px; position: relative; flex-shrink: 0; }
.fh-mark::before, .fh-mark::after { content: ""; position: absolute; width: 34px; height: 34px; border-radius: 9px; }
.fh-mark::before { left: 0; top: 0; background: var(--ac); }
.fh-mark::after { right: 0; bottom: 0; border: 4px solid var(--ac); mix-blend-mode: normal; }
.fh-logo-t { display: flex; flex-direction: column; line-height: 1.15; }
.fh-logo-t b { font-size: 17px; letter-spacing: .12em; font-weight: 800; }
.fh-logo-t small { font-size: 12px; color: var(--mu); margin-top: 3px; }
.fh-navs { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.fh-nav1, .fh-nav2 { display: flex; align-items: center; gap: 6px 20px; flex-wrap: wrap; }
.fh-n1 { font-size: 14px; color: var(--mu); text-decoration: none; padding: 2px 0 5px; border-bottom: 2px solid transparent; transition: color .15s; }
.fh-n1:hover, .fh-n1.on { color: var(--tx); }
.fh-n1.on { border-bottom-color: var(--ac); font-weight: 600; }
.fh-dd { position: relative; }
.fh-f { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--mu); cursor: pointer; padding: 3px 0; border-radius: 6px; user-select: none; white-space: nowrap; }
.fh-f:hover, .fh-f.on { color: var(--tx); }
.fh-f.on { font-weight: 600; }
.fh-f em { font-style: normal; color: var(--ac); }
.fh-f em::before { content: ": "; color: var(--mu); }
.fh-f i { font-style: normal; font-size: 10px; opacity: .7; }
.fh-f svg { width: 14px; height: 14px; }
.fh-menu { position: absolute; top: calc(100% + 8px); left: -10px; z-index: 40; min-width: 170px; max-height: 320px; overflow: auto; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sh); }
.fh-opt { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 7px; font-size: 14px; }
.fh-opt:hover { background: var(--chip); }
.fh-opt.on { color: var(--ac); font-weight: 700; }
.fh-round { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--card2); display: grid; place-items: center; flex-shrink: 0; color: var(--mu); }
.fh-round:hover { color: var(--tx); }
.fh-round svg { width: 18px; height: 18px; }
.fh-searchbar { max-width: 1200px; margin: 0 auto; padding: 0 24px 16px; }
.fh-q { width: 100%; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); color: var(--tx); padding: 0 14px; font: inherit; }

/* ── 첫 화면 쇼케이스 ── */
.fh-hero { background: var(--hero); color: #fff; padding: 44px 24px 34px; text-align: center; }
.fh-hero-t { margin: 0 0 26px; font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; letter-spacing: -.01em; }
.fh-stage { display: flex; align-items: center; justify-content: center; gap: clamp(16px, 9vw, 180px); }
.fh-frame { position: relative; width: min(1040px, 72vw, max(420px, calc((100vh - 340px) * 1.6))); aspect-ratio: 16 / 10; background: #1b1f25; box-shadow: 0 24px 60px rgba(0,0,0,.35); overflow: hidden; touch-action: pan-y; }
.fh-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility .6s; }
.fh-slide.on { opacity: 1; visibility: visible; }
.fh-slide .fh-img, .fh-slide img { width: 100%; height: 100%; object-fit: cover; }
.fh-cap { position: absolute; right: 0; bottom: 0; padding: 10px 16px; background: rgba(20,22,26,.55); backdrop-filter: blur(6px); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; }
.fh-cap:hover { background: rgba(20,22,26,.8); }
.fh-noslide { position: absolute; inset: 0; display: grid; place-items: center; color: #c9ced6; padding: 20px; }
.fh-arrow { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; flex-shrink: 0; transition: background .15s, transform .15s; }
.fh-arrow:hover { background: rgba(255,255,255,.26); transform: scale(1.06); }
.fh-arrow svg { width: 20px; height: 20px; }
.fh-dots { display: flex; justify-content: center; gap: 4px; margin-top: 14px; }
.fh-dot { width: 22px; height: 22px; border: 0; background: none; padding: 0; position: relative; }
.fh-dot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(255,255,255,.35); transition: width .2s, background .2s, margin .2s; }
.fh-dot.on::after { width: 18px; margin-left: -9px; border-radius: 4px; background: #fff; }

/* ── 구역 공통 ── */
.fh-sec { max-width: var(--wrap); margin: 0 auto; padding: 48px 32px; }
.fh-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.fh-sec-head h2, .fh-two h2 { margin: 0; font-size: clamp(20px, 1.8vw, 26px); letter-spacing: -.01em; }
.fh-sub { margin: 4px 0 0; color: var(--mu); }
.fh-count { color: var(--mu); font-size: 14px; white-space: nowrap; }
.fh-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 20px; }
.fh-chip { border: 1px solid var(--line); background: var(--chip); border-radius: 99px; padding: 5px 12px; font-size: 13px; }
.fh-chip:hover { border-color: var(--ac); }

/* ── 사이트 카드 ── */
.fh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.fh-card { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 14px 14px 16px; cursor: pointer; position: relative; transition: transform .2s ease, box-shadow .2s ease; }
.fh-card:hover { transform: translateY(-3px); box-shadow: var(--sh); }
.fh-thumb { aspect-ratio: 10 / 7; overflow: hidden; background: var(--card2); position: relative; }
.fh-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.fh-card:hover .fh-thumb img { transform: scale(1.03); }
.fh-card-b { padding: 14px 2px 0; }
.fh-card-t { margin: 0; font-size: 16px; font-weight: 700; }
.fh-maker { margin: 2px 0 0; font-size: 13px; color: var(--mu); }
.fh-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fh-tags span { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--chip); color: var(--mu); }
.fh-empty { text-align: center; color: var(--mu); padding: 40px 0; }

/* ── 디렉터리 ── */
.fh-directory { border-top: 1px solid var(--line); }
.fh-dir { list-style: none; margin: 0; padding: 0; columns: 3 300px; column-gap: 36px; }
.fh-dir li { break-inside: avoid; border-bottom: 1px solid var(--line); }
.fh-dir button { width: 100%; background: none; border: 0; text-align: left; padding: 11px 2px; display: grid; grid-template-columns: 1fr auto; gap: 0 12px; }
.fh-dir b { font-weight: 600; }
.fh-dir span { color: var(--mu); font-size: 13px; text-align: right; }
.fh-dir em { grid-column: 1 / -1; font-style: normal; color: var(--mu); font-size: 12px; }
.fh-dir button:hover b { color: var(--ac); }

/* ── 소개·문의 ── */
.fh-two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; border-top: 1px solid var(--line); }
.fh-about, .fh-contact { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 30px; }
.fh-body { white-space: pre-line; color: var(--mu); margin: 12px 0 0; line-height: 1.8; }
.fh-mail { display: inline-flex; gap: 6px; margin-top: 18px; padding: 10px 18px; border-radius: 99px; background: var(--ac); color: #fff; font-weight: 700; text-decoration: none; }
.fh-foot { border-top: 1px solid var(--line); text-align: center; color: var(--mu); font-size: 13px; padding: 28px 24px 96px; }
.fh-foot p { margin: 0; }

/* ── 창 ── */
.fh-modal { position: fixed; inset: 0; z-index: 60; background: rgba(8,10,12,.7); display: grid; place-items: center; padding: 20px; overflow: auto; }
.fh-modal-box { position: relative; width: min(560px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--sh); }
.fh-modal-box.fh-wide { width: min(980px, 100%); }
.fh-x { position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--chip); }
.fh-detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; }
.fh-detail img { width: 100%; border-radius: 6px; aspect-ratio: 10/7; object-fit: cover; }
.fh-detail h2 { margin: 0; font-size: 24px; padding-right: 36px; }
.fh-desc { line-height: 1.75; }
.fh-detail dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 18px 0; }
.fh-detail dt { font-size: 12px; color: var(--mu); }
.fh-detail dd { margin: 0; font-weight: 600; }
.fh-visit, .fh-primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 20px; border-radius: 99px; background: var(--ac); color: #fff; border: 0; font-weight: 700; text-decoration: none; }
.fh-m-t { margin: 0 0 16px; font-size: 20px; padding-right: 40px; }
.fh-m-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.fh-edit-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; }
.fh-edit-img img { width: 100%; border-radius: 6px; aspect-ratio: 10/7; object-fit: cover; }
.fh-edit-img button { margin-top: 10px; width: 100%; }
.fh-field { display: block; margin-bottom: 12px; }
.fh-field span { display: block; font-size: 12px; color: var(--mu); margin-bottom: 4px; }
.fh-field input, .fh-field textarea { width: 100%; border: 1px solid var(--line); background: var(--card2); color: var(--tx); border-radius: 8px; padding: 9px 11px; font: inherit; resize: vertical; }
.fh-four { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.fh-hint { font-size: 12px; color: var(--mu); margin: 0; }
.fh-warn { font-size: 12px; color: #ff8a65; margin: -6px 0 10px; }
.fh-help { padding-left: 20px; line-height: 1.8; margin: 0; }
.fh-help li { margin-bottom: 8px; }
.fh-help code { background: var(--chip); padding: 1px 6px; border-radius: 5px; }

/* ── 편집 ── */
.fh-edit-only { display: none !important; }
body.fh-editing .fh-edit-only { display: flex !important; }
body.fh-editing [data-k] { outline: 1px dashed color-mix(in srgb, var(--ac) 65%, transparent); outline-offset: 3px; border-radius: 3px; cursor: text; min-width: 1.5em; }
body.fh-editing [data-k]:focus { outline: 2px solid var(--ac); background: color-mix(in srgb, var(--ac) 10%, transparent); }
body.fh-editing [data-k]:empty::before { content: "(빈칸 — 눌러서 쓰기)"; opacity: .5; font-weight: 400; }
body.fh-editing .fh-card { cursor: default; }
body.fh-editing .fh-card:hover { transform: none; }
.fh-img { position: relative; }
.fh-img-btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; align-items: center; gap: 6px; border: 0; border-radius: 99px; padding: 10px 16px; background: rgba(15,17,20,.82); color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.fh-img-btn:hover { background: var(--ac); }
.fh-img.fh-drop { outline: 3px dashed var(--ac); outline-offset: -3px; }
.fh-etools { justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.fh-etools button, .fh-ctools button, .fh-edit-img button, .fh-m-foot .fh-danger { border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1); border-radius: 99px; padding: 7px 14px; font-size: 13px; color: #fff; }
.fh-etools button:disabled, .fh-ctools button:disabled { opacity: .35; cursor: default; }
.fh-ctools { gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.fh-ctools button, .fh-edit-img button, .fh-m-foot .fh-danger { color: var(--tx); border-color: var(--line); background: var(--chip); }
.fh-danger:hover { border-color: #e5484d !important; color: #e5484d !important; }
.fh-add { min-height: 260px; align-items: center; justify-content: center; border: 2px dashed var(--line); border-radius: 4px; background: none; color: var(--mu); font-size: 16px; font-weight: 600; }
.fh-add:hover { border-color: var(--ac); color: var(--ac); }

.fh-tools { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap-reverse; justify-content: flex-end; max-width: calc(100vw - 36px); }
.fh-tools-main { border: 0; border-radius: 99px; padding: 12px 20px; background: var(--tx); color: var(--bg); font-weight: 800; box-shadow: var(--sh); }
.fh-tools-main.on { background: var(--ac); color: #fff; }
.fh-tools-p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh); justify-content: flex-end; }
.fh-tools-p button { border: 1px solid var(--line); background: var(--chip); border-radius: 9px; padding: 7px 11px; font-size: 13px; white-space: nowrap; }
.fh-tools-p button:hover { border-color: var(--ac); }
.fh-saved { font-size: 12px; color: var(--mu); padding: 0 6px; }
.fh-acc { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 0 4px; }
.fh-acc input, .fh-bar-c input { width: 28px; height: 28px; border: 0; padding: 0; background: none; cursor: pointer; }

.fh-bar { position: fixed; z-index: 55; display: flex; align-items: center; gap: 2px; padding: 4px; background: #111317; color: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.fh-bar button { border: 0; background: none; color: #fff; padding: 6px 9px; border-radius: 7px; font-size: 13px; }
.fh-bar button:hover { background: rgba(255,255,255,.14); }
.fh-bar-c { display: inline-flex; padding: 0 4px; }

.fh-toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-radius: 12px; background: #111317; color: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.45); font-size: 14px; max-width: calc(100vw - 32px); }
.fh-toast button { border: 0; background: var(--ac); color: #fff; border-radius: 8px; padding: 6px 12px; font-weight: 700; white-space: nowrap; }

/* ── 넓은 화면: 양옆이 비지 않게 ── */
@media (min-width: 1700px) {
  :root { --wrap: 1640px; }
  .fh-head-in, .fh-searchbar { max-width: 1440px; }
  .fh-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── 태블릿·휴대폰 ── */
@media (max-width: 900px) {
  .fh-head-in { flex-wrap: wrap; gap: 14px; padding: 14px 16px; }
  .fh-logo { order: 1; }
  .fh-round { order: 2; margin-left: auto; }
  .fh-navs { order: 3; flex-basis: 100%; }
  .fh-nav1, .fh-nav2 { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 18px; padding-bottom: 2px; }
  .fh-nav1::-webkit-scrollbar, .fh-nav2::-webkit-scrollbar { display: none; }
  .fh-dd { position: static; }
  .fh-menu { left: 16px; right: 16px; top: auto; margin-top: 8px; }
  .fh-head { position: relative; }
  .fh-mark { width: 42px; height: 42px; }
  .fh-mark::before, .fh-mark::after { width: 28px; height: 28px; border-radius: 7px; }
  .fh-stage { position: relative; }
  .fh-frame { width: 100%; }
  .fh-arrow { position: absolute; z-index: 4; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; background: rgba(15,17,20,.45); }
  .fh-arrow:hover { transform: translateY(-50%); }
  .fh-arrow[data-act="prev"] { left: 8px; }
  .fh-arrow[data-act="next"] { right: 8px; }
  .fh-hero { padding: 28px 12px 24px; }
  .fh-sec { padding: 36px 16px; }
  .fh-two { grid-template-columns: 1fr; gap: 20px; }
  .fh-detail, .fh-edit-grid { grid-template-columns: 1fr; }
  .fh-modal-box { padding: 22px 18px; }
}
@media (max-width: 420px) {
  .fh-grid { grid-template-columns: 1fr; gap: 18px; }
  .fh-cap { font-size: 12px; padding: 7px 10px; }
  .fh-sec-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .fh-about, .fh-contact { padding: 22px; }
  .fh-four { grid-template-columns: 1fr; }
  .fh-tools { right: 10px; bottom: 10px; max-width: calc(100vw - 20px); }
  .fh-tools-p > * { flex-shrink: 0; white-space: nowrap; }
  .fh-tools-p { flex-wrap: nowrap; overflow-x: auto; width: calc(100vw - 20px); justify-content: flex-start; scrollbar-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
