/* 째깍악어 돌봄 가이드 — blog.tictoccroc.com
 *
 * 토큰 출처: tictoccroc-parent-new-web/node_modules/@dotss/ui/themes/tictoccroc/parentLight
 * 그 테마는 모바일 앱 UI 용이라 행간이 좁다(본문 18/26 = 1.44). 긴 글 읽기에는
 * 답답해서 크기는 토큰 그대로 두고 행간만 늘렸다. 벗어난 곳은 행간뿐이다.
 *
 * 데스크톱에서 폰 폭 컬럼으로 가두는 앱 프레임은 재현하지 않는다. 평범한 반응형 문서다.
 */

@font-face {
  font-family: 'Pretendard';
  font-weight: 400 700;
  font-display: swap;
  src: url('https://static.tictoccroc.co.kr/parent/fonts/PretendardVariable.woff2')
       format('woff2-variations');
}

:root {
  /* 옐로우는 흰 배경 대비가 1.55:1 이라 글자색으로 쓸 수 없다. 면·선·밑줄 전용. */
  --c-brand: #FFC800;            /* yellow70 */
  --c-brand-bg: #FFFBE6;         /* yellow10 */

  --c-title: #19191A;            /* grey100  17.6:1 */
  --c-body: #313135;             /* grey90   12.9:1 */
  --c-meta: #62626A;             /* grey70    6.04:1 — grey60은 4.19:1 이라 안 쓴다 */
  --c-line: #E5E5E6;             /* grey20 */
  --c-surface-alt: #F2F2F3;      /* grey10 */
  --c-page: #F7F7F8;             /* background.primary */
  --c-card-alt: #FAFAFC;         /* background.secondary */

  --shadow-1: 0 2px 10px rgba(0, 0, 0, 0.08);  /* elevation1 */
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.08);  /* elevation2 */

  /* 카드 816 − 좌우 패딩 48×2 = 본문 폭 720px. 한국어 약 42자/줄로 가독 최적 구간. */
  --measure: 816px;
  --pad-x: 48px;
  --radius: 16px;

  --font: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Helvetica Neue',
    'Apple SD Gothic Neo', 'Malgun Gothic', 맑은 고딕, 나눔고딕, 'Nanum Gothic',
    'Noto Sans KR', 'Noto Sans CJK KR', arial, 돋움, Dotum, Tahoma, Geneva, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

/* 글이 한 건뿐인 목록 페이지는 본문이 뷰포트를 못 채운다. 푸터가 화면 중간에 뜨고
   그 아래가 빈 회색으로 남아 페이지가 잘린 것처럼 보여서, 푸터를 바닥에 붙인다. */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-page);
  color: var(--c-body);
  font-family: var(--font);
  font-size: 18px;
  line-height: 32px;
  letter-spacing: -0.36px;
  /* 한국어는 단어 중간에서 끊으면 읽기가 크게 나빠진다 */
  word-break: keep-all;
}

a:focus-visible { outline: 2px solid var(--c-title); outline-offset: 2px; }

/* 스킵 링크. 평소엔 화면 밖, 포커스되면 헤더 위로 올라온다.
   display:none 이나 visibility:hidden 은 포커스 자체를 못 받아 쓸 수 없다. */
.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--c-title);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 8px; }

/* 스킵 링크가 포커스를 실제로 옮기려면 대상에 tabindex="-1" 이 있어야 한다.
   다만 본문 컨테이너 전체에 포커스 링을 두르면 노이즈라 여기서만 끈다.
   조작 가능한 요소가 아니므로 가시 포커스 요구 대상이 아니다. */
#main:focus { outline: none; }

/* ── 사이트 헤더 (Task 2에서 마크업 추가) ─────────────────── */

/* 브랜드 옐로우는 글자색으로는 못 쓰지만 면으로는 쓸 수 있다 — 이 밴드 위 검정
   글자는 11.6:1 이다. 브랜드를 상단 64px 안에서 끝내고 읽는 면은 건드리지 않는다. */
.site-header { background: var(--c-brand); }

.site-header__inner {
  max-width: var(--measure);
  margin: 0 auto;
  height: 64px;
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.site-brand__bi { display: block; width: auto; }

/* 워드마크와 보조 라벨 사이 구분은 가운뎃점 대신 세로선으로 낸다.
   옐로우 위에서는 점보다 선이 또렷하고, 워드마크의 각진 형태와도 맞는다. */
.site-brand__sub {
  position: relative;
  padding-left: 13px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.32px;
  color: var(--c-title);
  white-space: nowrap;
}
.site-brand__sub::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 16px;
  background: rgba(0, 0, 0, 0.28);
}

