/*
Theme Name: OntheTrip
Description: 여행·축제·행사 매거진 테마
Version: 1.1.0
Requires PHP: 8.0
Text Domain: onthetrip
*/
:root {
	--teal: #0891b2;
	--ink: #222222;
	--sub: #777777;
	--line: #e5e5e5;
	--wash: #f8f9fa;
	--foot: #2b2b2b;
	--radius: 7px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: #fff;
	color: var(--ink);
	font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
	font-size: 16px;
	line-height: 1.6;
	word-break: keep-all;
	overflow-wrap: anywhere;
}
body.drawer-open { overflow: hidden; }
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-inline: 24px; }
.wrap.narrow { max-width: 968px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 100; background: #fff; padding: 8px 12px; }
.icon { width: 24px; height: 24px; flex: none; }

/* 헤더 */
.header-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.wordmark { font-weight: 800; font-size: 27px; letter-spacing: -0.035em; line-height: 1; }
.wordmark b { color: var(--teal); font-weight: 800; }
.custom-logo { display: block; max-height: 40px; width: auto; }
.header-actions { display: flex; gap: 4px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
.search-panel { border-top: 1px solid var(--line); padding: 14px 0; }
.search-form { display: flex; gap: 8px; max-width: 640px; }
.search-form label { flex: 1; }
.search-form input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border: 0; border-radius: var(--radius); background: var(--ink); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.cat-nav { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cat-list { display: flex; gap: 36px; overflow-x: auto; scrollbar-width: none; }
.cat-list::-webkit-scrollbar { display: none; }
.cat-list a { display: block; padding: 13px 0; font-weight: 600; white-space: nowrap; }
.cat-list a:hover, .cat-list .current-menu-item > a { box-shadow: inset 0 -2px 0 currentColor; }
.cat-list .is-cctv a { color: var(--teal); }

.drawer { position: fixed; inset: 0; z-index: 50; overflow-y: auto; background: #fff; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; height: 64px; border-bottom: 1px solid var(--line); }
.drawer-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 24px; padding: 28px 0 48px; }
.drawer-grid h2 { font-size: 17px; margin-bottom: 10px; }
.drawer-grid li a { display: block; padding: 6px 0; color: #555; }

/* 섹션 */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 20px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 800; letter-spacing: -0.025em; }
.section-head .more { display: flex; gap: 16px; font-size: 14px; color: var(--sub); }
.section-head .more a:hover { color: var(--teal); }
.section-wash { background: var(--wash); }
.section + .section:not(.section-wash) > .wrap > .section-head { padding-top: 0; }
.hero { padding-top: 28px; }

/* 이미지 */
.thumb { display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: var(--wash); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb-empty { position: absolute; inset: 0; display: grid; place-items: center; background: #f1f3f4; }
.thumb-empty .wordmark, .thumb-empty .wordmark b { color: #c3c9cd; font-size: 20px; }

.hero-card { display: block; }
.hero-card .thumb-empty .wordmark, .hero-card .thumb-empty .wordmark b { font-size: 40px; }
.hero-card .kicker { display: block; margin-top: 18px; }
.hero-card h2 { margin-top: 4px; font-size: 34px; line-height: 1.3; font-weight: 800; letter-spacing: -0.03em; }
.hero-card .thumb + h2 { margin-top: 18px; }
.hero-card p { margin-top: 6px; color: var(--sub); font-size: 17px; }

/* 카드 */
.grid { display: grid; gap: 32px 20px; }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card, .card-body { display: flex; flex-direction: column; }
.card-body { gap: 2px; padding-top: 12px; }
.card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 17px; line-height: 1.45; font-weight: 700; letter-spacing: -0.015em; }
.cols-3 .card-title { font-size: 19px; }
a.card:hover .card-title, a.hero-card:hover h2 { color: var(--teal); }
.tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 22px; }
.kicker { color: var(--teal); font-size: 13px; font-weight: 700; }
.sub { color: var(--sub); font-size: 14px; }
.status { display: inline-block; padding: 0 7px; border: 1px solid var(--teal); border-radius: 4px; font-size: 12px; font-weight: 700; line-height: 20px; }
.status-ongoing { background: var(--teal); color: #fff; }
.status-upcoming { color: var(--teal); }
.status-ended { border-color: var(--line); background: var(--wash); color: var(--sub); }
.fee { padding: 0 7px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; font-weight: 700; line-height: 20px; }

.rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.rows li { border-bottom: 1px solid var(--line); }
.card-latest { flex-direction: row; gap: 16px; padding: 14px 0; align-items: center; }
.card-latest .thumb { flex: 0 0 160px; }
.card-latest .card-body { padding-top: 0; min-width: 0; }
.card-latest .thumb-empty .wordmark, .card-latest .thumb-empty .wordmark b { font-size: 14px; }

.cams { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cam { display: flex; flex-direction: column; height: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.cam strong { margin-bottom: 4px; font-size: 16px; }
.cam span { color: var(--sub); font-size: 13px; }
.cam:hover { border-color: var(--teal); }

.hero-hint { position: absolute; inset: auto 12px 16px; color: var(--sub); font-size: 13px; text-align: center; }
.empty { padding: 28px 20px; border-radius: var(--radius); background: var(--wash); color: var(--sub); text-align: center; font-size: 15px; }
.section-wash .empty { background: #fff; }
.empty a { color: var(--teal); font-weight: 700; text-decoration: underline; }
.empty span { font-size: 13px; }

/* 목록·글 */
.page { padding-top: 20px; padding-bottom: 64px; }
.article { max-width: 808px; padding-top: 20px; padding-bottom: 40px; }
.crumbs ol { display: flex; flex-wrap: wrap; font-size: 13px; color: var(--sub); }
.crumbs li + li::before { content: "›"; margin: 0 7px; }
.page-title { margin: 14px 0 8px; font-size: 32px; line-height: 1.3; font-weight: 800; letter-spacing: -0.03em; }
.with-icon { display: flex; align-items: center; gap: 10px; }
.lead { margin-bottom: 16px; color: var(--sub); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 28px; }
.chips a { display: block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
.chips a[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.article > header { margin-bottom: 18px; }
.article > .thumb { margin-bottom: 24px; }
.article > p { margin: 14px 0; }
.notice { padding: 10px 14px; border-radius: var(--radius); background: var(--wash); color: #555; font-size: 14px; }
.event-info { margin: 20px 0; border-top: 1px solid var(--line); }
.event-info div { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.event-info dt { flex: 0 0 72px; color: var(--sub); }
.event-info dd { margin: 0; }
.event-info a { color: var(--teal); text-decoration: underline; }
.content { font-size: 17px; line-height: 1.85; }
.content > * { margin: 0 0 20px; }
.content h2 { margin-top: 40px; font-size: 24px; line-height: 1.4; }
.content h3 { margin-top: 28px; font-size: 20px; }
.content a { color: var(--teal); text-decoration: underline; }
.content ul { list-style: disc; padding-left: 22px; }
.content ol { list-style: decimal; padding-left: 22px; }
.content figure { margin-left: 0; margin-right: 0; }
.content img { border-radius: var(--radius); }
.content table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; }
.content td, .content th { padding: 8px 12px; border: 1px solid var(--line); }
.player { position: relative; aspect-ratio: 16 / 9; margin: 16px 0; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pagination { margin-top: 40px; }
.nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.page-numbers { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.page-numbers.current { border-color: var(--ink); background: var(--ink); color: #fff; }
.ad-slot { margin: 24px 0; text-align: center; }
.ad-mark { display: block; margin-bottom: 6px; color: var(--sub); font-size: 12px; }

/* 푸터 */
.site-footer { background: var(--foot); color: #b4b4b4; font-size: 15px; }
.foot-row { display: flex; align-items: center; gap: 72px; padding-top: 44px; padding-bottom: 44px; }
.foot-logo { display: flex; flex: 0 0 180px; flex-direction: column; align-items: center; gap: 8px; color: #fff; }
.foot-logo svg { width: 120px; height: 80px; }
.foot-logo span { font-size: 32px; font-weight: 900; letter-spacing: -0.045em; line-height: 1; }
.foot-info { min-width: 0; }
.foot-info p { margin-top: 12px; }
.foot-links { display: flex; flex-wrap: wrap; row-gap: 6px; color: #eee; font-weight: 700; }
.foot-links li:not(:last-child)::after { content: "·"; margin: 0 10px; color: #6d6d6d; }
.foot-links a:hover, .foot-info p a:hover { color: #fff; text-decoration: underline; }

@media (max-width: 1023px) {
	.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cams { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.rows { grid-template-columns: 1fr; }
	.drawer-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 639px) {
	.wrap { padding-inline: 16px; }
	.header-row { height: 56px; }
	.wordmark { font-size: 23px; }
	.cat-list { gap: 15px; }
	.cat-list a { padding: 11px 0; font-size: 14px; }
	.section { padding: 30px 0; }
	.section-head h2 { font-size: 20px; }
	.hero { padding-top: 16px; }
	.hero-card h2 { font-size: 24px; }
	.hero-card p { font-size: 15px; }
	.grid { gap: 24px 12px; }
	.cols-3 { grid-template-columns: 1fr; }
	.cols-4 .card-title { font-size: 15px; }
	.cols-4 .sub { font-size: 12.5px; }
	.cams { gap: 8px; }
	.cam { padding: 12px; }
	.cam strong { font-size: 14px; }
	.card-latest { gap: 12px; }
	.card-latest .thumb { flex-basis: 116px; }
	.card-latest .card-title { font-size: 15px; }
	.page-title { font-size: 25px; }
	.drawer-grid { grid-template-columns: repeat(2, 1fr); }
	.foot-row { flex-direction: column; align-items: flex-start; gap: 24px; padding-top: 32px; padding-bottom: 32px; }
	.foot-logo { flex-basis: auto; align-items: flex-start; }
	.foot-logo svg { width: 84px; height: 56px; }
	.foot-logo span { font-size: 26px; }
	.foot-info { font-size: 14px; }
	.foot-links { column-gap: 16px; row-gap: 10px; }
	.foot-links li:not(:last-child)::after { content: none; }
}

/* ---------- 도로 CCTV ---------- */
.road-banner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: -12px 0 24px; padding: 16px 18px; border: 1px solid var(--teal); border-radius: var(--radius); }
.road-banner strong { color: var(--teal); font-size: 17px; }
.road-banner span { color: var(--sub); font-size: 14px; }
.road-banner:hover { background: var(--wash); }
.road { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px; align-items: start; }
.road-view { position: sticky; top: 16px; display: grid; gap: 16px; }
.admin-bar .road-view { top: 48px; }
.road-player { scroll-margin-top: 12px; }
.road-screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: #2b2b2b; }
.road-screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.road-screen video[hidden] { display: none; }
.road-msg { position: absolute; inset: 0; display: grid; place-content: center; padding: 16px; color: #fff; font-size: 14px; text-align: center; pointer-events: none; }
.road-msg[hidden] { display: none; }
.road-now { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.road-now strong { font-size: 17px; word-break: keep-all; overflow-wrap: anywhere; }
.road-live { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 4px; background: var(--teal); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; vertical-align: 2px; }
.road-live[hidden] { display: none; }
.road-now button { flex: none; padding: 6px 14px; border: 1px solid var(--ink); border-radius: var(--radius); background: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.road-now button[hidden] { display: none; }
.road-source { margin-top: 4px; color: var(--sub); font-size: 13px; }
.road-source a { text-decoration: underline; }
.road-map { height: clamp(220px, calc(100vh - 490px), 440px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--wash); isolation: isolate; }
.road-areas { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.road-areas button { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.road-areas button[aria-pressed="true"] { border-color: var(--teal); background: var(--teal); color: #fff; }
.road-spot { padding-top: 18px; }
.road-spot[hidden] { display: none; }
.road-spot h2 { margin-bottom: 8px; font-size: 17px; font-weight: 800; }
.road-spot ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.road-spot li { border-bottom: 1px solid var(--line); }
.road-cam { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 11px 10px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.road-cam span { min-width: 0; overflow-wrap: anywhere; }
.road-cam small { flex: none; color: var(--sub); font-size: 12.5px; }
.road-cam:hover { background: var(--wash); }
.road-cam[aria-pressed="true"] { background: var(--wash); box-shadow: inset 3px 0 0 var(--teal); font-weight: 700; }
@media (max-width: 899px) {
	.road { grid-template-columns: minmax(0, 1fr); }
	.road-view { position: static; }
	.road-map { height: 300px; }
	.road-list { margin-top: 16px; }
}
/* 세로로 든 폰: 목록을 내려도 영상이 위에 남게 합니다. */
@media (max-width: 899px) and (min-height: 600px) {
	.road { display: block; }
	.road-view { display: contents; }
	.road-player { position: sticky; top: 0; z-index: 20; padding: 8px 0; background: #fff; }
	.admin-bar .road-player { top: 46px; }
	.road-map { margin-top: 8px; }
}
