/* idontcommu-3t — 공개 메인 사이트 스타일
 * vanilla CSS only. 모바일 우선, 카드 1열.
 * admin.css 와 분리.
 */

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo",
               "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: #1f2024;
  background: #f7f7f8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }
a:focus-visible {
  outline: 2px solid #6b8afb;
  outline-offset: 2px;
  border-radius: 3px;
}
img { max-width: 100%; display: block; }

/* ===== 페이지 컨테이너 ===== */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* ===== 사이트 헤더 ===== */
.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid #ececef;
}
.site-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  min-height: 56px;
}
.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #1f2024;
  line-height: 1.2;
  min-width: 0;
}
.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.brand-tag {
  display: block;
  font-size: 0.75rem;
  color: #888;
  font-weight: 400;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-link {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: #888;
  text-decoration: none;
  padding: 0.4rem 0.65rem;
  border: 1px solid #e0e1e3;
  border-radius: 999px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.admin-link:hover {
  background: #f4f4f5;
  color: #1f2024;
}

/* ===== 날짜 picker ===== */
.dates {
  background: #fff;
  border-bottom: 1px solid #ececef;
  padding: 0.6rem 0;
  position: sticky;
  top: 56px;
  z-index: 15;
}
.dates-scroll {
  display: flex;
  gap: 0.4rem;
  padding: 0 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.dates-scroll::-webkit-scrollbar { height: 4px; }
.dates-scroll::-webkit-scrollbar-thumb { background: #d8d9dc; border-radius: 2px; }

.date-chip {
  flex-shrink: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  padding: 0.45rem 0.85rem;
  background: #f4f4f5;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #444;
  text-decoration: none;
  min-height: 44px;
  justify-content: center;
  transition: background 0.12s;
}
.date-chip:hover {
  background: #ececef;
}
.date-chip.active {
  background: #1f2024;
  color: #fff;
}
.date-chip.active .date-chip-meta {
  color: #c8cad1;
}
.date-chip-d {
  font-weight: 600;
}
.date-chip-meta {
  font-size: 0.7rem;
  color: #888;
  font-variant-numeric: tabular-nums;
}

/* ===== 본문 ===== */
.main {
  flex: 1;
  padding: 1rem;
  min-width: 0;
}

.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #ececef;
}
.day-h {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.day-h-sub {
  font-size: 0.82rem;
  font-weight: 400;
  color: #888;
  margin-left: 0.4rem;
  font-variant-numeric: tabular-nums;
}
.day-count {
  font-size: 0.82rem;
  color: #666;
  font-variant-numeric: tabular-nums;
}

/* ===== 빈 상태 ===== */
.empty {
  margin: 2rem 0;
  padding: 2.5rem 1.25rem;
  background: #fafafa;
  border: 1px dashed #d8d9dc;
  border-radius: 8px;
  text-align: center;
}
.empty-h {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #444;
}
.empty-sub {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: #888;
}
.empty-sub.muted { font-size: 0.78rem; color: #aaa; word-break: break-word; }

/* ===== 카드 1열 ===== */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.card {
  background: #fff;
  border: 1px solid #ececef;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.9rem 0.45rem;
  font-size: 0.78rem;
  color: #666;
}
.card-rank {
  font-weight: 700;
  color: #6b8afb;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}
.card-source-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.1rem;
  background: #ecf6f0;
  color: #097a3a;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.card-source-num { font-size: 0.85rem; }
.card-source-unit { font-size: 0.7rem; }
.card-source-name {
  color: #444;
  font-weight: 500;
}
.card-time {
  margin-left: auto;
  color: #aaa;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

/* 16:9 thumbnail — 풀폭 */
.card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #ececef;
  overflow: hidden;
  position: relative;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 0.85rem 0.95rem 1rem;
}
.card-title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.005em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.card-title a {
  color: #1f2024;
  text-decoration: none;
}
.card-title a:hover { text-decoration: underline; text-underline-offset: 3px; }

.card-snippet {
  margin: 0.4rem 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #444;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.snippet-toggle {
  display: inline;
  margin-left: 0.2rem;
  background: transparent;
  border: none;
  color: #6b8afb;
  font: inherit;
  font-size: 0.85rem;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.snippet-toggle:hover { color: #4965d8; }

.card-also {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  margin-top: 0.65rem;
  font-size: 0.78rem;
}
.card-also-label {
  color: #888;
  margin-right: 0.1rem;
}
.chip {
  background: #f4f4f5;
  color: #444;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.74rem;
  border: 1px solid transparent;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}
.chip:hover {
  background: #ececef;
  color: #1f2024;
  border-color: #d8d9dc;
}

.card-foot {
  margin-top: 0.85rem;
  display: flex;
  justify-content: flex-end;
}
.card-link {
  font-size: 0.85rem;
  color: #1f5fb0;
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.card-link:hover {
  background: #eef3fb;
  text-decoration: underline;
}

/* ===== 푸터 ===== */
.site-foot {
  padding: 1.5rem 1rem 2rem;
  border-top: 1px solid #ececef;
  font-size: 0.78rem;
  color: #888;
  text-align: center;
}
.foot-line {
  margin: 0 0 0.3rem;
}
.foot-line.muted { color: #aaa; }
.foot-line a {
  color: #888;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.foot-line a:hover { color: #444; }

.muted { color: #aaa; }

/* ===== 데스크탑 (≥720px) — 그대로 1열 유지, 여백만 ===== */
@media (min-width: 720px) {
  .main { padding: 1.5rem 1.5rem; }
  .site-head-inner { padding: 0.85rem 1.5rem; }
  .dates-scroll { padding: 0 1.5rem; }
  .day-h { font-size: 1.3rem; }
  .card-title { font-size: 1.15rem; }
  .card-head { padding: 0.85rem 1.1rem 0.5rem; }
  .card-body { padding: 1rem 1.15rem 1.15rem; }
}

/* ===== 다크 모드 — 시스템 따라감 ===== */
@media (prefers-color-scheme: dark) {
  body { background: #0f1115; color: #e6e7eb; }
  .page { background: #14171c; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04); }
  .site-head { background: rgba(20, 23, 28, 0.96); border-bottom-color: #23262d; }
  .brand-name { color: #e6e7eb; }
  .brand-tag { color: #888; }
  .admin-link { color: #888; border-color: #2c2e33; }
  .admin-link:hover { background: #1f2024; color: #e6e7eb; }
  .dates { background: #14171c; border-bottom-color: #23262d; }
  .date-chip { background: #1f2024; color: #c8cad1; }
  .date-chip:hover { background: #2c2e33; }
  .date-chip.active { background: #e6e7eb; color: #14171c; }
  .date-chip.active .date-chip-meta { color: #555; }
  .day-head { border-bottom-color: #23262d; }
  .day-h { color: #e6e7eb; }
  .day-h-sub, .day-count { color: #888; }
  .empty { background: #1a1d23; border-color: #2c2e33; }
  .empty-h { color: #c8cad1; }
  .card { background: #1a1d23; border-color: #23262d; }
  .card-thumb { background: #23262d; }
  .card-title a { color: #e6e7eb; }
  .card-snippet { color: #b9babf; }
  .card-source-name { color: #c8cad1; }
  .card-source-badge { background: #0f3a23; color: #4ec98a; }
  .chip { background: #23262d; color: #c8cad1; }
  .chip:hover { background: #2c2e33; color: #e6e7eb; border-color: #3a3c43; }
  .card-link { color: #6b8afb; }
  .card-link:hover { background: #1c2440; }
  .site-foot { border-top-color: #23262d; }
}
