/* ==========================================================================
   Naksh Power Solution — Blog styles (blog.php, blog-post.php, home "Latest articles")
   Uses the colour variables defined in site.css
   ========================================================================== */

/* 8 menu items: keep the desktop navbar on one line and never squeeze the logo */
.navbar .brand { flex-shrink: 0; }
.navbar .brand img { width: auto; max-width: none; }
/* 8 links + phone don't fit in 1220px: show the call button as a round icon */
.nav-phone > span:not(.ic) { display: none; }
@media (max-width: 1240px) { .nav-links a { padding: 9px 9px; font-size: 15px; } }
@media (max-width: 1100px) { .nav-links a { padding: 9px 6px; font-size: 14px; } }
@media (max-width: 1040px) and (min-width: 961px) { .nav-cta .btn { display: none; } }

/* ---------- Shared bits ---------- */
.blog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; color: var(--muted); }
.blog-meta span { display: inline-flex; align-items: center; gap: 6px; }
.blog-meta svg { width: 14px; height: 14px; color: var(--orange); }
.blog-cat { display: inline-block; background: var(--orange-soft); color: var(--orange-2) !important; font-weight: 700; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.blog-cat:hover { background: var(--orange); color: #fff !important; }

/* ---------- Blog list hero ---------- */
.blog-search { margin-top: 26px; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 6px 6px 6px 16px; max-width: 620px; box-shadow: 0 16px 40px rgba(0, 0, 0, .18); }
.blog-search svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.blog-search input { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 15px; color: var(--ink); background: transparent; padding: 8px 0; font-family: var(--font-body); }
.blog-sec { padding-top: 48px; }

/* ---------- Category chips ---------- */
.blog-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 34px; }
.blog-cats a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--navy); transition: .2s ease; }
.blog-cats a em { font-style: normal; font-size: 11.5px; background: #fff; color: var(--muted); border-radius: 999px; padding: 1px 7px; }
.blog-cats a:hover { border-color: var(--blue); color: var(--blue); }
.blog-cats a.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.blog-cats a.on em { background: rgba(255, 255, 255, .16); color: #fff; }

/* ---------- Featured (latest) post ---------- */
.blog-feature { display: grid; grid-template-columns: 1.15fr 1fr; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 40px; }
.bf-media { position: relative; display: block; min-height: 340px; background: var(--grad-blue); overflow: hidden; }
.bf-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.blog-feature:hover .bf-media img { transform: scale(1.04); }
.blog-new { position: absolute; top: 18px; left: 18px; background: var(--grad); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; padding: 6px 14px; border-radius: 999px; box-shadow: 0 8px 20px rgba(233, 80, 44, .35); }
.bf-body { padding: 40px 42px; display: flex; flex-direction: column; justify-content: center; }
.bf-body h2 { font-size: clamp(24px, 2.6vw, 32px); margin: 16px 0 12px; line-height: 1.2; }
.bf-body h2 a:hover { color: var(--blue); }
.bf-body p { color: var(--muted); font-size: 15.5px; margin-bottom: 24px; }
.bf-body .btn { align-self: flex-start; }

/* ---------- Cards grid ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.blog-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.blog-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.bc-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--grad-blue); }
.bc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.blog-card:hover .bc-media img { transform: scale(1.06); }
.bc-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.bc-body h3 { font-size: 19.5px; line-height: 1.3; margin: 12px 0 8px; }
.bc-body h3 a:hover { color: var(--blue); }
.bc-body p { font-size: 14.5px; color: var(--muted); flex: 1; }
.bc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); }
.bc-foot .link-arrow { font-size: 14px; }

/* ---------- Pager / empty ---------- */
.blog-pager { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 46px; }
.blog-pager a, .blog-pager span { min-width: 42px; height: 42px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; border: 1px solid var(--line); font-weight: 600; font-size: 14.5px; color: var(--navy); background: #fff; }
.blog-pager a:hover { border-color: var(--blue); color: var(--blue); }
.blog-pager span.on { background: var(--grad); color: #fff; border-color: transparent; }
.blog-pager span.dots { border: 0; background: none; min-width: 20px; padding: 0; }
.blog-empty { text-align: center; padding: 60px 20px; background: var(--bg-soft); border-radius: var(--radius-lg); }
.blog-empty .ic { width: 64px; height: 64px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--orange-soft); color: var(--orange); }
.blog-empty .ic svg { width: 30px; height: 30px; }
.blog-empty h2 { font-size: 26px; margin: 16px 0 8px; }
.blog-empty p { color: var(--muted); margin-bottom: 20px; }

/* ---------- Single post ---------- */
.blog-preview-bar { background: #FEF3C7; color: #78350F; font-size: 14px; text-align: center; padding: 10px 20px; border-bottom: 1px solid #FDE68A; }
.blog-preview-bar a { text-decoration: underline; font-weight: 700; margin-left: 6px; }
.post-hero { padding: 60px 0 58px; }
.post-hero h1 { font-size: clamp(28px, 3.8vw, 46px); max-width: 920px; line-height: 1.15; }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 20px; font-size: 14px; color: rgba(255, 255, 255, .8); }
.post-meta span { display: inline-flex; align-items: center; gap: 7px; }
.post-meta svg { width: 16px; height: 16px; color: #F9A26B; }
.post-edit { background: rgba(255, 255, 255, .14); padding: 2px 12px; border-radius: 999px; color: #fff !important; }
.post-sec { padding-top: 46px; }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 50px; align-items: start; }
.post-main { min-width: 0; }
.post-cover { margin: 0 0 30px; border-radius: var(--radius-lg); overflow: hidden; background: var(--grad-blue); aspect-ratio: 16 / 9; box-shadow: var(--shadow); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }

.post-toc { background: var(--bg-soft); border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 14px; padding: 16px 22px; margin-bottom: 30px; }
.post-toc summary { font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--navy); cursor: pointer; }
.post-toc ol { margin: 12px 0 2px; padding-left: 22px; display: grid; gap: 6px; list-style: decimal; }
.post-toc li { font-size: 14.5px; color: var(--muted); }
.post-toc a { color: var(--blue); }
.post-toc a:hover { color: var(--orange-2); text-decoration: underline; }

.post-content { font-size: 17px; line-height: 1.8; color: #2B3A4E; }
.post-content > *:first-child { margin-top: 0; }
.post-content p { margin: 0 0 20px; }
.post-content h2 { font-size: clamp(23px, 2.4vw, 29px); margin: 40px 0 14px; line-height: 1.25; scroll-margin-top: 110px; position: relative; padding-left: 16px; }
.post-content h2::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 5px; border-radius: 4px; background: var(--grad); }
.post-content h3 { font-size: 21px; margin: 30px 0 10px; line-height: 1.3; color: var(--navy); }
.post-content h4 { font-size: 18px; margin: 24px 0 8px; color: var(--navy); }
.post-content ul, .post-content ol { margin: 0 0 22px; padding-left: 4px; list-style: none; display: grid; gap: 9px; }
.post-content ul li { position: relative; padding-left: 28px; }
.post-content ul li::before { content: ""; position: absolute; left: 4px; top: 10px; width: 9px; height: 9px; border-radius: 2px; background: var(--orange); transform: rotate(45deg); }
.post-content ol { counter-reset: pc; }
.post-content ol li { position: relative; padding-left: 38px; counter-increment: pc; }
.post-content ol li::before { content: counter(pc); position: absolute; left: 0; top: 2px; width: 26px; height: 26px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 700; font-size: 13.5px; display: grid; place-items: center; line-height: 1; font-family: var(--font-head); }
.post-content li > ul, .post-content li > ol { margin: 8px 0 0; }
.post-content a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-content a:hover { color: var(--orange-2); }
.post-content strong, .post-content b { color: var(--ink); font-weight: 700; }
.post-content blockquote { margin: 28px 0; padding: 20px 24px 20px 26px; background: linear-gradient(90deg, #FFF4EC, #FFF9F5); border-left: 5px solid var(--orange); border-radius: 0 14px 14px 0; color: #5A2A12; font-size: 16.5px; }
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content img { max-width: 100%; height: auto; border-radius: 14px; display: block; margin: 8px auto; }
.post-content figure { margin: 30px 0; }
.post-content figure img { width: 100%; max-height: 520px; object-fit: cover; box-shadow: var(--shadow); }
.post-content figcaption { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 10px; font-style: italic; }
.post-content hr { border: 0; border-top: 2px dashed var(--line); margin: 34px 0; }
.post-content table { width: 100%; border-collapse: collapse; margin: 0 0 26px; font-size: 15px; display: block; overflow-x: auto; }
.post-content table th, .post-content table td { border: 1px solid var(--line); padding: 11px 14px; text-align: left; vertical-align: top; }
.post-content table th { background: var(--navy); color: #fff; font-family: var(--font-head); font-weight: 600; letter-spacing: .01em; }
.post-content table tr:nth-child(even) td { background: var(--bg-soft); }

.post-inline-cta { margin: 36px 0 26px; padding: 22px 24px; border-radius: 18px; background: var(--grad-blue); color: rgba(255, 255, 255, .8); display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.post-inline-cta b { display: block; color: #fff; font-family: var(--font-head); font-size: 19px; margin-bottom: 3px; }
.post-inline-cta span { font-size: 13.5px; }
.post-inline-cta .acts { display: flex; gap: 10px; flex-wrap: wrap; }
.post-inline-cta .btn svg { width: 16px; height: 16px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; font-size: 14px; }
.post-tags b { color: var(--navy); margin-right: 4px; }
.post-tags a { background: var(--bg-soft); border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.post-tags a:hover { border-color: var(--blue); color: var(--blue); }
.post-share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; }
.post-share b { color: var(--navy); margin-right: 4px; }
.post-share a, .post-share button { border: 0; cursor: pointer; padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 700; color: #fff !important; font-family: var(--font-body); }
.sh-wa { background: var(--wa); } .sh-fb { background: #1877F2; } .sh-in { background: #0A66C2; } .sh-x { background: #111; }
.post-share .sh-copy { background: var(--bg-soft) !important; color: var(--navy) !important; border: 1px solid var(--line) !important; }
.post-share a:hover, .post-share button:hover { filter: brightness(1.08); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; }
.post-nav .pn { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; transition: .2s ease; }
.post-nav .pn:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.post-nav .pn small { display: block; font-size: 12px; color: var(--orange-2); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.post-nav .pn b { display: block; font-family: var(--font-head); color: var(--navy); font-size: 16px; line-height: 1.3; margin-top: 5px; }
.post-nav .next { text-align: right; grid-column: 2; }

/* ---------- Sidebar ---------- */
.post-side { position: sticky; top: 110px; display: grid; gap: 20px; }
.side-cta { background: var(--navy); color: rgba(255, 255, 255, .75); border-radius: var(--radius-lg); padding: 26px 24px; position: relative; overflow: hidden; }
.side-cta::after { content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; border: 30px solid rgba(239, 106, 46, .16); }
.side-cta .ic { width: 50px; height: 50px; border-radius: 14px; background: var(--grad); display: grid; place-items: center; color: #fff; }
.side-cta .ic svg { width: 26px; height: 26px; }
.side-cta h3 { color: #fff; font-size: 21px; margin: 16px 0 8px; }
.side-cta p { font-size: 14px; margin-bottom: 18px; }
.side-call { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; color: #fff; font-weight: 700; font-size: 15px; }
.side-call svg { width: 16px; height: 16px; color: #F9A26B; }
.side-calc { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-radius: 18px; background: var(--orange-soft); border: 1px solid #FAD7C3; transition: .2s ease; }
.side-calc:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.side-calc > svg { width: 34px; height: 34px; color: var(--orange-2); flex-shrink: 0; }
.side-calc b { display: block; font-family: var(--font-head); color: var(--navy); font-size: 16.5px; }
.side-calc small { font-size: 13px; color: var(--muted); }
.side-box { border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: #fff; }
.side-box h4 { font-size: 17px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--bg-soft); }
.side-post { display: flex; gap: 12px; align-items: center; padding: 9px 0; }
.side-post + .side-post { border-top: 1px dashed var(--line); }
.side-post img { width: 70px; height: 54px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--bg-soft); }
.side-post b { display: block; font-size: 14px; line-height: 1.35; color: var(--ink); font-weight: 600; }
.side-post:hover b { color: var(--blue); }
.side-post small { font-size: 12px; color: var(--muted); }
.side-cats { list-style: none; margin: 0; padding: 0; }
.side-cats a { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14.5px; color: var(--text); border-bottom: 1px dashed var(--line); }
.side-cats li:last-child a { border-bottom: 0; }
.side-cats a:hover { color: var(--blue); }
.side-cats em { font-style: normal; font-size: 12px; background: var(--bg-soft); border-radius: 999px; padding: 1px 9px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .post-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 34px; }
}
@media (max-width: 960px) {
  .blog-feature { grid-template-columns: 1fr; }
  .bf-media { min-height: 0; aspect-ratio: 16 / 9; }
  .bf-body { padding: 28px; }
  .blog-grid { grid-template-columns: 1fr 1fr; }
  .post-layout { grid-template-columns: 1fr; }
  .post-side { position: static; grid-template-columns: 1fr 1fr; }
  .side-cta { grid-row: span 2; }
}
@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-search { padding: 5px 5px 5px 12px; }
  .blog-search .btn { padding: 9px 12px; }
  .blog-cats { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px 26px; padding: 0 20px 6px; scrollbar-width: none; }
  .blog-cats::-webkit-scrollbar { display: none; }
  .blog-cats a { white-space: nowrap; }
  .bf-body { padding: 22px; }
  .post-hero { padding: 44px 0 42px; }
  .post-content { font-size: 16px; }
  .post-content h2 { margin-top: 32px; }
  .post-side { grid-template-columns: 1fr; }
  .side-cta { grid-row: auto; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: 1; }
  .post-inline-cta .acts, .post-inline-cta .acts .btn { width: 100%; }
}
