/*
  public.css 는 프로토타입에서 그대로 옮겨 온 파일이라 손대지 않는다(프로토타입의
  frontend/public/styles.css 와 바이트 단위로 같다 - 이 동일성이 "옮기면서 디자인이
  바뀌지 않았다"는 증거 노릇을 한다). 기획본에 맞추느라 새로 필요해진 규칙만 여기에
  따로 쌓는다. CMS 쪽에서 cms.css 를 두고 cms-categories.css·cms-editor.css 를 따로 둔 것과
  같은 방식이다.

  이 파일에서 쓰는 색 이름(--muted, --navy, --line)은 public.css 최상단의 :root 가
  정의한다. base.html 이 public.css 를 먼저 불러오므로 여기서는 그대로 쓰면 된다.
*/

/* ---------------------------------------------------------------
   카테고리 아카이브 카드의 맨 아랫줄: 날짜 · 작성자 (+ 원문 공개)

   기획본 02 카테고리 페이지의 카드 메타는
     ORIGINAL DATA · 기업 장비 조달 방식 조사 2026 · 렌탈연구소 · 원문 공개
   순서다. 앞의 두 조각(라벨·제목)은 이미 .eyebrow 와 h4 가 그리고 있으므로,
   여기서는 그 뒤에 오는 "작성자"와 "원문 공개"만 담당한다.
   --------------------------------------------------------------- */
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font: 700 10px/1.4 Arial, sans-serif;
}

/* 날짜와 작성자 사이의 가운뎃점. 작성자가 없으면 이 칸 자체가 안 그려지므로
   점만 덩그러니 남는 일이 없다(fragments.html 의 th:if 참고). */
.card-meta .sep {
  color: var(--line);
}

