/* ============================================================
   히어링가이드 — 메인 스타일시트
   디자인 토큰은 :root 변수로 관리하며, site.config.js의 색상과
   동일한 값을 사용합니다. 색상을 바꾸려면 아래 변수와
   src/data/site.config.js 를 함께 수정하세요.
   ============================================================ */

:root {
  --color-main: #1C6E8C;
  --color-main-dark: #14536A;
  --color-sub: #F2A65A;
  --color-dark: #13303B;
  --color-bg: #FAFAF8;
  --color-bg-alt: #F1F3F2;
  --color-text: #22303A;
  --color-text-light: #5B6B73;
  --color-border: #E2E6E4;
  --color-white: #FFFFFF;
  --color-success-bg: #EAF6EE;
  --color-success-border: #BFE3CB;
  --color-warn-bg: #FFF6E8;
  --color-warn-border: #F4DDAA;
  --color-info-bg: #EAF3F7;
  --color-info-border: #BFDCE7;

  --font-base: "Pretendard", -apple-system, BlinkMacSystemFont, "Malgun Gothic",
    "Apple SD Gothic Neo", sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 3px rgba(19, 48, 59, 0.08);
  --shadow-md: 0 6px 20px rgba(19, 48, 59, 0.08);

  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--color-main); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  color: var(--color-dark);
  line-height: 1.35;
  font-weight: 700;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.4rem); }
h2 { font-size: clamp(1.35rem, 1.15rem + 0.7vw, 1.7rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; color: var(--color-text); }

ul, ol { margin: 0 0 1em; padding-left: 1.3em; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-dark);
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--color-dark);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--color-main), var(--color-main-dark));
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}
.brand-text { white-space: nowrap; }

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.95rem;
}
.main-nav a:hover { color: var(--color-main); text-decoration: none; }
.main-nav .nav-cta {
  background: var(--color-main);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
}
.main-nav .nav-cta:hover { background: var(--color-main-dark); color: #fff; }

.has-dropdown { position: relative; }
.main-nav ul.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  list-style: none;
  padding: 0.5rem;
  min-width: 170px;
  margin-top: 0.5rem;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown { display: block; }
.dropdown li a {
  display: block;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  font-size: 0.9rem;
}
.dropdown li a:hover { background: var(--color-bg-alt); text-decoration: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle-bar {
  width: 22px;
  height: 2px;
  background: var(--color-dark);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-main); color: #fff; }
.btn-primary:hover { background: var(--color-main-dark); color: #fff; }
.btn-outline { border-color: var(--color-main); color: var(--color-main); background: transparent; }
.btn-outline:hover { background: var(--color-main); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.link-arrow { font-weight: 600; color: var(--color-main); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--color-dark) 0%, var(--color-main-dark) 60%, var(--color-main) 100%);
  color: #fff;
  padding: 4.5rem 1.25rem 4rem;
}
.hero-inner { max-width: var(--max-width); margin: 0 auto; max-width: 760px; }
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-sub);
  margin-bottom: 0.9rem;
}
.hero h1 { color: #fff; margin-bottom: 1rem; }
.hero-desc { color: rgba(255,255,255,0.85); font-size: 1.05rem; max-width: 620px; }
.hero-actions { display: flex; gap: 0.9rem; margin-top: 1.6rem; flex-wrap: wrap; }
.hero .btn-outline { border-color: rgba(255,255,255,0.6); color: #fff; }
.hero .btn-outline:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ---------- Section layout ---------- */
.section { padding: 3.5rem 1.25rem; }
.section-alt { background: var(--color-bg-alt); }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.section-inner.narrow { max-width: 760px; }
.section-head { margin-bottom: 2rem; max-width: 640px; }
.section-sub { color: var(--color-text-light); }
.section-foot { margin-top: 2rem; text-align: center; }
.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: start; }

/* ---------- Category grid ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.category-grid-wide { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.category-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: block;
  overflow: hidden;
}
.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.category-card-image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 400 / 260;
  overflow: hidden;
  background: var(--color-bg-alt);
}
.category-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.category-card:hover .category-card-image img { transform: scale(1.05); }
.category-card-body { padding: 1.4rem 1.4rem 1.6rem; }
.category-card-icon {
  position: absolute;
  left: 1rem;
  bottom: -20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #fff;
  color: var(--color-main);
  font-size: 1.2rem;
  box-shadow: var(--shadow-md);
}
.category-card-body h2, .category-card-body h3 { margin-top: 1.1rem; margin-bottom: 0.5rem; }
.category-card-body p { color: var(--color-text-light); font-size: 0.92rem; margin-bottom: 0; }
.category-card-count {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-main);
}

/* ---------- Post grid / card ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
}
.post-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.post-card-category {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-main);
  margin-bottom: 0.6rem;
}
.post-card-title { font-size: 1.1rem; margin-bottom: 0.5rem; }
.post-card-title a { color: var(--color-dark); }
.post-card-subtitle { color: var(--color-text-light); font-size: 0.92rem; margin-bottom: 0.9rem; }
.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--color-text-light);
}
.dot { opacity: 0.6; }

/* ---------- Columns ---------- */
.column-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
}
.column-card {
  background: var(--color-dark);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 1.6rem;
}
.column-card-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--color-sub);
  margin-bottom: 0.6rem;
}
.column-card h2, .column-card h3 { color: #fff; }
.column-card h2 a, .column-card h3 a { color: #fff; }
.column-card-subtitle { color: rgba(255,255,255,0.75); font-size: 0.92rem; }
.column-card .post-card-meta { color: rgba(255,255,255,0.6); }

/* ---------- Principles ---------- */
.principle-list h3 { margin-bottom: 1rem; }
.principle-list ul, .principle-list-full ul { list-style: none; padding: 0; margin: 0; }
.principle-list li, .principle-list-full li {
  display: block;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin-bottom: 0.9rem;
}
.principle-list li strong, .principle-list-full li strong {
  display: block;
  color: var(--color-main-dark);
  margin-bottom: 0.3rem;
}
.principle-list li span, .principle-list-full li span { color: var(--color-text-light); font-size: 0.92rem; }

/* ---------- Owner box ---------- */
.owner-box {
  display: flex;
  gap: 1.5rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  align-items: flex-start;
}
.owner-box-avatar {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-sub), var(--color-main));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
}
.owner-box-avatar-lg { width: 90px; height: 90px; font-size: 2.2rem; }
.owner-role { color: var(--color-text-light); font-weight: 600; margin-bottom: 0.6rem; }
.owner-link { font-weight: 700; color: var(--color-main); border-bottom: 1px dashed var(--color-main); }

