/* 블로그(/blog/) 공통 모양. 페이지는 scripts/blog-build.js 가 만든다. 색은 첫 화면과 같은 언어(어두운 바탕, 앰버 강조), 글꼴 Outfit + Noto Sans KR.
 * 라이트 테마는 js/common.js 가 html 에 data-theme="light" 를 붙인다. 이 파일은 common.js 뒤에 불러 아래 라이트 값이 이긴다 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg: #09090b; --surface: #15151a; --surface-2: #1c1c23; --surface-3: #24242c;
    --border: rgba(255, 255, 255, 0.08); --border-2: rgba(255, 255, 255, 0.16);
    --text: #ececf1; --text-2: #c3c3cd; --text-3: #8f8f9b;
    --accent: #f59e0b; --accent-hover: #fbbf24; --accent-dim: rgba(245, 158, 11, 0.1); --on-accent: #1a1204;
    --glow: radial-gradient(ellipse 60% 420px at 78% -80px, rgba(245, 158, 11, 0.13), transparent 70%);
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
    --quote: rgba(245, 158, 11, 0.07);
    color-scheme: dark;
}
/* 라이트: 따뜻한 흰 바탕에 흰 카드. 회색으로 가라앉지 않게 바탕과 선에 앰버 기운을 조금 둔다 */
:root[data-theme="light"] {
    --bg: #fffdf8; --surface: #ffffff; --surface-2: #fbf6ea; --surface-3: #f3ead6;
    --border: rgba(120, 72, 8, 0.14); --border-2: rgba(120, 72, 8, 0.26);
    --text: #1c1917; --text-2: #3f3a36; --text-3: #6f675f;
    --accent: #b45309; --accent-hover: #92400e; --accent-dim: rgba(217, 119, 6, 0.1); --on-accent: #ffffff;
    --glow: radial-gradient(ellipse 60% 420px at 78% -80px, rgba(251, 191, 36, 0.28), transparent 70%);
    --shadow: 0 14px 34px rgba(120, 72, 8, 0.12);
    --quote: rgba(251, 191, 36, 0.14);
    color-scheme: light;
}
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    background: var(--glow) no-repeat, var(--bg); color: var(--text);
    font: 17px/1.8 "Noto Sans KR", Outfit, -apple-system, "Segoe UI", sans-serif;
    word-break: keep-all; overflow-wrap: anywhere; min-height: 100vh;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; height: auto; display: block; }

/* 머리: 첫 화면으로, 블로그 목록으로. 오른쪽 위 구석에는 common.js 의 계정과 테마 단추가 온다 */
.top { max-width: 760px; margin: 0 auto; padding: 16px 20px 0; display: flex; align-items: center; gap: 8px; font-family: Outfit, "Noto Sans KR", sans-serif; font-size: 14px; min-height: 46px; padding-right: 170px; }
.top a { color: var(--text-3); text-decoration: none; }
.top a:hover { color: var(--accent); }
.top .top-blog { color: var(--text-2); font-weight: 600; }
.top-sep { color: var(--text-3); opacity: 0.5; }
/* 다른 언어의 같은 페이지로. 좁은 화면에서는 구석 단추에 밀려 아랫줄로 내려간다 */
.top { flex-wrap: wrap; row-gap: 6px; }
.top .top-lang { margin-left: 6px; padding: 2px 11px; border: 1px solid var(--border-2); border-radius: 999px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.top .top-lang:hover { border-color: var(--accent); color: var(--accent); }
/* 브라우저 언어가 이 페이지와 다를 때만 blog.js 가 보여 주는 한 줄 */
.lang-note { max-width: 760px; margin: 14px auto 0; padding: 0 20px; font-size: 14px; }
.lang-note[hidden] { display: none; }
.lang-note a { display: block; padding: 9px 14px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--accent-dim); color: var(--text); text-decoration: none; }
.lang-note a::after { content: " →"; color: var(--accent); }
.lang-note a:hover { border-color: var(--accent); }

main { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* 목록 */
.intro { padding: 44px 0 28px; }
.intro h1 { font-size: 40px; line-height: 1.2; letter-spacing: -0.02em; }
.intro p { margin-top: 10px; color: var(--text-2); }
.list, .others { display: grid; gap: 18px; }
.card { display: grid; grid-template-columns: 250px 1fr; gap: 20px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.card:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); box-shadow: var(--shadow); }
.card img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.card-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card strong { font-size: 19px; line-height: 1.45; letter-spacing: -0.01em; }
.card-desc { font-size: 14.5px; line-height: 1.65; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta, .post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); font-family: Outfit, "Noto Sans KR", sans-serif; }
.tag { color: var(--accent); background: var(--accent-dim); border-radius: 999px; padding: 1px 10px; font-size: 12.5px; }
.upd { opacity: 0.85; }

/* 글 */
.post-head { padding: 40px 0 6px; }
.post-head h1 { font-size: 36px; line-height: 1.32; letter-spacing: -0.02em; margin-top: 12px; }
.lead { margin-top: 14px; font-size: 18.5px; line-height: 1.75; color: var(--text-2); }
.toc { margin: 26px 0 4px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); font-size: 15px; }
.toc strong { font-size: 13px; color: var(--text-3); font-weight: 600; }
.toc ol { margin: 6px 0 0 20px; }
.toc li { margin: 2px 0; }
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

