/* ==========================================================
   태양과 바다 — 전용 티스토리 스킨
   콘셉트: "사례로 읽는 생활 법률 매거진"
   색: 코발트 블루(바다) + 선샤인 옐로(태양) + 모래빛 바탕
   메뉴 배치: 가운데 정렬 제호 + 그 아래 전폭 가로 메뉴 띠 / 3열 카드 그리드 / 넓은 3단 푸터
   ========================================================== */
:root {
  --sea: #1d5fd1;
  --sea-deep: #143f8c;
  --sea-soft: #e8f0fd;
  --sun: #ffc93c;
  --sun-soft: #fff4d6;
  --sand: #fbf8f2;
  --ink: #18202e;
  --text: #333b49;
  --muted: #6c7484;
  --line: #e6e1d6;
  --font: "SUIT", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  background: var(--sand);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px; line-height: 1.85;
  word-break: keep-all; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; padding: 8px 12px; background: #fff; }

/* ---------- 제호 ---------- */
.masthead { background: #fff; }
.masthead-top {
  position: relative;
  max-width: 1080px; margin: 0 auto; padding: 46px 20px 30px;
  text-align: center;
}
.masthead-top::before {            /* 수평선 위로 떠오르는 해 */
  content: "";
  display: block; width: 56px; height: 28px; margin: 0 auto 16px;
  border-radius: 56px 56px 0 0;
  background: var(--sun);
  box-shadow: 0 6px 0 -2px var(--sea);
}
.masthead-kicker { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .14em; color: var(--sea); }
.masthead-title { margin: 0; font-size: 40px; font-weight: 900; line-height: 1.25; letter-spacing: -0.03em; }
.masthead-title a { color: var(--ink); text-decoration: none; }
.masthead-desc { margin: 10px 0 0; font-size: 15px; color: var(--muted); }

/* ---------- 가로 메뉴 띠 ---------- */
.ribbon { position: sticky; top: 0; z-index: 30; background: var(--sea); }
.ribbon-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.ribbon-menu ul, .shore-menu ul { list-style: none; margin: 0; padding: 0; }
.ribbon-menu ul { display: flex; flex-wrap: wrap; }
.ribbon-menu li a {
  display: block; padding: 14px 18px;
  color: #fff; font-size: 15px; font-weight: 700; text-decoration: none;
  border-bottom: 3px solid transparent;
}
.ribbon-menu li a:hover { border-bottom-color: var(--sun); }
.ribbon-search { display: flex; gap: 6px; }
.ribbon-search input {
  width: 180px; height: 36px; padding: 0 12px;
  border: 0; border-radius: 18px; background: rgba(255,255,255,.16); color: #fff;
  font: inherit; font-size: 14px;
}
.ribbon-search input::placeholder { color: rgba(255,255,255,.7); }
.ribbon-search button {
  height: 36px; padding: 0 14px; border: 0; border-radius: 18px;
  background: var(--sun); color: var(--ink); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
}

/* ---------- 본문 영역 ---------- */
.content { flex: 1 0 auto; width: 100%; max-width: 1080px; margin: 0 auto; padding: 44px 20px 30px; }

/* 목록 */
.board-title { margin: 0 0 24px; font-size: 24px; font-weight: 900; color: var(--ink); letter-spacing: -0.02em; }
.board-title::after { content: ""; display: block; width: 40px; height: 5px; margin-top: 10px; border-radius: 3px; background: var(--sun); }
.board-count { font-size: 15px; font-weight: 600; color: var(--muted); }
.grid { list-style: none; margin: 0 0 36px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }

.tile { display: flex; }
.tile-link {
  display: flex; flex-direction: column; width: 100%;
  background: #fff; border-radius: 18px; overflow: hidden; text-decoration: none;
  box-shadow: 0 1px 0 var(--line), 0 0 0 1px var(--line);
  transition: transform .18s, box-shadow .18s;
}
.tile-link:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(29,95,209,.14), 0 0 0 1px var(--line); }
.tile-link::before {                 /* 썸네일이 없을 때도 보이는 해·바다 띠 */
  content: ""; display: block; height: 8px;
  background: linear-gradient(90deg, var(--sun) 0 30%, var(--sea) 30% 100%);
}
.tile-thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--sea-soft); }
.tile-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.tile-title { margin: 0 0 8px; font-size: 19px; font-weight: 800; line-height: 1.45; color: var(--ink); }
.tile-link:hover .tile-title { color: var(--sea); }
.tile-summary {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 14px; font-size: 14.5px; line-height: 1.7; color: var(--muted);
}
.tile-date { margin-top: auto; font-size: 13px; color: #9aa1ad; }
.tile-wide { margin-bottom: 18px; }

/* ---------- 글 하나 보기 ---------- */
.story { max-width: 760px; margin: 0 auto 40px; }
.story-head { margin-bottom: 34px; padding-bottom: 26px; text-align: center; border-bottom: 1px solid var(--line); }
.story-kicker { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .14em; color: var(--sea); }
.story-title { margin: 0 0 12px; font-size: 34px; font-weight: 900; line-height: 1.4; color: var(--ink); letter-spacing: -0.03em; }
.story-date { margin: 0; font-size: 14px; color: var(--muted); }

/* 본문 헤딩: 티스토리 에디터 제목1=h2, 제목2=h3, 제목3=h4 */
.article-body h2, .article-body h2[data-ke-size] {
  position: relative;
  margin: 2.4em 0 .9em; padding-top: 18px;
  font-size: 25px !important; font-weight: 900; line-height: 1.45; color: var(--ink);
}
.article-body h2::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: 34px; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--sun) 0 40%, var(--sea) 40% 100%);
}
.article-body h3, .article-body h3[data-ke-size] {
  margin: 1.9em 0 .6em; font-size: 20px !important; font-weight: 800; line-height: 1.5; color: var(--sea-deep);
}
.article-body h4, .article-body h4[data-ke-size] { margin: 1.5em 0 .4em; font-size: 17px !important; font-weight: 800; color: var(--ink); }
.article-body p { margin: 0 0 1.35em; }
.article-body a { color: var(--sea); text-underline-offset: 3px; }
.article-body strong, .article-body b { color: var(--ink); box-shadow: inset 0 -.45em 0 var(--sun-soft); }
.article-body ul, .article-body ol { margin: 0 0 1.4em; padding-left: 1.3em; }
.article-body li { margin-bottom: .4em; }
.article-body li::marker { color: var(--sea); font-weight: 700; }
.article-body blockquote {
  margin: 1.8em 0; padding: 20px 24px;
  border: 0 !important; border-radius: 16px; background: var(--sea-soft);
  font-size: 17px; color: var(--ink);
}
.article-body table { width: 100%; margin: 1.6em 0; border-collapse: collapse; font-size: 15px; }
.article-body th { padding: 12px; background: var(--sea); color: #fff; text-align: left; font-weight: 700; }
.article-body td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
.article-body tr:nth-child(even) td { background: #fff; }

/* 전용 박스 (HTML 모드에서 class 지정)
   case-box  : 이런 일이 있었습니다 (사례)
   key-box   : 이것만 기억하세요
   law-note  : 관련 법령
   source-box : 출처 / disclaimer-box : 면책 */
.case-box, .key-box, .law-note { margin: 1.8em 0; padding: 22px 24px; border-radius: 18px; }
.case-box::before, .key-box::before, .law-note::before {
  display: inline-block; margin-bottom: 10px; padding: 3px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 800;
}
.case-box { background: #fff; border: 2px solid var(--sea-soft); }
.case-box::before { content: "이런 일이 있었습니다"; background: var(--sea); color: #fff; }
.key-box { background: var(--sun-soft); }
.key-box::before { content: "이것만 기억하세요"; background: var(--sun); color: var(--ink); }
.law-note { background: #fff; border-left: 5px solid var(--sea); border-radius: 0 18px 18px 0; font-size: 16px; }
.law-note::before { content: "관련 법령"; background: var(--sea-soft); color: var(--sea-deep); }
.case-box > *:last-child, .key-box > *:last-child, .law-note > *:last-child { margin-bottom: 0; }
.source-box { margin: 2.6em 0 0; padding: 16px 20px; border-radius: 14px; background: #fff; font-size: 14px; color: var(--muted); }
.source-box::before { content: "출처 · 참고 자료"; display: block; margin-bottom: 4px; font-weight: 800; color: var(--ink); }
.disclaimer-box { margin-top: 1em; font-size: 13px; line-height: 1.7; color: var(--muted); }

.story-tags { margin-top: 36px; }
.story-tags a {
  display: inline-block; margin: 0 6px 6px 0; padding: 4px 12px; border-radius: 999px;
  background: #fff; box-shadow: 0 0 0 1px var(--line); font-size: 13.5px; color: var(--muted); text-decoration: none;
}
.story-tags a:hover { color: var(--sea); box-shadow: 0 0 0 1px var(--sea); }
.story-notice { margin: 30px 0 0; padding: 16px 20px; border-radius: 14px; background: #fff; font-size: 13px; line-height: 1.7; color: var(--muted); }

/* ---------- 페이지 이동 ---------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 0 0 20px; font-size: 14px; }
.pager a { display: inline-block; min-width: 38px; padding: 7px 12px; border-radius: 19px; text-align: center; text-decoration: none; }
.pager a:hover { background: #fff; }
.pager .selected { color: var(--sea); font-weight: 800; }
.pager .no-more-prev, .pager .no-more-next { visibility: hidden; }

/* ---------- 넓은 3단 푸터 ---------- */
.shore { flex-shrink: 0; background: var(--ink); color: #aab3c2; font-size: 14px; }
.shore::before { content: ""; display: block; height: 6px; background: linear-gradient(90deg, var(--sun) 0 22%, var(--sea) 22% 100%); }
.shore-inner {
  max-width: 1080px; margin: 0 auto; padding: 40px 20px 20px;
  display: grid; grid-template-columns: 1.4fr 1fr 1.4fr; gap: 36px;
}
.shore-col p { margin: 0 0 8px; line-height: 1.75; }
.shore-title { font-size: 18px; font-weight: 900; color: #fff; }
.shore-label { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--sun); }
.shore-menu li a { display: inline-block; padding: 3px 0; color: #fff; text-decoration: none; }
.shore-menu li a:hover { color: var(--sun); }
.shore-copy { max-width: 1080px; margin: 0 auto; padding: 16px 20px 30px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12.5px; }

/* ---------- 반응형 ---------- */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .masthead-top { padding: 32px 16px 22px; }
  .masthead-title { font-size: 30px; }
  .ribbon-inner { flex-direction: column; align-items: stretch; gap: 0; padding: 0 12px 12px; }
  .ribbon-menu ul { justify-content: center; }
  .ribbon-menu li a { padding: 12px 14px; }
  .ribbon-search input { flex: 1; width: auto; }
  .ribbon { position: static; }
  .content { padding: 30px 16px 20px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .story-title { font-size: 26px; }
  .article-body h2, .article-body h2[data-ke-size] { font-size: 21px !important; }
  .article-body h3, .article-body h3[data-ke-size] { font-size: 18px !important; }
  .article-body table { display: block; overflow-x: auto; white-space: nowrap; }
  .shore-inner { grid-template-columns: 1fr; gap: 20px; padding-top: 30px; }
}