/* ---------- Author hub / session panel ---------- */
.author-hero {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}
.author-session-panel {
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  border-radius: var(--radius-md);
  padding: 1.3rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.author-session-panel.is-admin {
  background: var(--color-warn-bg);
  border-color: var(--color-warn-border);
}
.author-session-panel p { margin: 0; font-weight: 600; color: var(--color-dark); }
.author-principles h2 { margin-bottom: 1rem; }
.author-principles ul { list-style: none; padding: 0; }
.author-principles li {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin-bottom: 0.8rem;
}
.author-principles li strong { display: block; color: var(--color-main-dark); margin-bottom: 0.3rem; }
.author-principles li span { color: var(--color-text-light); font-size: 0.92rem; }

/* ---------- CTA ---------- */
.cta-section {
  background: var(--color-sub);
  padding: 3.5rem 1.25rem;
  text-align: center;
}
.cta-inner h2 { color: var(--color-dark); }
.cta-inner p { color: #5a4420; max-width: 520px; margin-left: auto; margin-right: auto; }
.cta-section .btn-primary { background: var(--color-dark); }
.cta-section .btn-primary:hover { background: #0b1f27; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { margin-bottom: 1rem; }
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-light);
}
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: 0.4rem; }
.breadcrumb a { color: var(--color-text-light); }
.breadcrumb [aria-current="page"] { color: var(--color-dark); font-weight: 600; }

/* ---------- Page head ---------- */
.page-head { max-width: var(--max-width); margin: 0 auto; padding: 2.5rem 1.25rem 0; }
.page-eyebrow { color: var(--color-main); font-weight: 700; font-size: 0.85rem; margin-bottom: 0.4rem; }
.page-lead { color: var(--color-text-light); max-width: 680px; font-size: 1.02rem; }

/* ---------- Post detail ---------- */
.post-subtitle { font-size: 1.1rem; color: var(--color-text-light); margin-bottom: 1.2rem; }
.post-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}
.author-chip { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.author-chip-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-main); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
}
.post-dates { font-size: 0.85rem; color: var(--color-text-light); display: flex; gap: 0.4rem; }

.post-body-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 1rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  align-items: start;
}
.post-toc {
  position: sticky;
  top: 90px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.3rem;
}
.post-toc h2 { font-size: 0.95rem; margin-bottom: 0.7rem; }
.post-toc ol { list-style: decimal; padding-left: 1.1em; margin: 0; }
.post-toc li { margin-bottom: 0.5rem; font-size: 0.9rem; }
.post-content { max-width: 720px; }
.post-content-single { max-width: 720px; margin: 0 auto; }

