/* ============================================================
   WAKIT shared content styles (single source for web + app)

   Loaded by BOTH:
     - the SvelteKit web shell      → web/src/app.html  (<head>)
     - the wakit app SPA shell      → app.html          (<head>)

   Why: when the app fetches a SvelteKit page it injects only the
   <body> content (the <head> is dropped). So any styling that must
   survive into the app CANNOT live in Svelte scoped <style> (those
   become <head> <link>s). Put shared-content styles here, with plain
   unscoped classes, and both shells load this one file.
   ============================================================ */

/* Light defaults + dark overrides keyed on [data-theme="dark"] (same attribute
   wakit's theme-init/theme-toggle set, key 'blog-theme'). So shared content goes
   dark/light correctly on BOTH the web shell and inside the app. */
:root {
  --sc-primary: var(--wk-theme, #e94b3c);
  --sc-primary-soft: color-mix(in srgb, var(--sc-primary) 12%, transparent);
  --sc-bg: #ffffff;
  --sc-surface: #ffffff;
  --sc-hover: #f1f5f9;
  --sc-text: #0f172a;
  --sc-muted: #64748b;
  --sc-faint: #94a3b8;
  --sc-border: #e2e8f0;
  --sc-error: #ef4444;
  --sc-radius: 14px;
}
[data-theme="dark"] {
  --sc-primary: var(--wk-theme, #ff6b5c);
  --sc-primary-soft: color-mix(in srgb, var(--sc-primary) 20%, transparent);
  --sc-bg: #0b1220;
  --sc-surface: #131c2e;
  --sc-hover: #1c2840;
  --sc-text: #e5e7eb;
  --sc-muted: #94a3b8;
  --sc-faint: #6b7a90;
  --sc-border: #233048;
  --sc-error: #f87171;
}

/* ---- 브랜드 로고 (라이트/다크 전환) ----
   로고 이미지 2장을 겹쳐두고 data-theme 로 한 장만 표시 → 테마 토글 시 JS 없이 즉시 반응.
   다크 전용 로고가 없으면 다크에서도 원본(라이트) 로고를 그대로 사용(폴백). */
.wk-logo { width: auto; object-fit: contain; display: block; }
.wk-logo--dark { display: none; }
[data-theme="dark"] .wk-logo--light { display: none; }
[data-theme="dark"] .wk-logo--dark { display: block; }
/* 앱 상단바 로고 크기 (웹 nav 는 app.css 의 .nav__logo-img 가 크기 지정) */
.appbar-logo { height: 26px; }

/* ---- board list ---- */
.board { max-width: 760px; margin: 0 auto; padding: 60px 24px; }
.board__head h1 { font-size: 2rem; font-weight: 800; margin: 0 0 6px; color: var(--sc-text); }
.board__head p { color: var(--sc-muted); margin: 0 0 28px; }
.board__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.board__item a {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  text-decoration: none;
  color: inherit;
}
.board__item a:hover { border-color: var(--sc-primary); }
.board__item h2 { font-size: 1.05rem; margin: 0 0 4px; color: var(--sc-text); }
.board__item span { color: var(--sc-muted); font-size: 0.9rem; }

/* ---- post detail ---- */
.post { max-width: 680px; margin: 0 auto; padding: 60px 24px; }
.post__back { color: var(--sc-muted); font-weight: 600; text-decoration: none; }
.post h1 { font-size: 2rem; font-weight: 800; margin: 18px 0 14px; color: var(--sc-text); }
.post p { color: var(--sc-muted); line-height: 1.8; font-size: 1.05rem; }

/* ---- home (main) ---- */
.home-hero { max-width: 760px; margin: 0 auto; padding: 72px 24px 36px; text-align: center; }
.home-hero__title { font-size: 2.4rem; font-weight: 800; line-height: 1.2; margin: 14px 0 16px; color: var(--sc-text); }
.home-hero__desc { font-size: 1.08rem; color: var(--sc-muted); margin: 0 0 28px; }
.home-hero__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.home-btn { padding: 13px 28px; border-radius: 12px; font-weight: 700; text-decoration: none; }
.home-btn--primary { background: var(--sc-primary); color: #fff; }
.home-btn--ghost { background: transparent; color: var(--sc-text); border: 1px solid var(--sc-border); }

.home-cards {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 24px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.home-card { border: 1px solid var(--sc-border); border-radius: 16px; padding: 22px; }
.home-card h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--sc-text); }
.home-card p { margin: 0; color: var(--sc-muted); font-size: 0.95rem; line-height: 1.6; }
.home-card code { background: rgba(100, 116, 139, 0.12); padding: 1px 6px; border-radius: 6px; font-size: 0.85em; }

/* ---- tiny source badge so you can SEE it's the shared content ---- */
.sc-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--sc-primary);
  font-size: 0.78rem;
  font-weight: 700;
}

