/*
Theme Name: Ice Rental Lab
Theme URI: https://purifierental.tiond.com/
Author: ROBOTION
Description: 얼음 정수기 렌탈 가격·계약 조건 비교 정보 플랫폼 전용 테마. 홈(html.php)과 동일한 디자인 시스템을 상속합니다.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: icerental
*/

/* ============================================================
   1. DESIGN TOKENS (홈 html.php와 동일)
   ============================================================ */
:root {
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  --font-serif: "Noto Serif KR", "Noto Sans KR", serif;

  --ink: #0b1b33;
  --ink-soft: #31425c;
  --muted: #5b6b82;
  --faint: #8b98ab;

  --bg: #ffffff;
  --bg-soft: #f4f8fd;
  --bg-deep: #0b1b33;

  --line: #e3e9f1;
  --line-strong: #cdd8e6;

  --brand: #146ef5;
  --brand-strong: #0c5cd6;
  --brand-soft: #e9f2ff;
  --brand-ink: #0a3f8f;
  --ice: #0fa3b8;
  --ice-soft: #e2f6f8;

  --radius-s: 10px;
  --radius: 16px;
  --radius-l: 22px;

  --shadow-1: 0 1px 2px rgba(11,27,51,.05), 0 6px 18px rgba(11,27,51,.06);
  --shadow-2: 0 12px 40px rgba(11,27,51,.12);

  --sp-1: 8px;  --sp-2: 16px; --sp-3: 24px; --sp-4: 32px;
  --sp-5: 48px; --sp-6: 64px; --sp-7: 96px; --sp-8: 128px;

  --container: 1160px;
  --measure: 760px;
  --header-h: 72px;
}

/* ============================================================
   2. RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-soft);
  background: var(--bg);
  overflow-x: hidden;
  letter-spacing: -0.01em;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--brand-strong); }
h1,h2,h3,h4,h5,h6 { color: var(--ink); margin: 0 0 .5em; line-height: 1.3; letter-spacing: -0.02em; word-break: keep-all; }
p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.35em; margin: 0 0 1.2em; }
li { margin-bottom: .45em; }
:focus-visible { outline: 3px solid rgba(20,110,245,.45); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-soft); color: var(--brand-ink); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-3); }

/* ============================================================
   3. HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .header-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-3);
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .brand-logo { width: 40px; height: 40px; flex: none; display: block; }
.brand .brand-name { font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; white-space: nowrap; }
.brand .brand-name em { font-style: normal; color: var(--brand); }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  color: var(--ink-soft); font-size: 15px; font-weight: 600; border-radius: 10px;
}
.main-nav a:hover { color: var(--brand); background: var(--brand-soft); }
.main-nav .current-menu-item > a, .main-nav .current_page_item > a { color: var(--brand-strong); }
.nav-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; margin-left: 8px;
  background: var(--brand); color: #fff !important; font-weight: 700;
  border-radius: 999px; box-shadow: 0 6px 16px rgba(20,110,245,.28);
}
.nav-cta:hover { background: var(--brand-strong); color:#fff; }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--line); background: #fff;
  border-radius: 12px; cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; stroke: var(--ink); }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    display: none; flex-direction: column; align-items: stretch; gap: 2px;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: var(--sp-2); box-shadow: var(--shadow-2);
  }
  .main-nav.open { display: flex; }
  .main-nav a { justify-content: flex-start; padding: 0 16px; }
  .nav-cta { margin-left: 0; justify-content: center; }
}

/* ============================================================
   4. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 26px;
  font-size: 16px; font-weight: 700; letter-spacing: -0.01em;
  border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(20,110,245,.26); }
.btn-primary:hover { background: var(--brand-strong); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.btn-lg { min-height: 54px; padding: 0 32px; font-size: 17px; }

/* ============================================================
   5. FOOTER
   ============================================================ */
