/* 장애와가치 인터넷신문 — 공통 스타일
   원칙: 휴대폰 먼저, 접근성 기본값, 본문 큰 글씨·넓은 줄 간격.
   색: 법인 로고(네이비·틸·코랄)에서 가져왔다.
   - 글자·주 단추는 네이비(대비 충분).
   - 틸·코랄은 큰 요소·장식에만 쓴다(중간 밝기라 작은 글자엔 대비가 모자람). */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

:root {
  /* 브랜드 색 — 법인 공식 로고에서 추출 */
  --navy: #0a3359;         /* 주색: 글자·단추. 흰 배경 대비 약 11:1 */
  --navy-deep: #06243f;    /* 더 짙은 네이비: 바닥글·강조 */
  --teal: #0b9794;         /* 틸: 상징·장식 */
  --teal-deep: #0a6f6c;    /* 글자로 쓸 수 있는 틸(대비 약 4.7:1) */
  --coral: #db613f;        /* 코랄: 포인트·강조선 */
  --coral-deep: #b23e22;   /* 글자로 쓸 수 있는 코랄 */

  /* 바탕·글자 */
  --bg: #fbfaf7;           /* 살짝 따뜻한 흰색 */
  --surface: #ffffff;
  --text: #1c2430;         /* 본문 글자. 대비 약 14:1 */
  --text-soft: #586072;    /* 보조 글자. 대비 약 6:1 */
  --line: #e7e3db;         /* 옅은 경계선 */
  --line-strong: #d4cfc4;
  --card: #f3efe8;         /* 따뜻한 카드 바탕 */
  --teal-tint: #e2f1f0;    /* 아주 옅은 틸 */
  --coral-tint: #fceae4;   /* 아주 옅은 코랄 */

  --focus: #1457d6;
  --maxwidth: 680px;
  --wide: 980px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(14,39,66,.04), 0 6px 20px rgba(14,39,66,.06);
  --shadow-lift: 0 2px 6px rgba(14,39,66,.08), 0 14px 34px rgba(14,39,66,.10);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -60px;
  background: var(--navy-deep); color: #fff;
  padding: 10px 16px; border-radius: 8px; z-index: 100; transition: top .15s;
}
.skip-link:focus { top: 8px; }

.wrap { width: 100%; max-width: var(--maxwidth); margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: var(--wide); }

/* ── 제목 ── */
h1, h2, h3 { line-height: 1.32; font-weight: 800; color: var(--navy-deep); letter-spacing: -.01em; }
h1 { font-size: 1.85rem; margin: 0 0 .4em; }
h2 { font-size: 1.4rem; margin: 1.7em 0 .5em; }
h3 { font-size: 1.15rem; margin: 1.4em 0 .4em; }

a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--navy-deep); }

