/* ================================================================
   site.css — 모든 페이지가 공유하는 공통 스타일
   (헤더 내비게이션 · 푸터 · 콘텐츠 글 · 테마 변수)
   순수 CSS, 빌드 도구 없음. 계산기(index.html)의 파스텔 테마와 통일.
   ================================================================ */

:root {
  --sky: #a8d8ff;
  --pink: #ffc6e0;
  --sky-deep: #7cc0ff;
  --pink-deep: #ff9ecb;
  /* 다크 테마(기본) */
  --bg: #0e1220;
  --bg-glow: #161d31;
  --panel: #1a2030;
  --panel-border: #2a3346;
  --field: #141a2b;
  --field-border: #2a3346;
  --text-main: #eaf2ff;
  --text-sub: #7d8aa5;
  --header-bg: rgba(14, 18, 32, 0.75);
}

/* 라이트(화이트) 테마 */
:root[data-theme="light"] {
  --bg: #eef4ff;
  --bg-glow: #ffffff;
  --panel: #ffffff;
  --panel-border: #e2e8f5;
  --field: #f2f7ff;
  --field-border: #dbe4f5;
  --text-main: #2a3550;
  --text-sub: #9aa7c2;
  --header-bg: rgba(255, 255, 255, 0.78);
}

/* ---------- 상단 헤더 / 내비게이션 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text-main);
  background: var(--field);
}

/* 해/달 테마 토글 (계산기와 동일한 파스텔 원형) */
.theme-toggle {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  border-radius: 50%;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--sky), var(--pink));
  box-shadow: 0 4px 0 rgba(124, 192, 255, 0.35),
              0 6px 12px rgba(124, 192, 255, 0.2);
  transition: filter 0.15s ease;
}
.theme-toggle:hover { filter: brightness(1.05); }

/* ---------- 콘텐츠(글) 공통 ---------- */
.page-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--text-sub); }

.article h1 {
  font-size: 30px;
  line-height: 1.3;
  color: var(--text-main);
  margin-bottom: 10px;
}
.article .meta {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 28px;
}
.article h2 {
  font-size: 21px;
  color: var(--text-main);
  margin: 34px 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--sky-deep);
}
.article h3 {
  font-size: 17px;
  color: var(--text-main);
  margin: 22px 0 8px;
}
.article p,
.article li {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-main);
}
.article p { margin-bottom: 16px; }
.article ul,
.article ol { margin: 0 0 16px 22px; }
.article li { margin-bottom: 8px; }
.article strong { color: var(--sky-deep); }
.article a { color: var(--sky-deep); }

/* 예시·공식 강조 박스 */
.callout {
  background: var(--field);
  border: 1px solid var(--field-border);
  border-left: 4px solid var(--pink-deep);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 0 20px;
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--text-main);
}
.callout .tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--pink-deep);
  margin-bottom: 4px;
}
.formula {
  display: block;
  background: var(--field);
  border: 1px solid var(--field-border);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 0 0 20px;
  font-size: 17px;
  text-align: center;
  color: var(--text-main);
  overflow-x: auto;
}

/* 표 */
.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 15px;
}
.article th,
.article td {
  border: 1px solid var(--panel-border);
  padding: 10px 12px;
  text-align: left;
  color: var(--text-main);
}
.article th { background: var(--field); font-weight: 700; }

/* ---------- 카드 그리드 (가이드 목록 / 홈 추천) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0 8px;
}
.guide-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 20px;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.guide-card:hover {
  transform: translateY(-3px);
  border-color: var(--sky-deep);
}
.guide-card .ico { font-size: 26px; }
.guide-card h3 {
  font-size: 17px;
  color: var(--text-main);
  margin: 10px 0 6px;
}
.guide-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-sub);
  margin: 0;
}

/* ---------- 푸터 ---------- */
.site-footer {
  border-top: 1px solid var(--panel-border);
  padding: 30px 20px 40px;
  text-align: center;
  color: var(--text-sub);
  font-size: 13px;
}
.site-footer .foot-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.site-footer a {
  color: var(--text-sub);
  text-decoration: none;
  font-weight: 600;
}
.site-footer a:hover { color: var(--text-main); }

/* ---------- 페이지 뼈대(콘텐츠 페이지 body) ---------- */
.doc-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1200px 800px at 50% 0%, var(--bg-glow), var(--bg));
  font-family: "Segoe UI", "Apple SD Gothic Neo", sans-serif;
  transition: background 0.4s ease;
}
.doc-body main { flex: 1 0 auto; }

/* ---------- 우측 하단 고정 제휴 문의 버튼(FAB) ---------- */
.contact-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  height: 54px;
  border-radius: 27px; /* 알약(pill) 모양 */
  text-decoration: none;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--sky-deep), var(--pink-deep));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4),
              0 4px 0 rgba(124, 192, 255, 0.3);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 0.15s ease, box-shadow 0.15s ease;
}
.contact-fab:hover { filter: brightness(1.05); transform: translateY(-2px); }
.contact-fab:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

/* 모바일 */
@media (max-width: 560px) {
  .brand { font-size: 16px; }
  .site-nav a { padding: 7px 9px; font-size: 13px; }
  .article h1 { font-size: 25px; }
}
@media (max-width: 420px) {
  .contact-fab {
    right: 14px;
    bottom: 14px;
    height: 48px;
    font-size: 15px;
    padding: 0 18px;
  }
}
