/* 바다낚시 CCTV. 디자인은 나중에 입힌다: 지금은 구조와 기능이 보이는 최소 스타일만 둔다. */
:root {
  --bg: #F4F8F9; --card: #FFFFFF; --band: #E8F1F3; --ink: #10303A; --sub: #51707A;
  --line: #D5E2E6; --aqua: #0B7C8C; --deep: #0B4A5A; --warn: #B4540A; --bad: #B42318;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; }
a { color: var(--aqua); text-underline-offset: 3px; }
img { max-width: 100%; }
h1 { font-size: 28px; line-height: 1.3; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0 0 14px; }
h2 small { font-size: 14px; font-weight: 500; color: var(--sub); }
h2 a { color: inherit; text-decoration: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 머리말 */
.hd { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; padding: 10px 24px; background: var(--deep); }
.hd .logo { color: #fff; font-weight: 800; font-size: 18px; text-decoration: none; white-space: nowrap; }
.hd nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.hd nav a { color: #CFE6EA; text-decoration: none; padding: 6px 12px; border-radius: 999px; white-space: nowrap; font-size: 15px; }
.hd nav a.on { background: #fff; color: var(--deep); font-weight: 700; }

main { position: relative; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 24px 56px; }
.crumb { font-size: 14px; color: var(--sub); margin-bottom: 14px; }
.intro { margin-bottom: 20px; }
.intro p { margin: 0; color: var(--sub); }

/* 검색 · 해역 고르기 (스크롤해도 머리말 아래에 붙어 있다) */
.finder { position: sticky; top: 48px; z-index: 9; background: var(--bg); padding: 10px 0; margin-bottom: 8px; }
.search input { width: 100%; padding: 12px 14px; font: inherit; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); }
.chips { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.chip { font: inherit; font-size: 15px; padding: 6px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--deep); border-color: var(--deep); color: #fff; font-weight: 700; }
.empty { padding: 28px 16px; text-align: center; border: 1px dashed var(--line); border-radius: 14px; margin: 12px 0 24px; }
.empty[hidden], .favs[hidden], .sea[hidden] { display: none; }
.empty button, .btn, .play { display: inline-block; font: inherit; font-weight: 700; padding: 10px 18px; border: 0; border-radius: 10px; background: var(--deep); color: #fff; text-decoration: none; cursor: pointer; }
.legend { font-size: 13px; color: var(--sub); margin: 4px 0 22px; line-height: 2; }

/* 카드 목록: PC 4열 · 태블릿 2열 · 모바일 1열 */
.sea, .favs { margin-bottom: 36px; }
.favs { padding: 16px; background: var(--band); border-radius: 16px; }
.cams { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .cams { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .cams { grid-template-columns: 1fr; } }
.cam { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cam[hidden] { display: none; }
.cams + .cams { margin-top: 14px; }
.cams.links { gap: 10px; }
.cam.link .info { padding: 10px 44px 10px 12px; }
.cam.link h3 { font-size: 15px; }
.cams:not(:has(> .cam:not([hidden]))) { display: none; } /* 검색으로 전부 가려진 묶음은 간격도 없앤다 */
@media (max-width: 599px) { .cams.links { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cam.link .place { display: none; } }
.cam .thumb { display: block; aspect-ratio: 16 / 9; background: var(--band); }
.cam .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cam .ph { display: grid; place-items: center; width: 100%; height: 100%; font-size: 28px; color: var(--sub); }
.cam .info { padding: 10px 44px 12px 12px; }
.cam h3 { font-size: 16px; margin: 6px 0 2px; }
.cam h3 a { color: var(--ink); text-decoration: none; }
.cam h3 a::after { content: ''; position: absolute; inset: 0; } /* 카드 어디를 눌러도 상세로 */
.cam p { margin: 0; font-size: 13px; color: var(--sub); }
.fav { position: absolute; right: 6px; bottom: 6px; z-index: 1; width: 36px; height: 36px; font-size: 20px; line-height: 1; border: 0; border-radius: 50%; background: transparent; color: var(--sub); cursor: pointer; }
.fav[aria-pressed="true"] { color: #E0A100; }
.fav.big { position: static; width: auto; height: auto; padding: 8px 14px; font: inherit; font-size: 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }

.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--band); color: var(--deep); line-height: 1.6; }
.badge.youtube { background: #FDE8E8; color: #B42318; }
.badge.still { background: #DDF3EA; color: #0A6B45; }
.badge.external { background: #E6ECF7; color: #2A4A8A; }
.badge.late { background: #FDEFD8; color: var(--warn); }
.badge.down { background: #EEE; color: #555; }

/* 상세 */
.detail header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.detail header h1 { margin: 0; flex: 1 1 auto; }
.view { margin: 0 0 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.view img { display: block; width: 100%; height: auto; }
.view figcaption { padding: 10px 14px; font-size: 14px; color: var(--sub); }
.view figcaption b { color: var(--warn); }
.view.ext, .view.down, .view.yt { padding: 28px 20px; text-align: center; }
.view.yt.playing { padding: 0; aspect-ratio: 16 / 9; }
.view.yt iframe { display: block; width: 100%; height: 100%; border: 0; }
.hint { font-size: 13px; color: var(--sub); margin: 10px 0 0; }
.meta { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; background: var(--card); border: 1px solid var(--line); }
.meta th, .meta td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.meta tr:last-child th, .meta tr:last-child td { border-bottom: 0; }
.meta th { width: 130px; color: var(--sub); font-weight: 600; white-space: nowrap; }
.caution { font-size: 14px; color: var(--sub); margin-bottom: 32px; }
.about-list ul, .doc ul { padding-left: 20px; }
.about-list { font-size: 15px; color: var(--sub); }
.doc { max-width: 760px; }
.doc h2 { margin-top: 28px; }

/* 꼬리말 */
.foot { background: var(--deep); color: #CFE6EA; font-size: 14px; }
.foot-in { max-width: 1100px; margin: 0 auto; padding: 32px 24px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
@media (max-width: 699px) { .foot-in { grid-template-columns: 1fr; } }
.foot .brand { font-weight: 800; font-size: 17px; color: #fff; margin-bottom: 8px; }
.foot .ttl { font-weight: 700; color: #fff; margin-bottom: 8px; }
.foot a { display: block; color: #CFE6EA; text-decoration: none; padding: 3px 0; }
.foot p { margin: 0 0 8px; }
.foot .copy { display: block; margin-top: 12px; opacity: .7; }

@media (max-width: 599px) {
  .hd { padding: 8px 16px; gap: 12px; }
  .wrap { padding: 16px 16px 40px; }
  h1 { font-size: 23px; }
  .meta th { width: 96px; }
}

/* ---------- 광고 자리 (rodindex.com · badafishing.com 과 같은 구조. /js/ads.js 가 채운다) ---------- */
.ad-zone[hidden], .ad-disclosure[hidden] { display: none; }
.ad-unit { position: relative; display: block; aspect-ratio: 1 / 1; min-width: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--card); line-height: 0; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.ad-unit img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ad-unit:hover { border-color: var(--aqua); transform: translateY(-2px); }
/* 광고 묶음마다 한 번만 '광고' 표시 (자리가 숨겨지면 같이 숨겨진다) */
.ad-zone::before { content: '광고'; display: block; height: var(--cap, 18px); line-height: var(--cap, 18px); font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--sub); opacity: .8; text-align: center; }
/* 제휴 링크 고지 문구 (공정위 표시 지침): 좌우 광고가 보일 때만 본문 맨 위에 나온다 */
.ad-disclosure { max-width: 1052px; margin: 20px auto 0; padding: 10px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--band); font-size: 14px; line-height: 1.5; color: var(--sub); text-align: center; }
@media (max-width: 1100px) { .ad-disclosure { margin-left: 24px; margin-right: 24px; } }
/* 본문 가로 3칸: 직접 판매하는 자리 */
.ad-fixed { max-width: 808px; margin: 0 auto; padding: 0 24px 72px; }
.ad-fixed.at-top { padding: 40px 24px 0; }
.ad-fixed:has(.ad-zone[hidden]) { display: none; }
.ad-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ad-grid3::before { grid-column: 1 / -1; margin-bottom: -6px; }
/* 좌우 세로: 본문 양옆 빈자리에 놓이고, 스크롤해도 화면 세로 가운데에 놓인 채 따라온다 (넓은 화면만) */
.ad-rail { display: none; }
.ad-col { display: flex; flex-direction: column; gap: var(--g); align-items: center; }
.ad-sticky {
  --n: 5; --g: 10px; --cap: 18px;
  --u: min(144px, calc((100vh - 24px - var(--cap) - var(--n) * var(--g)) / var(--n)));
  --colh: calc(var(--cap) + var(--n) * var(--u) + var(--n) * var(--g));
  position: sticky; top: max(12px, calc((100vh - var(--colh)) / 2));
  display: flex; flex-direction: column; align-items: center;
}
.ad-sticky .ad-unit { width: var(--u); }
.ads-nofollow .ad-sticky { position: static; --u: 144px; }
@media (min-width: 1420px) {
  .ad-rail { display: block; position: absolute; top: 48px; bottom: 48px; width: 144px; z-index: 3; }
  .ad-rail.l { left: calc(50% - 550px - 144px); }
  .ad-rail.r { right: calc(50% - 550px - 144px); }
}
/* 좁은 화면: 좌우 세로 광고를 본문 아래 가로 한 줄로 (옆으로 밀어서 더 보기) */
.ad-mobile { max-width: 1100px; margin: 0 auto; padding: 8px 24px 64px; }
.ad-mobile:has(.ad-zone[hidden]) { display: none; }
.ad-row::before { content: none; }
.ad-mobile::before { content: '광고'; display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--sub); opacity: .8; text-align: center; }
.ad-row { --g: 10px; display: flex; gap: var(--g); overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain; }
.ad-row::-webkit-scrollbar { display: none; }
.ad-row .ad-unit { flex: 0 0 min(170px, calc((100% - 2 * var(--g)) / 3)); scroll-snap-align: start; }
.ad-row .ad-unit:hover { transform: none; }
@media (min-width: 1420px) { .ad-mobile { display: none; } }
@media (max-width: 599px) { .ad-fixed { padding-bottom: 56px; } .ad-grid3 { gap: 8px; } .ad-unit { border-radius: 12px; } }
/* 이 사이트에 맞춘 값: 머리말이 붙어 있으므로 좌우 광고는 그 아래에서 시작한다 */
.ad-sticky { --u: min(144px, calc((100vh - 88px - var(--cap) - var(--n) * var(--g)) / var(--n))); top: max(64px, calc((100vh - var(--colh)) / 2)); }
.ad-fixed { max-width: 620px; padding: 0 0 36px; }
.ad-disclosure { margin-top: 12px; padding: 6px 14px; font-size: 13px; border-radius: 10px; }
.ad-mobile { padding: 0 24px 40px; }
@media (max-width: 599px) { .ad-disclosure { margin: 8px 16px 0; font-size: 12px; } .ad-mobile { padding: 0 16px 32px; } }
