/*
Theme Name: 꿀팁24
Theme URI: https://gongsa-admin-update.web.app/
Author: 코데라플로우
Description: 뉴스룸형 매거진 테마 (코데라플로우 블로그오토). 헤더·카테고리 메뉴·썸네일 그리드·관련글/인기글·반응형.
Version: 1.0.0
License: GPL-2.0-or-later
Text Domain: coderaflow-newsroom
*/

:root{
  --brand:#1428A0;       /* 블로그별 [디자인 적용]에서 덮어씀 */
  --ink:#202124;
  --muted:#6b7280;
  --line:#e9ebee;
  --bg:#ffffff;
  --soft:#f5f6f8;
  --maxw:1200px;
  --radius:10px;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font-family:'Pretendard','Noto Sans KR',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;line-height:1.6;font-size:16px}
img{max-width:100%;height:auto;display:block}
a{color:inherit;text-decoration:none}
a:hover{color:var(--brand)}
.wrap{max-width:var(--maxw);margin:0 auto;padding:0 20px}

/* 헤더 */
.site-header{position:sticky;top:0;z-index:50;background:rgba(255,255,255,.96);backdrop-filter:saturate(1.2) blur(6px);border-bottom:1px solid var(--line)}
.site-header .bar{display:flex;align-items:center;gap:18px;height:64px}
.brand{font-weight:800;font-size:22px;letter-spacing:-.5px;white-space:nowrap}
.brand img{max-height:34px;width:auto}
.nav{flex:1;min-width:0}
.nav ul{list-style:none;margin:0;padding:0;display:flex;gap:22px;overflow:auto;justify-content:flex-end}
.nav li{white-space:nowrap}
.nav a{display:inline-block;padding:8px 0;font-weight:600;font-size:15.5px;color:#3c4043;border-bottom:2px solid transparent}
.nav a:hover{color:var(--brand);border-color:var(--brand)}
.hdr-actions{display:flex;align-items:center;gap:10px}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border:0;background:transparent;cursor:pointer;color:#3c4043;border-radius:8px}
.icon-btn:hover{background:var(--soft);color:var(--brand)}
.menu-toggle{display:none}
.search-box{display:none;border-top:1px solid var(--line);background:#fff}
.search-box.open{display:block}
.search-box form{display:flex;gap:8px;max-width:var(--maxw);margin:0 auto;padding:14px 20px}
.search-box input[type=search]{flex:1;padding:12px 14px;border:1px solid var(--line);border-radius:10px;font-size:15px}
.search-box button{padding:0 18px;border:0;background:var(--brand);color:#fff;border-radius:10px;font-weight:700;cursor:pointer}

/* 히어로 */
.hero{padding:28px 0 8px}
.hero a{display:grid;grid-template-columns:1.4fr 1fr;gap:26px;align-items:center}
.hero .thumb{aspect-ratio:16/9;border-radius:var(--radius);overflow:hidden;background:var(--soft)}
.hero .thumb img{width:100%;height:100%;object-fit:cover}
.cat-chip{display:inline-block;font-size:12.5px;font-weight:800;letter-spacing:.3px;color:var(--brand);margin-bottom:10px;text-transform:uppercase}
.hero h2{font-size:30px;line-height:1.25;margin:0 0 12px;letter-spacing:-.6px}
.hero p{color:var(--muted);margin:0 0 12px}
.meta{color:var(--muted);font-size:13.5px}

/* 섹션 헤더 */
.sec-head{display:flex;align-items:center;justify-content:space-between;margin:34px 0 16px;padding-bottom:10px;border-bottom:2px solid var(--ink)}
.sec-head h3{margin:0;font-size:20px;letter-spacing:-.4px}
.sec-head a{font-size:14px;color:var(--muted);font-weight:600}

/* 카드 그리드 */
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:26px}
.card .thumb{aspect-ratio:16/9;border-radius:var(--radius);overflow:hidden;background:var(--soft);margin-bottom:12px}
.card .thumb img{width:100%;height:100%;object-fit:cover;transition:transform .35s ease}
.card:hover .thumb img{transform:scale(1.05)}
.card h4{margin:6px 0 8px;font-size:17.5px;line-height:1.4;letter-spacing:-.3px}
.card:hover h4{color:var(--brand)}

/* 본문(기사) */
.article{max-width:760px;margin:0 auto;padding:30px 0 10px}
.article h1{font-size:34px;line-height:1.3;letter-spacing:-.6px;margin:14px 0 14px}
.article .post-meta{display:flex;gap:14px;color:var(--muted);font-size:14px;border-bottom:1px solid var(--line);padding-bottom:18px;margin-bottom:22px}
.article .featured{border-radius:var(--radius);overflow:hidden;margin:0 0 24px}
.entry{font-size:17px;line-height:1.9;color:#2b2f33;word-break:keep-all;counter-reset:cfh2}
.entry p{margin:0 0 1.5em}
.entry h2{counter-increment:cfh2;display:flex;align-items:center;gap:12px;font-size:21px;margin:2.6em 0 1em;padding:14px 18px;line-height:1.4;letter-spacing:-.3px;color:#16191d;background:var(--soft);border-left:6px solid var(--brand);border-radius:0 10px 10px 0}
.entry h2::before{content:counter(cfh2);flex-shrink:0;width:30px;height:30px;border-radius:8px;background:var(--brand);color:#fff;font-size:15px;font-weight:800;display:flex;align-items:center;justify-content:center}
.entry h3{font-size:18.5px;margin:1.8em 0 .5em;padding-left:13px;line-height:1.5;color:#1a1d21;border-left:3px solid var(--brand);font-weight:700}
.entry>*:first-child{margin-top:0}
.entry>p:first-of-type{font-size:17.5px;color:#374151}
.entry h2[id]{scroll-margin-top:84px}
.entry img{border-radius:8px;margin:1em 0}
.entry a{color:var(--brand);text-decoration:underline}
.entry blockquote{margin:1.4em 0;padding:14px 18px;border-left:4px solid var(--brand);background:var(--soft);border-radius:0 8px 8px 0;color:#444}
.entry .post-summary{background:var(--soft);border:1px solid var(--line);border-left:4px solid var(--brand);border-radius:0 10px 10px 0;padding:16px 18px;margin:0 0 26px}
.entry .post-summary strong{display:block;margin-bottom:8px;color:var(--brand);font-size:15px}
.entry .post-summary ul{margin:0;padding-left:18px}
.entry .post-summary li{margin:4px 0}
/* 표: 가로 스크롤(잘림 방지) + 브랜드 컬러 헤더 + 가운데 정렬 + 줄무늬 */
.entry .table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:1.7em 0;border:1px solid var(--line);border-radius:12px;box-shadow:0 1px 3px rgba(0,0,0,.05)}
.entry table{width:100%;border-collapse:collapse;font-size:15px;margin:0;background:#fff}
.entry .table-wrap table{min-width:480px}
.entry th,.entry td{padding:12px 14px;text-align:center;vertical-align:middle;line-height:1.55;word-break:keep-all;border-bottom:1px solid var(--line);border-right:1px solid #eef1f4}
.entry th:last-child,.entry td:last-child{border-right:0}
.entry tbody tr:last-child td{border-bottom:0}
.entry th{background:var(--brand);color:#fff;font-weight:700;border-bottom:0;border-right-color:rgba(255,255,255,.22)}
.entry tbody tr:nth-child(even){background:rgba(2,6,23,.028)}
.entry tbody tr:hover{background:rgba(2,6,23,.05)}

/* FAQ 아코디언(질문 클릭 → 답변 펼침) */
.entry .cf-faq{display:flex;flex-direction:column;gap:10px;margin:1.5em 0}
.entry details.cf-faq-item{border:1px solid var(--line);border-left:4px solid var(--brand);border-radius:10px;background:#fff;overflow:hidden}
.entry details.cf-faq-item summary{cursor:pointer;list-style:none;padding:14px 46px 14px 48px;font-weight:700;color:var(--ink);position:relative;line-height:1.5;background:var(--soft);transition:background .15s}
.entry details.cf-faq-item summary::-webkit-details-marker{display:none}
.entry details.cf-faq-item summary::before{content:"Q";position:absolute;left:14px;top:50%;transform:translateY(-50%);width:24px;height:24px;border-radius:6px;background:var(--brand);color:#fff;font-size:13px;font-weight:700;display:flex;align-items:center;justify-content:center}
.entry details.cf-faq-item summary::after{content:"";position:absolute;right:20px;top:50%;width:9px;height:9px;border-right:2px solid var(--brand);border-bottom:2px solid var(--brand);transform:translateY(-70%) rotate(45deg);transition:transform .2s}
.entry details.cf-faq-item[open] summary{background:var(--brand);color:#fff}
.entry details.cf-faq-item[open] summary::before{background:#fff;color:var(--brand)}
.entry details.cf-faq-item[open] summary::after{border-color:#fff;transform:translateY(-30%) rotate(225deg)}
.entry .cf-faq-a{padding:15px 18px;color:#4b5563;line-height:1.85}
.entry .cf-faq-a p{margin:0 0 .8em}
.entry .cf-faq-a p:last-child{margin:0}

/* 계산기 위젯 */
.entry .cf-calc{border:1px solid var(--line);border-left:4px solid var(--brand);border-radius:12px;padding:18px;margin:1.8em 0;background:var(--soft)}
.entry .cf-calc-h{font-weight:800;color:var(--brand);margin-bottom:12px;font-size:16.5px}
.entry .cf-calc label{display:block;font-size:14px;font-weight:600;color:#374151;margin:9px 0}
.entry .cf-calc input,.entry .cf-calc select{display:block;width:100%;max-width:300px;margin-top:5px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;font-size:15px;background:#fff}
.entry .cf-calc button{margin-top:14px;background:var(--brand);color:#fff;border:0;padding:11px 24px;border-radius:8px;font-weight:700;cursor:pointer;font-size:15px}
.entry .cf-calc button:hover{filter:brightness(0.94)}
.entry .cf-calc-res{margin-top:14px;padding:14px 16px;background:#fff;border:1px solid var(--line);border-radius:8px;line-height:1.85;font-size:16px}
.entry .cf-calc-res:empty{display:none}
.entry .cf-calc-note{color:var(--muted);font-size:12px}

/* 목차(TOC) */
.entry .cf-toc{background:#fff;border:1px solid var(--line);border-radius:12px;padding:16px 20px;margin:0 0 28px}
.entry .cf-toc-h{font-weight:800;font-size:15px;color:var(--brand);margin-bottom:10px;display:flex;align-items:center;gap:7px}
.entry .cf-toc-h::before{content:"";width:16px;height:16px;border-left:3px solid var(--brand);border-bottom:3px solid var(--brand)}
.entry .cf-toc ol{margin:0;padding-left:20px;counter-reset:toc}
.entry .cf-toc li{margin:7px 0;line-height:1.5}
.entry .cf-toc a{color:#374151;text-decoration:none}
.entry .cf-toc a:hover{color:var(--brand);text-decoration:underline}

/* 기사 헤더 디테일: 카테고리 칩(채움) + 메타 구분점 */
.article a.cat-chip{display:inline-block;background:var(--brand);color:#fff;padding:5px 13px;border-radius:999px;text-transform:none;font-size:12.5px;font-weight:700;margin-bottom:14px}
.article .post-meta span+span{position:relative;padding-left:15px}
.article .post-meta span+span::before{content:"";position:absolute;left:5px;top:50%;transform:translateY(-50%);width:3px;height:3px;border-radius:50%;background:#cbd0d6}
.article .featured img{width:100%}
.entry ol,.entry ul{padding-left:22px;margin:0 0 1.5em}
.entry ol li,.entry ul li{margin:8px 0;line-height:1.8}

/* 글 중간 인기글 3개 */
.cf-midposts{margin:2.2em 0;padding:18px;background:var(--soft);border-radius:12px}
.cf-midposts .lab{font-size:13px;font-weight:800;color:var(--brand);letter-spacing:.3px;margin-bottom:12px}
.cf-midposts .row3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.cf-midposts .it .th{aspect-ratio:16/9;border-radius:8px;overflow:hidden;background:#e9ecef;margin-bottom:8px}
.cf-midposts .it .th img{width:100%;height:100%;object-fit:cover}
.cf-midposts .it .tt{font-size:14px;font-weight:600;line-height:1.45;color:var(--ink)}
.cf-midposts .it:hover .tt{color:var(--brand)}

/* 하단 전체 글 그리드 */
.cf-allposts{margin:46px 0 0}
.cf-allposts .grid{gap:20px}

/* 댓글 접기/간소화 */
.cf-cmt-toggle{display:inline-flex;align-items:center;gap:6px;margin:6px 0 0;padding:10px 16px;border:1px solid var(--line);background:#fff;border-radius:999px;font-weight:700;font-size:14px;cursor:pointer;color:#3c4043}
.cf-cmt-toggle:hover{border-color:var(--brand);color:var(--brand)}
.cf-cmt-list{list-style:none;padding:0;margin:16px 0}
.cf-cmt-list .comment-body{border-bottom:1px solid var(--line);padding:12px 0}
.cf-cmt-list .comment-author{font-size:14px;font-weight:700}
.cf-cmt-list .comment-meta{font-size:12px;color:var(--muted);margin-bottom:4px}
.cf-cmt-list .comment-meta a{color:var(--muted)}
.comment-respond{margin-top:18px}
@media(max-width:640px){ .cf-midposts .row3{grid-template-columns:1fr 1fr;gap:10px} }
.tags{margin:26px 0;display:flex;flex-wrap:wrap;gap:8px}
.tags a{font-size:13px;background:var(--soft);color:#444;padding:6px 12px;border-radius:999px}

/* 단(컨텐츠+사이드) */
.layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:34px;align-items:start}
.layout.full{grid-template-columns:1fr}
.sidebar .widget{margin-bottom:26px;border:1px solid var(--line);border-radius:var(--radius);padding:16px}
.sidebar .widget-title{font-size:15px;font-weight:800;margin:0 0 12px;padding-bottom:8px;border-bottom:2px solid var(--ink)}
/* 사이드바 인기글: 썸네일 + 1줄 제목(길면 …중략) */
.cf-side-pop{display:flex;flex-direction:column;gap:14px}
.cf-side-pop .it{display:block}
.cf-side-pop .th{width:100%;aspect-ratio:16/9;border-radius:8px;overflow:hidden;background:#e9ecef;margin-bottom:7px}
.cf-side-pop .th img,.cf-side-pop .th svg{width:100%;height:100%;object-fit:cover;display:block}
.cf-side-pop .tt{font-size:14px;font-weight:600;color:var(--ink);line-height:1.45;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cf-side-pop .it:hover .tt{color:var(--brand)}
.banner{display:block;background:var(--soft);border:1px dashed #cfd4da;border-radius:var(--radius);min-height:120px;display:flex;align-items:center;justify-content:center;color:#9aa0a6;font-size:13px;text-align:center;padding:12px}

/* 관련글 */
.related{margin:40px 0 0}

/* 댓글 */
.comments{max-width:760px;margin:34px auto 0}
.comments h3{font-size:20px;border-bottom:2px solid var(--ink);padding-bottom:10px}
.comments ol{list-style:none;padding:0}
.comments .comment-body{border-bottom:1px solid var(--line);padding:14px 0}
.comments textarea,.comments input[type=text],.comments input[type=email],.comments input[type=url]{width:100%;padding:11px 13px;border:1px solid var(--line);border-radius:8px;margin:6px 0;font-size:15px;font-family:inherit}
.comments .submit{background:var(--brand);color:#fff;border:0;padding:11px 22px;border-radius:8px;font-weight:700;cursor:pointer}

/* 푸터 */
.site-footer{margin-top:60px;background:#16181d;color:#c7ccd3;padding:40px 0}
.site-footer .wrap{display:flex;flex-wrap:wrap;gap:20px;justify-content:space-between;align-items:center}
.site-footer .f-brand{font-weight:800;color:#fff;font-size:18px}
.site-footer a{color:#c7ccd3}
.site-footer .f-menu{display:flex;gap:18px;flex-wrap:wrap;list-style:none;margin:0;padding:0}
.site-footer .copy{width:100%;color:#8b9099;font-size:13px;border-top:1px solid #2a2e35;padding-top:18px;margin-top:8px}

/* 페이지네이션 */
.pagination{display:flex;gap:8px;justify-content:center;margin:36px 0}
.pagination .page-numbers{padding:8px 13px;border:1px solid var(--line);border-radius:8px;font-weight:600}
.pagination .current{background:var(--brand);color:#fff;border-color:var(--brand)}

/* 반응형 */
@media(max-width:980px){
  .grid{grid-template-columns:repeat(2,1fr)}
  .layout{grid-template-columns:1fr}
  .hero a{grid-template-columns:1fr}
}
@media(max-width:640px){
  .nav{position:fixed;inset:64px 0 auto 0;background:#fff;border-bottom:1px solid var(--line);transform:translateY(-130%);transition:transform .25s;max-height:70vh;overflow:auto}
  .nav.open{transform:translateY(0)}
  .nav ul{flex-direction:column;gap:0;padding:6px 20px;justify-content:flex-start}
  .nav li{border-bottom:1px solid var(--line)}
  .nav a{display:block;padding:13px 0}
  .menu-toggle{display:inline-flex}
  .grid{grid-template-columns:1fr;gap:22px}
  .hero h2{font-size:24px}
  .article h1{font-size:26px}
}
