/*
Theme Name: Hwamyeong Dental
Theme URI: https://smartworkandlife.com
Author: 손상현 (스마트워크앤라이프)
Author URI: https://smartworkandlife.com
Description: 치과 전문 에디토리얼 테마. AI 챗봇 검색창 + 증례 블로그 + SEO 최적화. Gowun Batang 명조체 기반 고급스러운 디자인.
Version: 1.8.1
Requires at least: 6.0
Requires PHP: 7.4
License: Proprietary
Text Domain: smart-dental
Tags: dental, medical, editorial, blog, custom-colors, custom-menu, featured-images, responsive-layout
*/

/* 모바일 가로 드래그(가로 스크롤) 차단 — sticky 헤더 보존 */
html { overflow-x: hidden; }
@supports (overflow-x: clip) { html { overflow-x: clip; } }
body { overflow-x: clip; max-width: 100%; }
img, video, iframe, table, pre { max-width: 100%; }

:root {
  --ink: #0f1729;
  --ink-soft: #3d4759;
  --ink-muted: #7a8598;
  --line: #e8ebf0;
  --line-soft: #f0f2f6;
  --bg: #fafbfc;
  --bg-card: #ffffff;
  --accent: #1a3a5c;
  --accent-light: #2563a0;
  --accent-soft: #e8f0f9;
  --gold: #a88a5a;
  --gold-soft: #f5efe3;
  --highlight: #fef9e7;
  --shadow-sm: 0 1px 2px rgba(15, 23, 41, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 41, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 41, 0.08);
  --shadow-focus: 0 0 0 4px rgba(37, 99, 160, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ============================================
   Top Masthead (brand strip)
============================================ */
.masthead {
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.masthead-brand {
  font-family: 'Gowun Batang', serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}

.masthead-brand::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
}

.masthead-meta {
  display: flex;
  gap: 24px;
  font-weight: 500;
}

.masthead-meta a {
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.masthead-meta a:hover { color: var(--accent); }

/* ============================================
   Hero Section
============================================ */
.hero {
  max-width: 960px;
  margin: 0 auto;
  padding: 96px 24px 64px;
  text-align: center;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 1px;
  background: var(--gold);
}

.hero-kicker {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 20px;
}

.hero-title {
  font-family: 'Gowun Batang', serif;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 20px;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto 48px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ============================================
   Search Bar (Chatbot Entry)
============================================ */
.search-wrap {
  max-width: 680px;
  margin: 0 auto 20px;
  position: relative;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  border-radius: 100px;
  padding: 6px 6px 6px 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-focus), var(--shadow-md);
  transform: translateY(-1px);
}

.search-icon {
  width: 22px;
  height: 22px;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  padding: 16px 12px;
  outline: none;
  min-width: 0;
}

.search-input::placeholder {
  color: var(--ink-muted);
  font-weight: 400;
}

.search-btn {
  background: var(--ink);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 100px;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.search-btn:hover {
  background: var(--accent);
  transform: translateX(1px);
}

.search-btn:active { transform: scale(0.98); }

.search-btn:disabled {
  background: var(--ink-muted);
  cursor: not-allowed;
  transform: none;
}

/* AI Badge */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  margin-top: 14px;
  font-weight: 500;
}

.ai-badge .dot {
  width: 6px;
  height: 6px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================
   Suggestion Chips
============================================ */
.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 680px;
  margin: 24px auto 0;
}

.chip {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent-light);
  color: var(--accent);
  transform: translateY(-1px);
}

.chip:active { transform: scale(0.98); }

/* ============================================
   Quick Access Cards
============================================ */
.quick-access {
  max-width: 720px;
  margin: 64px auto 0;
  padding: 0 24px;
}

.quick-access-label {
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 20px;
  font-weight: 600;
  position: relative;
}

.quick-access-label::before,
.quick-access-label::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 60px;
  height: 1px;
  background: var(--line);
}

.quick-access-label::before { left: calc(50% - 140px); }
.quick-access-label::after { right: calc(50% - 140px); }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.quick-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.quick-card:hover {
  border-color: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-card.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.quick-card.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.quick-icon {
  width: 22px;
  height: 22px;
  stroke-width: 1.5;
}

.quick-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ============================================
   Chat Panel (appears after first query)
============================================ */
.chat-panel {
  max-width: 720px;
  margin: 40px auto 0;
  padding: 0 24px;
  display: none;
}

.chat-panel.active { display: block; animation: slideIn 0.4s ease-out; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-container {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 16px;
}

.chat-title {
  font-family: 'Gowun Batang', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-title::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
}

.chat-clear {
  background: none;
  border: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 12px;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.chat-clear:hover { background: var(--line-soft); color: var(--ink); }

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  padding-right: 4px;
}

.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

.msg {
  display: flex;
  animation: msgIn 0.3s ease-out;
  max-width: 85%;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-user { align-self: flex-end; }
.msg-bot { align-self: flex-start; max-width: 92%; }

.bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.65;
  word-wrap: break-word;
}

.msg-user .bubble {
  background: var(--ink);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg-bot .bubble {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line-soft);
  border-bottom-left-radius: 4px;
}

.bubble a.booking-link {
  display: inline-block;
  margin: 8px 6px 2px 0;
  padding: 8px 16px;
  border-radius: 100px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.bubble a.book-naver {
  background: #03c75a;
  color: white;
}

.bubble a.book-kakao {
  background: #fee500;
  color: #181600;
}

.bubble a.book-call {
  background: var(--accent);
  color: white;
}

.bubble a.booking-link:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.disclaimer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  color: var(--ink-muted);
  font-style: italic;
  line-height: 1.5;
}

/* Typing indicator */
.typing {
  display: inline-flex;
  gap: 3px;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-muted);
  animation: typing 1.4s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Chat Input (after first msg) */
.chat-input-wrap {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 100px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus { border-color: var(--accent-light); }

.chat-send {
  background: var(--ink);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 100px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-send:hover { background: var(--accent); }
.chat-send:disabled { background: var(--ink-muted); cursor: not-allowed; }

/* ============================================
   Case Blog Grid (임상 증례)
============================================ */
.blog-section {
  max-width: 1200px;
  margin: 120px auto 0;
  padding: 0 24px;
}

.blog-header {
  text-align: center;
  margin-bottom: 48px;
  position: relative;
}

.blog-header::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 1px;
  background: var(--gold);
}

.blog-kicker {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 14px;
}

.blog-title {
  font-family: 'Gowun Batang', serif;
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 12px;
}

.blog-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.blog-subtitle {
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 520px;
  margin: 0 auto;
}

/* Category filter */
.blog-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 32px auto 48px;
  max-width: 720px;
}

.filter-btn {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 8px 18px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn:hover {
  border-color: var(--accent-light);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

/* Grid: 3 columns x 5 rows = 15 cases */
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.case-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.case-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-light);
}

.case-card:hover .case-image {
  transform: scale(1.05);
}

.case-card:hover .case-title {
  color: var(--accent);
}

.case-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--line-soft);
}

.case-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.case-category-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 12px;
  background: rgba(15, 23, 41, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 100px;
  text-transform: uppercase;
}

.case-category-tag.cat-implant { background: rgba(26, 58, 92, 0.9); }
.case-category-tag.cat-ortho { background: rgba(168, 138, 90, 0.9); }
.case-category-tag.cat-aesthetic { background: rgba(153, 53, 86, 0.85); }
.case-category-tag.cat-general { background: rgba(15, 110, 86, 0.85); }

.case-body {
  padding: 20px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.case-date {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.case-date::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.case-title {
  font-family: 'Gowun Batang', serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-excerpt {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.case-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.case-read-more {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.02em;
}

.case-read-more .arrow {
  transition: transform 0.25s;
}

.case-card:hover .case-read-more .arrow {
  transform: translateX(3px);
}

.case-meta-right {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 11px;
  color: var(--ink-muted);
}

/* View all CTA */
.blog-view-all {
  text-align: center;
  margin-top: 56px;
}

.view-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: 100px;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
}

.view-all-btn:hover {
  background: var(--ink);
  color: white;
  transform: translateY(-1px);
}

.view-all-btn .arrow {
  transition: transform 0.25s;
}

.view-all-btn:hover .arrow {
  transform: translateX(4px);
}

/* ============================================
   SEO Hidden Content (crawlable)
============================================ */
.seo-content {
  max-width: 960px;
  margin: 120px auto 0;
  padding: 64px 24px;
  border-top: 1px solid var(--line);
}

.seo-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 12px;
}

.seo-content h2 {
  font-family: 'Gowun Batang', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.seo-content p {
  color: var(--ink-soft);
  margin-bottom: 12px;
  line-height: 1.8;
}

.seo-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.seo-keyword {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 12px;
  padding: 4px 10px;
  background: var(--gold-soft);
  color: var(--gold);
  border-radius: 4px;
  font-weight: 500;
}

/* ============================================
   Responsive
============================================ */
@media (max-width: 640px) {
  .masthead { padding: 14px 18px; flex-wrap: wrap; gap: 10px; }
  .masthead-meta { gap: 14px; font-size: 11px; }
  .masthead-brand { font-size: 17px; }
  .hero { padding: 60px 18px 40px; }
  .hero::before { top: 24px; }
  .hero-kicker { font-size: 11px; margin-bottom: 14px; }
  .hero-subtitle { font-size: 15px; margin-bottom: 32px; }

  .search-wrap { margin-bottom: 16px; }
  .search-box { padding: 4px 4px 4px 16px; }
  .search-input { font-size: 15px; padding: 12px 8px; }
  .search-btn { padding: 11px 18px; font-size: 13px; }
  .search-icon { width: 18px; height: 18px; }

  .chips-row { gap: 6px; padding: 0 8px; }
  .chip { padding: 6px 12px; font-size: 12px; }

  .quick-access { margin-top: 40px; padding: 0 18px; }
  .quick-access-label::before,
  .quick-access-label::after { display: none; }
  .quick-grid { gap: 6px; }
  .quick-card { padding: 14px 6px; }
  .quick-icon { width: 18px; height: 18px; }
  .quick-label { font-size: 11px; }

  .chat-panel { padding: 0 12px; }
  .chat-container { padding: 16px; border-radius: 16px; }
  .bubble { font-size: 14px; padding: 10px 14px; }
  .msg { max-width: 92%; }

  .blog-section { margin-top: 72px; padding: 0 18px; }
  .blog-header { margin-bottom: 28px; }
  .blog-filter { margin: 24px auto 32px; gap: 5px; }
  .filter-btn { font-size: 12px; padding: 6px 14px; }
  .case-grid { grid-template-columns: 1fr; gap: 20px; }
  .case-body { padding: 18px 20px 20px; }
  .case-title { font-size: 16px; }
  .case-excerpt { font-size: 13px; }
  .blog-view-all { margin-top: 40px; }
  .view-all-btn { padding: 12px 24px; font-size: 13px; }

  .seo-content { padding: 40px 18px; margin-top: 60px; }
  .seo-content h2 { font-size: 22px; }

  /* v1.5: 메뉴 박스 5개 모바일 최적화 */
  .menu-boxes-section { padding: 40px 16px !important; }
  .menu-boxes-section h2 { font-size: 22px !important; }
  .menu-boxes-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .menu-box { padding: 18px 10px !important; }
  .menu-box h3 { font-size: 14px !important; }
  .menu-box p { font-size: 11px !important; }
  .menu-box > div:first-child { font-size: 28px !important; margin-bottom: 8px !important; }

  /* v1.5: 메인 SEO 콘텐츠 모바일 최적화 */
  .main-seo-content { padding: 40px 18px !important; }
  .main-seo-content h2 { font-size: 24px !important; }
  .main-seo-content h3 { font-size: 19px !important; }
  .main-seo-content h4 { font-size: 16px !important; }
  .main-seo-content p { font-size: 15px !important; line-height: 1.85 !important; word-break: keep-all !important; }
  .main-seo-content ul { font-size: 15px !important; }
  .main-seo-content li { word-break: keep-all !important; }

  /* v1.5: 푸터 키워드 모바일 최적화 */
  footer { padding: 40px 16px 30px !important; }
  footer > div > div:first-child { grid-template-columns: 1fr !important; gap: 24px !important; }
  footer h2, footer h3 { font-size: 16px !important; }
}

@media (min-width: 641px) and (max-width: 900px) {
  .case-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }

  /* v1.5: 태블릿 메뉴 박스 */
  .menu-boxes-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .menu-boxes-section { padding: 50px 24px !important; }

  /* v1.5: 태블릿 SEO 콘텐츠 */
  .main-seo-content { padding: 60px 32px !important; }
}

/* v1.5: 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
  .hero-title { font-size: 30px !important; }
  .hero-subtitle { font-size: 14px !important; padding: 0 8px !important; }
  .hero-kicker { font-size: 10px !important; letter-spacing: 0.18em !important; }

  /* 메뉴 박스 1열로 (매우 작은 화면) */
  .menu-boxes-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
  .menu-box { padding: 16px 14px !important; display: flex !important; align-items: center !important; gap: 12px !important; text-align: left !important; }
  .menu-box > div:first-child { font-size: 24px !important; margin-bottom: 0 !important; flex-shrink: 0 !important; }
  .menu-box h3 { margin: 0 !important; }
  .menu-box p { display: none !important; }

  .main-seo-content h2 { font-size: 22px !important; }
  .main-seo-content h3 { font-size: 17px !important; }
  .main-seo-content { padding: 32px 14px !important; }
}

/* ============================================
   v2.10.3: 한글 줄바꿈 전역 최적화
   - keep-all: 단어 중간 절대 안 끊김 ("공개합/니다" 방지)
   - text-wrap balance: 제목이 두 줄일 때 균형 있게 분배 (외톨이 단어 방지)
   ============================================ */
body {
  word-break: keep-all;
  overflow-wrap: break-word;
}
h1, h2, h3, h4,
.hero-title, .hero-subtitle {
  word-break: keep-all;
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}

/* ============================================
   v3.0.8 : Sticky 헤더 · 의료진 프로필 · 콘텐츠 이미지
============================================ */

/* ── 상단 카테고리 바 고정 ───────────────── */
.masthead {
  position: sticky;
  top: 0;
  z-index: 900;
  /* 관리자 바가 있을 때 겹치지 않도록 */
  transition: box-shadow 0.25s ease, padding 0.25s ease;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(255, 255, 255, 0.94);
}
.admin-bar .masthead { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .masthead { top: 46px; }
}
/* 스크롤 시 그림자 + 높이 축소 (JS에서 .is-stuck 부여) */
.masthead.is-stuck {
  box-shadow: 0 2px 16px rgba(15, 23, 41, 0.10);
  padding-top: 10px;
  padding-bottom: 10px;
}
.masthead.is-stuck .masthead-brand { font-size: 18px; }

/* 앵커 이동 시 헤더에 가려지지 않도록 */
:target,
section[id] { scroll-margin-top: 92px; }

/* ── 의료진 프로필 ───────────────────────── */
.sd-doctor {
  padding: 56px 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-top: 1px solid var(--line-soft);
}
.sd-doctor--full {
  background: #ffffff;
  border-top: none;
  padding-top: 20px;
}
.sd-doctor-inner {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 44px;
  align-items: start;
}
.sd-doctor--full .sd-doctor-inner { grid-template-columns: 380px 1fr; }

.sd-doctor-photo { margin: 0; }
.sd-doctor-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  border-radius: 16px;
  box-shadow: 0 10px 36px rgba(26, 58, 92, 0.13);
  background: #eef2f7;
}

.sd-doctor-kicker {
  font-size: 12px;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--gold, #a88a5a);
  margin: 0 0 10px;
  text-transform: none;
}
.sd-doctor-name {
  font-family: 'Gowun Batang', serif;
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 700;
  color: #1a3a5c;
  line-height: 1.3;
  margin: 0 0 18px;
  word-break: keep-all;
}
.sd-doctor-intro p {
  font-size: 16px;
  line-height: 1.95;
  color: #3d4759;
  margin: 0 0 14px;
  word-break: keep-all;
}
.sd-doc-block { margin-top: 24px; }
.sd-doc-block-title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #1a3a5c;
  margin: 0 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid #e8ebf0;
}
.sd-doc-list { list-style: none; margin: 0; padding: 0; }
.sd-doc-list li {
  position: relative;
  padding: 5px 0 5px 17px;
  font-size: 15px;
  line-height: 1.75;
  color: #3d4759;
  word-break: keep-all;
}
.sd-doc-list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 14px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold, #a88a5a);
}
.sd-doctor-more {
  display: inline-block;
  margin-top: 20px;
  font-size: 14.5px;
  font-weight: 600;
  color: #1a3a5c;
  text-decoration: none;
  border-bottom: 1px solid #c9d4e2;
  padding-bottom: 2px;
}
.sd-doctor-more:hover { border-bottom-color: #1a3a5c; }

/* ── 콘텐츠 이미지 슬롯 ──────────────────── */
.sd-content-img { padding: 0; margin: 56px 0; }
.sd-content-img figure { max-width: 100%; margin: 0; }
.sd-content-img img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1920 / 600;
  object-fit: cover;
  object-position: center;
  background: #f4f6f9;
}
.sd-content-img figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 13.5px;
  color: #7a8598;
  line-height: 1.7;
  word-break: keep-all;
}