.post-body h2 { margin-top: 2rem; }
.post-body h3 { margin-top: 1.4rem; }
.post-body ul, .post-body ol { margin-bottom: 1.2em; }
.post-body li { margin-bottom: 0.4em; }

.info-box {
  border-radius: var(--radius-md);
  padding: 1.3rem 1.5rem;
  margin: 1.8rem 0;
  border: 1px solid;
}
.info-box h2 { font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.8rem; }
.info-box ul { margin-bottom: 0; }
.summary-box { background: var(--color-success-bg); border-color: var(--color-success-border); }
.summary-box h2 { color: #1F6B3C; }
.mistake-box { background: var(--color-warn-bg); border-color: var(--color-warn-border); }
.mistake-box h2 { color: #8A5A00; }
.checklist-box { background: var(--color-info-bg); border-color: var(--color-info-border); }
.checklist-box h2 { color: var(--color-main-dark); }
.checklist-box ul { list-style: none; padding-left: 0; }
.checklist-box label { display: flex; align-items: flex-start; gap: 0.6rem; cursor: pointer; }
.checklist-box input[type="checkbox"] { margin-top: 0.25em; }

.post-note {
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-style: italic;
  border-top: 1px dashed var(--color-border);
  padding-top: 1.2rem;
  margin-top: 2rem;
}

.editor-box {
  display: flex;
  gap: 1.2rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  margin-top: 1.5rem;
  align-items: flex-start;
}
.editor-box-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-light); margin-bottom: 0.3rem; }
.editor-box-name { font-weight: 700; margin-bottom: 0.5rem; }
.editor-box p { margin-bottom: 0.4rem; }

.related-section { margin-top: 1rem; }

/* ---------- Column detail ---------- */
.column-body p { font-size: 1.02rem; }

/* ---------- Legal docs / plain ---------- */
.legal-doc h2 { margin-top: 2rem; font-size: 1.15rem; }
.plain-list { list-style: disc; }
.plain-list li { margin-bottom: 0.6em; }

/* ---------- Contact ---------- */
.contact-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.6rem;
}
.contact-card h2 { display: flex; align-items: center; gap: 0.6rem; }
.contact-email-btn { margin: 1rem 0; font-size: 1.05rem; }
.contact-note { font-size: 0.88rem; color: var(--color-text-light); }
.form-disclaimer {
  background: var(--color-warn-bg);
  border: 1px solid var(--color-warn-border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  font-size: 0.88rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}
.contact-form { margin-top: 1.3rem; }
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.9rem; }
.form-row input, .form-row textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
}

/* ---------- Sitemap page ---------- */
.sitemap-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 2.5rem; }
.sitemap-col h2 { font-size: 1.05rem; margin-top: 1.5rem; }
.sitemap-col ul { list-style: none; padding: 0; }
.sitemap-col li { margin-bottom: 0.5rem; font-size: 0.92rem; }

/* ---------- 404 ---------- */
.not-found-code {
  font-size: 5rem;
  font-weight: 900;
  color: var(--color-main);
  margin: 0;
  line-height: 1;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--color-dark); color: rgba(255,255,255,0.85); padding: 3.5rem 1.25rem 1.5rem; }
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 2rem;
}
.footer-brand .brand { color: #fff; margin-bottom: 0.8rem; }
.footer-tagline { color: var(--color-sub); font-weight: 600; margin-bottom: 0.6rem; }
.footer-desc { color: rgba(255,255,255,0.6); font-size: 0.88rem; }
.footer-heading { color: #fff; font-size: 0.95rem; margin-bottom: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.6rem; font-size: 0.9rem; }
.site-footer a { color: rgba(255,255,255,0.75); }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
}
.footer-bottom a { color: rgba(255,255,255,0.8); }

/* ---------- Admin badge (injected via JS when admin session active) ---------- */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-dark);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .post-body-wrap { grid-template-columns: 1fr; }
  .post-toc { position: static; margin-bottom: 1.5rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .sitemap-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.2s ease;
    padding: 1.5rem;
    overflow-y: auto;
  }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; align-items: flex-start; gap: 0.2rem; width: 100%; }
  .main-nav li { width: 100%; }
  .main-nav a { display: block; padding: 0.9rem 0.2rem; width: 100%; border-bottom: 1px solid var(--color-border); }
  .main-nav .nav-cta { text-align: center; margin-top: 0.5rem; }
  .main-nav ul.dropdown { position: static; box-shadow: none; border: none; display: block; margin-top: 0; padding-left: 1rem; }
  .nav-toggle { display: flex; }

  .owner-box { flex-direction: column; }
  .author-hero { flex-direction: column; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero { padding: 3rem 1.25rem; }
}
