/*
Theme Name: DrainInfo Premium
Template: twentytwentyfive
Description: Premium child theme for DrainInfo - 김해 하수구 정보 검색
Version: 1.0.0
*/

:root {
  --di-primary: #0c4a6e;
  --di-primary-dark: #082f49;
  --di-primary-light: #0e7490;
  --di-accent: #0891b2;
  --di-accent-light: #22d3ee;
  --di-success: #059669;
  --di-warning: #d97706;
  --di-danger: #dc2626;
  --di-bg: #f8fafc;
  --di-surface: #ffffff;
  --di-surface-alt: #f1f5f9;
  --di-border: #e2e8f0;
  --di-border-light: #f1f5f9;
  --di-text: #0f172a;
  --di-text-secondary: #475569;
  --di-text-muted: #94a3b8;
  --di-radius-sm: 6px;
  --di-radius-md: 10px;
  --di-radius-lg: 16px;
  --di-radius-xl: 24px;
  --di-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --di-shadow-md: 0 4px 16px rgba(0,0,0,0.07);
  --di-shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --di-font: 'Pretendard Variable','Pretendard',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --di-content-w: 760px;
  --di-site-w: 1200px;
}

@font-face {
  font-family: 'Pretendard Variable';
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');
}

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

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--di-font) !important;
  color: var(--di-text) !important;
  background: var(--di-bg) !important;
  line-height: 1.7 !important;
  font-size: 16px !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === HEADER === */
.di-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--di-border);
  transition: box-shadow 0.2s;
}
.di-header.scrolled { box-shadow: var(--di-shadow-md); }
.di-header-inner {
  max-width: var(--di-site-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.di-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--di-primary);
}
.di-logo svg { width: 36px; height: 36px; flex-shrink: 0; }
.di-logo-text {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--di-primary);
}
.di-nav { display: flex; align-items: center; gap: 4px; }
.di-nav a {
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--di-text-secondary);
  text-decoration: none;
  border-radius: var(--di-radius-sm);
  transition: color 0.15s, background 0.15s;
}
.di-nav a:hover {
  color: var(--di-accent);
  background: rgba(8,145,178,0.06);
}
.di-mobile-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--di-text);
}
.di-mobile-toggle svg { width: 24px; height: 24px; }
.di-mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(12px);
  z-index: 999;
  padding: 24px;
  overflow-y: auto;
}
.di-mobile-menu.active { display: block; }
.di-mobile-menu a {
  display: block;
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--di-text);
  text-decoration: none;
  border-bottom: 1px solid var(--di-border-light);
}
.di-mobile-menu a:hover { color: var(--di-accent); }

@media (max-width: 768px) {
  .di-nav { display: none; }
  .di-mobile-toggle { display: block; }
}

/* === POST SINGLE === */
.di-single { max-width: 100%; padding-bottom: 80px; }
.di-post-hero {
  position: relative;
  width: 100%;
  max-height: 480px;
  overflow: hidden;
  background: var(--di-primary-dark);
}
.di-post-hero img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  display: block;
  opacity: 0.7;
}
.di-post-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 60px 24px 40px;
  background: linear-gradient(transparent, rgba(8,47,73,0.9));
}
.di-post-hero-overlay h1 {
  max-width: var(--di-content-w);
  margin: 0 auto;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.di-post-meta {
  max-width: var(--di-content-w);
  margin: 0 auto;
  padding: 16px 0;
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}
.di-post-body {
  max-width: var(--di-content-w);
  margin: 0 auto;
  padding: 48px 24px 0;
}

/* === TYPOGRAPHY === */
.di-post-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--di-primary);
  margin: 56px 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--di-accent);
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.di-post-body h2:first-child { margin-top: 0; }
.di-post-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--di-text);
  margin: 36px 0 14px;
  padding-left: 14px;
  border-left: 3px solid var(--di-accent);
  line-height: 1.4;
}
.di-post-body p {
  margin: 0 0 18px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--di-text);
  word-break: keep-all;
}
.di-post-body strong { color: var(--di-primary-dark); font-weight: 600; }

/* === IMAGES === */
.di-post-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--di-radius-lg);
  margin: 28px 0;
  box-shadow: var(--di-shadow-md);
}
.di-post-body figure {
  margin: 32px 0;
}
.di-post-body figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--di-text-muted);
  margin-top: 8px;
}

