/* ==========================================================================
   igan.kr — 경량 커스텀 테마 스타일
   톤: 차분하고 밝게 / 붉은색 미사용 / 중장년·고령 가독성 우선 / 모바일 우선
   ========================================================================== */

:root {
  --bg: #F7F4EC;         /* 크림 배경 */
  --surface: #FFFFFF;
  --text: #2C2C2A;       /* 본문 */
  --text-soft: #5B5B55;
  --point: #5E8C71;      /* 세이지 그린 */
  --point-dark: #4A7159;
  --subpoint: #A8C4AE;
  --warn: #8A6D3B;       /* 주의(붉은색 대신 갈색 계열) */
  --warn-bg: #F3ECDD;
  --line: #E3DFD3;
  --radius: 12px;
  --wrap: 1080px;
  --wrap-narrow: 720px;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;         /* 지시서 3-1: 본문 17px */
  line-height: 1.8;        /* 행간 1.8 */
  color: var(--text);
  background: var(--bg);
  word-break: keep-all;    /* 한글 어절 단위 줄바꿈 */
}

img { max-width: 100%; height: auto; }
a { color: var(--point-dark); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: var(--wrap-narrow); }
.center { text-align: center; }
.is-hidden { display: none !important; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--point);
  color: #fff; padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-block; text-align: center; text-decoration: none;
  font-size: 17px; font-weight: 600; line-height: 1.4;
  padding: 13px 22px; border-radius: var(--radius); cursor: pointer;
  border: 2px solid transparent; transition: background-color .15s ease;
}
.btn-lg { padding: 16px 28px; font-size: 18px; }
.btn-primary { background: var(--point); color: #fff; }
.btn-primary:hover { background: var(--point-dark); }
.btn-outline { background: transparent; color: var(--point-dark); border-color: var(--point); }
.btn-outline:hover { background: rgba(94,140,113,.08); }
.btn-kakao { background: var(--warn); color: #fff; }
.btn-kakao:hover { background: #75592e; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 헤더 ---------- */
.site-header {
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; }
.brand-link { text-decoration: none; display: inline-block; }
.brand-text { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
/* 브랜드 스택: igan.kr / 한글명 / 영문명(작게). 모바일 자연 줄바꿈 */
.brand-stack { display: flex; flex-direction: column; line-height: 1.15; padding: 6px 0; }
.brand-domain { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.brand-ko { font-size: 14px; font-weight: 700; color: var(--point-dark); margin-top: 2px; }
.brand-en { font-size: 10.5px; font-weight: 500; color: var(--text-soft); letter-spacing: .01em; }

.nav-toggle {
  display: inline-flex; flex-direction: column; gap: 5px; justify-content: center;
  width: 44px; height: 44px; background: none; border: none; cursor: pointer;
}
.nav-toggle-bar { display: block; width: 24px; height: 2px; background: var(--text); margin: 0 auto; }

.site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface);
  border-bottom: 1px solid var(--line); display: none; }
.site-nav.is-open { display: block; }
.primary-menu { list-style: none; margin: 0; padding: 6px 0; }
.primary-menu li { border-top: 1px solid var(--line); }
.primary-menu li:first-child { border-top: none; }
.primary-menu a { display: block; padding: 14px 20px; text-decoration: none; color: var(--text); font-weight: 600; }
.primary-menu a:hover { background: rgba(94,140,113,.06); }
.menu-kakao a { color: var(--warn); }

/* ---------- 공통 섹션 ---------- */
.site-main { min-height: 50vh; }
.section { padding: 40px 0; }
.section-tinted { background: #EFEBDF; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 24px; font-weight: 800; margin: 0 0 16px; letter-spacing: -.02em; }
.section-title.center { text-align: center; margin-bottom: 28px; }
.section-more { text-decoration: none; color: var(--point-dark); font-weight: 600; font-size: 15px; }
.empty-state { color: var(--text-soft); padding: 24px 0; }

/* ---------- 히어로 ---------- */
.hero { background: linear-gradient(180deg, #EFEBDF 0%, var(--bg) 100%); padding: 56px 0; }
.hero-eyebrow { font-size: 15px; font-weight: 700; color: var(--point-dark); margin: 0 0 10px; letter-spacing: -.01em; }
.hero-title { font-size: 28px; font-weight: 800; line-height: 1.4; margin: 0 0 12px; letter-spacing: -.02em; }
.hero-sub { font-size: 18px; color: var(--text-soft); margin: 0 0 28px; }
.hero-cta { display: flex; flex-direction: column; gap: 12px; }

/* ---------- eGFR 진입 카드 ---------- */
.egfr-card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 24px; text-decoration: none; color: inherit;
}
.egfr-card:hover { border-color: var(--point); }
.egfr-card-title { font-size: 22px; font-weight: 800; margin: 0 0 8px; }
.egfr-card-desc { margin: 0 0 12px; color: var(--text-soft); }
.egfr-card-link { color: var(--point-dark); font-weight: 700; }

/* ---------- 최근 소식 목록 ---------- */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { border-top: 1px solid var(--line); }
.post-item:first-child { border-top: none; }
.post-item a { display: flex; flex-direction: column; gap: 4px; padding: 16px 0; text-decoration: none; color: inherit; }
.post-item-title { font-size: 18px; font-weight: 600; }
.post-item-excerpt { color: var(--text-soft); font-size: 15px; }
.post-item-date { color: var(--text-soft); font-size: 14px; }

/* ---------- 우리가 바라는 세 가지 ---------- */
.voice-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.voice-card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; text-decoration: none; color: inherit;
}
.voice-card:hover { border-color: var(--point); }
.voice-num { display: inline-block; color: var(--point); font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.voice-card-title { font-size: 20px; font-weight: 800; margin: 0 0 8px; }
.voice-card-desc { margin: 0; color: var(--text-soft); }

/* ---------- 카톡 배너 ---------- */
.kakao-banner { background: var(--point); color: #fff; }
.kakao-banner-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 32px 20px; text-align: center; }
.kakao-banner-text { margin: 0; font-size: 18px; font-weight: 600; }
.kakao-banner .btn-kakao { background: #fff; color: var(--point-dark); }
.kakao-banner .btn-kakao:hover { background: #f0f0f0; }

/* ---------- 푸터 ---------- */
.site-footer { background: #2C2C2A; color: #D8D4C8; padding: 32px 0; }
.footer-menu { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-menu a { color: #D8D4C8; text-decoration: none; font-size: 15px; }
.footer-menu a:hover { color: #fff; }
.footer-disclaimer { font-size: 14px; color: #A9A497; margin: 0 0 8px; }
.footer-org { font-size: 14px; font-weight: 700; color: #D8D4C8; margin: 0 0 4px; }
.footer-org-en { font-weight: 500; color: #A9A497; }
.footer-copy { font-size: 13px; color: #8A867B; margin: 0; }

/* ---------- 단일 글 / 페이지 ---------- */
.single-cat { display: inline-block; color: var(--point-dark); font-weight: 700; font-size: 14px; text-decoration: none; margin-bottom: 6px; }
.single-title, .page-title { font-size: 26px; font-weight: 800; line-height: 1.4; margin: 0 0 10px; letter-spacing: -.02em; }
.single-meta { color: var(--text-soft); font-size: 15px; margin: 0 0 20px; }
.single-thumb { margin: 0 0 20px; }
.single-content, .page-content { font-size: 17px; }
.single-content h2, .page-content h2 { font-size: 22px; margin: 32px 0 12px; }
.single-content h3, .page-content h3 { font-size: 19px; margin: 24px 0 10px; }
.single-content p, .page-content p { margin: 0 0 18px; }
.single-content img, .page-content img { border-radius: 8px; }
.single-content blockquote, .page-content blockquote {
  border-left: 4px solid var(--subpoint); background: #fff; margin: 20px 0; padding: 12px 18px; border-radius: 0 8px 8px 0;
}
/* 본문 표: 테두리 없이 행 구분선, 모바일 가로 스크롤(.table-scroll 래퍼) */
.table-scroll { overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch; }
.single-content table, .page-content table {
  width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 16px; min-width: 320px;
}
.table-scroll table { margin: 0; }
.single-content th, .single-content td,
.page-content th, .page-content td {
  text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.6;
}
.single-content thead th, .page-content thead th {
  background: #EFEBDF; font-weight: 700; border-bottom: 2px solid var(--subpoint); white-space: nowrap;
}
/* 연락처 이메일 */
.contact-email { font-size: 18px; font-weight: 700; margin: 12px 0 24px; }
.contact-email-link { color: var(--point-dark); text-decoration: none; border-bottom: 1px solid var(--subpoint); }
.contact-email-link:hover { color: var(--point); }
.single-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; font-size: 15px; }
.single-nav a { color: var(--point-dark); text-decoration: none; }

/* ---------- 아카이브 ---------- */
.archive-head { margin-bottom: 20px; }
.archive-title { font-size: 24px; font-weight: 800; margin: 0; }
.archive-desc { color: var(--text-soft); margin-top: 8px; }

/* ---------- 페이지네이션 ---------- */
.pagination { margin-top: 28px; display: flex; justify-content: center; }
.pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-block; min-width: 40px; text-align: center; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--text);
}
.pagination .page-numbers.current { background: var(--point); color: #fff; border-color: var(--point); }

/* ---------- 검색 폼 ---------- */
.search-form { display: flex; gap: 8px; margin-top: 16px; }
.search-field { flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; }

/* ==========================================================================
   eGFR 계산기
   ========================================================================== */
.egfr .page-title { margin-bottom: 16px; }

.notice { border-radius: var(--radius); padding: 16px 18px; margin: 0 0 20px; font-size: 15px; }
.notice p { margin: 0 0 6px; }
.notice p:last-child { margin-bottom: 0; }
.notice-top { background: #fff; border: 1px solid var(--line); color: var(--text-soft); }
.notice-warn { background: var(--warn-bg); border: 1px solid #E0D2B4; color: var(--warn); }

.egfr-step-title { font-size: 22px; font-weight: 800; margin: 0 0 16px; }
.egfr-hint { color: var(--text-soft); margin: 0 0 16px; }

.choose-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.choose-grid.single-mode { grid-template-columns: 1fr; }
.choose-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 22px;
  font-family: inherit;
}
.choose-card:hover { border-color: var(--point); }
.choose-card-title { font-size: 19px; font-weight: 800; color: var(--text); }
.choose-card-desc { font-size: 15px; color: var(--text-soft); }

.upload-box {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 120px; border: 2px dashed var(--subpoint); border-radius: var(--radius);
  background: #fff; cursor: pointer; padding: 20px; color: var(--text-soft);
}
.upload-box:hover { border-color: var(--point); }
.upload-preview { margin: 16px 0; }
.upload-preview img { border-radius: 8px; border: 1px solid var(--line); max-height: 320px; }

.egfr-actions { display: flex; gap: 10px; margin-top: 20px; }
.egfr-actions .btn { flex: 1; }

.egfr-loading { display: flex; align-items: center; gap: 12px; margin-top: 18px; color: var(--text-soft); }
.spinner {
  width: 22px; height: 22px; border: 3px solid var(--subpoint); border-top-color: var(--point);
  border-radius: 50%; animation: spin 0.9s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.egfr-error { color: var(--warn); font-weight: 600; margin-top: 14px; }

/* 폼 */
.egfr-form .field { margin-bottom: 18px; }
.egfr-form label, .field-label { display: block; font-weight: 600; margin-bottom: 6px; }
.egfr-form input[type="number"] {
  width: 100%; padding: 13px 14px; font-size: 17px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; font-family: inherit;
}
.egfr-form input:focus { outline: 2px solid var(--point); border-color: var(--point); }
.req { color: var(--warn); }
.radio-row { display: flex; gap: 20px; }
.radio-row label { font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.radio-row input { width: 20px; height: 20px; }
.field-error { color: var(--warn); font-size: 14px; margin: 6px 0 0; font-weight: 600; }
.field-sep { border: none; border-top: 1px solid var(--line); margin: 24px 0 16px; }
.field-optional-head { font-weight: 700; color: var(--text-soft); margin: 0 0 12px; }

/* 결과 */
.result-headline {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; text-align: center; margin-bottom: 24px;
}
.result-label { display: block; color: var(--text-soft); font-size: 15px; }
.result-value { display: block; font-size: 40px; font-weight: 800; color: var(--point-dark); margin: 6px 0; }
.result-value small { font-size: 15px; font-weight: 600; color: var(--text-soft); }
.result-stage { display: inline-block; font-size: 18px; font-weight: 700; }

/* KDIGO 격자 */
.kdigo-wrap { margin-bottom: 24px; }
.kdigo-title { font-size: 18px; font-weight: 800; margin: 0 0 12px; }
.kdigo-grid-scroll { overflow-x: auto; }
.kdigo-grid { border-collapse: collapse; width: 100%; min-width: 380px; text-align: center; }
.kdigo-grid th, .kdigo-grid td { border: 1px solid #fff; padding: 10px 6px; font-size: 13px; }
.kdigo-grid thead th { background: #EFEBDF; font-weight: 700; }
.kdigo-corner { background: transparent !important; }
.kdigo-rowhead { background: #EFEBDF; font-weight: 700; white-space: nowrap; }
.kdigo-grid td small, .kdigo-grid th small { font-weight: 400; color: var(--text-soft); font-size: 11px; }
.kdigo-word { display: block; font-weight: 600; color: var(--text); }
.kdigo-dark .kdigo-word { color: #fff; }
.kdigo-current { outline: 3px solid var(--point-dark); outline-offset: -3px; position: relative; }
.kdigo-here { display: block; font-size: 11px; font-weight: 800; margin-top: 2px; }
.kdigo-dark .kdigo-here { color: #fff; }
.kdigo-row-dim { opacity: .45; }
.kdigo-legend-note { color: var(--warn); font-size: 14px; margin: 10px 0 0; }
.kdigo-foot { color: var(--text-soft); font-size: 14px; margin: 12px 0 0; }

.result-explain {
  background: var(--warn-bg); border-left: 4px solid var(--subpoint);
  border-radius: 0 8px 8px 0; padding: 16px 18px; margin-bottom: 20px; font-size: 16px;
}
.result-common { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-align: center; }
.result-common p { margin: 0 0 12px; }

/* ==========================================================================
   반응형 — 태블릿 이상
   ========================================================================== */
@media (min-width: 720px) {
  body { font-size: 17px; }
  .hero { padding: 72px 0; }
  .hero-title { font-size: 36px; }
  .hero-cta { flex-direction: row; }
  .hero-cta .btn { min-width: 200px; }
  .voice-grid { grid-template-columns: repeat(3, 1fr); }
  .choose-grid { grid-template-columns: 1fr 1fr; }
  .section-title { font-size: 26px; }
  .single-title, .page-title { font-size: 30px; }
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav { position: static; display: block; border: none; background: transparent; }
  .primary-menu { display: flex; gap: 4px; padding: 0; }
  .primary-menu li { border: none; }
  .primary-menu a { padding: 10px 14px; font-size: 15px; border-radius: 8px; }
  .kakao-banner-inner { flex-direction: row; justify-content: center; }
}