/* ============================================================
   profile (single source) — ported from app_basic css/profile.css,
   mapped onto --sc-* tokens so light/dark work on web + app.
   ============================================================ */
.profile-page { padding: 20px 0 40px; min-height: 60vh; }
.profile-page .container { max-width: 720px; margin: 0 auto; padding: 0 24px; }

.profile-card {
  display: flex; align-items: center; gap: 16px; padding: 20px;
  border: 1px solid var(--sc-border); border-radius: 16px; background: var(--sc-surface);
}
.profile-card__avatar {
  flex-shrink: 0; width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--sc-primary-soft); color: var(--sc-primary); font-size: 32px;
}
.profile-card__info { flex: 1; min-width: 0; }
.profile-card__name { margin: 0 0 2px; font-size: 18px; font-weight: 700; color: var(--sc-text); }
.profile-card__email {
  margin: 0; font-size: 14px; color: var(--sc-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-card__edit {
  flex-shrink: 0; padding: 8px 14px; border: 1px solid var(--sc-border); border-radius: 999px;
  font-size: 13px; font-weight: 600; text-decoration: none; color: var(--sc-text);
  transition: background .15s ease, border-color .15s ease;
}
.profile-card__edit:hover { background: var(--sc-hover); border-color: var(--sc-primary); }

.profile-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px;
  border: 1px solid var(--sc-border); border-radius: 16px; background: var(--sc-surface); overflow: hidden;
}
.profile-stats__item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 8px;
  text-decoration: none; transition: background .15s ease;
}
.profile-stats__item + .profile-stats__item { border-left: 1px solid var(--sc-border); }
.profile-stats__item:hover { background: var(--sc-hover); }
.profile-stats__num { font-size: 20px; font-weight: 700; color: var(--sc-text); }
.profile-stats__label { font-size: 13px; color: var(--sc-muted); }

.profile-section { margin-top: 24px; }
.profile-section__title { margin: 0 0 8px; padding: 0 4px; font-size: 13px; font-weight: 600; color: var(--sc-faint); }
.profile-menu { border: 1px solid var(--sc-border); border-radius: 16px; background: var(--sc-surface); overflow: hidden; }
.profile-menu__item {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  text-decoration: none; color: var(--sc-text); transition: background .15s ease;
}
.profile-menu__item + .profile-menu__item { border-top: 1px solid var(--sc-border); }
.profile-menu__item:hover { background: var(--sc-hover); }
.profile-menu__icon { font-size: 20px; color: var(--sc-primary); width: 24px; text-align: center; }
.profile-menu__label { flex: 1; font-size: 15px; font-weight: 500; }
.profile-menu__arrow { font-size: 14px; color: var(--sc-faint); }

