/*
Theme Name: Shanghai Twist
Theme URI: https://shanghaitwist.com
Description: 상하이 여행 전문 가이드 — Twenty Twenty-Five 자식 테마. 파스텔 블루 디자인 시스템 적용.
Author: Shanghai Twist
Author URI: https://shanghaitwist.com
Template: twentytwentyfive
Version: 1.0.0
Text Domain: shanghai-twist
License: GPL v2 or later
*/

/* ============================================================
   디자인 토큰
============================================================ */
:root {
  --blue:       #3B82F6;
  --blue-mid:   #60A5FA;
  --blue-light: #EFF6FF;
  --blue-pale:  #DBEAFE;
  --blue-soft:  #BFDBFE;
  --accent:     #93C5FD;
  --peach:      #FDE8DC;
  --lavender:   #EDE9FE;
  --mint:       #D1FAE5;
  --yellow-s:   #FEF9C3;
  --ink:        #1E293B;
  --ink-mid:    #475569;
  --muted:      #94A3B8;
  --border:     #E2E8F0;
  --bg:         #FFFFFF;
  --bg-soft:    #F8FAFC;
  --bg-section: #F1F5F9;
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --shadow-sm:  0 2px 8px rgba(59,130,246,0.07);
  --shadow-md:  0 8px 28px rgba(59,130,246,0.11);
  --shadow-lg:  0 16px 48px rgba(59,130,246,0.14);
}

/* ============================================================
   기본 리셋 & 타이포그래피
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Twenty Twenty-Five 기본 스타일 오버라이드 */
body.wp-singular,
body.home,
body.blog,
body.archive,
body.category,
body.tag {
  background: #fff;
}

.wp-site-blocks { padding: 0 !important; }
.wp-block-template-part { all: unset; display: block; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Noto Serif KR', serif;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.35;
}

a { color: var(--blue); text-decoration: none; transition: color 0.18s; }
a:hover { color: #2563EB; }

img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   HEADER
============================================================ */
.st-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.st-header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 66px;
}
.st-logo {
  display: flex;
  align-items: baseline;
  gap: 7px;
  text-decoration: none;
  flex-shrink: 0;
}
.st-logo-kr {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.st-logo-en {
  font-family: 'Playfair Display', serif;
  font-size: 0.73rem;
  font-style: italic;
  color: var(--blue);
}
.st-nav { display: flex; flex: 1; justify-content: center; }
.st-nav-list { display: flex; list-style: none; gap: 2px; }
.st-nav-item { position: relative; }
.st-nav-link {
  display: flex;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--ink-mid);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.42rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
  cursor: pointer;
}
.st-nav-link .arrow { font-size: 0.58rem; opacity: 0.45; transition: transform 0.2s; }
.st-nav-link:hover { background: var(--blue-light); color: var(--blue); }
.st-nav-link:hover .arrow { transform: rotate(180deg); }
.st-nav-link.active { color: var(--blue); font-weight: 700; background: var(--blue-light); }
.st-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  z-index: 300;
}
.st-nav-item:hover .st-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.st-dropdown a {
  display: block;
  text-decoration: none;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.81rem;
  color: var(--ink-mid);
  transition: background 0.15s, color 0.15s;
}
.st-dropdown a:hover { background: var(--blue-light); color: var(--blue); }
.st-dropdown-lbl {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 6px 13px 2px;
  display: block;
}
.st-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 8px; }
.st-header-right { margin-left: auto; flex-shrink: 0; }
.st-search-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-section);
  border-radius: 20px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s;
  font-family: inherit;
}
.st-search-btn:hover { border-color: var(--blue-mid); }