.body { padding-top: 10px; }
.body h2 { font-size: 26px; line-height: 1.4; letter-spacing: -0.015em; margin: 52px 0 14px; scroll-margin-top: 20px; }
.body h3 { font-size: 20px; line-height: 1.5; margin: 34px 0 10px; scroll-margin-top: 20px; }
.body p { margin: 16px 0; }
.body ul, .body ol { margin: 16px 0 16px 24px; }
.body li { margin: 6px 0; padding-left: 2px; }
.body li::marker { color: var(--accent); font-weight: 600; }
.body strong { font-weight: 700; }
.body hr { border: 0; border-top: 1px solid var(--border); margin: 44px 0; }
.body code { font: 0.88em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.body pre { margin: 18px 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }
.body pre code { background: none; border: 0; padding: 0; }
.body blockquote { margin: 22px 0; padding: 12px 18px; border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; background: var(--quote); color: var(--text-2); }
.body blockquote p { margin: 6px 0; }

/* 앱 화면 그림. 한 장이면 가운데, 여러 장이면 나란히(휴대폰에서는 옆으로 넘긴다) */
.shots { display: grid; gap: 14px; margin: 26px 0; }
.shots.n2 { grid-template-columns: repeat(2, 1fr); }
.shots.n3 { grid-template-columns: repeat(3, 1fr); }
.shots.n4 { grid-template-columns: repeat(4, 1fr); }
.shots figure { min-width: 0; }
.shots img { width: 100%; border-radius: 14px; border: 1px solid var(--border-2); background: var(--surface); box-shadow: var(--shadow); }
.shots.n1 img { max-height: 640px; width: auto; max-width: 100%; margin: 0 auto; }
.shots figcaption { margin-top: 10px; font-size: 13.5px; line-height: 1.6; color: var(--text-3); text-align: center; }

/* 앱으로 가는 카드 */
.app-card { display: flex; align-items: center; gap: 14px; margin: 22px 0; padding: 14px 16px; border: 1px solid var(--border-2); border-radius: 16px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.app-card:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow); }
.app-card img { flex: none; width: 48px; height: 48px; border-radius: 12px; }
.app-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-card-text strong { font-size: 16.5px; line-height: 1.4; }
.app-card-text span { font-size: 13.5px; line-height: 1.55; color: var(--text-3); }
.app-card-go { flex: none; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 14px; border-radius: 999px; padding: 6px 16px; }
.app-card:hover .app-card-go { background: var(--accent-hover); }

/* 영상: 썸네일을 먼저 보여 주고 누르면 유튜브 플레이어를 넣는다 (blog.js) */
.video { margin: 26px 0; }
.video-play { position: relative; display: block; width: 100%; border: 1px solid var(--border-2); border-radius: 14px; overflow: hidden; background: #000; cursor: pointer; padding: 0; aspect-ratio: 16 / 9; }
.video-play img { width: 100%; height: 100%; object-fit: cover; }
.video-icon { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: rgba(9, 9, 11, 0.72); border: 2px solid rgba(255, 255, 255, 0.85); transition: background 0.15s, transform 0.15s; }
.video-icon::after { content: ""; position: absolute; left: 30px; top: 22px; border-style: solid; border-width: 15px 0 15px 24px; border-color: transparent transparent transparent #fff; }
.video-play:hover .video-icon { background: #f59e0b; transform: scale(1.06); }
.video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; background: #000; }
.video-note { margin-top: 8px; font-size: 13.5px; color: var(--text-3); text-align: center; }
.video-note span { opacity: 0.8; margin-left: 6px; }

/* 글 끝 */
.used { margin-top: 52px; padding-top: 24px; border-top: 1px solid var(--border); }
.used h2, .others h2 { font-size: 15px; color: var(--text-3); font-weight: 600; margin-bottom: 12px; }
.used p { display: flex; flex-wrap: wrap; gap: 8px; }
.used a { font-size: 14.5px; color: var(--text); text-decoration: none; border: 1px solid var(--border-2); background: var(--surface); border-radius: 999px; padding: 5px 14px; }
.used a:hover { border-color: var(--accent); color: var(--accent); }
.others { margin-top: 48px; }
.others h2 { margin-bottom: -4px; }

.bottom { max-width: 760px; margin: 64px auto 0; padding: 22px 20px 8px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; }
.bottom a { color: var(--text-3); text-decoration: none; }
.bottom a:hover { color: var(--accent); }

@media (max-width: 640px) {
    body { font-size: 16.5px; }
    .top { padding-right: 150px; }
    .intro { padding: 30px 0 22px; }
    .intro h1 { font-size: 32px; }
    .post-head { padding-top: 28px; }
    .post-head h1 { font-size: 28px; }
    .lead { font-size: 17px; }
    .body h2 { font-size: 22.5px; margin-top: 44px; }
    .body h3 { font-size: 18.5px; }
    .card { grid-template-columns: 1fr; gap: 12px; }
    .shots.n3, .shots.n4 { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 62%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin-right: -20px; padding-right: 20px; }
    .shots.n3 figure, .shots.n4 figure { scroll-snap-align: start; }
    .shots img { box-shadow: none; }
    .app-card { padding: 12px; gap: 12px; }
    .app-card-go { padding: 6px 12px; }
}
@media print {
    .top, .bottom, .others, .toc, .video-play, .lang-note { display: none !important; }
    body { background: #fff; color: #000; }
}
