/*
Theme Name: 전북 디지털새싹 캠프
Theme URI: https://filemoa.com/digital-saessak/
Description: 디지털새싹 C형 전북 컨소시엄 홍보 블로그용 GeneratePress 자식 테마. 색·형태는 클라이언트 공식 배너에서 추출한 값을 따른다 (docs/design-direction.md).
Author: 원광대학교 · 서울교육대학교 · ㈜잇플 컨소시엄
Template: generatepress
Version: 2.0.0
Text Domain: saessak
*/

/* ══ 토큰 — 클라이언트 배너 픽셀 실측값 ══════════════ */
:root {
  --sky:       #C0E0F8;   /* 배너 바탕 45% */
  --sky-pale:  #E4F2FC;   /* 페이지 바탕 */
  --card:      #FFFFFF;
  --hill:      #90C8B0;   /* 언덕 */
  --cream:     #F8F0D8;
  --orange:    #E08828;   /* 포인트 — 배지·CTA 에만. 이 위의 글자는 흰색이 아니라 --ink (4.64:1) */
  --orange-dk: #9A5710;   /* 링크·hover 배경용. 흰 배경 5.61:1 / --sky-pale 4.92:1 */
  --ink:       #333333;
  --ink-2:     #5C5C5C;   /* 흰 배경 대비 6.4:1 */
  --line:      #DCDCDC;

  --display: 'Cafe24Ssurround', 'Pretendard', sans-serif;
  --body: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui,
          'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;

  --radius: 20px;
  --measure: 760px;   /* 패딩 제외 680px → 한글 한 줄 40자대 */
}

/* ══ 기본 ═══════════════════════════════════════════ */
body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.85;          /* 한글은 받침 때문에 1.5 면 줄이 붙어 보인다 */
  color: var(--ink);
  background-color: var(--sky-pale);
  word-break: keep-all;       /* 단어 중간에서 끊기지 않게 */
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.4;
}

a { color: var(--orange-dk); }

/* ══ 헤더 ═══════════════════════════════════════════ */
.site-header {
  background-color: var(--card);
  border-bottom: 2px solid var(--ink);
}
.main-title a { font-family: var(--display); }
.site-description {
  font-family: var(--body);
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.main-navigation { background-color: transparent; }
.main-navigation .main-nav ul li a { font-weight: 700; }

/* ══ 히어로 — 배너 모티프(하늘 + 언덕) ═══════════════ */
.saessak-hero {
  position: relative;
  background-color: var(--sky);
  padding: 58px 20px 0;
  text-align: center;
  overflow: hidden;
}
.saessak-hero-inner {
  max-width: 760px;
  margin-inline: auto;
  padding-bottom: 46px;
}
.saessak-eyebrow {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 14px;
}
.saessak-hero h1 {
  font-size: clamp(30px, 6vw, 44px);
  color: var(--ink);
  margin: 0 0 14px;
}
.saessak-lead {
  font-size: 17px;
  color: var(--ink);
  margin: 0 auto 26px;
  max-width: 30em;
}

/* 대상 배지 — 배너가 사업을 이 셋으로 조직한다 */
.saessak-targets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.saessak-targets li {
  background-color: var(--orange);
  color: var(--ink);      /* 흰색은 주황 위에서 2.72:1 — AA 미달. 먹색이 4.64:1 */
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  padding: 11px 20px;
  border-radius: 999px;
}

/* 언덕 곡선 */
.saessak-hill {
  display: block;
  width: 100%;
  height: 52px;
  color: var(--hill);
}
.saessak-hill svg { display: block; width: 100%; height: 100%; }

/* 히어로가 h1 을 맡으므로 홈의 페이지 제목은 숨긴다 (h1 중복 방지).
   .page 를 함께 거는 이유 — 설정에서 홈을 "최신 글"로 바꾸면 body.home 이 글 목록에도 붙어
   모든 글의 제목·날짜가 통째로 사라진다. 히어로는 그때 안 뜨므로 제목만 없어진다. */
.home.page .entry-header { display: none; }

/* ══ 본문 카드 ══════════════════════════════════════ */
.separate-containers .inside-article,
.separate-containers .comments-area,
.separate-containers .page-header,
.separate-containers .paging-navigation,
.separate-containers .inside-page-header {
  background-color: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  max-width: var(--measure);   /* 한 줄 40자대 유지 */
  margin-inline: auto;
  padding: 40px;
}

.entry-content h2 {
  font-size: 26px;
  margin: 46px 0 16px;
}
.entry-content h2:first-child { margin-top: 0; }
.entry-content h3 {
  font-size: 20px;
  margin: 34px 0 10px;
}
.entry-content p { margin: 0 0 1.15em; }

/* ══ 표 — 테두리 대신 행 구분선 ═════════════════════ */
.entry-content .wp-block-table { overflow-x: auto; margin: 22px 0; }
.entry-content .wp-block-table:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}
.entry-content th,
.entry-content td {
  padding: 14px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.7;
}
.entry-content thead th {
  background-color: var(--sky-pale);
  border-bottom: 2px solid var(--ink);
  font-weight: 700;
  font-size: 15px;
}
.entry-content tbody th {
  width: 30%;
  color: var(--ink-2);
  font-weight: 700;
}