/* ============================================================
   FOOTER
============================================================ */
.st-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 2.8rem 0 1.8rem;
  margin-top: 5rem;
}
.st-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.8rem;
}
.st-footer-tagline { font-size: 0.78rem; color: var(--muted); margin-top: 0.55rem; line-height: 1.65; }
.st-footer-col h4 { font-family: 'Noto Serif KR', serif; font-size: 0.83rem; font-weight: 600; margin-bottom: 0.85rem; }
.st-footer-links { list-style: none; }
.st-footer-links li { margin-bottom: 0.42rem; }
.st-footer-links a { font-size: 0.78rem; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.st-footer-links a:hover { color: var(--blue); }
.st-footer-bottom {
  max-width: 1240px;
  margin: 1.8rem auto 0;
  padding: 1.2rem 2rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 0.71rem;
  color: var(--muted);
}

/* ============================================================
   단일 글 (single.php)
============================================================ */
.st-post-hero {
  background: linear-gradient(135deg, var(--blue-pale) 0%, var(--blue-light) 60%, #fff 100%);
  padding: 3.5rem 0 3rem;
  border-bottom: 1px solid var(--border);
}
.st-post-hero-inner { max-width: 1240px; margin: 0 auto; padding: 0 2rem; }
.st-breadcrumb {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.st-breadcrumb a { color: var(--blue); }
.st-breadcrumb a:hover { text-decoration: underline; }
.st-post-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--blue-pale);
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 0.9rem;
}
.st-post-hero h1 {
  font-family: 'Noto Serif KR', serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.04em;
  margin-bottom: 0.9rem;
  line-height: 1.3;
}
.st-post-meta-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.78rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.st-post-meta-row span { display: flex; align-items: center; gap: 4px; }
.st-post-hero-thumb {
  margin-top: 2rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-height: 460px;
  box-shadow: var(--shadow-lg);
}
.st-post-hero-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* 본문 레이아웃 */
.st-post-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}
.st-post-content {
  font-size: 0.97rem;
  line-height: 1.9;
  color: var(--ink);
}
.st-post-content h2 { font-size: 1.45rem; margin: 2.5rem 0 0.8rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--blue-pale); }
.st-post-content h3 { font-size: 1.2rem; margin: 2rem 0 0.6rem; }
.st-post-content p { margin-bottom: 1.3rem; }
.st-post-content ul, .st-post-content ol { padding-left: 1.5rem; margin-bottom: 1.3rem; }
.st-post-content li { margin-bottom: 0.4rem; }
.st-post-content blockquote {
  border-left: 3px solid var(--blue-mid);
  background: var(--blue-light);
  padding: 1rem 1.4rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--ink-mid);
}
.st-post-content img {
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}
.st-post-content a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.st-post-content code {
  background: var(--bg-section);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}
.st-post-content pre {
  background: var(--ink);
  color: #e2e8f0;
  padding: 1.2rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.5rem 0;
}

/* 이전/다음 글 */
.st-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.st-post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s;
  background: #fff;
}
.st-post-nav-link:hover { border-color: var(--blue-mid); background: var(--blue-light); color: var(--ink); }
.st-post-nav-link.next { text-align: right; }
.st-post-nav-label { font-size: 0.7rem; color: var(--muted); font-weight: 600; letter-spacing: 0.08em; }
.st-post-nav-title { font-size: 0.87rem; font-weight: 600; line-height: 1.4; }

/* 사이드바 */
.st-sidebar { position: sticky; top: 86px; }
.st-sidebar-block {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  margin-bottom: 1.4rem;
}
.st-sidebar-block h3 {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--blue-pale);
}
.st-tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.st-tag {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--blue-light);
  color: var(--blue);
  text-decoration: none;
  transition: all 0.18s;
  border: 1px solid var(--blue-pale);
}
.st-tag:hover { background: var(--blue); color: #fff; }
.st-related-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--ink);
  transition: color 0.18s;
}
.st-related-item:last-child { border-bottom: none; padding-bottom: 0; }
.st-related-item:hover { color: var(--blue); }
.st-related-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-section);
}
.st-related-title { font-size: 0.8rem; font-weight: 600; line-height: 1.4; }
.st-related-date { font-size: 0.68rem; color: var(--muted); margin-top: 3px; }

/* ============================================================
   아카이브 (archive.php / index.php)
============================================================ */
.st-archive-hero {
  background: linear-gradient(135deg, var(--blue-pale) 0%, var(--blue-light) 60%, #fff 100%);
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}
.st-archive-hero-inner { max-width: 1240px; margin: 0 auto; padding: 0 2rem; }
.st-archive-hero h1 {
  font-family: 'Noto Serif KR', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.04em;
  margin-bottom: 0.4rem;
}
.st-archive-hero p { font-size: 0.9rem; color: var(--ink-mid); font-weight: 300; }
.st-archive-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--blue-pale);
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 0.9rem;
}

