/* ==========================================================================
   TipsPedia Hub (hub.tipspedia.kr) - Custom Blogger Theme
   Design system replicated 1:1 from bizhelp.kr (colors, type, spacing, layout)
   Served via jsDelivr CDN from github.com/playskang-svg/tipspedia-hub-theme
   ========================================================================== */

:root {
  --bg: #f6f4ef;
  --bg-alt: #efece4;
  --ink: #1c222b;
  --ink-soft: #565f6b;
  --line: #ddd8cd;
  --navy: #16202c;
  --navy-soft: #29394d;
  --accent: #d9762e;
  --accent-soft: #f6e4d3;
  --card: #ffffff;
  --radius: 10px;
  --max: 1080px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  line-height: 1.6;
  word-break: keep-all;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 40px; }

/* ---------- Header ---------- */
.site-header { background: var(--navy); color: #fff; }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; gap: 16px; flex-wrap: wrap; }
.brand { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.brand span { color: var(--accent); }
.brand .tagline { display: block; font-size: 0.72rem; font-weight: 400; color: #b7c0cc; letter-spacing: 0; margin-top: 2px; }
.main-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.main-nav a { font-size: 0.92rem; color: #dfe4ea; padding: 6px 2px; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: #fff; border-color: var(--accent); }
.main-nav a.featured { background: var(--accent); border: 1px solid var(--accent); border-radius: 999px; color: #fff; font-weight: 700; padding: 6px 12px; }
.main-nav a.featured:hover { background: #24478a; border-color: #24478a; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, var(--navy) 0%, var(--navy) 55%, var(--bg) 55%); padding: 30px 0 0; }
.hero-inner { background: var(--navy-soft); color: #fff; border-radius: var(--radius); padding: 44px 32px; margin-bottom: -46px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 32px; align-items: stretch; }
.hero-eyebrow { color: var(--accent); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em; }
.hero h1 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); line-height: 1.35; margin: 10px 0 12px; font-weight: 800; }
.hero p { color: #cfd6de; max-width: 46em; margin: 0; }

.landing-cta { background: #fff; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: var(--radius); color: var(--ink); display: flex; flex-direction: column; justify-content: center; padding: 24px; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.landing-cta:hover { box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2); transform: translateY(-2px); }
.landing-cta-label { color: var(--accent); font-size: 0.78rem; font-weight: 700; }
.landing-cta strong { font-size: 1.35rem; line-height: 1.35; margin: 6px 0 18px; display: block; }
.landing-cta-action { color: var(--accent); font-size: 0.9rem; font-weight: 700; }

/* ---------- Category grid ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin: 70px 0 40px; }
.cat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; transition: border-color 0.15s ease, transform 0.15s ease; }
.cat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.cat-card .num { font-size: 0.75rem; color: var(--ink-soft); font-weight: 700; }
.cat-card h3 { margin: 6px 0 6px; font-size: 1.05rem; }
.cat-card p { margin: 0; font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- Section heading ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin: 44px 0 20px; }
.section-head h2 { font-size: 1.3rem; margin: 0; }
.section-head a { font-size: 0.85rem; color: var(--accent); font-weight: 600; }

/* ---------- Article list (mapped onto native Blogger Blog1 markup) ---------- */
.date-outer { border: 0; background: none; box-shadow: none; padding: 0; margin: 0; }
.date-header { display: none; }
.post-outer {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  box-shadow: none;
  margin-bottom: 0;
}
.post-outer::before {
  content: "";
  grid-row: 1;
  grid-column: 1;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--accent);
  flex: none;
}
.post-outer .post { display: contents; }
.post-title { grid-column: 2; grid-row: 1; margin: 0 0 6px; font-size: 1.05rem; order: 2; }
.post-title a { color: var(--ink); }
.post-header { display: none; }
.post-body {
  grid-column: 2;
  grid-row: 2;
  margin: 0 !important;
  color: var(--ink-soft) !important;
  font-size: 0.9rem !important;
  line-height: 1.6 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-footer { grid-column: 3; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.post-footer-line-1 { display: flex; flex-direction: column; align-items: flex-end; }
.post-timestamp { font-size: 0.78rem; color: var(--ink-soft); text-align: right; white-space: nowrap; order: 2; }
.post-timestamp .tp-read-time { display: none; }
.post-author, .post-comment-link, .post-icons { display: none; }
.post-footer-line-2 { order: -1; margin-bottom: 4px; }
.post-labels { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em; }
.post-labels a { color: var(--accent); }
.post-footer-line-3 { display: none; }
.post-share-buttons, .share-button-widget { display: none !important; }

/* Re-order grid children: since HTML order is title, header, body, footer -
   use CSS 'order' inside a flex/grid context by wrapping via display:contents on .post */
.post-outer { grid-template-areas: "chip label meta" "chip title meta" "chip excerpt meta"; grid-template-columns: 48px 1fr auto; }
.post-outer::before { grid-area: chip; align-self: start; }
.post-footer-line-2 { grid-area: label; }
.post-title { grid-area: title; }
.post-body { grid-area: excerpt; }
.post-footer-line-1 { grid-area: meta; }
.post-footer { display: contents; }

/* ---------- Pager ---------- */
.blog-pager { text-align: center; margin: 30px 0; }
.blog-pager a { display: inline-block; padding: 9px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 0.85rem; color: var(--ink); }
.blog-pager a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Article detail page ---------- */
/* Simple theme gives no page-type class in markup; main.js adds body.is-single-post via URL pattern detection */
body.is-single-post .post-outer { display: block !important; grid-template-columns: none !important; border: 0 !important; padding: 34px 0 22px !important; border-bottom: 1px solid var(--line) !important; }
body.is-single-post .post-outer::before { display: none !important; }
body.is-single-post .post-title { font-size: clamp(1.5rem, 3.2vw, 2.1rem) !important; line-height: 1.4 !important; margin: 0 0 14px !important; font-weight: 800; }
body.is-single-post .post-body {
  display: block !important;
  -webkit-line-clamp: unset !important;
  overflow: visible !important;
  font-size: 1.02rem !important;
  color: var(--ink) !important;
  line-height: 1.9 !important;
  padding: 30px 0 !important;
}
body.is-single-post .post-body img { border-radius: var(--radius); margin: 18px auto; }
body.is-single-post .post-body h2 { font-size: 1.25rem; margin: 34px 0 12px; border-left: 4px solid var(--accent); padding-left: 10px; }
body.is-single-post .post-body h3 { font-size: 1.1rem; margin: 26px 0 10px; font-weight: 800; }
body.is-single-post .post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
body.is-single-post .post-body blockquote { border-left: 4px solid var(--accent); background: var(--bg-alt); margin: 18px 0; padding: 14px 20px; color: var(--ink-soft); }
body.is-single-post .post-body table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 0.92rem; }
body.is-single-post .post-body th, body.is-single-post .post-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
body.is-single-post .post-body th { background: var(--bg-alt); }
body.is-single-post .post-footer { display: block !important; }
body.is-single-post .post-footer-line-1 { flex-direction: row !important; align-items: center !important; gap: 14px; font-size: 0.8rem; color: var(--ink-soft); }
body.is-single-post .post-timestamp { order: 0; }
body.is-single-post .post-footer-line-2 { margin: 16px 0 0 !important; }
body.is-single-post .post-labels a { background: var(--accent-soft); color: var(--accent); padding: 4px 10px; border-radius: 999px; font-weight: 700; margin-right: 6px; }
body.is-single-post .hero, body.is-single-post .cat-grid, body.is-single-post .section-head { display: none !important; }
body.is-single-post .date-header { display: block !important; font-size: 0.82rem; color: var(--ink-soft); margin: 24px 0 0; }

/* ---------- Sidebar: bizhelp home page has no sidebar (single column) ---------- */
.sidebar, #sidebar-wrapper, .fauxcolumn-right-outer, .column-right-outer { display: none !important; }
.content-outer, .main-outer, .content-inner, .region-inner.main-inner, .columns.fauxcolumns,
.columns-inner, .column-center-outer, .column-center-inner, .main.section, #main {
  float: none !important; width: 100% !important; max-width: 100% !important;
}
.content-outer, #main-wrapper, .main-outer { max-width: var(--max) !important; margin: 0 auto !important; padding: 0 40px !important; box-sizing: border-box !important; }
.hero, .site-header .bar, .site-footer .footer-grid, .site-footer .footer-bottom { padding-left: 0; padding-right: 0; }

/* Native Blogger page-header widget: kept in DOM for SEO/accessibility, visually hidden - replaced by .site-header */
.header-outer { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #cfd6de; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr) minmax(0,1fr); gap: 30px; padding: 46px 0 28px; }
.footer-grid h4 { color: #fff; font-size: 0.95rem; margin: 0 0 12px; }
.footer-grid p { font-size: 0.85rem; margin: 0; color: #a7b0bc; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; font-size: 0.88rem; }
.footer-grid a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #2b3947; padding: 16px 20px; font-size: 0.78rem; color: #8b96a3; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .site-header .bar { padding: 14px 20px; }
  .main-nav { gap: 4px 12px; font-size: 0.85rem; }
  .hero-inner { padding: 30px 20px; margin-bottom: -60px; gap: 22px; }
  .landing-cta { padding: 20px; }
  .cat-grid { margin-top: 84px; }
  .post-outer { grid-template-columns: 40px 1fr; grid-template-areas: "chip label" "chip title" "chip excerpt" "chip meta"; }
  .post-outer::before { width: 40px; height: 40px; }
  .post-footer-line-1 { align-items: flex-start !important; }
  .footer-grid { grid-template-columns: 1fr; padding: 34px 0 20px; }
}