.site-footer { background: var(--bg-deep); color: #b9c6d8; margin-top: var(--sp-7); }
.footer-main {
  max-width: var(--container); margin: 0 auto; padding: var(--sp-6) var(--sp-3) var(--sp-4);
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: var(--sp-5);
}
.footer-brand .brand { margin-bottom: var(--sp-2); }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { font-size: 14px; color: #93a4ba; max-width: 360px; }
.footer-col h4 { color: #fff; font-size: 14px; letter-spacing: .06em; margin-bottom: var(--sp-2); }
.footer-col a { display: block; color: #93a4ba; font-size: 14px; padding: 4px 0; min-height: 32px; }
.footer-col a:hover { color: #fff; }
.footer-legal {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: var(--sp-4) var(--sp-3) var(--sp-5);
}
.footer-legal .legal-box {
  max-width: var(--container); margin: 0 auto;
  font-size: 12.5px; line-height: 1.8; color: #7e8fa5;
}
.footer-legal .legal-box p { margin: 0 0 6px; }
.footer-bottom {
  max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-3) var(--sp-4);
  display: flex; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 13px; color: #7e8fa5;
}
@media (max-width: 860px) {
  .footer-main { grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
  .footer-brand { grid-column: 1 / -1; }
}

/* ============================================================
   6. SINGLE POST / PAGE
   ============================================================ */
.single-head {
  padding: var(--sp-6) 0 var(--sp-4);
  background: linear-gradient(180deg, #f4f8fd 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
}
.single-head .kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--brand-strong);
  background: var(--brand-soft); border-radius: 999px; padding: 6px 14px; margin-bottom: var(--sp-2);
}
.single-head h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; max-width: 18em; }
.single-head .meta { color: var(--muted); font-size: 14px; margin-top: var(--sp-2); }
.single-layout { max-width: var(--container); margin: 0 auto; padding: var(--sp-5) var(--sp-3); display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--sp-5); }
.single-rail { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; font-size: 14px; }
.single-rail h3 { font-size: 13px; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; margin-bottom: var(--sp-2); }
.single-rail ul { list-style: none; padding: 0; margin: 0; }
.single-rail li { margin: 0; }
.single-rail a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--muted); }
.single-rail a:hover { color: var(--brand); background: var(--brand-soft); }
.single-article { min-width: 0; }
.single-article .entry-content { max-width: var(--measure); }
.entry-content h2 {
  font-size: clamp(22px, 3vw, 28px); font-weight: 800; margin: var(--sp-6) 0 var(--sp-3);
  padding-left: 14px; border-left: 4px solid var(--brand); line-height: 1.35;
}
.entry-content h3 { font-size: 20px; font-weight: 700; margin: var(--sp-5) 0 var(--sp-2); }
.entry-content p { max-width: var(--measure); }
.entry-content ul, .entry-content ol { max-width: var(--measure); }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content img { border-radius: var(--radius); box-shadow: var(--shadow-1); margin: var(--sp-4) 0; }
.entry-content figure { margin: var(--sp-4) 0; }
.entry-content figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 10px; }
.entry-content blockquote {
  margin: var(--sp-4) 0; padding: var(--sp-3) var(--sp-4);
  background: var(--bg-soft); border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink-soft);
}
.entry-content blockquote p { margin: 0; }
.entry-content .callout {
  margin: var(--sp-4) 0; padding: var(--sp-3) var(--sp-4);
  background: var(--brand-soft); border: 1px solid #cfe0ff; border-radius: var(--radius);
}
.entry-content .callout strong { color: var(--brand-strong); }
/* 테이블 */
.entry-content table {
  width: 100%; margin: var(--sp-4) 0; border-collapse: separate; border-spacing: 0;
  font-size: 14.5px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1);
}
.entry-content table th {
  background: var(--bg-deep); color: #fff; text-align: left;
  padding: 12px 16px; font-weight: 700; font-size: 13.5px; letter-spacing: .01em;
}
.entry-content table td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; color: var(--ink-soft); }
.entry-content table tr:nth-child(even) td { background: #fafcff; }
.entry-content .table-wrap { overflow-x: auto; margin: var(--sp-4) 0; }
.entry-content .table-wrap table { margin: 0; }
/* 인라인 차트(가로 막대) */
.entry-content .chart { margin: var(--sp-4) 0; }
.entry-content .chart .bar-row { display: grid; grid-template-columns: 130px 1fr 64px; align-items: center; gap: 12px; padding: 8px 0; }
.entry-content .chart .bar-label { font-size: 13.5px; color: var(--ink-soft); font-weight: 600; }
.entry-content .chart .bar-track { background: #edf2f8; border-radius: 999px; height: 12px; overflow: hidden; }
.entry-content .chart .bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--ice)); }
.entry-content .chart .bar-val { font-size: 13px; color: var(--muted); text-align: right; }
/* 단계 다이어그램 */
.entry-content .steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-2); margin: var(--sp-4) 0; counter-reset: step; }
.entry-content .steps .step { position: relative; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-3) var(--sp-2); text-align: center; }
.entry-content .steps .step::before { counter-increment: step; content: counter(step); display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: 0 auto 10px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: 14px; }
.entry-content .steps .step strong { display: block; color: var(--ink); margin-bottom: 4px; }
.entry-content .steps .step span { font-size: 13px; color: var(--muted); }
/* FAQ */
.entry-content .faq-item { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-3); margin-bottom: var(--sp-2); }
.entry-content .faq-item h3 { margin: 0 0 8px; font-size: 16.5px; }
/* AI·법적 고지 */
.legal-notice, .ai-notice { max-width: var(--measure); }
/* 관련글 */
.related { margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--line); }
.related h2 { font-size: 22px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-3); }

