/* 잠깐만 (waitam.kr) — 브랜드: 골든 옐로우 #FFC512 · 딥 그린 #1E5C3B
   단일 라이트 테마로 고정한다 (브랜드 색이 화면의 주인공이라 다크 반전을 허용하지 않음). */
:root {
  color-scheme: light;

  --yellow: #ffc512;
  --yellow-deep: #e8ae00;
  --green: #1e5c3b;
  --green-dark: #14402a;
  --green-soft: #eaf2ed;
  /* 어두운 사진 위에 얹는 용도의 밝은 브랜드 톤 — 딥그린 원색은 그라데이션에 묻힌다 */
  --green-lit: #4fa97c;
  --yellow-lit: #ffd24e;

  --bg: #faf7f1;
  --surface: #ffffff;
  --surface-2: #f4f1ea;
  --line: #e6e0d4;
  --line-strong: #d5cdbc;

  --ink: #16181a;
  --ink-2: #565f5a;
  --ink-3: #8b938e;

  /* 반응 5종 카테고리 색 — 고정 순서, 절대 순환시키지 않는다.
     (데이터비주얼 참조 팔레트 슬롯 1~5. 흰 표면에서 인접쌍 CVD ΔE 9.1 / 정상시야 19.6 통과.
      일부 슬롯은 3:1 미만이라 막대 아래 직접 라벨을 항상 함께 표기한다.) */
  --s1: #2a78d6; /* 좋아요 */
  --s2: #eb6834; /* 쏠쏠정보 */
  --s3: #1baf7a; /* 흥미진진 */
  --s4: #eda100; /* 분석탁월 */
  --s5: #e87ba4; /* 후속강추 */

  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(20, 40, 30, 0.06), 0 6px 20px rgba(20, 40, 30, 0.07);
  --shadow-lift: 0 4px 10px rgba(20, 40, 30, 0.1), 0 18px 40px rgba(20, 40, 30, 0.14);
  --header-h: 60px;
  --tabs-h: 52px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--tabs-h) + 12px); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo",
    "Malgun Gothic", "맑은 고딕", "Noto Sans KR", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

.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;
}

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

.wrap { width: min(100%, 1280px); margin: 0 auto; padding: 0 20px; }

/* ── 헤더 ─────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--green);
  height: var(--header-h);
  display: flex; align-items: center;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--yellow); }
.brand svg { height: 26px; width: auto; display: block; }
.brand .tagline {
  color: rgba(255, 255, 255, 0.72); font-size: 13px; font-weight: 500;
  padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, 0.22);
}
.social { display: flex; align-items: center; gap: 6px; }
.social a {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  color: rgba(255, 255, 255, 0.82); transition: background .15s, color .15s;
}
.social a:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.social svg { width: 18px; height: 18px; fill: currentColor; }

/* ── 카테고리 탭 ──────────────────────────────────────────── */
.tabs {
  position: sticky; top: var(--header-h); z-index: 49;
  background: var(--yellow);
  height: var(--tabs-h);
  box-shadow: 0 1px 0 rgba(20, 60, 40, 0.12);
}
.tabs .wrap { display: flex; align-items: center; gap: 6px; height: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs .wrap::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  padding: 8px 18px; border-radius: 999px;
  font-weight: 700; font-size: 15.5px; letter-spacing: -0.01em;
  color: var(--green-dark);
  transition: background .15s, color .15s;
}
.tab:hover { background: rgba(20, 64, 42, 0.1); }
.tab[aria-current="page"] { background: var(--green); color: var(--yellow); }
.tab .count { font-size: 12.5px; font-weight: 600; opacity: .62; margin-left: 5px; }

