/* QPE Engine v2 — Tomainer(2호기) article 디자인
 *
 * 출처: `sites/qspae/design/article.css`(1호기)를 그대로 옮긴 뒤 사용자 지시 4개를 반영했다.
 *   1. CTA 버튼 색 #E85D4E — 팔레트 accent를 이 값으로 통일했다.
 *      제목 바·밑줄 그라데이션의 밝은 톤도 같은 색조(hsl 6°)의 명도 변형만 쓴다.
 *      accent-light hsl(6,77%,70%), accent-soft hsl(6,77%,85%).
 *      1호기 #e8664a와 육안 차이가 거의 없어 두 코랄을 섞으면 오히려 지저분해진다.
 *      제목 바·인용·콜아웃·CTA가 모두 한 색을 쓴다.
 *   2. 본문 글꼴 크기 18px → 20px. 제목·목록·표는 같은 비율로 키우되
 *      H2는 강조가 목적이므로 비율보다 조금 더 키웠다(28 → 32px).
 *   3. CTA 버튼 면적 약 2.5배. 290×54 → 460×86 (2.53배).
 *   4. Pretendard 로딩. 1호기는 `mu-plugins/qspae-minimal-site.php`가 폰트를 넣지만
 *      그 플러그인은 1호기 전용이라 2호기에는 없다. 그래서 이 파일이 직접 불러온다.
 *      1호기와 같은 v1.3.9 고정 버전이다.
 *
 * compiler가 발급하는 semantic class만 스타일한다. 글별 예외를 만들지 않는다.
 */

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.css");

body.qpe-v2-content {
  /* core default와 같은 토큰 이름을 쓴다. 값만 호기별로 다르다. */
  --qpe-ink: #28211d;
  --qpe-body: #4a403a;
  --qpe-muted: #7b6d64;
  --qpe-line: #eee5de;
  --qpe-soft: #fffaf7;
  --qpe-accent: #e85d4e;
  --qpe-accent-strong: #c8483a;
  --qpe-accent-light: #ed8378;
  --qpe-accent-soft: #f6c1bb;

  --qpe-font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --qpe-radius: 16px;
  --qpe-radius-sm: 14px;
  --qpe-shadow-soft: 0 8px 24px rgba(74, 52, 39, .06);
  --qpe-shadow-image: 0 14px 36px rgba(74, 52, 39, .10);

  --qpe-tone-warning: #d9534f;
  --qpe-tone-warning-bg: #fff7f5;
  --qpe-tone-success: #5a9a76;
  --qpe-tone-success-bg: #f7fbf8;
  --qpe-tone-compare: #d99a47;
  --qpe-tone-steps: #6c9e9a;
  --qpe-focus: #2d6cdf;

  font-family: var(--qpe-font);
}

body.qpe-v2-content .entry-content {
  max-width: 860px;
  margin-inline: auto;
  color: var(--qpe-body);
  font-family: var(--qpe-font);
  font-size: 20px;
  line-height: 1.85;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

/* ── 제목 ─────────────────────────────────────────────── */

body.qpe-v2-content .entry-content h2.wp-block-heading {
  position: relative;
  margin: 68px 0 28px;
  padding: 2px 0 16px 20px;
  border-bottom: 1px solid var(--qpe-line);
  color: var(--qpe-ink);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.4;
}

/* 왼쪽 코랄 바 */
body.qpe-v2-content .entry-content h2.wp-block-heading::before {
  content: "";
  position: absolute;
  top: .12em;
  bottom: .52em;
  left: 0;
  width: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--qpe-accent-light), var(--qpe-accent));
}

/* 밑줄 위 짧은 그라데이션 */
body.qpe-v2-content .entry-content h2.wp-block-heading::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 86px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--qpe-accent), var(--qpe-accent-soft));
}