/* === TABLES === */
.di-post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.92rem;
  border-radius: var(--di-radius-md);
  overflow: hidden;
  box-shadow: var(--di-shadow-sm);
}
.di-post-body .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
  border-radius: var(--di-radius-md);
  box-shadow: var(--di-shadow-sm);
}
.di-post-body .table-wrap table {
  margin: 0;
  box-shadow: none;
}
.di-post-body thead th {
  background: var(--di-primary);
  color: #fff;
  font-weight: 600;
  padding: 14px 16px;
  text-align: left;
  white-space: nowrap;
}
.di-post-body tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--di-border);
  vertical-align: top;
}
.di-post-body tbody tr:last-child td { border-bottom: none; }
.di-post-body tbody tr:nth-child(even) { background: var(--di-surface-alt); }
.di-post-body tbody tr:hover { background: rgba(8,145,178,0.04); }

/* === LISTS === */
.di-post-body ul, .di-post-body ol {
  margin: 18px 0;
  padding-left: 24px;
}
.di-post-body li {
  margin-bottom: 10px;
  line-height: 1.7;
  font-size: 1rem;
}
.di-post-body ul li::marker { color: var(--di-accent); }
.di-post-body ol li::marker { color: var(--di-accent); font-weight: 600; }

/* === CALLOUT / BLOCKQUOTE === */
.di-post-body blockquote,
.di-post-body .callout {
  margin: 28px 0;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(8,145,178,0.06), rgba(12,74,110,0.04));
  border-left: 4px solid var(--di-accent);
  border-radius: 0 var(--di-radius-md) var(--di-radius-md) 0;
  font-size: 0.95rem;
  color: var(--di-text);
}
.di-post-body blockquote p:last-child,
.di-post-body .callout p:last-child { margin-bottom: 0; }
.callout-warning {
  background: linear-gradient(135deg, rgba(217,119,6,0.08), rgba(217,119,6,0.03)) !important;
  border-left-color: var(--di-warning) !important;
}
.callout-danger {
  background: linear-gradient(135deg, rgba(220,38,38,0.06), rgba(220,38,38,0.03)) !important;
  border-left-color: var(--di-danger) !important;
}
.callout-success {
  background: linear-gradient(135deg, rgba(5,150,105,0.06), rgba(5,150,105,0.03)) !important;
  border-left-color: var(--di-success) !important;
}

/* === INLINE CHART (CSS BAR) === */
.di-chart { margin: 28px 0; }
.di-chart-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--di-text-secondary);
  margin-bottom: 16px;
}
.di-bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 12px;
}
.di-bar-label {
  flex: 0 0 120px;
  font-size: 0.85rem;
  color: var(--di-text-secondary);
  text-align: right;
}
.di-bar-track {
  flex: 1;
  height: 28px;
  background: var(--di-surface-alt);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}
.di-bar-fill {
  height: 100%;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--di-accent), var(--di-primary-light));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  transition: width 0.6s ease;
}
@media (max-width: 480px) {
  .di-bar-label { flex: 0 0 80px; font-size: 0.8rem; }
}

/* === STEP/TIMELINE === */
.di-steps { margin: 28px 0; }
.di-step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  position: relative;
}
.di-step::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: -24px;
  width: 2px;
  background: var(--di-border);
}
.di-step:last-child::before { display: none; }
.di-step-num {
  flex: 0 0 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--di-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 1;
}
.di-step-content { flex: 1; padding-top: 6px; }
.di-step-content strong { display: block; margin-bottom: 4px; }

/* === TOC === */
.di-toc {
  background: var(--di-surface);
  border: 1px solid var(--di-border);
  border-radius: var(--di-radius-lg);
  padding: 24px 28px;
  margin: 0 0 40px;
}
.di-toc-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--di-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.di-toc ol {
  margin: 0;
  padding-left: 20px;
  counter-reset: toc;
}
.di-toc li {
  margin-bottom: 8px;
  font-size: 0.92rem;
}
.di-toc a {
  color: var(--di-text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.di-toc a:hover { color: var(--di-accent); }

/* === SUMMARY BOX === */
.di-summary {
  background: linear-gradient(135deg, var(--di-primary), var(--di-primary-dark));
  color: #fff;
  border-radius: var(--di-radius-lg);
  padding: 28px 32px;
  margin: 0 0 40px;
}
.di-summary h3 {
  color: var(--di-accent-light) !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 0 12px !important;
  font-size: 1.05rem !important;
}
.di-summary p { color: rgba(255,255,255,0.9) !important; margin-bottom: 8px !important; }
.di-summary ul { padding-left: 18px; }
.di-summary li { color: rgba(255,255,255,0.85); margin-bottom: 6px; }

/* === RELATED POSTS === */
.di-related {
  max-width: var(--di-content-w);
  margin: 60px auto 0;
  padding: 0 24px;
}
.di-related-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--di-text);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--di-border);
}
.di-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.di-related-card {
  border-radius: var(--di-radius-md);
  overflow: hidden;
  background: var(--di-surface);
  border: 1px solid var(--di-border);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.di-related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--di-shadow-lg);
}
.di-related-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.di-related-card-body {
  padding: 16px;
}
.di-related-card-body h4 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--di-text);
  margin: 0;
}
@media (max-width: 768px) {
  .di-related-grid { grid-template-columns: 1fr; gap: 12px; }
  .di-related-card { display: flex; }
  .di-related-card img { width: 120px; height: 90px; flex-shrink: 0; }
  .di-related-card-body { display: flex; align-items: center; }
}