/* ── 페이지 머리말 ────────────────────────────────────────── */
main { padding: 26px 0 64px; }
/* 제목 한 줄 + 오른쪽 보조정보(총 건수 / LIVE 상태) */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.page-head .aside { color: var(--ink-2); font-size: 13px; display: flex; align-items: center; gap: 10px; }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #e34948; box-shadow: 0 0 0 0 rgba(227, 73, 72, .55); animation: pulse 2.2s infinite; }
@keyframes pulse {
  70% { box-shadow: 0 0 0 9px rgba(227, 73, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(227, 73, 72, 0); }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.empty {
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
  padding: 56px 24px; text-align: center; color: var(--ink-2);
}

/* ── ① 잠깐만: 카드뉴스 그리드 ────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 20px; }
.news-card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  transition: transform .18s ease, box-shadow .18s ease;
  text-align: left; padding: 0; cursor: pointer; width: 100%; display: block; border-width: 1px;
}
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.news-card .shot { aspect-ratio: 4 / 5; background: var(--surface-2); position: relative; }
.news-card .shot img { width: 100%; height: 100%; object-fit: cover; }
.news-card .meta { padding: 10px 12px 12px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.news-card .meta .press { font-weight: 700; color: var(--green); }
.news-card .meta .dot { color: var(--line-strong); }

/* 카드 PNG가 없는 초기 발행분 — 기사 사진 + 헤드라인으로 같은 톤의 대체 카드를 만든다 */
.fallback-card { width: 100%; height: 100%; position: relative; background: var(--green-dark); overflow: hidden; }
.fallback-card img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.fallback-card .veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,64,42,.15) 0%, rgba(20,64,42,.72) 52%, rgba(10,32,21,.95) 100%); }
.fallback-card .body { position: absolute; inset: auto 0 0 0; padding: 16px 16px 18px; }
.fallback-card .kicker { display: inline-block; background: var(--yellow); color: var(--green-dark); font-weight: 800; font-size: 11.5px; padding: 3px 9px; border-radius: 5px; margin-bottom: 9px; }
.fallback-card .head {
  color: #fff; font-weight: 800; font-size: clamp(15px, 1.35vw, 19px); line-height: 1.32; letter-spacing: -0.025em;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}
.fallback-card.no-photo img { display: none; }

/* ── ② 쇼츠 ───────────────────────────────────────────────── */
.shorts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(206px, 1fr)); gap: 20px; }
.short-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.short-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.short-card .frame { position: relative; aspect-ratio: 9 / 16; background: #000; }
.short-card .frame img { width: 100%; height: 100%; object-fit: cover; }
.short-card .frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.short-card .play {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.short-card .play .veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .35)); }
.short-card .play .btn {
  position: relative; width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255, 197, 18, .95); display: grid; place-items: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .4); transition: transform .16s ease;
}
.short-card .play:hover .btn { transform: scale(1.08); }
.short-card .play .btn svg { width: 22px; height: 22px; fill: var(--green-dark); margin-left: 3px; }
@media (prefers-reduced-motion: reduce) { .short-card .play .btn { transition: none; } }
.short-card .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.78); color: #fff; font-size: 11.5px; font-weight: 700; padding: 2px 6px; border-radius: 5px; letter-spacing: .01em; }
.short-card .body { padding: 11px 12px 13px; }
/* 제목 자리를 항상 2줄로 잡아둔다 — 한 줄짜리 제목 때문에 아래 조회수·버튼이
   카드마다 다른 높이로 올라와 그리드가 들쭉날쭉해지는 것을 막는다 */
.short-card .title {
  font-weight: 700; font-size: 14px; line-height: 1.4; letter-spacing: -0.02em;
  min-height: calc(2 * 1.4em);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.short-card .sub { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.short-card .sub .dot { color: var(--line-strong); }
.short-card .links { margin-top: 9px; display: flex; gap: 8px; flex-wrap: wrap; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--green-soft); color: var(--green); border: 1px solid transparent;
  transition: background .14s, border-color .14s;
}
.pill:hover { background: #dcebe2; }
.pill.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.pill.ghost:hover { border-color: var(--green); color: var(--green); }

/* ── ③ 실시간 ─────────────────────────────────────────────── */
/* 제목 오른쪽에 붙는 좁은 상태 박스 — 내용만큼만 차지한다 */
.live-bar {
  display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 15px; box-shadow: var(--shadow);
}
.live-bar .state { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 12.5px; color: var(--green); letter-spacing: .02em; }
.live-bar .note { color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }
.live-bar .note b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
/* 상태 텍스트는 SSE로 통째로 갈아끼우므로 래퍼로 감싸되, 자식이 live-bar의 flex에 그대로 참여하게 한다 */
.live-bar [data-live-status] { display: contents; }

.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }

.live-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .18s;
}
.live-card:hover { box-shadow: var(--shadow-lift); }
.live-card.rank-1 { border-color: var(--yellow); box-shadow: 0 0 0 2px rgba(255, 197, 18, .35), var(--shadow); }