.profile-account { margin-top: 28px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.profile-account__logout {
  width: 100%; max-width: 320px; padding: 13px; text-align: center;
  border: 1px solid var(--sc-border); border-radius: 12px; background: var(--sc-surface);
  font-size: 15px; font-weight: 600; text-decoration: none; color: var(--sc-text); transition: background .15s ease;
}
.profile-account__logout:hover { background: var(--sc-hover); }
.profile-account__withdraw { font-size: 13px; text-decoration: underline; color: var(--sc-faint); }
.profile-account__withdraw:hover { color: var(--sc-error); }

/* theme settings — segmented control (system / light / dark) */
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-options__item {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px;
  border: 1px solid var(--sc-border); border-radius: 12px; background: var(--sc-surface);
  color: var(--sc-muted); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.theme-options__item i { font-size: 20px; }
.theme-options__item:hover { background: var(--sc-hover); }
.theme-options__item.is-active { border-color: var(--sc-primary); color: var(--sc-primary); background: var(--sc-primary-soft); }

/* ==================== 업종 카탈로그 (catalog) — 웹·앱 공용 ==================== */
.cat { max-width: 760px; margin: 0 auto; padding: 0 18px 48px; }
.cat--pad { padding-top: clamp(20px, 5vw, 36px); }

/* 히어로 */
.cat-hero { position: relative; border-radius: 18px; overflow: hidden; margin: 14px 0 20px; min-height: 320px; display: flex; align-items: flex-end; background: var(--sc-primary-soft); }
.cat-hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-hero__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,.72) 100%); }
.cat-hero__emoji { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 90px; opacity: .5; }
.cat-hero__body { position: relative; padding: 22px; color: #fff; }
.cat-hero__title { font-size: clamp(24px, 6vw, 34px); font-weight: 800; line-height: 1.2; margin: 0 0 8px; white-space: pre-line; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.cat-hero__sub { font-size: 14.5px; opacity: .95; margin: 0; text-shadow: 0 1px 8px rgba(0,0,0,.5); }

/* 섹션 제목 */
.cat-sec { margin-top: 30px; }
.cat-sec__t { font-size: 18px; font-weight: 800; color: var(--sc-text); margin: 0 0 14px; letter-spacing: -.01em; }

/* 메뉴 */
.menu-cat { margin-bottom: 26px; }
.menu-cat__h { font-size: 15px; font-weight: 800; color: var(--sc-primary); margin: 0 0 8px; padding-bottom: 8px; border-bottom: 2px solid var(--sc-primary-soft); }
.menu-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--sc-border); }
.menu-item__body { flex: 1; min-width: 0; }
.menu-item__name { font-size: 15.5px; font-weight: 700; color: var(--sc-text); }
.menu-item__badge { display: inline-block; margin-left: 6px; background: var(--sc-primary); color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 6px; padding: 1px 6px; vertical-align: middle; }
.menu-item__desc { font-size: 13px; color: var(--sc-muted); margin: 3px 0 0; }
.menu-item__price { flex: 0 0 auto; font-size: 15px; font-weight: 800; color: var(--sc-text); }

/* 정보 카드 (연락/영업/위치) */
.info-card { border: 1px solid var(--sc-border); border-radius: var(--sc-radius); padding: 18px; margin-bottom: 14px; background: var(--sc-surface); }
.info-card__t { font-size: 13px; font-weight: 800; color: var(--sc-muted); margin: 0 0 10px; letter-spacing: .02em; }
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14.5px; color: var(--sc-text); }
.info-row span:first-child { color: var(--sc-muted); }
.info-addr { font-size: 15px; font-weight: 600; color: var(--sc-text); line-height: 1.6; margin: 0 0 6px; }
.info-dir { font-size: 13.5px; color: var(--sc-muted); line-height: 1.6; margin: 0; }
.info-map { display: block; width: 100%; border-radius: 12px; margin-top: 12px; overflow: hidden; }
.info-map img { width: 100%; display: block; }