.st-archive-wrap { max-width: 1240px; margin: 0 auto; padding: 2.8rem 2rem; }
.st-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.st-post-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.22s, box-shadow 0.22s;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
}
.st-post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
}
.st-card-thumb {
  height: 185px;
  overflow: hidden;
  background: var(--bg-section);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  flex-shrink: 0;
}
.st-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s; }
.st-post-card:hover .st-card-thumb img { transform: scale(1.05); }
.st-card-body { padding: 1.15rem 1.2rem; flex: 1; display: flex; flex-direction: column; }
.st-card-cat {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.35rem;
}
.st-card-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.96rem;
  font-weight: 600;
  margin-bottom: 0.42rem;
  line-height: 1.48;
  flex: 1;
}
.st-card-excerpt {
  font-size: 0.77rem;
  color: var(--muted);
  line-height: 1.58;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.st-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--muted);
}
.st-card-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.st-card-tag {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--blue-light);
  color: var(--blue);
}

/* 페이지네이션 */
.st-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.st-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--ink-mid);
  text-decoration: none;
  transition: all 0.18s;
  background: #fff;
}
.st-pagination .page-numbers:hover,
.st-pagination .page-numbers.current {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.st-pagination .page-numbers.dots { border-color: transparent; background: transparent; color: var(--muted); }

/* ============================================================
   공통 컴포넌트
============================================================ */
.st-empty {
  text-align: center;
  padding: 4rem 2rem;
  grid-column: 1 / -1;
}
.st-empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.st-empty-title { font-family: 'Noto Serif KR', serif; font-size: 1.1rem; font-weight: 600; margin-bottom: 0.4rem; }
.st-empty-desc { font-size: 0.83rem; color: var(--muted); }

.st-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--blue-pale);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: st-spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes st-spin { to { transform: rotate(360deg); } }

/* ============================================================
   반응형
============================================================ */
@media (max-width: 1000px) {
  .st-post-wrap { grid-template-columns: 1fr; }
  .st-sidebar { position: static; }
  .st-posts-grid { grid-template-columns: repeat(2, 1fr); }
  .st-footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .st-post-hero h1 { font-size: 1.6rem; }
  .st-archive-hero h1 { font-size: 1.5rem; }
  .st-posts-grid { grid-template-columns: 1fr; }
  .st-footer-inner { grid-template-columns: 1fr; }
  .st-post-nav { grid-template-columns: 1fr; }
}

/* ============================================================
   모바일 햄버거 메뉴
============================================================ */
.st-hamburger-btn { display: none; align-items: center; justify-content: center; background: none; border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 11px; font-size: 1.25rem; line-height: 1; color: var(--ink); cursor: pointer; transition: all 0.2s; margin-left: 8px; }
.st-hamburger-btn:hover { background: var(--blue-light); border-color: var(--blue-mid); }
.st-mobile-menu { display: none; position: fixed; top: 66px; left: 0; right: 0; z-index: 150; background: #fff; border-bottom: 2px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,0.09); max-height: 0; overflow: hidden; transition: max-height 0.32s cubic-bezier(0.4,0,0.2,1); }
.st-mobile-menu.open { max-height: calc(100vh - 66px); overflow-y: auto; }
.st-mobile-menu-inner { padding: 0.4rem 0 1.2rem; }
.mob-nav-item { border-bottom: 1px solid var(--border); }
.mob-nav-row { display: flex; align-items: center; }
.mob-nav-link { flex: 1; display: block; padding: 16px 1.5rem; font-size: 0.97rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.mob-nav-link:hover { color: var(--blue); background: var(--blue-light); }
.mob-nav-lbl { cursor: default; }
.mob-arrow { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 48px; height: 54px; background: none; border: none; font-size: 1.1rem; color: var(--muted); cursor: pointer; transition: transform 0.25s; }
.mob-nav-item.mob-open .mob-arrow { transform: rotate(180deg); }
.mob-submenu { display: none; background: var(--bg-soft); border-top: 1px solid var(--border); }
.mob-nav-item.mob-open .mob-submenu { display: block; }
.mob-sub-lbl { display: block; padding: 8px 1.5rem 4px; font-size: 0.68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.mob-submenu a { display: block; padding: 13px 2rem; font-size: 0.93rem; color: var(--ink-mid); border-bottom: 1px solid var(--border); }
.mob-submenu a:last-child { border-bottom: none; }
.mob-submenu a:hover { color: var(--blue); background: var(--blue-light); }

@media (max-width: 768px) {
  .st-hamburger-btn { display: flex; }
  .st-nav { display: none !important; }
  .st-mobile-menu { display: block; }
}