.site-header__cta {
  padding: 9px 16px;
  border-radius: 999px;
  background: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.28px;
  color: var(--c-title);
  text-decoration: none;
  white-space: nowrap;
}
.site-header__cta:hover { background: var(--c-title); color: #FFFFFF; }

/* ── 글 카드 ─────────────────────────────────────────── */

/* 768~815px 구간(예: 아이패드 세로 768px)에서는 카드가 뷰포트 가장자리에 붙어
   box-shadow 가 잘린다. 최소 여백을 확보해 그림자가 보이게 한다. */
article {
  max-width: min(var(--measure), 100% - 40px);
  margin: 32px auto;
  padding: 48px var(--pad-x) 56px;
  background: #FFFFFF;
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

article > header {
  padding-bottom: 28px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--c-line);
}

article > header h1 {
  margin: 0 0 12px;
  font-size: 36px;
  line-height: 48px;
  font-weight: 700;
  letter-spacing: -0.72px;
  color: var(--c-title);
}

.target-question {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  letter-spacing: -0.32px;
  color: var(--c-meta);
}

/* AI 인용을 노리는 문단이라 시각적 무게를 준다 */
.summary {
  margin: 0 0 20px;
  padding: 20px 24px;
  background: var(--c-brand-bg);
  border-left: 3px solid var(--c-brand);
  border-radius: 0 12px 12px 0;
  font-size: 18px;
  line-height: 32px;
  font-weight: 500;
  letter-spacing: -0.36px;
  color: var(--c-title);
}

.post-dates {
  margin: 0;
  font-size: 13px;
  line-height: 20px;
  letter-spacing: -0.26px;
  color: var(--c-meta);
}
/* 게시일·수정일 사이 구분자. DOM을 건드리지 않기 위해 CSS로 넣는다. */
.post-dates time + time::before { content: " · "; color: var(--c-meta); }

/* ── 본문 ───────────────────────────────────────────── */

.content {
  font-size: 18px;
  line-height: 32px;
  letter-spacing: -0.36px;
  color: var(--c-body);
  /* marked 의 GFM 자동링크가 만드는 긴 URL 이 끊김 없이 카드를 밀어내지 않도록 */
  overflow-wrap: break-word;
}

.content > *:first-child { margin-top: 0; }
.content p { margin: 0 0 20px; }

.content h2 {
  margin: 48px 0 16px;
  font-size: 24px; line-height: 36px; font-weight: 700; letter-spacing: -0.48px;
  color: var(--c-title);
}
.content h3 {
  margin: 32px 0 12px;
  font-size: 20px; line-height: 30px; font-weight: 700; letter-spacing: -0.4px;
  color: var(--c-title);
}
.content h4 {
  margin: 24px 0 8px;
  font-size: 18px; line-height: 26px; font-weight: 700; letter-spacing: -0.36px;
  color: var(--c-title);
}

/* 배포될 원고 2건에 인라인 링크가 30개 있다. 가장 자주 보이는 요소다.
   옐로우는 글자색으로 못 쓰므로 글자는 grey100, 브랜드색은 밑줄로만 낸다. */
.content a,
article > footer a,
.site-footer a {
  color: var(--c-title);
  text-decoration: underline;
  text-decoration-color: var(--c-brand);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.content a:hover,
article > footer a:hover,
.site-footer a:hover { background: var(--c-brand-bg); }

.content ul, .content ol { margin: 0 0 20px; padding-left: 22px; }
.content li { margin-bottom: 8px; }
.content ul li::marker { color: var(--c-brand); }

.content blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--c-brand-bg);
  border-left: 3px solid var(--c-brand);
  border-radius: 0 8px 8px 0;
}
.content blockquote > *:last-child { margin-bottom: 0; }

.content hr { margin: 40px 0; border: 0; border-top: 1px solid var(--c-line); }

.content img { max-width: 100%; height: auto; border-radius: 12px; }

.content code {
  padding: 2px 6px;
  background: var(--c-surface-alt);
  border-radius: 6px;
  font-size: 15px;
}
.content pre {
  padding: 16px 20px;
  background: var(--c-surface-alt);
  border-radius: 8px;
  overflow-x: auto;
}
.content pre code { padding: 0; background: none; }

/* 표: 배포될 원고 2건에 표가 5개 있다 (당일 3 · 아픈아이 2) */
.content table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 24px;
}
.content th, .content td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--c-line);
}
.content thead th {
  background: var(--c-surface-alt);
  font-weight: 700;
  color: var(--c-title);
  border-top: 0;
}

/* ── FAQ ────────────────────────────────────────────── */

.faq { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--c-line); }
.faq h2 {
  margin: 0 0 20px;
  font-size: 24px; line-height: 36px; font-weight: 700; letter-spacing: -0.48px;
  color: var(--c-title);
}
.faq-item {
  margin-bottom: 12px;
  padding: 20px 24px;
  background: var(--c-card-alt);
  border-radius: 12px;
}
.faq-item h3 {
  margin: 0 0 8px;
  font-size: 18px; line-height: 26px; font-weight: 700; letter-spacing: -0.36px;
  color: var(--c-title);
}
.faq-item p { margin: 0; font-size: 16px; line-height: 26px; letter-spacing: -0.32px; }

