:root {
  --bg: #f4f6f8;
  --surface: #fff;
  --line: #e3e7ec;
  --text: #1c2530;
  --muted: #77828f;
  --brand: #1ab1ea;
  --brand-dark: #0d97cd;
  --brand-tint: #eaf7fe;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  /* 광고 iframe이 뷰포트보다 넓어도 페이지가 가로로 스크롤되지 않게 한다. */
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; vertical-align: middle; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 12px; }

/* ---------- 헤더 ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); padding: 26px 12px 8px; }

.tagline { margin: 0; text-align: center; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.3; }
.tagline a { display: inline-block;
  background: linear-gradient(100deg, var(--brand-dark) 0%, var(--brand) 55%, #7c5cff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* pill 형태의 검색폼. 테두리 대신 그림자로 떠 보이게 하고 포커스 시 링 색이 진해진다. */
.search-form {
  display: flex; align-items: center; gap: 10px;
  width: min(100%, 560px); margin: 16px auto 4px; padding: 5px 5px 5px 18px;
  background: var(--surface); border: 2px solid var(--brand);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(26, 177, 234, .14);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.search-form:focus-within {
  border-color: var(--brand-dark);
  box-shadow: 0 6px 22px rgba(26, 177, 234, .26);
}
.search-form input {
  flex: 1; min-width: 0; height: 42px;
  border: 0; outline: 0; background: transparent; padding: 0;
  font-size: 16px; /* iOS에서 16px 미만이면 포커스 시 자동 확대된다 */
}
.search-form input::placeholder { color: #aab4bf; }
.search-form button {
  flex: none; width: 46px; height: 42px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
}
.search-form button:hover { background: var(--brand-dark); }

/* ---------- 바로가기 (한 줄) ---------- */
.shortcuts { max-width: 1200px; margin: 12px auto 0; }
.shortcuts ul {
  display: flex; justify-content: flex-start;
  gap: 2px; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.shortcuts li:first-child { margin-left: auto; }
.shortcuts li:last-child { margin-right: auto; }
.shortcuts ul::-webkit-scrollbar { display: none; }
.shortcuts li { flex: none; }
.shortcuts a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 10px; border-radius: 10px; }
.shortcuts a:hover { background: var(--bg); }
.shortcuts img { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; }
.shortcuts span { font-size: 11px; color: var(--muted); text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.sc-all-icon { display: grid; place-items: center; width: 32px; height: 32px;
  border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 18px; }

/* ---------- 정보 스트립 ---------- */
.info-strip {
  display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin: 14px 0;
}
.info-label { color: var(--muted); font-size: 12px; margin-right: 4px; }
.info-weather strong { font-size: 20px; margin-right: 4px; }
.info-dust { color: var(--muted); font-size: 12px; margin-left: 6px; }
.info-finance { display: flex; gap: 16px; flex-wrap: wrap; }
.info-finance .up { color: #d33; }
.info-finance .down { color: #2d6cdf; }
.info-trending { display: flex; gap: 14px; overflow-x: auto; }
.info-trending li { white-space: nowrap; }
.info-trending .rank { color: var(--brand); font-weight: 700; margin-right: 5px; }

/* ---------- 레이아웃 ---------- */
/* 우측 고정 레일 없음. 광고는 피드 안에 카드로 섞인다(.card-ad). */

/* ---------- 카드 ---------- */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
  transition: transform .13s ease, box-shadow .13s ease, border-color .13s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: #d2dae2;
  box-shadow: 0 10px 24px rgba(28, 37, 48, .09);
}
.card > a { display: block; height: 100%; }
.card-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: linear-gradient(150deg, #eef2f6, #f8fafc); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.card:hover .card-thumb img { transform: scale(1.04); }
.card-play {
  position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff;
}
.card-body { display: block; padding: 11px 14px 13px; }
.card-badge { display: inline-block; margin-bottom: 5px; padding: 2px 8px; border-radius: 999px;
  background: var(--brand-tint); color: #0b87b8; font-size: 11px; font-weight: 600; }
.card-shopping .card-badge { background: #fdeee9; color: #c4502e; }
.card-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; font-weight: 600; font-size: 14.5px; line-height: 1.45;
  word-break: keep-all;
}
.card-sub { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.card-shopping .card-sub { color: #d33; font-weight: 700; }
.card-ad { position: relative; padding: 12px; display: grid; place-items: center; }
/* 네이티브 혼입 광고임을 표시하는 라벨 */
.card-ad::before {
  content: "광고"; position: absolute; top: 8px; right: 10px;
  font-size: 10px; line-height: 1.6; color: #aab4bf;
  border: 1px solid var(--line); border-radius: 999px; padding: 0 7px;
  background: var(--surface);
}
.card-ad-rect iframe,
.card-ad-rect ins { max-width: 100%; }

/* 썸네일 없는 뉴스 카드: 빈 이미지 영역 대신 은은한 그라디언트와 큰 제목으로 채운다. */
.card-news:not(.has-thumb) { background: linear-gradient(160deg, var(--brand-tint), #ffffff 65%); }
.card-news:not(.has-thumb) .card-body { padding-top: 15px; padding-bottom: 16px; }
.card-news:not(.has-thumb) .card-badge { background: rgba(26, 177, 234, .16); }
.card-news:not(.has-thumb) .card-title { font-size: 15.5px; line-height: 1.5; }

.more-btn {
  display: block; width: 100%; margin: 16px 0 24px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 15px; font-weight: 600; color: var(--text); cursor: pointer;
  transition: background .13s ease, border-color .13s ease;
}
.more-btn:hover { background: #fafbfc; border-color: #d2dae2; }
.more-btn[disabled] { color: var(--muted); cursor: default; }

.empty { padding: 40px 0; text-align: center; color: var(--muted); }
.ad-slot { margin: 14px 0; text-align: center; overflow: hidden; }

/* ---------- 날개배너 ---------- */
/* JS(mobileCheck)로 숨기면 모바일에서도 스크립트를 받아오고 광고 요청이 나간다.
   CSS로 숨기고, 넓은 화면에서만 노출한다. */
.wing { display: none; }

/* ---------- 푸터 ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 20px 12px; margin-top: 24px; }
.footer-links { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; }
.footer-links a { font-size: 12px; color: var(--muted); }
.footer-copy { max-width: 1200px; margin: 12px auto 0; text-align: center; color: var(--muted); font-size: 12px; }

/* ---------- 태블릿 ---------- */
@media (min-width: 641px) {
  .tagline { font-size: 24px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 데스크톱 ---------- */
@media (min-width: 1025px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); }
  /* 300px 고정폭 300x250 광고가 4열(열당 약 260-290px)에서 잘리지 않도록 2열을 차지시킨다. */
  .card-ad-rect { grid-column: span 2; }
}

/* ---------- 날개배너 노출 ---------- */
/* 컨테이너(최대 1200px) 좌측 여백에 배너 120px이 온전히 들어가는 폭부터 노출한다.
   50% - 730px ≥ 0 즉 1460px 이상일 때 calc 값이 양수가 되므로, 그 아래에서는
   절대 화면 가장자리로 붙어 본문을 침범하지 않게 아예 숨긴다. */
@media (min-width: 1480px) {
  .wing { display: block; position: absolute; top: 140px; width: 120px; }
  .wing-left { left: calc(50% - 730px); }
}