/* 큰 액션 버튼 (전화·지도·CTA) */
.cat-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; box-sizing: border-box; background: var(--sc-primary); color: #fff; border: 0; border-radius: 13px; padding: 15px; font-size: 15.5px; font-weight: 800; text-decoration: none; margin-top: 12px; }
.cat-btn--ghost { background: transparent; color: var(--sc-text); border: 1px solid var(--sc-border); }
.cat-btn i { font-size: 17px; }

/* 홈 대표메뉴 칩 */
.cat-quick { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.cat-quick a { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--sc-border); border-radius: 12px; padding: 14px; text-decoration: none; }
.cat-quick a:hover { border-color: var(--sc-primary); }
.cat-quick__ic { font-size: 22px; }
.cat-quick__l { font-size: 14.5px; font-weight: 700; color: var(--sc-text); }
.cat-quick__d { font-size: 12px; color: var(--sc-muted); }

/* 메뉴 항목 썸네일 + 클릭형 */
.menu-item--link { text-decoration: none; }
.menu-item--link:active { background: var(--sc-hover); }
.menu-item__thumb { flex: 0 0 auto; width: 62px; height: 62px; border-radius: 10px; overflow: hidden; background: var(--sc-primary-soft); }
.menu-item__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 메뉴 상세 */
.idet { margin-bottom: 8px; }
.idet__media { border-radius: 16px; overflow: hidden; aspect-ratio: 4/3; background: var(--sc-primary-soft); margin: 6px 0 16px; }
.idet__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.idet__media--empty { display: flex; align-items: center; justify-content: center; font-size: 72px; }
.idet__cat { display: inline-block; font-size: 12px; font-weight: 800; color: var(--sc-primary); background: var(--sc-primary-soft); border-radius: 999px; padding: 3px 10px; }
.idet__name { font-size: 24px; font-weight: 800; color: var(--sc-text); margin: 10px 0 6px; letter-spacing: -.01em; }
.idet__price { font-size: 20px; font-weight: 800; color: var(--sc-primary); }
.idet__desc { font-size: 15px; color: var(--sc-text); line-height: 1.75; margin: 16px 0 4px; }

/* 홈 히어로 — 풀블리드 100% (PC·모바일 공통), 내부 텍스트는 중앙 정렬 반응형 */
.cat-hero--home { width: 100%; margin: 0; border-radius: 0; min-height: clamp(300px, 42vw, 460px); }
.cat-hero--home .cat-hero__body { width: 100%; padding: 0 0 clamp(20px, 4vw, 40px); }
.cat-hero__inner { max-width: 760px; margin: 0 auto; padding: 0 20px; width: 100%; box-sizing: border-box; }
.cat-hero--home + .cat { padding-top: 16px; }

/* 설정 — 테마 세그먼트 */
.set-sec { padding-top: 6px; }
.set-sec__t { font-size: 14px; font-weight: 800; color: var(--sc-muted); margin: 0 0 12px; letter-spacing: .02em; }
.theme-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-opt {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  border: 1.5px solid var(--sc-border); border-radius: 14px; padding: 18px 8px;
  background: var(--sc-surface); color: var(--sc-text); font-family: inherit;
  font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.theme-opt i { font-size: 22px; color: var(--sc-muted); }
.theme-opt.is-active { border-color: var(--sc-primary); background: var(--sc-primary-soft); color: var(--sc-primary); }
.theme-opt.is-active i { color: var(--sc-primary); }
.set-hint { font-size: 12.5px; color: var(--sc-muted); margin: 12px 2px 0; }

/* 연락처 SNS 행 (연동 링크) */
.sns-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; color: var(--sc-text); text-decoration: none; border-top: 1px solid var(--sc-border); }
.sns-row:first-of-type { border-top: 0; }
.sns-row > .bi:first-child { font-size: 20px; color: var(--sc-primary); width: 24px; text-align: center; }
.sns-row__l { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; }
.sns-row__arr { font-size: 14px; color: var(--sc-faint); }
