/*
Theme Name: Sinkdoor Theme
Theme URI: https://sinkdoor.nsuri.com
Description: 싱크도어 교체 비교 가이드 프리미엄 테마
Author: ROBOTION
Version: 1.0
Template: twentytwentyfive
Text Domain: sinkdoor-theme
*/

:root {
  --c-primary: #1B4332;
  --c-primary-light: #2D6A4F;
  --c-primary-lighter: #40916C;
  --c-primary-dark: #132F23;
  --c-accent: #C4894A;
  --c-accent-light: #D4A76A;
  --c-accent-dark: #A06E35;
  --c-bg: #FAFAF7;
  --c-surface: #FFFFFF;
  --c-surface-alt: #F5F3EF;
  --c-text: #1C1C1E;
  --c-text-secondary: #4A5568;
  --c-text-muted: #8A919C;
  --c-border: #E2DED8;
  --c-border-light: #EEEAE4;
  --shadow-sm: 0 1px 3px rgba(27,67,50,0.06);
  --shadow-md: 0 4px 12px rgba(27,67,50,0.08);
  --shadow-lg: 0 8px 24px rgba(27,67,50,0.10);
  --shadow-xl: 0 16px 48px rgba(27,67,50,0.12);
  --font-base: 'Pretendard Variable','Pretendard',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 24px;
  --max-content: 760px;
  --max-wide: 1200px;
  --header-h: 72px;
  --ease: cubic-bezier(0.4,0,0.2,1);
  --t-fast: 150ms var(--ease);
  --t-base: 200ms var(--ease);
  --t-slow: 300ms var(--ease);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; font-size: 16px; }
body {
  font-family: var(--font-base);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary-light); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-accent); }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-base);
  font-weight: 700;
  line-height: 1.3;
  color: var(--c-text);
  letter-spacing: -0.02em;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.25rem; }
p { margin-bottom: 1.25em; }

.container { max-width: var(--max-wide); margin: 0 auto; padding: 0 24px; }
.content-narrow { max-width: var(--max-content); margin: 0 auto; }

/* ===== HEADER ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--header-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
.site-header.scrolled {
  border-bottom-color: var(--c-border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--c-text);
}
.site-logo svg {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.site-logo-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--c-primary);
  letter-spacing: -0.01em;
}
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a {
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-text-secondary);
  border-radius: var(--r-md);
  transition: color var(--t-fast), background var(--t-fast);
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--c-primary);
  background: rgba(27,67,50,0.06);
}
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  background: none; border: none; cursor: pointer;
  position: relative;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--c-text);
  position: absolute; left: 11px;
  transition: transform var(--t-base), opacity var(--t-fast);
}
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }
.nav-toggle.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--c-primary-dark);
  color: rgba(255,255,255,0.7);
  padding: 64px 0 0;
  margin-top: 96px;
  font-size: 0.875rem;
  line-height: 1.7;
}
.footer-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
}
.footer-brand { }
.footer-brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}
.footer-brand p { margin-bottom: 8px; }
.footer-links h4,
.footer-legal-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a {
  color: rgba(255,255,255,0.7);
  transition: color var(--t-fast);
}
.footer-links a:hover { color: var(--c-accent-light); }
.footer-bottom {
  margin-top: 48px;
  padding: 24px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}
.footer-bottom .container { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.footer-legal-notice {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.6;
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.15);
  border-radius: var(--r-md);
}
.footer-legal-notice p { margin-bottom: 4px; }

/* ===== POST HERO ===== */
.post-hero {
  position: relative;
  width: 100%;
  height: 420px;
  margin-top: var(--header-h);
  overflow: hidden;
  background: var(--c-primary-dark);
}
.post-hero-img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.post-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(19,47,35,0.2) 0%, rgba(19,47,35,0.85) 100%);
  display: flex; align-items: flex-end;
  padding: 48px 24px;
}
.post-hero-content {
  max-width: var(--max-content);
  margin: 0 auto;
  width: 100%;
  color: #fff;
}
.post-category {
  display: inline-block;
  padding: 4px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--c-accent-light);
  border: 1px solid rgba(212,167,106,0.4);
  border-radius: var(--r-full);
  margin-bottom: 16px;
}
.post-hero-content h1 {
  font-size: 2.5rem;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}
