/*
Theme Name: DrainHelp Theme
Theme URI: https://drainhelp.toothvia.com
Description: 김해 하수구 배관 정보 플랫폼 전용 테마
Author: DrainHelp
Version: 1.0
Template: twentytwentyfive
Text Domain: drainhelp-theme
*/

:root {
  --dh-primary: #1a3a5c;
  --dh-primary-light: #2a5a8c;
  --dh-accent: #e8873a;
  --dh-accent-hover: #d47630;
  --dh-bg: #f8f9fb;
  --dh-surface: #ffffff;
  --dh-text: #1e293b;
  --dh-text-muted: #64748b;
  --dh-text-light: #94a3b8;
  --dh-border: #e2e8f0;
  --dh-border-light: #f1f5f9;
  --dh-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --dh-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --dh-shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --dh-radius-sm: 6px;
  --dh-radius-md: 12px;
  --dh-radius-lg: 20px;
  --dh-font-heading: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --dh-font-body: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --dh-max-width: 1200px;
  --dh-content-width: 780px;
}

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

@font-face {
  font-family: 'Pretendard';
  src: url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard-dynamic-subset.min.css');
}

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard-dynamic-subset.min.css');

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--dh-font-body);
  color: var(--dh-text);
  background: var(--dh-bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Hide WP admin bar on front */
#wpadminbar { display: none !important; }
html { margin-top: 0 !important; }

/* ===== HEADER ===== */
.dh-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--dh-border);
  padding: 0 24px;
}
.dh-header-inner {
  max-width: var(--dh-max-width);
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.dh-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.dh-logo-icon {
  width: 40px; height: 40px; border-radius: var(--dh-radius-sm);
  background: var(--dh-primary);
  display: flex; align-items: center; justify-content: center;
}
.dh-logo-icon svg { width: 24px; height: 24px; }
.dh-logo-text {
  font-size: 1.1rem; font-weight: 700; color: var(--dh-primary);
  letter-spacing: -0.02em;
}
.dh-nav { display: flex; gap: 8px; align-items: center; }
.dh-nav a {
  color: var(--dh-text-muted); text-decoration: none;
  font-size: 0.9rem; font-weight: 500; padding: 8px 14px;
  border-radius: var(--dh-radius-sm);
  transition: all 0.2s ease;
}
.dh-nav a:hover { color: var(--dh-primary); background: var(--dh-border-light); }
.dh-nav-mobile-btn {
  display: none; background: none; border: none; cursor: pointer;
  padding: 8px; color: var(--dh-text);
}
@media(max-width:768px) {
  .dh-nav { display: none; position: fixed; top: 72px; left: 0; right: 0;
    background: var(--dh-surface); flex-direction: column; padding: 16px;
    border-bottom: 1px solid var(--dh-border); box-shadow: var(--dh-shadow-lg); }
  .dh-nav.open { display: flex; }
  .dh-nav a { padding: 12px 16px; width: 100%; font-size: 1rem; }
  .dh-nav-mobile-btn { display: block; }
}

/* ===== SINGLE POST ===== */
.dh-single-wrap {
  max-width: var(--dh-content-width);
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.dh-single-wrap .entry-title,
.dh-single-wrap h1 {
  font-family: var(--dh-font-heading);
  font-size: 2rem; font-weight: 800; line-height: 1.35;
  color: var(--dh-text); margin-bottom: 24px;
  letter-spacing: -0.03em;
}
.dh-single-wrap .entry-content h2 {
  font-family: var(--dh-font-heading);
  font-size: 1.45rem; font-weight: 700; line-height: 1.4;
  color: var(--dh-primary); margin: 56px 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--dh-accent);
  letter-spacing: -0.02em;
}
.dh-single-wrap .entry-content h3 {
  font-size: 1.2rem; font-weight: 700; color: var(--dh-text);
  margin: 40px 0 16px;
}
.dh-single-wrap .entry-content p {
  font-size: 1.05rem; line-height: 1.8; margin-bottom: 20px;
  color: var(--dh-text); word-break: keep-all;
}
.dh-single-wrap .entry-content ul,
.dh-single-wrap .entry-content ol {
  margin: 16px 0 24px 24px; line-height: 1.8;
}
.dh-single-wrap .entry-content li { margin-bottom: 8px; }
.dh-single-wrap .entry-content img {
  max-width: 100%; height: auto; border-radius: var(--dh-radius-md);
  margin: 24px 0; box-shadow: var(--dh-shadow-sm);
}
.dh-single-wrap .entry-content table {
  width: 100%; border-collapse: collapse; margin: 24px 0;
  font-size: 0.95rem; border-radius: var(--dh-radius-md);
  overflow: hidden; box-shadow: var(--dh-shadow-sm);
}
.dh-single-wrap .entry-content table th {
  background: var(--dh-primary); color: #fff;
  padding: 14px 16px; text-align: left; font-weight: 600;
}
.dh-single-wrap .entry-content table td {
  padding: 12px 16px; border-bottom: 1px solid var(--dh-border);
}
.dh-single-wrap .entry-content table tr:nth-child(even) td {
  background: #f8fafc;
}
.dh-single-wrap .entry-content blockquote {
  border-left: 4px solid var(--dh-accent);
  background: linear-gradient(135deg, #fff7ed, #fffbf5);
  padding: 20px 24px; margin: 24px 0;
  border-radius: 0 var(--dh-radius-md) var(--dh-radius-md) 0;
  font-size: 1.02rem; color: var(--dh-text);
}

/* Featured image in single */
.dh-featured-img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  border-radius: var(--dh-radius-lg); margin-bottom: 32px;
  box-shadow: var(--dh-shadow-md);
}

/* Legal notices */
.ai-notice, .legal-notice, .affiliate-notice {
  font-size: 0.85em !important;
}

/* ===== FOOTER ===== */
.dh-footer {
  background: var(--dh-primary);
  color: rgba(255,255,255,0.7);
  padding: 64px 24px 32px;
}
.dh-footer-inner {
  max-width: var(--dh-max-width);
  margin: 0 auto;
}
.dh-footer-top {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px; margin-bottom: 48px;
}
.dh-footer-brand h3 {
  color: #fff; font-size: 1.2rem; font-weight: 700; margin-bottom: 12px;
}
.dh-footer-brand p { font-size: 0.9rem; line-height: 1.7; }
.dh-footer-links h4 {
  color: rgba(255,255,255,0.9); font-size: 0.95rem; font-weight: 600;
  margin-bottom: 16px;
}
.dh-footer-links a {
  display: block; color: rgba(255,255,255,0.6);
  text-decoration: none; font-size: 0.9rem; padding: 4px 0;
  transition: color 0.2s;
}
.dh-footer-links a:hover { color: var(--dh-accent); }
.dh-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px; font-size: 0.8rem;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.dh-footer-legal { font-size: 0.78rem; color: rgba(255,255,255,0.45); margin-top: 16px; line-height: 1.7; }
@media(max-width:768px) {
  .dh-footer-top { grid-template-columns: 1fr; gap: 32px; }
  .dh-footer-bottom { flex-direction: column; text-align: center; }
}

/* ===== PAGE TEMPLATE ===== */
.dh-page-wrap {
  max-width: var(--dh-content-width);
  margin: 0 auto; padding: 48px 24px 80px;
}
.dh-page-wrap h1 {
  font-size: 2rem; font-weight: 800; margin-bottom: 32px;
  color: var(--dh-primary);
}
.dh-page-wrap h2 { font-size: 1.3rem; font-weight: 700; margin: 32px 0 16px; color: var(--dh-text); }
.dh-page-wrap p { line-height: 1.8; margin-bottom: 16px; }
.dh-page-wrap ul { margin: 12px 0 20px 20px; }

/* ===== RELATED POSTS ===== */
.dh-related { margin-top: 64px; padding-top: 48px; border-top: 1px solid var(--dh-border); }
.dh-related h2 { font-size: 1.3rem; margin-bottom: 24px; color: var(--dh-text); border: none; padding: 0; }
.dh-related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.dh-related-card {
  background: var(--dh-surface); border-radius: var(--dh-radius-md);
  overflow: hidden; box-shadow: var(--dh-shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none; color: var(--dh-text);
}
.dh-related-card:hover { transform: translateY(-4px); box-shadow: var(--dh-shadow-md); }
.dh-related-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.dh-related-card h3 { font-size: 0.95rem; padding: 16px; font-weight: 600; line-height: 1.5; }
@media(max-width:768px) { .dh-related-grid { grid-template-columns: 1fr; } }

/* Scroll animations */
@media(prefers-reduced-motion: no-preference) {
  .dh-animate { opacity: 0; transform: translateY(24px); transition: opacity 0.5s ease, transform 0.5s ease; }
  .dh-animate.visible { opacity: 1; transform: translateY(0); }
}

/* Mobile table scroll */
.dh-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 24px 0; }