body.qpe-v2-content .entry-content h3.wp-block-heading {
  margin: 44px 0 18px;
  color: var(--qpe-ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.45;
}

body.qpe-v2-content .entry-content h4.wp-block-heading {
  margin: 30px 0 13px;
  color: var(--qpe-body);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
}

/* ── 본문 ─────────────────────────────────────────────── */

body.qpe-v2-content .entry-content p {
  margin: 0 0 26px;
}

body.qpe-v2-content .entry-content strong {
  color: var(--qpe-ink);
  font-weight: 700;
}

body.qpe-v2-content .entry-content .wp-block-list {
  margin: 0 0 30px;
  padding-left: 1.45em;
}

body.qpe-v2-content .entry-content .wp-block-list li {
  color: var(--qpe-body);
  font-size: 20px;
  line-height: 1.85;
}

body.qpe-v2-content .entry-content .wp-block-list li + li {
  margin-top: 11px;
}

body.qpe-v2-content .entry-content code {
  padding: .15em .4em;
  border: 1px solid var(--qpe-line);
  border-radius: 6px;
  background: var(--qpe-soft);
  color: var(--qpe-ink);
  font-size: .92em;
}

/* ── 이미지 ───────────────────────────────────────────── */
/* 둥근 모서리 + 부드러운 그림자. 원본 픽셀은 건드리지 않고 CSS로만 처리한다. */

body.qpe-v2-content .entry-content .wp-block-image {
  margin: 38px auto;
  text-align: center;
}

body.qpe-v2-content .entry-content .wp-block-image img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  border: 1px solid var(--qpe-line);
  border-radius: var(--qpe-radius);
  box-shadow: var(--qpe-shadow-image);
}

body.qpe-v2-content .entry-content .wp-element-caption {
  margin-top: 11px;
  color: var(--qpe-muted);
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
}

/* ── 표 ───────────────────────────────────────────────── */

body.qpe-v2-content .entry-content .wp-block-table {
  margin: 34px 0;
  overflow-x: auto;
  border: 1px solid var(--qpe-line);
  border-radius: var(--qpe-radius-sm);
  background: #fff;
  box-shadow: var(--qpe-shadow-soft);
}

body.qpe-v2-content .entry-content .wp-block-table table {
  width: 100%;
  min-width: 620px;
  margin: 0;
  border-collapse: collapse;
}

body.qpe-v2-content .entry-content .wp-block-table th,
body.qpe-v2-content .entry-content .wp-block-table td {
  padding: 15px 17px;
  border: 1px solid var(--qpe-line);
  color: var(--qpe-body);
  font-size: 18px;
  line-height: 1.65;
  text-align: left;
  vertical-align: top;
}

body.qpe-v2-content .entry-content .wp-block-table th {
  background: var(--qpe-soft);
  color: var(--qpe-ink);
  font-weight: 700;
}

/* ── 인용 ─────────────────────────────────────────────── */

body.qpe-v2-content .entry-content blockquote {
  margin: 34px 0;
  padding: 22px 26px;
  border: 1px solid #f1dcd3;
  border-left: 5px solid var(--qpe-accent);
  border-radius: var(--qpe-radius);
  background: var(--qpe-soft);
  box-shadow: var(--qpe-shadow-soft);
}

body.qpe-v2-content .entry-content blockquote > :last-child {
  margin-bottom: 0;
}

body.qpe-v2-content .entry-content .wp-block-separator {
  max-width: 100%;
  margin: 50px 0;
  border-color: var(--qpe-line);
}

/* ── 콜아웃 ───────────────────────────────────────────── */

body.qpe-v2-content .entry-content .qpe-callout {
  margin: 34px 0;
  padding: 26px;
  border: 1px solid var(--qpe-line);
  border-radius: var(--qpe-radius);
  background: var(--qpe-soft);
  box-shadow: var(--qpe-shadow-soft);
}

body.qpe-v2-content .entry-content .qpe-callout > :last-child {
  margin-bottom: 0;
}