.post-meta {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
}

/* ===== ARTICLE BODY ===== */
.article-wrap {
  padding: 64px 24px 96px;
}
.article-body {
  max-width: var(--max-content);
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--c-text);
}
.article-body > *:first-child { margin-top: 0; }
.article-body h2 {
  font-size: 1.5rem;
  color: var(--c-primary);
  margin: 56px 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--c-border);
  position: relative;
}
.article-body h2::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 48px; height: 2px;
  background: var(--c-accent);
}
.article-body h3 {
  font-size: 1.2rem;
  color: var(--c-primary-light);
  margin: 40px 0 16px;
}
.article-body p {
  margin-bottom: 1.4em;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.article-body strong { color: var(--c-primary); font-weight: 600; }

/* Summary box */
.article-summary {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  margin-bottom: 40px;
  font-size: 0.98rem;
  line-height: 1.75;
  box-shadow: var(--shadow-sm);
}
.article-summary p:last-child { margin-bottom: 0; }

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 28px 0;
  font-size: 0.92rem;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--c-border);
}
.article-body thead th {
  background: var(--c-primary);
  color: #fff;
  font-weight: 600;
  padding: 14px 18px;
  text-align: left;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}
.article-body tbody td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--c-border-light);
  vertical-align: top;
}
.article-body tbody tr:last-child td { border-bottom: none; }
.article-body tbody tr:nth-child(even) { background: var(--c-surface-alt); }
.article-body tbody tr:hover { background: rgba(27,67,50,0.03); }
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 28px 0;
}
.table-wrap table { margin: 0; }

/* Blockquotes / Callouts */
.article-body blockquote {
  border-left: 4px solid var(--c-accent);
  background: var(--c-surface);
  padding: 20px 24px;
  margin: 28px 0;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 0.98rem;
  color: var(--c-text-secondary);
  box-shadow: var(--shadow-sm);
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.info-callout {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid rgba(45,106,79,0.15);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin: 28px 0;
  font-size: 0.95rem;
  color: var(--c-primary);
}
.info-callout p:last-child { margin-bottom: 0; }
.info-callout strong { color: var(--c-primary-dark); }

/* Lists */
.article-body ul,
.article-body ol {
  margin: 20px 0;
  padding-left: 24px;
}
.article-body li {
  margin-bottom: 8px;
  padding-left: 4px;
}
.article-body ul li::marker { color: var(--c-accent); }
.article-body ol li::marker { color: var(--c-primary-light); font-weight: 600; }

/* Images */
.article-body img {
  border-radius: var(--r-lg);
  margin: 32px 0;
  box-shadow: var(--shadow-md);
}
.article-body figure {
  margin: 32px 0;
}
.article-body figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--c-text-muted);
  margin-top: 10px;
}

/* Bar Chart */
.bar-chart {
  margin: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bar-label {
  width: 100px;
  flex-shrink: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--c-text-secondary);
  text-align: right;
}
.bar-track {
  flex: 1;
  height: 28px;
  background: var(--c-surface-alt);
  border-radius: var(--r-full);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  transition: width 1s var(--ease);
  min-width: fit-content;
}
.bar-fill.accent {
  background: linear-gradient(90deg, var(--c-accent-dark) 0%, var(--c-accent) 100%);
}

/* Step Timeline */
.step-timeline {
  margin: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.step-timeline::before {
  content: '';
  position: absolute;
  left: 19px; top: 20px; bottom: 20px;
  width: 2px;
  background: var(--c-border);
}
.step-item {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  position: relative;
}
.step-number {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
  z-index: 1;
}
.step-content {
  flex: 1;
  padding-top: 8px;
}
.step-content strong {
  display: block;
  margin-bottom: 4px;
}

/* ===== LEGAL / AI NOTICES (in-content) ===== */
.legal-notice {
  font-size: 0.85em !important;
  color: #777 !important;
  background: #f8f9fa !important;
  border-left: 3px solid #cbd5e1 !important;
  padding: 10px 14px !important;
  margin-top: 2em !important;
  border-radius: 0 6px 6px 0 !important;
}
.legal-notice p { margin: 4px 0 !important; font-size: inherit !important; }
.ai-notice {
  font-size: 0.85em !important;
  color: #888 !important;
  margin-top: 2em !important;
}

/* ===== POST CARDS ===== */
.post-card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--c-border-light);
  transition: transform var(--t-base), box-shadow var(--t-base);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.post-card-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}