/* ── 사진 (4:3) — 위에 순위 · 댓글수 · 성별비율을 얹는다 ── */
.live-card .shot { position: relative; aspect-ratio: 4 / 3; background: var(--green-dark); overflow: hidden; }
.live-card .photo { position: absolute; inset: 0; display: block; }
.live-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.live-card .photo .no-photo {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: var(--green-soft); color: var(--green); font-weight: 800; font-size: 15px; opacity: .5;
}
/* 위아래만 어둡게 — 사진 가운데는 가리지 않으면서 얹은 글자가 읽힌다.
   헤드라인이 사진 위에 올라오므로 아래쪽은 더 넓고 진하게 깐다 */
.live-card .photo .shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 26, 17, .58) 0%, rgba(8, 26, 17, .14) 20%, rgba(8, 26, 17, 0) 34%),
    linear-gradient(0deg, rgba(8, 26, 17, .92) 0%, rgba(8, 26, 17, .78) 26%, rgba(8, 26, 17, .42) 48%, rgba(8, 26, 17, 0) 72%);
}
.live-card .corner { position: absolute; top: 9px; display: flex; align-items: center; gap: 5px; }
/* 순위 배지와 댓글수는 글자 밑선을 맞춰 한 줄로 읽히게 한다 */
.live-card .corner.tl { left: 9px; align-items: baseline; gap: 9px; }
.live-card .corner.tr { right: 11px; }
/* 연령대 칩 — 원래 쓰던 연한 초록 알약 그대로. 사진 위에 얹히므로 그림자만 더한다 */
.age-chip {
  font-size: 11.5px; font-weight: 700; color: var(--green); background: var(--green-soft);
  padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
}

/* 헤드라인 + 성별막대를 사진 아래쪽에 붙여둔다.
   제목이 두 줄이 되면 위로 밀려 올라가고 막대 위치는 그대로다. */
.live-card .caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 12px 11px; display: flex; flex-direction: column; gap: 9px;
}

.rank-badge {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .94); color: var(--green-dark); font-weight: 800; font-size: 15px;
  font-variant-numeric: tabular-nums; box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.rank-1 .rank-badge { background: var(--yellow); }
.rank-2 .rank-badge, .rank-3 .rank-badge { background: var(--green); color: var(--yellow); }
.live-card .cmt {
  color: #fff; font-size: 25px; font-weight: 800; letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums; text-shadow: 0 2px 10px rgba(0, 0, 0, .55);
  line-height: 1;
}

.gender-strip { display: flex; align-items: center; gap: 8px; }
.gender-strip .g-lbl {
  flex: 0 0 auto; /* 막대가 늘어나도 라벨이 쭈그러들거나 잘리지 않게 */
  font-size: 11.5px; color: rgba(255, 255, 255, .88); white-space: nowrap;
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}
.gender-strip .g-lbl b { color: #fff; font-weight: 800; }
.gender-strip .gbar {
  flex: 1; display: flex; height: 8px; border-radius: 5px; overflow: hidden; gap: 2px;
  background: rgba(255, 255, 255, .28);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .5);
}
.gender-strip .gbar span { display: block; }
/* 브랜드 두 색을 사진 위에서 읽히도록 한 단계 밝힌 톤 (남 그린 / 여 옐로우).
   딥그린 원색은 사진 아래쪽 어두운 그라데이션에 묻혀 막대가 사라져 보인다. */