/* ══ 각주 · 인용 ════════════════════════════════════ */
.entry-content .note,
.entry-content p.note {
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.75;
}
.entry-content blockquote {
  border-left: 5px solid var(--hill);
  background-color: var(--sky-pale);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin: 22px 0;
  font-size: 16px;
  color: var(--ink-2);
}
.entry-content blockquote.callout-warn {
  border-left-color: var(--orange);
  background-color: #FDF3E6;
}

/* ══ 최근 소식 · 글 목록 카드 ═══════════════════════ */
.saessak-latest { margin-top: 54px; }
.saessak-latest > h2 { font-size: 26px; margin: 0 0 20px; }

.saessak-posts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.saessak-posts li { margin: 0; }

.saessak-posts a {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--card);
  text-decoration: none;
  color: var(--ink);
  transition: transform .16s ease;
}
.saessak-posts a:hover,
.saessak-posts a:focus-visible { transform: translateY(-3px); }
.saessak-posts a:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

/* 사진 영역 — 사진이 없어도 그리드가 들쭉날쭉하지 않게 같은 비율을 유지 */
.saessak-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background-color: var(--sky);
  border-bottom: 2px solid var(--ink);
  overflow: hidden;
}
.saessak-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 현수막처럼 아주 납작한 이미지는 잘라내면 내용이 사라진다. 통째로 보여준다. */
.saessak-thumb.is-wide img {
  object-fit: contain;
  padding: 8px;
}

/* 사진이 없을 때 — 히어로와 같은 언덕 모티프로 자리를 채운다 */
.saessak-thumb-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  color: var(--hill);
}
.saessak-thumb-empty svg {
  display: block;
  width: 100%;
  height: 45%;
}

.saessak-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 12px;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, .92);
  color: var(--ink-2);
}
.saessak-badge.is-target {          /* 대상 유형일 때만 주황 */
  background-color: var(--orange);
  color: var(--ink);
}

.saessak-card-body { padding: 14px 16px 16px; }
.saessak-posts .title {
  display: block;
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.45;
  margin-bottom: 8px;
}
.saessak-posts time {
  display: block;
  font-size: 13.5px;
  color: var(--ink-2);
}

.saessak-more { margin-top: 24px; }
.saessak-more a {
  display: inline-block;
  background-color: var(--orange);
  color: var(--ink);
  border-radius: 999px;
  padding: 13px 26px;
  font-size: 15.5px;
  font-weight: 700;
  text-decoration: none;
}
/* hover 는 배경이 어두워지므로 글자를 흰색으로 뒤집는다 (--orange-dk 위 흰색 5.61:1) */
.saessak-more a:hover,
.saessak-more a:focus-visible {
  background-color: var(--orange-dk);
  color: #fff;
}

/* ══ 글 목록 / 글 상세 ══════════════════════════════ */
.entry-title { font-size: 30px; }
.entry-meta, .entry-meta a { color: var(--ink-2); font-size: 14px; }
.post-image img { border-radius: 14px; }

/* ══ 사이드바 위젯 ══════════════════════════════════ */
.widget-area .widget {
  background-color: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 22px;
}
.widget-area .widget-title { font-family: var(--display); font-size: 17px; }

/* ══ 푸터 ═══════════════════════════════════════════ */
.site-footer { background-color: var(--card); border-top: 2px solid var(--ink); }
.site-info { font-size: 13.5px; color: var(--ink-2); line-height: 1.75; }

/* ══ 반응형 ═════════════════════════════════════════ */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .separate-containers .inside-article { padding: 24px 20px; border-radius: 16px; }
  .saessak-hero { padding-top: 40px; }
  .saessak-targets li { font-size: 14px; padding: 9px 16px; }
  .entry-content h2 { font-size: 22px; }
  .entry-title { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  .saessak-posts a { transition: none; }
  .saessak-posts a:hover, .saessak-posts a:focus-visible { transform: none; }
}