/* ── 출처 ───────────────────────────────────────────── */

article > footer { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--c-line); }
article > footer h2 {
  margin: 0 0 16px;
  font-size: 20px; line-height: 30px; font-weight: 700; letter-spacing: -0.4px;
  color: var(--c-title);
}
article > footer ul { margin: 0; padding: 0; list-style: none; }
article > footer li { margin-bottom: 10px; font-size: 15px; line-height: 24px; letter-spacing: -0.3px; }
article > footer small { font-size: 13px; letter-spacing: -0.26px; color: var(--c-meta); }

/* ── 사이트 푸터 (Task 2에서 마크업 추가) ─────────────────── */

/* margin-top: auto — body 가 flex column 이라 이게 푸터를 바닥으로 민다 */
.site-footer { margin-top: auto; background: #FFFFFF; border-top: 1px solid var(--c-line); }
.site-footer__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 36px var(--pad-x) 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.site-footer__inner img { display: block; }
.site-footer p {
  margin: 0;
  font-size: 14px; line-height: 20px; letter-spacing: -0.28px;
  color: var(--c-body);
}
.site-footer__copy { font-size: 13px; letter-spacing: -0.26px; color: var(--c-meta); }

/* ── 목록 페이지 (Task 4에서 마크업 추가) ─────────────────── */

.home { max-width: var(--measure); margin: 32px auto; padding: 0 var(--pad-x); }
.home h1 {
  margin: 0 0 12px;
  font-size: 36px; line-height: 48px; font-weight: 700; letter-spacing: -0.72px;
  color: var(--c-title);
}
.home__lead {
  margin: 0 0 32px;
  font-size: 18px; line-height: 32px; letter-spacing: -0.36px;
  color: var(--c-meta);
}

.post-list { margin: 0; padding: 0; list-style: none; }
.post-card { margin-bottom: 16px; }
.post-card > a {
  display: block;
  padding: 28px 32px;
  background: #FFFFFF;
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  text-decoration: none;
}
.post-card > a:hover { box-shadow: var(--shadow-2); }
.post-card h2 {
  margin: 0 0 8px;
  font-size: 24px; line-height: 36px; font-weight: 700; letter-spacing: -0.48px;
  color: var(--c-title);
}
.post-card p {
  margin: 0 0 12px;
  font-size: 16px; line-height: 24px; letter-spacing: -0.32px;
  color: var(--c-body);
}
.post-card time { font-size: 13px; line-height: 20px; letter-spacing: -0.26px; color: var(--c-meta); }

/* ── 모바일 ─────────────────────────────────────────── */

@media (max-width: 767px) {
  :root { --pad-x: 20px; }

  body { font-size: 16px; line-height: 28px; letter-spacing: -0.32px; }

  article {
    /* 데스크톱 규칙의 min(...) 여백을 무효화해 다시 엣지투엣지로 되돌린다 */
    max-width: 100%;
    margin: 0;
    padding: 28px var(--pad-x) 40px;
    border-radius: 0;
    box-shadow: none;
  }

  article > header h1,
  .home h1 { font-size: 24px; line-height: 36px; letter-spacing: -0.48px; }

  .content,
  .summary,
  .home__lead { font-size: 16px; line-height: 28px; letter-spacing: -0.32px; }

  .summary { padding: 16px 20px; }

  .content h2, .faq h2, .post-card h2 { font-size: 20px; line-height: 30px; letter-spacing: -0.4px; }
  .content h3, article > footer h2 { font-size: 18px; line-height: 26px; letter-spacing: -0.36px; }
  .content h4, .faq-item h3 { font-size: 16px; line-height: 24px; letter-spacing: -0.32px; }
  .content h2 { margin-top: 40px; }

  /* 표를 블록으로 바꿔 가로 스크롤. 래퍼 div를 넣으면 본문 DOM이 바뀌므로 CSS로만 해결한다.
     width: max-content 가 없으면 기본 규칙의 width: 100% 가 그대로 적용되어 블록이
     컨테이너 폭에 고정되고, 좁은 표는 스크롤 대신 줄바꿈으로 도망친다. */
  .content table { display: block; overflow-x: auto; width: max-content; max-width: 100%; font-size: 14px; line-height: 22px; }

  .home { margin: 24px auto; }
  .post-card > a { padding: 20px; }
  .site-footer__inner { padding: 24px var(--pad-x) 32px; }
}

@media (max-width: 400px) {
  .site-brand__sub { display: none; }
}