/* ── 모바일 ──────────────────────────────── */
@media (max-width: 860px) {
  .sd-doctor-inner,
  .sd-doctor--full .sd-doctor-inner {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .sd-doctor-photo {
    max-width: 260px;
    margin: 0 auto;
  }
  .sd-doctor-body { text-align: left; }
}
@media (max-width: 640px) {
  .masthead.is-stuck { padding: 9px 16px; }
  :target, section[id] { scroll-margin-top: 76px; }

  .sd-doctor { padding: 40px 18px; }
  .sd-doctor-photo { max-width: 210px; }
  .sd-doctor-name { font-size: 23px; margin-bottom: 14px; }
  .sd-doctor-intro p { font-size: 15.5px; line-height: 1.85; }
  .sd-doc-list li { font-size: 14.5px; }
  .sd-doc-block { margin-top: 20px; }

  .sd-content-img { padding: 0; margin: 38px 0; }
  .sd-content-img img { aspect-ratio: 16 / 10; }
  /* 모바일 전용 이미지를 넣은 슬롯은 넣은 비율 그대로 전체 표시 */
  .sd-content-img--m img { aspect-ratio: auto; height: auto; object-fit: contain; }
  .sd-content-img figcaption { font-size: 12.5px; }
}

/* 터치 타겟 최소 크기 (모바일 접근성) */
@media (max-width: 640px) {
  .masthead-meta a,
  .nav-link { min-height: 40px; display: flex; align-items: center; }
}

/* v3.0.8: H1 안으로 들어간 kicker */
.hero-kicker--in-h1 {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold, #a88a5a);
  margin-bottom: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
}
@media (max-width: 640px) { .hero-kicker--in-h1 { font-size: 11px; margin-bottom: 10px; } }

/* 메인 배너 모바일 전용 이미지(1080×1080)를 넣은 경우: 정사각 비율로 표시 */
@media (max-width: 768px) {
  .main-banner--m img { height: auto !important; object-fit: contain; }  /* 비율은 v_mobile_opt 블록에서 지정 */
}


/* ── v_banner_full + v_mobile_opt: 메인 배너 무크롭 + 모바일 비율 분리 ──
   PC는 1920:850 가로형, 모바일 전용 이미지가 있으면 1:1 정사각 비율을 쓴다.
   인라인에 aspect-ratio 를 두면 모바일에서도 가로형이 강제되어
   정사각 이미지가 좌우 여백에 갇혀 작게 표시되므로 반드시 CSS 로 분리한다. */
.main-banner { width: 100%; }
.main-banner img {
  width: 100%;
  height: auto !important;
  max-height: none !important;
  object-fit: contain;
  display: block;
  aspect-ratio: 1920 / 850;
}
@media (max-width: 768px) {
  /* 모바일 전용 이미지(정사각)를 등록한 경우 */
  .main-banner--m img { aspect-ratio: 1 / 1 !important; }
  /* 모바일 이미지가 없으면 PC 가로형을 그대로 축소 */
  .main-banner:not(.main-banner--m) img { aspect-ratio: 1920 / 850; }
}