/* === FOOTER === */
.di-footer {
  background: var(--di-primary-dark);
  color: rgba(255,255,255,0.8);
  padding: 48px 24px 32px;
  margin-top: 80px;
}
.di-footer-inner {
  max-width: var(--di-site-w);
  margin: 0 auto;
}
.di-footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.di-footer-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.di-footer-desc {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  max-width: 300px;
  line-height: 1.6;
}
.di-footer-links { display: flex; gap: 32px; }
.di-footer-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
}
.di-footer-links a:hover { color: var(--di-accent-light); }
.di-footer-bottom {
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
.di-footer-legal {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  line-height: 1.7;
  max-width: 700px;
}
.di-footer-copy {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
}
@media (max-width: 768px) {
  .di-footer-top { flex-direction: column; gap: 24px; }
  .di-footer-links { flex-direction: column; gap: 12px; }
}

/* === PAGE TEMPLATE === */
.di-page {
  max-width: var(--di-content-w);
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.di-page h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--di-primary);
  margin-bottom: 32px;
  letter-spacing: -0.02em;
}
.di-page h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--di-primary);
  margin: 40px 0 16px;
}
.di-page p { margin: 0 0 16px; line-height: 1.8; }
.di-page ul, .di-page ol { margin: 16px 0; padding-left: 24px; }
.di-page li { margin-bottom: 8px; }

/* === OVERRIDE WP DEFAULTS === */
.wp-site-blocks, .wp-block-template-part,
.has-global-padding, body .is-layout-constrained {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
}
.wp-block-post-content { max-width: 100% !important; }
body .entry-content, body .wp-block-group { max-width: 100% !important; }

/* Hide WP default elements */
.wp-block-site-title, .wp-block-site-tagline,
.wp-block-navigation, .wp-block-template-part[data-slug="header"],
.wp-block-template-part[data-slug="footer"],
body > .wp-site-blocks > header,
body > .wp-site-blocks > footer,
.powered-by-wordpress, .wp-block-loginout { display: none !important; }

/* === ANIMATIONS === */
@media (prefers-reduced-motion: no-preference) {
  .di-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .di-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .di-post-hero img { height: 280px; }
  .di-post-hero-overlay h1 { font-size: 1.5rem; }
  .di-post-body { padding: 32px 20px 0; }
  .di-post-body h2 { font-size: 1.3rem; margin-top: 40px; }
  .di-post-body table { font-size: 0.85rem; }
  .di-post-body thead th { padding: 10px 12px; }
  .di-post-body tbody td { padding: 10px 12px; }
  .di-page { padding: 32px 20px 60px; }
  .di-page h1 { font-size: 1.5rem; }
}
@media (max-width: 480px) {
  .di-header-inner { padding: 0 16px; }
  .di-post-hero img { height: 200px; }
  .di-post-hero-overlay { padding: 40px 16px 24px; }
  .di-post-hero-overlay h1 { font-size: 1.25rem; }
  .di-post-body { padding: 24px 16px 0; }
}

/* === LEGAL NOTICES in posts === */
.legal-notice { font-size: 0.85em !important; }
.ai-notice { font-size: 0.85em !important; }

/* === CHECKLIST STYLE === */
.di-checklist {
  list-style: none;
  padding-left: 0 !important;
}
.di-checklist li {
  position: relative;
  padding-left: 28px;
}
.di-checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--di-accent);
  border-radius: 4px;
  background: rgba(8,145,178,0.06);
}

/* === INFO CARD === */
.di-info-card {
  background: var(--di-surface);
  border: 1px solid var(--di-border);
  border-radius: var(--di-radius-lg);
  padding: 24px;
  margin: 24px 0;
}
.di-info-card-title {
  font-weight: 700;
  color: var(--di-primary);
  margin-bottom: 12px;
  font-size: 1.05rem;
}
