/* ============================================================
   홈 3단 레이아웃 (index.html, 2026-10-05)
   왼쪽 전체 = 최신 소식 · 가운데 = 히어로·LIVE·바로가기 · 오른쪽 전체 = 공식 SNS(css/social.css)
   좌우 열은 헤더 아래에 붙어(sticky) 화면 높이만큼 차지하고 각자 스크롤한다.
   style.css 와 따로 둔다 (홈을 여러 세션이 같이 고치므로 충돌을 줄이려고)
   ============================================================ */

.home-main { padding-top: 20px; }
.home-3col {
  width: calc(100% - 32px); /* 큰 화면에서도 좌우 끝까지 (2026-10-05 — 예전엔 1880px 상한) */
  margin-inline: auto;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr) 380px;
  grid-template-areas: "news center social";
  gap: 24px;
  align-items: start;
}
.home-news { grid-area: news; }
.home-center { grid-area: center; min-width: 0; }
.home-3col > .social { grid-area: social; }

/* 왼쪽 최신 소식 — 오른쪽 SNS 패널(.social)과 같은 틀 */
.home-news {
  position: sticky; top: 77px; max-height: calc(100vh - 92px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0 14px 12px; overscroll-behavior: contain;
}
.home-news-top {
  position: sticky; top: 0; z-index: 2; background: var(--panel);
  padding: 12px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 10px;
}
.home-news-top .section-title { margin: 0; font-size: 1.25rem; }
/* 좁은 열이라 날짜를 제목 위로 */
.home-news .news-head { flex-direction: column; gap: 6px; padding: 12px 14px; }
.home-news .news-item .news-body h3 { font-size: 0.98rem; }

/* 소식을 누르면(넓은 화면) 왼쪽 열이 가로로 넓어지고 [목록 | 본문] 두 칸이 된다 — js/news.js */
.home-3col { transition: grid-template-columns 0.25s ease; }
.home-3col.news-wide { grid-template-columns: min(860px, 46vw) minmax(0, 1fr) 380px; }
.home-news.reading {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0 16px; align-items: start;
}
.home-news.reading > .home-news-top { grid-column: 1 / -1; }
.home-news .news-item.selected { border-left-color: var(--tan-bright); background: var(--panel-2); }
.home-news .news-item.selected h3 { color: var(--tan-bright); }
/* 옆 칸 모드에선 목록 안의 펼침 영역은 쓰지 않는다 */
.home-news.reading .news-item .news-detail { display: none; }
.news-reader {
  position: sticky; top: 56px; max-height: calc(100vh - 92px - 64px); overflow-y: auto;
  padding: 4px 4px 16px 16px; border-left: 1px solid var(--border); overscroll-behavior: contain;
}
.news-reader-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.news-reader-head .news-date { font-family: var(--font-mono); color: var(--muted); font-size: 0.82rem; }
.news-reader-close {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--panel-2); color: var(--text-strong); cursor: pointer; flex-shrink: 0;
}
.news-reader-close:hover { border-color: var(--tan); }
.news-reader h3 { font-size: 1.3rem; line-height: 1.4; color: var(--text-strong); }
.news-reader .news-title-en { color: var(--muted); font-size: 0.84rem; margin-top: 2px; }
.news-reader-sum { color: var(--text); margin: 12px 0; padding: 10px 12px; background: rgba(0, 0, 0, 0.18); border-left: 3px solid var(--tan-dim); }
.news-reader .news-full-in h4 { margin: 18px 0 6px; color: var(--tan-bright); font-size: 1.02rem; }
.news-reader .news-full-in p { margin: 0 0 8px; line-height: 1.75; color: var(--text); }