/* ============================================================
   7. CARDS / GRID
   ============================================================ */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l);
  overflow: hidden; box-shadow: var(--shadow-1);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.card-thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-soft); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.card:hover .card-thumb img { transform: scale(1.03); }
.card-body { padding: var(--sp-3); display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-cat { font-size: 12.5px; font-weight: 700; color: var(--brand-strong); }
.card-title { font-size: 17px; font-weight: 800; color: var(--ink); line-height: 1.45; }
.card-title a { color: inherit; }
.card-title a:hover { color: var(--brand); }
.card-excerpt { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0; }
.card-more { margin-top: auto; font-size: 13.5px; font-weight: 700; color: var(--brand); display: inline-flex; align-items: center; gap: 6px; }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--sp-3); }

/* ============================================================
   8. ARCHIVE / INDEX / SEARCH
   ============================================================ */
.archive-head { padding: var(--sp-6) 0 var(--sp-4); background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.archive-head h1 { font-size: clamp(26px, 3.4vw, 36px); }
.archive-head .count { color: var(--muted); font-size: 14px; }
.archive-list { padding: var(--sp-5) 0 var(--sp-6); }
.no-results { padding: var(--sp-7) 0; text-align: center; color: var(--muted); }

/* ============================================================
   9. FORMS (문의 페이지)
   ============================================================ */
.wpcf7-form, .consult-form { display: grid; gap: var(--sp-2); max-width: 640px; }
.form-field label { display: block; font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  font: inherit; font-size: 15px; color: var(--ink); background: #fff;
}
.form-field textarea { min-height: 130px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20,110,245,.15); }
.form-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-soft); }
.form-check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); }
.form-note { font-size: 13px; color: var(--muted); }

/* ============================================================
   10. TOC (easy-table-of-contents)
   ============================================================ */
#ez-toc-container {
  background: var(--bg-soft) !important; border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important; padding: var(--sp-3) !important;
  box-shadow: none !important; width: 100%; max-width: var(--measure);
}
#ez-toc-container .ez-toc-title { font-weight: 800; color: var(--ink); }
#ez-toc-container ul { margin: 0 !important; padding-left: 1.2em !important; }
#ez-toc-container a { color: var(--ink-soft); border-bottom: none; }
#ez-toc-container a:hover { color: var(--brand); }

/* ============================================================
   11. RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .single-layout { grid-template-columns: 1fr; }
  .single-rail { display: none; }
  body { font-size: 16px; }
}
@media (max-width: 600px) {
  .posts-grid { grid-template-columns: 1fr; }
  .entry-content .chart .bar-row { grid-template-columns: 96px 1fr 52px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
