/*
  ============================================================
  realinvestment.tistory.com — style.css (복구본)
  ============================================================
*/

/* ===== RESET ===== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:16px;scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  font-family:'Pretendard',-apple-system,BlinkMacSystemFont,'맑은 고딕','Malgun Gothic',sans-serif;
  color:#2d3748;background:#f9fafb;line-height:1.7;
  word-break:keep-all;overflow-wrap:break-word;
}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto;display:block}
ul,ol{list-style:none}
input,textarea,button{font:inherit;border:none;outline:none}

/* ===== 읽기 진행률 바 ===== */
.reading-progress{
  position:fixed;top:0;left:0;
  width:0;height:3px;
  background:linear-gradient(90deg,#3182ce,#e2a84b);
  z-index:200;
  transition:width .1s linear;
  pointer-events:none;
}

/* ===== HEADER ===== */
.site-header{
  background:#1a365d;color:#fff;
  position:sticky;top:0;z-index:100;
  box-shadow:0 2px 8px rgba(0,0,0,.12);
}
.header-inner{
  max-width:1100px;margin:0 auto;padding:14px 20px;
  display:flex;align-items:center;flex-wrap:wrap;gap:8px 20px;
}
.blog-title{font-size:20px;font-weight:800;letter-spacing:-.5px}
.blog-title a{color:#fff}
.blog-title a:hover{color:#e2a84b}

.gnb{margin-left:auto}
.category-list{display:flex;gap:4px;flex-wrap:wrap}
.cat-item{position:relative}
.cat-link{
  display:block;padding:6px 12px;font-size:13.5px;font-weight:500;
  color:#cbd5e0;border-radius:4px;transition:all .15s;white-space:nowrap;
}
.cat-link:hover{color:#fff;background:rgba(255,255,255,.1)}
.sub-category{
  display:none;position:absolute;top:100%;left:0;
  background:#fff;border-radius:6px;box-shadow:0 4px 16px rgba(0,0,0,.12);
  min-width:160px;padding:6px 0;z-index:200;
}
.cat-item:hover .sub-category{display:block}
.sub-category a{display:block;padding:8px 16px;font-size:13px;color:#4a5568}
.sub-category a:hover{background:#f7fafc;color:#1a365d}
.mobile-menu-btn{
  display:none;background:none;color:#fff;font-size:24px;
  cursor:pointer;margin-left:auto;padding:4px 8px;
}

/* ===== LAYOUT ===== */
.layout-wrap{
  max-width:1100px;margin:0 auto;padding:24px 20px;
  display:grid;grid-template-columns:1fr 300px;gap:32px;align-items:start;
}
.content-area{min-width:0}

/* ===== POST CARDS (목록) ===== */
.post-card{
  background:#fff;border-radius:10px;overflow:hidden;
  margin-bottom:20px;box-shadow:0 1px 4px rgba(0,0,0,.06);
  transition:box-shadow .2s,transform .2s;
}
.post-card:hover{box-shadow:0 4px 16px rgba(0,0,0,.1);transform:translateY(-2px)}
.post-card-link{display:flex;gap:16px;padding:20px}
.post-thumb{
  width:140px;min-width:140px;height:100px;
  border-radius:6px;overflow:hidden;background:#edf2f7;
}
.post-thumb img{width:100%;height:100%;object-fit:cover}
.post-card-body{flex:1;display:flex;flex-direction:column;gap:6px}
.post-category{
  display:inline-block;font-size:12px;font-weight:600;
  color:#3182ce;background:#ebf8ff;padding:2px 8px;
  border-radius:3px;width:fit-content;
}
.post-card-title{
  font-size:17px;font-weight:700;color:#1a202c;line-height:1.4;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.post-card-summary{
  font-size:13.5px;color:#718096;line-height:1.5;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.post-date{font-size:12px;color:#a0aec0;margin-top:auto}

/* ===== POST VIEW (개별 글) ===== */
.post-view{
  background:#fff;border-radius:10px;padding:32px;
  box-shadow:0 1px 4px rgba(0,0,0,.06);
}
.post-header{margin-bottom:28px;padding-bottom:20px;border-bottom:1px solid #e2e8f0}
.post-title{
  font-size:26px;font-weight:800;color:#1a202c;
  line-height:1.35;margin:10px 0 12px;letter-spacing:-.5px;
}

/* 날짜 + 읽기 시간 */
.post-meta-row{display:flex;align-items:center;gap:12px}
.reading-time{
  font-size:12px;color:#718096;
  background:#f7fafc;padding:2px 8px;border-radius:4px;
}
.reading-time:empty{display:none}

/* ===== 💰 광고 슬롯 ===== */
.ad-slot{
  display:block;margin:28px auto;text-align:center;
  overflow:hidden;border-radius:6px;
  min-height:0;max-height:0;opacity:0;
  transition:all .3s;
}
.ad-slot:has(ins),
.ad-slot:has(iframe),
.ad-slot:has(script + *),
.ad-slot.active{
  min-height:280px;max-height:none;opacity:1;
  background:#f9fafb;
}
.ad-slot.active{min-height:280px;max-height:none;opacity:1}
.ad-slot ins.adsbygoogle{width:100%}
.ad-slot-top{margin-top:0;margin-bottom:28px}
.ad-slot-bottom{margin-top:28px;margin-bottom:8px}
.ad-slot-mid{margin:32px 0}
.ad-slot-sidebar{
  min-height:0;max-height:0;opacity:0;
  margin-bottom:20px;position:sticky;top:80px;
}
.ad-slot-sidebar:has(ins),
.ad-slot-sidebar:has(iframe),
.ad-slot-sidebar.active{
  min-height:250px;max-height:none;opacity:1;
}

/* ===== 본문 (entry-content) ===== */
.entry-content{font-size:16.5px;line-height:1.85;color:#2d3748}
.entry-content p{margin-bottom:22px}

.entry-content h2{
  margin-top:56px;margin-bottom:20px;padding-top:24px;padding-bottom:12px;
  border-bottom:2px solid #1a365d;font-size:22px;font-weight:800;
  color:#1a365d;letter-spacing:-.3px;
}
.entry-content h3{
  margin-top:36px;margin-bottom:14px;
  font-size:18px;font-weight:700;color:#2d4a7a;
}
.entry-content h4{
  margin-top:28px;margin-bottom:10px;
  font-size:16px;font-weight:700;color:#4a5568;
}

.entry-content a{
  color:#2b6cb0;text-decoration:underline;
  text-underline-offset:3px;text-decoration-color:#bee3f8;
  transition:all .15s;
}
.entry-content a:hover{color:#1a365d;text-decoration-color:#1a365d}

.entry-content img{border-radius:6px;margin:24px auto}
.entry-content figure{margin:28px 0}
.entry-content figcaption{text-align:center;font-size:13px;color:#a0aec0;margin-top:8px}

.entry-content ul,.entry-content ol{margin:16px 0 20px 20px}
.entry-content ul{list-style:disc}
.entry-content ol{list-style:decimal}
.entry-content li{margin-bottom:8px;padding-left:4px}

/* ===== 비교표 ===== */
.table-wrap{
  overflow-x:auto;-webkit-overflow-scrolling:touch;
  margin:28px 0;border-radius:8px;
}
.entry-content table{
  width:100%;border-collapse:collapse;margin:28px 0;
  font-size:14.5px;border-radius:8px;overflow:hidden;
  box-shadow:0 1px 4px rgba(0,0,0,.06);
}
.table-wrap table{margin:0;min-width:500px}
.entry-content table thead th{
  background:#1a365d;color:#fff;padding:13px 16px;
  text-align:left;font-weight:600;font-size:13.5px;white-space:nowrap;
}
.entry-content table tbody td{
  padding:12px 16px;border-bottom:1px solid #edf2f7;vertical-align:top;
}
.entry-content table tbody tr:nth-child(even){background:#f7fafc}
.entry-content table tbody tr:hover{background:#edf2f7;transition:background .15s}
.entry-content table td strong,
.entry-content table td b{color:#c53030;font-weight:700}

/* ===== 목차 (TOC) ===== */
.toc-box{
  background:#f8fafc;border:1px solid #e2e8f0;
  border-left:4px solid #1a365d;border-radius:0 8px 8px 0;
  padding:22px 26px;margin:0 0 28px;
}
.toc-box .toc-title{margin-bottom:10px}
.toc-box b{font-size:15px;color:#1a365d}
.toc-box a{
  display:block;padding:5px 0;font-size:14.5px;
  color:#4a5568;text-decoration:none;transition:all .15s;
  border-left:2px solid transparent;padding-left:0;
}
.toc-box a:hover{color:#1a365d;padding-left:6px}
.toc-box a.active{
  color:#1a365d;font-weight:700;
  padding-left:8px;border-left-color:#3182ce;
}

/* ===== 강조 박스 ===== */
.highlight-box{
  background:linear-gradient(135deg,#ebf8ff,#e6fffa);
  border:1px solid #bee3f8;border-left:4px solid #3182ce;
  border-radius:0 8px 8px 0;padding:20px 24px;margin:28px 0;
  font-size:16px;font-weight:600;color:#2a4365;
}
.highlight-box strong{color:#c53030;font-size:19px}

/* ===== CTA 박스 ===== */
.cta-box{
  background:#f7fafc;border:1px solid #e2e8f0;
  border-radius:10px;padding:22px 26px;margin:36px 0 24px;
}
.cta-box .cta-title{margin:0 0 14px;font-weight:800;font-size:15px;color:#1a365d}
.cta-box a{
  display:flex;align-items:center;padding:10px 12px;margin:0 -12px;
  color:#2b6cb0;text-decoration:none;font-size:15px;font-weight:500;
  border-radius:6px;transition:all .15s;
}
.cta-box a::before{content:"→";margin-right:8px;color:#a0aec0}
.cta-box a:hover{background:#edf2f7;color:#1a365d}

/* ===== 팁·인용·경고 박스 ===== */
.entry-content blockquote{
  margin:28px 0;padding:18px 24px;border-left:4px solid #3182ce;
  background:#ebf8ff;border-radius:0 8px 8px 0;color:#2a4365;font-size:15px;
}
.tip-box{
  background:#fffff0;border:1px solid #ecc94b;
  border-radius:8px;padding:18px 24px;margin:28px 0;
}
.tip-box::before{content:"💡 팁  ";font-weight:700}
.warning-box{
  background:#fff5f5;border:1px solid #feb2b2;border-left:4px solid #e53e3e;
  border-radius:0 8px 8px 0;padding:16px 22px;margin:28px 0;
  font-size:14px;color:#742a2a;
}

/* ===== 태그 ===== */
.post-tags{
  display:flex;flex-wrap:wrap;gap:8px;
  margin:28px 0;padding-top:20px;border-top:1px solid #e2e8f0;
}
.tag-badge{
  display:inline-block;padding:5px 12px;background:#edf2f7;
  color:#4a5568;font-size:13px;border-radius:20px;transition:all .15s;
}
.tag-badge:hover{background:#1a365d;color:#fff}

/* ===== 관련글 ===== */
.related-posts{margin-top:32px;padding-top:24px;border-top:1px solid #e2e8f0}
.related-title{font-size:17px;font-weight:700;color:#1a365d;margin-bottom:16px}
.related-list{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.related-list li a{
  display:flex;align-items:center;gap:12px;padding:12px;
  background:#f7fafc;border-radius:8px;transition:all .15s;
}
.related-list li a:hover{background:#edf2f7;transform:translateY(-1px)}
.related-thumb{width:60px;height:60px;min-width:60px;border-radius:6px;object-fit:cover}
.related-link-title{
  font-size:14px;font-weight:600;color:#2d3748;line-height:1.4;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}

/* ===== 댓글 ===== */
.comment-section{margin-top:36px;padding-top:24px;border-top:1px solid #e2e8f0}
.comment-title{font-size:17px;font-weight:700;color:#1a365d;margin-bottom:16px}
.comment-count{color:#3182ce;font-size:15px}
.comment-item{padding:16px 0;border-bottom:1px solid #f1f5f9}
.comment-meta{display:flex;align-items:center;gap:10px;margin-bottom:8px}
.comment-author{font-weight:600;font-size:14px;color:#2d3748}
.comment-date{font-size:12px;color:#a0aec0}
.comment-body{font-size:14.5px;line-height:1.7;color:#4a5568}
.comment-form{margin-top:20px;padding:20px;background:#f7fafc;border-radius:8px}
.comment-form-guest{display:flex;gap:8px;margin-bottom:10px}
.comment-form-guest input{
  flex:1;padding:10px 14px;background:#fff;
  border:1px solid #e2e8f0;border-radius:6px;font-size:14px;
}
.comment-form textarea{
  width:100%;padding:12px 14px;background:#fff;
  border:1px solid #e2e8f0;border-radius:6px;font-size:14px;resize:vertical;
}
.comment-form-actions{display:flex;align-items:center;justify-content:space-between;margin-top:10px}
.secret-check{font-size:13px;color:#718096;cursor:pointer}
.btn-comment{
  padding:10px 24px;background:#1a365d;color:#fff;
  font-weight:600;font-size:14px;border-radius:6px;cursor:pointer;
  transition:background .15s;
}
.btn-comment:hover{background:#2d4a7a}

/* ===== 페이지네이션 ===== */
.pagination{display:flex;justify-content:center;gap:4px;margin:32px 0}
.page-link{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:36px;height:36px;padding:0 8px;font-size:14px;
  color:#4a5568;border-radius:6px;transition:all .15s;
}
.page-link:hover{background:#edf2f7}
.page-link.selected{background:#1a365d;color:#fff;font-weight:700}

/* ===== SIDEBAR ===== */
.sidebar{position:sticky;top:80px;max-height:calc(100vh - 100px);overflow-y:auto}
.sidebar-widget{
  background:#fff;border-radius:10px;padding:20px;
  margin-bottom:16px;box-shadow:0 1px 4px rgba(0,0,0,.06);
}
.widget-title{
  font-size:14px;font-weight:700;color:#1a365d;
  margin-bottom:12px;padding-bottom:8px;border-bottom:2px solid #edf2f7;
}
.widget-content{font-size:14px;line-height:1.7;color:#4a5568}
.widget-content a{display:block;padding:6px 0;color:#4a5568;transition:color .15s}
.widget-content a:hover{color:#1a365d}
.search-box input{
  width:100%;padding:10px 14px;background:#f7fafc;
  border:1px solid #e2e8f0;border-radius:6px;font-size:14px;
}
.search-box input:focus{border-color:#3182ce;box-shadow:0 0 0 3px rgba(49,130,206,.15)}

/* ===== FOOTER ===== */
.site-footer{background:#1a365d;color:#a0aec0;margin-top:48px}
.footer-inner{max-width:1100px;margin:0 auto;padding:28px 20px;text-align:center}
.footer-links{display:flex;justify-content:center;gap:24px;margin-bottom:12px}
.footer-links a{font-size:13px;color:#cbd5e0;transition:color .15s}
.footer-links a:hover{color:#fff}
.copyright{font-size:12px;color:#718096}

/* 맨 위로 */
.btn-top{
  position:fixed;bottom:24px;right:24px;width:44px;height:44px;
  background:#1a365d;color:#fff;font-size:20px;border-radius:50%;
  cursor:pointer;opacity:0;visibility:hidden;transition:all .3s;
  box-shadow:0 2px 8px rgba(0,0,0,.2);z-index:99;
}
.btn-top.show{opacity:1;visibility:visible}
.btn-top:hover{background:#2d4a7a;transform:translateY(-2px)}

/* ===== RESPONSIVE ===== */
@media(max-width:1024px){
  .layout-wrap{grid-template-columns:1fr;gap:24px;padding:16px}
  .sidebar{
    position:static;max-height:none;
    display:grid;grid-template-columns:repeat(2,1fr);gap:12px;
  }
  .ad-slot-sidebar{position:static;grid-column:1/-1}
}

@media(max-width:768px){
  .blog-title{font-size:17px}
  .gnb{display:none;width:100%;order:10}
  .gnb.open{display:block}
  .gnb.open .category-list{
    flex-direction:column;gap:0;
    background:rgba(0,0,0,.1);border-radius:6px;margin-top:8px;padding:4px;
  }
  .gnb.open .cat-link{padding:10px 14px;color:#e2e8f0}
  .gnb.open .sub-category{position:static;box-shadow:none;background:transparent;padding:0 0 0 16px}
  .gnb.open .sub-category a{color:#a0aec0}
  .mobile-menu-btn{display:block}

  .post-view{padding:20px 16px}
  .post-title{font-size:21px}
  .entry-content{font-size:15.5px;line-height:1.8}
  .entry-content h2{font-size:19px;margin-top:44px;padding-top:20px}
  .entry-content h3{font-size:17px;margin-top:32px}

  .ad-slot.active,.ad-slot:has(ins){min-height:250px}

  .table-wrap{margin:24px -8px;padding:0 8px}
  .entry-content table{min-width:480px;font-size:13px}
  .entry-content table th,.entry-content table td{padding:10px 12px}

  .post-card-link{flex-direction:column;gap:12px;padding:16px}
  .post-thumb{width:100%;height:160px}
  .post-card-title{font-size:16px}

  .related-list{grid-template-columns:1fr}
  .sidebar{grid-template-columns:1fr}
  .highlight-box{padding:16px 18px;font-size:15px}
  .highlight-box strong{font-size:17px}
  .cta-box{padding:18px 20px}
  .comment-form-guest{flex-direction:column}

  .reading-progress{height:2px}
}

@media(max-width:480px){
  .header-inner{padding:12px 14px}
  .blog-title{font-size:15px}
  .layout-wrap{padding:12px}
  .post-view{padding:16px 12px;border-radius:8px}
  .post-title{font-size:19px}
  .entry-content{font-size:15px}
}