/* 가운데 — 히어로는 열 안의 카드처럼 */
.home-center .hero { padding: 48px 16px 44px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.home-center .live-card { margin-top: 20px; }
.home-center .section-title { margin-top: 28px; }
.home-center .card-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* 중간 폭: 소식·SNS를 가운데 아래로 */
@media (max-width: 1280px) {
  .home-3col {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "center center" "news social";
  }
  .home-news, .home-3col > .social { max-height: 80vh; position: static; }
}
@media (max-width: 860px) {
  .home-3col { grid-template-columns: 1fr; grid-template-areas: "center" "news" "social"; }
  .home-news, .home-3col > .social { max-height: none; overflow: visible; }
  .home-news-top { position: static; }
}

/* style.css 의 .news-full-in 은 날짜 칸만큼(134px) 들여 쓰는데, 이 패널은 날짜가 제목 위라 들여쓰기를 없앤다 */
.home-news .news-full-in { margin-left: 14px; }
.news-reader .news-full-in { margin: 0; padding-top: 12px; }
.news-reader .news-full-in p { font-size: 0.92rem; }
/* 소식 패널이 넓어져 가운데가 좁아지면 LIVE 카드를 위아래로 쌓는다 */
.home-3col.news-wide .live-card { grid-template-columns: 1fr; }

/* 히어로 자동 갱신 안내 (index.html .hero-note) */
.hero-note {
  display: inline-block; text-align: center; word-break: keep-all;
  margin: 14px auto 0; padding: 7px 14px; max-width: 100%;
  border: 1px solid var(--border-strong); border-radius: 20px; background: rgba(0, 0, 0, 0.25);
  color: var(--text); font-size: 0.9rem; line-height: 1.5;
}
.hero-note strong { color: var(--tan-bright); font-weight: 600; }
.hero-note-sub { color: var(--muted); font-size: 0.84rem; }
.hero-note-dot {
  display: inline-block; vertical-align: middle; margin: -2px 7px 0 0;
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px rgba(120, 190, 120, 0.2); animation: hero-note-pulse 2.4s ease-in-out infinite;
}
@keyframes hero-note-pulse { 50% { box-shadow: 0 0 0 6px rgba(120, 190, 120, 0); } }
@media (prefers-reduced-motion: reduce) { .hero-note-dot { animation: none; } }
.home-center .hero .hero-actions { margin-top: 20px; }
/* 히어로 버튼 6개 — 5+1 로 갈리지 않게 3열 격자 (좁으면 2열) */
.home-center .hero .hero-actions {
  display: grid; grid-template-columns: repeat(3, minmax(0, 200px)); justify-content: center; gap: 10px;
}
.home-center .hero .hero-actions .btn { justify-content: center; padding-inline: 12px; white-space: nowrap; }
@media (max-width: 560px) {
  .home-center .hero .hero-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 홈은 본문이 좌우 끝까지 가므로 푸터도 같은 폭으로 (헤더는 원래 전체 폭 · 다른 페이지 푸터는 1180px 그대로) */
body[data-page="home"] .site-footer .container { width: auto; margin-inline: 16px; }

/* 프로모션 코드 카드 (index.html .promo-card · js/promo.js) — 누르면 복사 */
.promo-card {
  margin-top: 20px; padding: 16px 18px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
}
.home-center .promo-card .section-title { margin: 0; }
.promo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.promo-date { font-family: var(--font-mono); color: var(--muted); font-size: 0.8rem; }
.promo-desc { margin: 6px 0 12px; color: var(--text); font-size: 0.9rem; }
.promo-codes {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px;
}
.promo-codes button {
  width: 100%; padding: 9px 10px; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.92rem; letter-spacing: 0.04em;
  color: var(--text-strong); background: var(--panel-2);
  border: 1px solid var(--border-strong); border-radius: 6px;
  transition: border-color 0.15s, color 0.15s;
}
.promo-codes button:hover, .promo-codes button:focus-visible { border-color: var(--tan); color: var(--tan-bright); }
.promo-codes button.copied { border-color: var(--green); color: var(--green); }
.promo-codes button.failed { border-color: var(--red, #c55); color: var(--red, #c55); }
.promo-codes button { overflow-wrap: anywhere; }
.promo-mode { display: block; margin-top: 3px; text-align: center; color: var(--muted); font-size: 0.75rem; }

/* 리뉴얼 (css/renewal.css 와 짝) — 레거시(data-design="legacy")에는 영향 없음 */
/* 소식: 영어 원제 줄·"기준 · 공식 발표를 옮겨…" 꼬리말 숨김 */
html[data-design="renewal"] .home-news .news-title-en,
html[data-design="renewal"] .news-reader .news-title-en,
html[data-design="renewal"] .home-news .news-foot { display: none; }
html[data-design="renewal"] .home-news .news-item .news-date { letter-spacing: 0; font-size: 0.8rem; }
html[data-design="renewal"] .news-reader-sum { border-left: none; border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
/* 프로모션 코드 — 자간 넓힌 모노 대신 본문 서체 · 둥근 칩 */
html[data-design="renewal"] .promo-date { font-family: inherit; font-size: 0.82rem; }
html[data-design="renewal"] .promo-codes button {
  font-family: var(--font-mono); letter-spacing: 0; font-size: 0.9rem; font-weight: 600;
  border-radius: 10px; background: rgba(255, 255, 255, 0.03); border-color: var(--border);
}