.gender-strip .gbar .m { background: var(--green-lit); }
.gender-strip .gbar .f { background: var(--yellow-lit); }
.gender-strip .gbar span:first-child { border-radius: 4px 0 0 4px; }
.gender-strip .gbar span:last-child { border-radius: 0 4px 4px 0; }

/* 사진 위 헤드라인 — 카드에서 가장 큰 글자 */
.live-card .headline {
  color: #fff; font-weight: 800; font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.3; letter-spacing: -0.035em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .55), 0 1px 3px rgba(0, 0, 0, .4);
}
.live-card .headline:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── 사진 아래: 반응 한 줄 → 출처 한 줄 ── */
.live-card .body { padding: 11px 14px 13px; }
.live-card .byline {
  margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line);
  font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.live-card .byline .press { font-weight: 700; color: var(--green); }
.live-card .byline .dot { color: var(--line-strong); }
.live-card .sec { background: var(--surface-2); border-radius: 5px; padding: 1px 7px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }

/* 반응 5종 — 막대 없이 "이름 숫자"만 한 줄로. 가장 많이 눌린 항목만 굵게 */
.rx-line {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  font-size: 12.5px; color: var(--ink-3);
}
.rx-it { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rx-it b { color: var(--ink-2); font-weight: 700; }
.rx-it.lead { color: var(--green); }
.rx-it.lead b { color: var(--green); font-weight: 800; }
.rx-line.none { display: block; color: var(--ink-3); font-size: 11.5px; }

/* ── 카드뉴스 상세 오버레이 ───────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(12, 30, 21, .62); backdrop-filter: blur(3px);
  padding: 24px; overflow-y: auto;
}
.overlay[open], .overlay.on { display: block; }
.sheet {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lift);
  width: min(100%, 960px); margin: 0 auto; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}
.sheet .visual { background: var(--surface-2); }
.sheet .visual img { width: 100%; height: auto; }
.sheet .detail { padding: 26px 28px 28px; min-width: 0; }
.sheet h2 { margin: 10px 0 0; font-size: 21px; line-height: 1.35; font-weight: 800; letter-spacing: -0.03em; }
.sheet .byline { margin-top: 10px; font-size: 13px; color: var(--ink-2); display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.sheet .byline .press { font-weight: 700; color: var(--green); }
.sheet .summary { margin-top: 16px; font-size: 14.5px; line-height: 1.75; color: #2c3230; white-space: pre-wrap; }
.sheet .actions { margin-top: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.sheet .kicker { display: inline-block; background: var(--yellow); color: var(--green-dark); font-weight: 800; font-size: 11.5px; padding: 3px 9px; border-radius: 5px; }
.sheet-close {
  position: absolute; top: 14px; right: 16px; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); border: 0; cursor: pointer; font-size: 20px; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 3px 12px rgba(0, 0, 0, .22); color: var(--ink);
}
.overlay .holder { position: relative; width: min(100%, 960px); margin: 0 auto; }

/* ── 푸터 ─────────────────────────────────────────────────── */
.site-footer { background: var(--green-dark); color: rgba(255, 255, 255, .74); padding: 30px 0 40px; font-size: 13px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; }
.site-footer .brandline { display: flex; align-items: center; gap: 10px; color: var(--yellow); font-weight: 700; }
.site-footer .brandline svg { height: 18px; width: auto; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .links { display: flex; gap: 14px; flex-wrap: wrap; }

/* ── 반응형 ───────────────────────────────────────────────── */
@media (max-width: 820px) {
  .sheet { grid-template-columns: 1fr; }
  .sheet .detail { padding: 20px 20px 24px; }
  .brand .tagline { display: none; }
  .overlay { padding: 12px; }
}
@media (max-width: 620px) {
  .wrap { padding: 0 14px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .shorts-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .live-grid { grid-template-columns: 1fr; }
  .tab { padding: 7px 14px; font-size: 14.5px; }
  .page-head h1 { font-size: 19px; }
  main { padding: 18px 0 48px; }
}