body.qpe-v2-content .entry-content .qpe-callout-info    { border-left: 5px solid var(--qpe-accent); }
body.qpe-v2-content .entry-content .qpe-callout-warning { border-left: 5px solid var(--qpe-tone-warning); background: var(--qpe-tone-warning-bg); }
body.qpe-v2-content .entry-content .qpe-callout-success { border-left: 5px solid var(--qpe-tone-success); background: var(--qpe-tone-success-bg); }
body.qpe-v2-content .entry-content .qpe-callout-summary { border-top: 5px solid var(--qpe-accent); }
body.qpe-v2-content .entry-content .qpe-callout-compare { border-top: 5px solid var(--qpe-tone-compare); }
body.qpe-v2-content .entry-content .qpe-callout-steps   { border-top: 5px solid var(--qpe-tone-steps); }

/* ── CTA ──────────────────────────────────────────────── */

/* 제휴 장부가 affiliate일 때만 router가 글 시작에 삽입한다. */
/* 공정위 경제적 이해관계 고지.
   라우터가 제휴 목적지를 쓰는 글의 the_content 맨 앞에 자동으로 넣는다.
   원고에는 없고 렌더 시점에만 생기므로 본문 SHA와 무관하다.

   라우터 PHP는 1호기와 공유하는 파일이라 마크업은 고치지 않는다.
   배지·박스는 CSS로 지우고 문장 한 줄만 남긴다.
   2026-08-19 사용자 지정: 16px, #666666, 가운데 정렬. */

body.qpe-v2-content .entry-content .qpe-affiliate-disclosure {
  display: block;
  margin: 0 0 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #666666;
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
}

body.qpe-v2-content .entry-content .qpe-affiliate-disclosure__label {
  display: none;
}

body.qpe-v2-content .entry-content .qpe-affiliate-disclosure__copy p {
  margin: 0;
  color: #666666;
  font-size: 16px;
  line-height: 1.6;
}

body.qpe-v2-content .entry-content .qpe-conversion-zone {
  margin: 56px 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
}

body.qpe-v2-content .entry-content .qpe-cta {
  justify-content: center;
  margin: 0;
}

/* 광고 모듈이 나중에 이 hook을 채운다. CTA와 바로 맞닿지 않도록 별도 영역으로 둔다. */
body.qpe-v2-content .entry-content .qpe-ad-slot-before,
body.qpe-v2-content .entry-content .qpe-ad-slot-after {
  clear: both;
  margin: 48px 0;
}

/* 1호기 290×54 → 460×86. 면적 약 2.53배. */
body.qpe-v2-content .entry-content .qpe-cta-button .wp-block-button__link {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-width: 460px;
  min-height: 86px;
  padding: 24px 44px;
  border: 1px solid var(--qpe-accent-strong);
  border-radius: 999px;
  background: var(--qpe-accent);
  color: #fff;
  font-family: var(--qpe-font);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(200, 72, 58, .24);
  transition: background-color .15s ease, transform .15s ease;
}

body.qpe-v2-content .entry-content .qpe-cta-button .wp-block-button__link:hover,
body.qpe-v2-content .entry-content .qpe-cta-button .wp-block-button__link:focus-visible {
  background: var(--qpe-accent-strong);
  color: #fff;
  transform: translateY(-1px);
}

body.qpe-v2-content .entry-content .qpe-cta-button .wp-block-button__link:focus-visible {
  outline: 3px solid var(--qpe-focus);
  outline-offset: 3px;
}

/* ── 모바일 ───────────────────────────────────────────── */