.post-card-body {
  padding: 20px 24px 24px;
}
.post-card-cat {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-accent-dark);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}
.post-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--c-primary); }
.post-card-excerpt {
  font-size: 0.88rem;
  color: var(--c-text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== RELATED POSTS ===== */
.related-section {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 80px 24px;
  border-top: 1px solid var(--c-border);
}
.related-section h2 {
  font-size: 1.5rem;
  margin-bottom: 32px;
  color: var(--c-text);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ===== PAGE TEMPLATE ===== */
.page-wrap {
  margin-top: var(--header-h);
  padding: 64px 24px 96px;
}
.page-content {
  max-width: var(--max-content);
  margin: 0 auto;
}
.page-content h1 {
  font-size: 2rem;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--c-border);
}
.page-content h2 {
  font-size: 1.4rem;
  color: var(--c-primary);
  margin: 40px 0 16px;
}
.page-content p {
  margin-bottom: 1.25em;
  line-height: 1.8;
}
.page-content ul,
.page-content ol {
  margin: 16px 0;
  padding-left: 24px;
}
.page-content li { margin-bottom: 6px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-base);
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-base);
  text-decoration: none;
  line-height: 1.4;
}
.btn-primary {
  background: var(--c-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--c-primary-light);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-outline {
  background: transparent;
  color: var(--c-primary);
  border: 1.5px solid var(--c-primary);
}
.btn-outline:hover {
  background: var(--c-primary);
  color: #fff;
}
.btn-accent {
  background: var(--c-accent);
  color: #fff;
}
.btn-accent:hover {
  background: var(--c-accent-dark);
  color: #fff;
}

/* ===== UTILITIES ===== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.text-center { text-align: center; }

/* ===== SCROLL ANIMATION ===== */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 404 ===== */
.page-404 {
  margin-top: var(--header-h);
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 24px;
}
.page-404 h1 { font-size: 4rem; color: var(--c-border); margin-bottom: 16px; }
.page-404 p { color: var(--c-text-muted); margin-bottom: 32px; }

/* ===== WP OVERRIDES ===== */
.wp-block-post-content,
.entry-content { max-width: var(--max-content); margin: 0 auto; }
#wpadminbar ~ .site-header { top: 32px; }
body.admin-bar .post-hero { margin-top: calc(var(--header-h) + 32px); }
body.admin-bar .page-wrap { margin-top: calc(var(--header-h) + 32px); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --header-h: 60px; }
  h1 { font-size: 1.75rem; }
  .post-hero { height: 320px; }
  .post-hero-content h1 { font-size: 1.75rem; }
  .article-wrap { padding: 40px 20px 64px; }
  .article-body { font-size: 1rem; }
  .article-body h2 { font-size: 1.3rem; margin-top: 40px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--c-surface);
    flex-direction: column;
    padding: 16px 24px;
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--t-slow), opacity var(--t-base);
  }
  .site-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .site-nav a {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
  }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .related-grid { grid-template-columns: 1fr; }
  .bar-label { width: 80px; font-size: 0.82rem; }
  .step-item { gap: 14px; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .header-inner { padding: 0 16px; }
  .post-hero { height: 260px; }
  .post-hero-content h1 { font-size: 1.5rem; }
  .post-hero-overlay { padding: 32px 16px; }
  .article-body table { font-size: 0.85rem; }
  .article-body thead th { padding: 10px 12px; }
  .article-body tbody td { padding: 10px 12px; }
  .article-summary { padding: 18px 20px; }
  .page-content { padding: 0; }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .fade-up { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: 2px;
}
::selection {
  background: rgba(27,67,50,0.15);
  color: var(--c-text);
}