/* ── 머리말 ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,250,247,.9); backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { max-width: var(--wide); display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .emblem { height: 40px; width: auto; flex: 0 0 auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-size: 1.18rem; font-weight: 800; color: var(--navy-deep); letter-spacing: -.02em; }
.brand-tag { font-size: .68rem; font-weight: 700; letter-spacing: .14em; color: var(--teal-deep); }
.site-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  color: var(--text); text-decoration: none; border-radius: 10px; font-weight: 600;
}
.site-nav a:hover { background: var(--teal-tint); color: var(--navy-deep); }
.site-nav a[aria-current="page"] { color: var(--navy-deep); font-weight: 800; box-shadow: inset 0 -3px 0 var(--coral); border-radius: 0; }

/* ── 단추 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  font-size: 1rem; font-weight: 700; font-family: inherit; letter-spacing: -.01em;
  border: 2px solid var(--navy); border-radius: var(--radius);
  background: var(--navy); color: #fff; cursor: pointer; text-decoration: none;
  transition: transform .08s ease, background .15s, box-shadow .15s;
}
.btn:hover { background: var(--navy-deep); border-color: var(--navy-deep); color: #fff; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface); color: var(--navy); }
.btn-ghost:hover { background: var(--teal-tint); color: var(--navy-deep); border-color: var(--navy); }
.btn-danger { background: var(--coral-deep); border-color: var(--coral-deep); }
.btn-danger:hover { background: #a7412d; border-color: #a7412d; }
.btn-wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── 입력칸 ── */
label { display: block; font-weight: 700; color: var(--navy-deep); margin: 18px 0 6px; }
.hint { font-weight: 400; color: var(--text-soft); font-size: .95rem; margin-top: 2px; }
input[type="text"], input[type="email"], input[type="password"],
input[type="url"], input[type="datetime-local"], input[type="file"], select, textarea {
  width: 100%; padding: 13px 15px;
  font-size: 1.05rem; font-family: inherit; line-height: 1.6;
  border: 2px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus { border-color: var(--teal-deep); outline-color: var(--teal-deep); }
textarea { min-height: 320px; resize: vertical; }

/* ── 안내 띠 ── */
.notice {
  background: var(--teal-tint); border: 1px solid #c6e3e1;
  padding: 13px 16px; border-radius: var(--radius-sm); margin: 16px 0;
}
.notice-danger { background: var(--coral-tint); border-color: #f4cfc5; color: #7a2a18; }

/* ── 상태 딱지 ── */
.tag {
  display: inline-block; font-size: .82rem; font-weight: 700;
  padding: 3px 11px; border-radius: 999px; background: var(--card); color: var(--text-soft);
  vertical-align: middle;
}
.tag-pending   { background: #fdefd8; color: #86560a; }
.tag-rejected  { background: var(--coral-tint); color: #9c3b26; }
.tag-scheduled { background: #e3eefb; color: #1a4a8a; }
.tag-published { background: var(--teal-tint); color: var(--teal-deep); }
.tag-draft, .tag-unpublished { background: #ecebe7; color: #5a6270; }

/* ── 글 목록 ── */
.article-list { list-style: none; padding: 0; margin: 0; }
.article-list li { border-bottom: 1px solid var(--line); }
.article-list a { display: block; padding: 20px 0; text-decoration: none; color: var(--navy-deep); }
.article-list a:hover { color: var(--navy); }
.article-list a:hover .title { text-decoration: underline; }
.article-list .title { font-size: 1.15rem; font-weight: 700; }
.article-list .meta { color: var(--text-soft); font-size: .92rem; margin-top: 5px; font-weight: 400; }

/* 눈에 띄는 작은 꼬리표 */
.kicker {
  display: inline-block; font-size: .82rem; font-weight: 800;
  letter-spacing: .04em; color: var(--teal-deep); text-transform: none;
}
.kicker::before { content: ''; display: inline-block; width: 18px; height: 2px; background: var(--coral); vertical-align: middle; margin-right: 8px; transform: translateY(-3px); }

/* ── 바닥 언론사 표기 ── */
.site-footer {
  margin-top: 64px; background: var(--navy-deep); color: #c7d3e0;
  padding: 36px 0 60px; font-size: .9rem;
}
.site-footer .wrap { max-width: var(--wide); }
.site-footer .foot-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.site-footer .foot-brand .emblem { height: 36px; width: auto; }
.site-footer .foot-brand strong { color: #fff; font-size: 1.05rem; }
.site-footer p { margin: 4px 0; }
.site-footer a { color: #9fd6d2; }
.site-footer a:hover { color: #fff; }

/* ── 읽기 화면 ── */
.article-head { margin: 28px 0 8px; }
.article-head h1 { font-size: 2rem; }
.article-meta { color: var(--text-soft); font-size: .95rem; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.article-meta .dot { color: var(--line-strong); }
.article-cover { width: 100%; height: auto; border-radius: var(--radius); margin: 22px 0 6px; display: block; box-shadow: var(--shadow); }
.article-cover-caption { color: var(--text-soft); font-size: .9rem; margin: 0 0 10px; }
.article-body { font-size: 1.12rem; }
.article-body p { margin: 1.15em 0; }
.article-body h2 { margin-top: 1.8em; }
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body li { margin: .4em 0; }
.article-body strong { color: var(--navy-deep); }
.article-body blockquote {
  margin: 1.3em 0; padding: 6px 20px; border-left: 4px solid var(--teal); color: var(--text-soft);
  background: var(--teal-tint); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.source-link { margin: 28px 0; }
.author-box {
  margin: 40px 0; padding: 22px; background: var(--card); border-radius: var(--radius);
  display: flex; gap: 14px; align-items: flex-start;
}
.author-box .avatar {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem;
}
.author-box h2 { margin: 0 0 4px; font-size: 1.05rem; }
.author-box p { margin: 0; color: var(--text-soft); }
.next-reads { margin: 40px 0; }
.support-box {
  margin: 36px 0; padding: 28px 22px; text-align: center;
  background: linear-gradient(135deg, var(--teal-tint), var(--coral-tint));
  border-radius: var(--radius); border: 1px solid #e3e6df;
}
.support-box p { margin: 0 0 14px; font-weight: 600; color: var(--navy-deep); }

/* 읽는 진행 표시줄 */
.read-progress {
  position: fixed; top: 0; left: 0; height: 4px; width: 0;
  background: linear-gradient(90deg, var(--teal), var(--coral)); z-index: 90;
}

/* ── 음성 듣기 막대 ── */
.listen-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -2px 20px rgba(14,39,66,.10);
  padding-bottom: env(safe-area-inset-bottom);
}
.listen-inner { max-width: var(--maxwidth); margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 11px 20px; }
.listen-play {
  min-height: 48px; padding: 0 24px; font-size: 1rem; font-weight: 700; font-family: inherit;
  border: 2px solid var(--navy); border-radius: var(--radius);
  background: var(--navy); color: #fff; cursor: pointer;
}
.listen-play:hover { background: var(--navy-deep); }
.listen-speed select { min-height: 48px; width: auto; }
body.has-listen-bar { padding-bottom: 96px; }

/* ── 홈 ── */
.hero {
  background: linear-gradient(180deg, var(--teal-tint) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line); margin-bottom: 8px;
}
.hero .wrap { padding-top: 40px; padding-bottom: 36px; }
.hero h1 { font-size: 2.1rem; max-width: 14em; }
.hero p { color: var(--text-soft); font-size: 1.08rem; margin: 10px 0 0; max-width: 32em; }

.lead { display: block; text-decoration: none; color: var(--navy-deep); margin: 8px 0; }
.lead .lead-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: box-shadow .18s, transform .18s;
}
.lead:hover .lead-card { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.lead img { width: 100%; height: auto; display: block; aspect-ratio: 16/9; object-fit: cover; }
.lead .lead-body { padding: 22px; }
.lead h2 { font-size: 1.6rem; margin: 10px 0 8px; }
.lead:hover h2 { color: var(--navy); }
.lead .meta { color: var(--text-soft); font-size: .95rem; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 44px 0 4px; }
.section-title { margin: 0; font-size: 1.25rem; color: var(--navy-deep); }

/* 공유 단추 줄 */
.share-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0; align-items: center; }

/* 미리보기·검토 칸(dialog) */
dialog { box-shadow: var(--shadow-lift); }
dialog::backdrop { background: rgba(14,39,66,.4); }

/* 관리 화면 카드 */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin: 16px 0; box-shadow: var(--shadow);
}
.member-row { padding: 18px 0; border-bottom: 1px solid var(--line); }

/* 넓은 화면 */
@media (min-width: 768px) {
  body { font-size: 18px; }
  h1 { font-size: 2.1rem; }
  .hero h1 { font-size: 2.6rem; }
  .article-head h1 { font-size: 2.4rem; }
}

/* 작은 휴대폰: 머리말이 빠듯하지 않게 */
@media (max-width: 480px) {
  .site-header .wrap { min-height: 58px; }
  .brand .emblem { height: 34px; width: auto; }
  .brand-name { font-size: 1.05rem; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 0 9px; font-size: .95rem; }
  .hero h1 { font-size: 1.7rem; }
}

/* ============================================================
   관리 화면 전용 (집필진·편집장·관리자)
   독자 화면과 같은 브랜드·토큰을 쓰되, 일 처리에 편한 레이아웃.
   ============================================================ */

/* 관리 상단 띠 — 역할별 메뉴 + 로그인한 사람 + 로그아웃 */
.admin-bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.admin-bar .wrap { max-width: var(--wide); display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; min-height: 56px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.admin-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.admin-tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 15px; border-radius: 10px; font-weight: 700; color: var(--text-soft); text-decoration: none; }
.admin-tabs a:hover { background: var(--teal-tint); color: var(--navy-deep); }
.admin-tabs a[aria-current="page"] { color: var(--navy-deep); background: var(--teal-tint); box-shadow: inset 0 -3px 0 var(--coral); }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user .who { font-size: .92rem; color: var(--text-soft); }
.admin-user .who strong { color: var(--navy-deep); }

/* 작은 단추 */
.btn-sm { min-height: 40px; padding: 0 14px; font-size: .92rem; border-radius: 10px; }

/* 페이지 머리(제목 + 한 줄 설명 + 오른쪽 동작) */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 28px 0 10px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--text-soft); margin: 4px 0 0; font-size: 1rem; }

/* 숫자 요약 카드 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 18px 0 8px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: block; transition: box-shadow .16s, transform .16s; }
a.stat-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.stat-card .num { font-size: 2.1rem; font-weight: 800; color: var(--navy-deep); line-height: 1; }
.stat-card .lbl { color: var(--text-soft); font-weight: 600; margin-top: 7px; font-size: .95rem; }
.stat-card.alert { border-color: #f0d08a; background: #fff8ea; }
.stat-card.alert .num { color: #9a6700; }

/* 카드형 목록 (관리용 — 제목·상태·동작을 한 카드에) */
.card-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 12px; }
.card-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card-item.flag { border-left: 4px solid var(--coral); }
.ci-title { font-weight: 700; color: var(--navy-deep); font-size: 1.08rem; }
.ci-title a { color: inherit; text-decoration: none; }
.ci-title a:hover { text-decoration: underline; }
.ci-meta { color: var(--text-soft); font-size: .92rem; margin-top: 5px; display: flex; flex-wrap: wrap; gap: 5px 10px; align-items: center; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }

/* 세그먼트형 필터 (알약 모양) */
.seg { display: inline-flex; background: var(--card); border-radius: 999px; padding: 4px; gap: 3px; flex-wrap: wrap; }
.seg button { min-height: 42px; padding: 0 17px; border: none; background: transparent; font-weight: 700; font-family: inherit; color: var(--text-soft); border-radius: 999px; cursor: pointer; font-size: .96rem; }
.seg button:hover { color: var(--navy-deep); }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.seg .cnt { font-size: .8rem; opacity: .85; margin-left: 5px; }

/* 아래에서 올라오는 작업 칸(dialog) */
dialog.sheet { border: none; border-radius: 18px; padding: 0; width: 94%; max-width: 560px; box-shadow: var(--shadow-lift); }
dialog.sheet.wide { max-width: 720px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 1.2rem; }
.sheet-body { padding: 20px 22px; max-height: 70vh; overflow: auto; }
.sheet-foot { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--bg); border-radius: 0 0 18px 18px; }
.sheet-foot .grow { flex: 1 1 auto; }

/* 빈 상태 안내 */
.empty { text-align: center; color: var(--text-soft); padding: 40px 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty .big { font-size: 1.05rem; color: var(--navy-deep); font-weight: 700; margin-bottom: 6px; }

@media (min-width: 768px) {
  .sheet-body { padding: 24px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