@media (max-width: 767px) {
  body.qpe-v2-content .entry-content { font-size: 18px; line-height: 1.8; }

  body.qpe-v2-content .entry-content h2.wp-block-heading {
    margin-top: 50px;
    margin-bottom: 22px;
    padding-left: 16px;
    font-size: 25px;
  }
  body.qpe-v2-content .entry-content h3.wp-block-heading { margin-top: 34px; font-size: 21px; }
  body.qpe-v2-content .entry-content h4.wp-block-heading { font-size: 19px; }

  body.qpe-v2-content .entry-content .wp-block-list li { font-size: 18px; line-height: 1.8; }

  body.qpe-v2-content .entry-content .wp-block-table th,
  body.qpe-v2-content .entry-content .wp-block-table td { padding: 12px; font-size: 15px; }

  body.qpe-v2-content .entry-content .wp-block-image { margin: 30px auto; }
  body.qpe-v2-content .entry-content .wp-block-image img {
    border-radius: 12px;
    box-shadow: 0 10px 26px rgba(74, 52, 39, .09);
  }

  body.qpe-v2-content .entry-content .qpe-callout { margin: 26px 0; padding: 21px; border-radius: var(--qpe-radius-sm); }
  body.qpe-v2-content .entry-content blockquote { padding: 19px 21px; border-radius: var(--qpe-radius-sm); }

  body.qpe-v2-content .entry-content .qpe-affiliate-disclosure { margin-bottom: 24px; }

  body.qpe-v2-content .entry-content .qpe-conversion-zone { margin: 44px 0; padding: 0; }
  body.qpe-v2-content .entry-content .qpe-cta,
  body.qpe-v2-content .entry-content .qpe-cta-button { width: 100%; margin: 0; }
  body.qpe-v2-content .entry-content .qpe-cta-button .wp-block-button__link {
    width: 100%;
    min-width: 0;
    min-height: 72px;
    padding: 20px 24px;
    font-size: 20px;
  }
}

/* ── 대표 썸네일 ──────────────────────────────────────── */
/* 테마가 .entry-content 밖에 출력하므로 별도로 맞춘다.
   썸네일은 본문 이미지가 아니라 문서 헤드 자산이다.

   GeneratePress 기본 DOM 순서는 `대표 이미지 → 제목 → 본문`이다.
   독자가 제목을 먼저 보고 이미지를 지나 본문으로 내려가도록
   flex order로 `제목 → 대표 이미지 → 본문`으로 바꾼다.
   PHP 훅이나 테마 수정 없이 CSS만으로 처리해 디자인을 파일 한 장에 유지한다. */

body.qpe-v2-content .inside-article {
  display: flex;
  flex-direction: column;
}

/* 선언하지 않은 나머지 요소(메타·푸터 등)는 DOM 순서대로 뒤에 남는다. */
body.qpe-v2-content .inside-article > * { order: 3; }
body.qpe-v2-content .inside-article > .entry-header { order: 1; }
body.qpe-v2-content .inside-article > .featured-image { order: 2; }

/* 제목 영역도 .entry-content 밖이라 여기서 잡는다.
   .inside-article을 flex로 만들면 여백 상쇄가 사라지므로
   제목·이미지·본문 사이 간격을 테마 기본값에 맡기지 않고 명시한다. */

body.qpe-v2-content .entry-header {
  margin: 0 0 36px;
}

body.qpe-v2-content .entry-title {
  margin: 0;
  color: var(--qpe-ink);
  font-family: var(--qpe-font);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.34;
  letter-spacing: -.01em;
}

body.qpe-v2-content .entry-header .entry-meta {
  margin-top: 14px;
  color: var(--qpe-muted);
  font-size: 15px;
}

body.qpe-v2-content .featured-image {
  margin: 0 auto 48px;
}

body.qpe-v2-content .featured-image img {
  display: block;
  width: auto;
  max-width: min(100%, 560px);
  height: auto;
  margin-inline: auto;
  border: 1px solid var(--qpe-line);
  border-radius: var(--qpe-radius);
  box-shadow: var(--qpe-shadow-image);
}

@media (max-width: 767px) {
  body.qpe-v2-content .entry-header { margin-bottom: 26px; }
  body.qpe-v2-content .entry-title { font-size: 28px; line-height: 1.36; }
  body.qpe-v2-content .featured-image { margin-bottom: 34px; }
  body.qpe-v2-content .featured-image img {
    max-width: min(100%, 420px);
    border-radius: 12px;
    box-shadow: 0 10px 26px rgba(74, 52, 39, .09);
  }
}