/* 근거 자산(tier=evidence) 글에만 붙는 배지. 오른쪽 끝으로 민다. */
.card-meta .original {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* 카드가 한 줄로 좁아지면 배지를 오른쪽 끝까지 밀 자리가 없다. 줄바꿈을 허용한다. */
@media (max-width: 560px) {
  .card-meta {
    flex-wrap: wrap;
  }

  .card-meta .original {
    margin-left: 0;
  }
}

/* ---------------------------------------------------------------
   기사 상세: 신뢰 정보 줄

   public.css:235 는 이 줄을 repeat(4, 1fr) 로 잡아 두었다. 그런데 우리는
   검수자(기획서 정합 때 더한 것)와 GEO 검증(기획본 04 요구)까지 다섯 칸을
   쓰므로, 4칸 격자에서는 마지막 칸이 혼자 다음 줄로 밀려났다 - 실제로 그렇게
   그려지고 있었다.

   칸 수를 5로 못박는 대신 auto-fit 으로 둔다. 검수자(owner_name)가 비어 있는
   글은 네 칸만 그리는데, 5로 못박으면 그런 글에 빈 칸이 하나 남기 때문이다.

   좁은 화면 규칙을 여기서 다시 적어 주는 이유: 이 파일은 public.css 뒤에
   실리므로, 미디어 쿼리 안에 있든 아니든 나중에 온 이 선언이 이긴다. 다시
   적지 않으면 public.css:287 의 "좁은 화면에서는 한 줄에 하나" 규칙이 무시된다.
   --------------------------------------------------------------- */
.trust-row {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

@media (max-width: 900px) {
  .trust-row {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------
   기사 상세: 눈에 보이는 이동 경로

   프로토타입에는 이 요소가 없어 public.css 에도 규칙이 없다. JSON-LD 의
   BreadcrumbList 와 짝이 맞도록 화면에도 같은 경로를 그린다.
   --------------------------------------------------------------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  color: var(--muted);
  /* public-type.css 가 public.css 의 10px 을 13px 로 올린다 - 내가 쓴 규칙도
     같은 폭으로 맞춘다. 그러지 않으면 이 부분만 작아 보인다. */
  font-size: 13px;
  font-weight: 800;
}

.crumbs a {
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
}

/* 현재 글 제목은 길 수 있다. 한 줄로 잘라 경로가 화면을 밀지 않게 한다. */
.crumbs [aria-current="page"] {
  max-width: 46ch;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------------
   기사 상세: AI 패널 안의 안내 문구

   .chat-notice 는 /chat 화면에서 가로로 꽉 찬 띠로 쓰던 것이라, 패널 안에서는
   좌우 여백과 모서리만 패널에 맞춰 준다.
   --------------------------------------------------------------- */
.detail-assistant .chat-notice {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
}

/* ---------------------------------------------------------------
   가로형 카드 썸네일의 나머지 두 색

   public.css 는 .portrait-card 와 .feature-slide 에는 one~eight 를 주면서
   .thumb 에는 one~six 까지만 준다(:134-139). 프로토타입에서는 .thumb 을 쓰는
   화면에 seven·eight 짜리 글이 놓일 일이 없어 문제가 없었는데, 카테고리 화면을
   기획본대로 가로형 카드(.thumb)로 바꾸면서 그런 글이 실제로 놓이게 됐다 -
   시드의 article-work-life(seven)와 article-contract-terms(eight)가 그렇다.
   그 두 글만 배경 없는 회색 사각형으로 나오던 것을 메운다.

   색은 public.css 의 .portrait-card.seven / .eight 과 같은 값을 쓴다.
   --------------------------------------------------------------- */
.thumb.seven {
  background: linear-gradient(135deg, #15364e, #468b8a);
}

.thumb.eight {
  background: linear-gradient(135deg, #273b68, #6c87aa);
}

/* ---------------------------------------------------------------
   기사 상세: 옆의 AI 질문 패널을 뺀 뒤의 폭

   public.css:184 는 .detail-layout 을 두 칸(본문 / 320px)으로 잡는다. 오른쪽
   칸에 있던 패널을 뺐으므로, 그 자리를 비워 두지 않고 한 칸으로 되돌린다.
   그러지 않으면 본문 오른쪽에 320px 짜리 빈 여백이 남는다.

   max-width 도 함께 줄인다. 1360px 는 본문 1000px + 패널 320px + 여백을
   담으려던 값이라, 패널이 없는 지금은 본문이 화면 왼쪽으로 치우쳐 보인다.
   --------------------------------------------------------------- */
.detail-layout {
  max-width: 1056px;
  grid-template-columns: minmax(0, 1fr);
}

/* ---------------------------------------------------------------
   렌탈 브리핑

   제목과 읽는 시간만 있는 짧은 목록이라, 카드(.pop, .card)를 쓰지 않고 줄로
   그린다. 프로토타입에 대응하는 요소가 없어 새로 만든 유일한 공개 화면 구성이다.
   글꼴 크기와 색은 옆 섹션들과 같은 토큰을 쓴다.
   --------------------------------------------------------------- */
.briefing {
  max-width: 1180px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.briefing > li {
  border-bottom: 1px solid var(--line);
}

.briefing a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 4px;
  text-decoration: none;
}

.briefing a:hover .briefing-title {
  text-decoration: underline;
}

.briefing-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* 읽는 시간은 곁들이는 정보다. 제목보다 약하게 둔다. */
.briefing-time {
  flex: 0 0 auto;
  color: var(--muted);
  font: 800 11px/1 Arial, sans-serif;
  white-space: nowrap;
}

.briefing-go {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 600px) {
  .briefing a {
    flex-wrap: wrap;
    gap: 6px;
  }

  .briefing-title {
    flex: 1 1 100%;
  }
}

/* ---------------------------------------------------------------
   카테고리 배너

   public.css 의 .category-hero 는 그라데이션 띠다. 배너를 정한 카테고리에서는
   그 자리에 그림을 깐다 - 주소는 화면마다 다르므로 인라인 style 로 들어오고
   (category.html 의 같은 자리 주석 참고), 여기서는 그 그림이 띠를 어떻게 채울지만
   정한다.

   .category-hero 자체를 고치지 않고 .has-banner 를 따로 두는 이유: 배너가 없는
   카테고리는 지금까지와 똑같이 보여야 한다.
   --------------------------------------------------------------- */
.category-hero.has-banner {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* public.css 가 그린 장식용 원 두 개는 그라데이션 배경을 전제로 한 것이라,
   사진 위에 겹치면 얼룩처럼 보인다. */
.category-hero.has-banner::before {
  content: none;
}

/* 제목은 그림 위에 놓인다. 그림이 밝으면 흰 글자가 묻히므로 어두운 막을 한 겹
   덮는다 - 막이 없으면 어떤 그림에서는 제목이 아예 읽히지 않는다.
   ::after 를 막으로 쓴다(::before 는 위에서 지웠다). */
.category-hero.has-banner::after {
  position: absolute;
  border: 0;
  border-radius: 0;
  background: rgb(16 22 48 / 45%);
  content: "";
  inset: 0;
  width: auto;
  height: auto;
}


/* ---------------------------------------------------------------
   머리말

   public.css 의 .header 는 `grid-template-columns: 1fr repeat(4, auto)` 다 -
   로고 한 칸 + 카테고리 네 칸으로 칸 수가 못박혀 있다. 프로토타입에 카테고리가
   딱 네 개였기 때문인데, 다섯 번째부터는 격자가 새 줄을 만들어 그 카테고리만
   아래로 떨어진다. 카테고리를 하나 더 만들었을 뿐인데 머리말이 무너지는 것이라,
   운영자가 원인을 짐작하기 어렵다.

   칸 수를 늘려 잡는 것으로는 해결되지 않는다 - 카테고리 수는 운영자가 정하는
   값이고, 몇 개로 잡아 두든 그 수를 넘기는 날이 온다. 그래서 칸을 세지 않는
   방식(flex)으로 바꾼다.

   로고에 margin-right: auto 를 주어 격자의 `1fr` 이 하던 일(나머지 공간을 밀어
   카테고리를 오른쪽으로 붙이기)을 그대로 이어 간다.
   --------------------------------------------------------------- */
@media (min-width: 901px) {
  .header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    /* height 를 고정하면 줄이 늘어날 때 내용이 밖으로 넘친다. 한 줄일 때의
       높이는 min-height 로 지키고, 넘칠 때만 자라게 한다. */
    height: auto;
    min-height: 76px;
    /* 세로 12px(줄 사이) · 가로 28px(항목 사이). public.css 의 gap: 28px 을
       두 줄이 됐을 때도 답답하지 않게 나눈 것이다. */
    gap: 12px 28px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .header .wordmark {
    margin-right: auto;
  }




}

/* 뉴스레터 단추는 카테고리 목록의 마지막 항목처럼 붙는다. 글자가 두 줄로
   쪼개지면 알약 모양이 무너지므로 줄바꿈만 막는다. */
.pill-newsletter {
  white-space: nowrap;
}

/* -------------------------------------------------------------------------
   추천 질문 펼침. 눌린 라디오의 뒤 형제 중 짝이 되는 영역만 보이게 한다.
   JS 없이 "누르면 그 자리에서 펼쳐진다"를 만드는 유일한 방법이라, 라디오는
   .ai-prompts 와 펼침 영역보다 앞에 있어야 한다(~ 는 뒤 형제만 고른다).
   ------------------------------------------------------------------------- */
.ai-prompt-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* public.css:79 의 `.ai-prompts button` 은 타입 선택자라 label 에는 듣지 않는다.
   같은 모양을 여기에 다시 적는다(글자 크기는 public-type.css 가 올린 13px 에 맞춘다). */
.ai-prompts label {
  display: inline-block;
  padding: 8px 11px;
  border: 1px solid #c8dbe6;
  border-radius: 999px;
  background: rgb(255 255 255 / 72%);
  color: #29415f;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

/* 좁은 화면에서 .ai-prompts 는 가로 스크롤이 된다(public.css:324). 단추가 눌려
   좁아지지 않도록 button 과 같은 값을 label 에도 준다. */
@media (max-width: 900px) {
  .ai-prompts label {
    flex: 0 0 auto;
  }
}

.ai-prompt-panel {
  display: none;
}

/* 고른 질문만 펼치고, 그 단추를 눌린 모양으로 바꾼다. 추천 질문 수만큼 필요하다 -
   SuggestedQuestions.QUESTIONS 가 늘어도 견디도록 여섯 개까지 미리 적어 둔다. */
#ai-prompt-1:checked ~ .ai-prompt-1-panel,
#ai-prompt-2:checked ~ .ai-prompt-2-panel,
#ai-prompt-3:checked ~ .ai-prompt-3-panel,
#ai-prompt-4:checked ~ .ai-prompt-4-panel,
#ai-prompt-5:checked ~ .ai-prompt-5-panel,
#ai-prompt-6:checked ~ .ai-prompt-6-panel {
  display: block;
}

#ai-prompt-1:checked ~ .ai-prompts label[for="ai-prompt-1"],
#ai-prompt-2:checked ~ .ai-prompts label[for="ai-prompt-2"],
#ai-prompt-3:checked ~ .ai-prompts label[for="ai-prompt-3"],
#ai-prompt-4:checked ~ .ai-prompts label[for="ai-prompt-4"],
#ai-prompt-5:checked ~ .ai-prompts label[for="ai-prompt-5"],
#ai-prompt-6:checked ~ .ai-prompts label[for="ai-prompt-6"] {
  border-color: #18345f;
  background: #18345f;
  color: #fff;
}

/* 라디오 자체는 보이지 않으므로, 키보드로 옮겼을 때 어느 단추에 있는지를 단추가 대신
   알려줘야 한다. 이것이 없으면 키보드 사용자는 초점을 놓친다. */
#ai-prompt-1:focus-visible ~ .ai-prompts label[for="ai-prompt-1"],
#ai-prompt-2:focus-visible ~ .ai-prompts label[for="ai-prompt-2"],
#ai-prompt-3:focus-visible ~ .ai-prompts label[for="ai-prompt-3"],
#ai-prompt-4:focus-visible ~ .ai-prompts label[for="ai-prompt-4"],
#ai-prompt-5:focus-visible ~ .ai-prompts label[for="ai-prompt-5"],
#ai-prompt-6:focus-visible ~ .ai-prompts label[for="ai-prompt-6"] {
  outline: 2px solid #1f6feb;
  outline-offset: 2px;
}

/* ---------------------------------------------------------------
   글 대표 이미지(CMS 편집 화면의 "대표 이미지", db/19).
   있으면 표지 자리(.feature-art · .thumbnail · .thumb · .article-visual)에 사진을 꽉 채워
   깔고(인라인 background-image), 색 그라데이션·표지 문구·장식 원은 숨긴다.
   없으면 지금처럼 색 배경 + 표지 문구다.
   --------------------------------------------------------------- */
.has-cover {
  background-color: #e9edf3;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.thumb.has-cover::before,
.thumb.has-cover::after {
  display: none;
}

/* 세로형 카드는 카드 전체가 표지라 글자가 사진 위에 얹힌다 - 아래쪽을 어둡게 덮어
   흰 글자가 읽히게 한다. */
.portrait-card.has-cover {
  background: linear-gradient(180deg, rgb(10 20 40 / 10%) 30%, rgb(10 20 40 / 78%)),
              var(--cover-image) center / cover no-repeat;
}

.portrait-card.has-cover::before,
.portrait-card.has-cover::after {
  display: none;
}
