/*
Theme Name: CoderSathi GeneratePress Child
Theme URI: https://codersathi.com
Author: Yuba Raj Kalathoki
Author URI: https://codersathi.com
Description: A GeneratePress child theme for the CoderSathi programming blog.
Version: 1.0.24
Template: generatepress
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: codersathi
Tags: blog, education, custom-logo, featured-images, threaded-comments, translation-ready
*/

:root {
  --cs-navy: #020b1d;
  --cs-navy-2: #071a3b;
  --cs-ink: #08142d;
  --cs-muted: #5d6b82;
  --cs-line: #e6edf7;
  --cs-soft: #f5f8fc;
  --cs-blue: #075fc7;
  --cs-blue-2: #59c2ff;
  --cs-gold: #ffb21a;
  --cs-green: #63bd37;
  --cs-purple: #8d5cf6;
  --cs-radius: 8px;
  --cs-shadow: 0 14px 34px rgba(8, 20, 45, .09);
  --cs-card-radius: var(--cs-radius);
  --cs-card-border-width: 1px;
  --cs-card-padding: 24px;
  --cs-card-bg: #fff;
  --cs-card-border: var(--cs-line);
  --cs-card-soft-bg: #f8fbff;
  --cs-card-shadow: 0 8px 24px rgba(8,20,45,.06);
  --cs-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--cs-ink);
  background: #fff;
  font-family: var(--cs-font);
  font-size: 16px;
  line-height: 1.65;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > .cs-site-main {
  flex: 1 0 auto;
}
.site-footer {
  flex-shrink: 0;
}
body,
body.home,
body.page,
body.single,
#page,
.site,
.site-content,
.inside-article {
  background: #fff !important;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--cs-blue); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cs-blue) 45%, #fff);
  outline-offset: 3px;
}
img { max-width: 100%; height: auto; display: block; }
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}
.screen-reader-text:focus {
  z-index: 100000;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 14px;
  clip: auto;
  clip-path: none;
  border-radius: 6px;
  color: #fff;
  background: var(--cs-blue);
  box-shadow: var(--cs-shadow);
}
.container { width: min(1160px, calc(100% - 48px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 11, 29, .97);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
.header-inner { height: 62px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; font-weight: 900; font-size: 25px; line-height: 1; white-space: nowrap; }
.brand img { max-height: 42px; width: auto; }
.brand .cs { color: #fff; }
.brand .accent { color: var(--cs-gold); }
.brand .name { color: #6fc7ff; margin-left: 2px; }
.main-nav { margin-left: auto; }
.main-nav ul { margin: 0; padding: 0; list-style: none; }
.main-nav > ul,
.main-nav > div > ul { display: flex; align-items: center; gap: 28px; }
.main-nav li { position: relative; }
.main-nav a { color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; position: relative; }
.main-nav .current-menu-item > a,
.main-nav a:hover { color: #fff; }
.main-nav > ul > .current-menu-item > a::after,
.main-nav > div > ul > .current-menu-item > a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  display: block;
  width: 24px;
  height: 3px;
  background: var(--cs-gold);
  border-radius: 3px;
  transform: translateX(-50%);
}
.main-nav > ul > .menu-item-has-children > a::before,
.main-nav > div > ul > .menu-item-has-children > a::before {
  content: "⌄";
  order: 2;
  color: #d8e8ff;
  font-size: 13px;
  line-height: 1;
  transform: translateY(-1px);
}
.main-nav ul.sub-menu {
  display: block !important;
  position: absolute;
  left: 0;
  top: calc(100% + 18px);
  z-index: 100;
  width: 230px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--cs-radius);
  background: #061632;
  box-shadow: 0 22px 44px rgba(0, 0, 0, .28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.main-nav ul.sub-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -18px;
  height: 18px;
}
.main-nav li:hover > ul.sub-menu,
.main-nav li:focus-within > ul.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.main-nav ul.sub-menu a {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #eaf3ff;
  line-height: 1.25;
}
.main-nav ul.sub-menu a:hover,
.main-nav ul.sub-menu .current-menu-item > a {
  background: rgba(25,118,255,.16);
  color: #fff;
}
.main-nav ul.sub-menu a::after,
.main-nav ul.sub-menu a::before {
  display: none;
}
.search-toggle,
.menu-toggle {
  width: 38px;
  height: 38px;
  border: 0;
  color: #fff;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.menu-toggle { display: none; }
.search-form-wrap {
  display: none;
  padding: 0 0 14px;
}
.search-form-wrap.is-open { display: block; }
.search-form { display: flex; gap: 8px; max-width: 520px; margin-left: auto; }
.search-field {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--cs-radius);
  background: rgba(255,255,255,.08);
  color: #fff;
  padding: 12px 14px;
}
.search-submit,
.btn {
  border: 1px solid transparent;
  border-radius: var(--cs-radius);
  padding: 12px 20px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary,
.search-submit { color: #fff; background: linear-gradient(135deg, #075fc7, #064fac); }
.btn-outline { color: #fff; border-color: rgba(255,255,255,.78); background: transparent; }
.btn-ghost { color: var(--cs-blue); border-color: #b9d5ff; background: #fff; }

.hero {
  color: #fff;
  background:
    radial-gradient(circle at 75% 28%, rgba(34, 92, 196, .38), transparent 28%),
    linear-gradient(115deg, #041431 0%, #061b43 55%, #0b1f59 100%);
  min-height: 440px;
  overflow: hidden;
  display: block;
  width: 100%;
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 560px); gap: 36px; align-items: center; padding: 42px 0 0; }
.eyebrow { display: inline-flex; padding: 7px 13px; color: #75caff; background: rgba(25, 118, 255, .22); border-radius: var(--cs-radius); font-weight: 900; font-size: 12px; letter-spacing: .02em; text-transform: uppercase; }
.hero h1 { font-size: clamp(38px, 5vw, 56px); line-height: 1.1; margin: 20px 0 14px; letter-spacing: 0; }
.hero h1 span { color: var(--cs-blue-2); }
.hero p { max-width: 560px; margin: 0 0 26px; font-size: 18px; color: #eef6ff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 26px; }
.hero-stack { display: flex; flex-wrap: wrap; gap: 18px; width: fit-content; max-width: 100%; padding: 15px 20px; border-radius: var(--cs-radius); background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.hero-stack span { display: inline-flex; gap: 8px; align-items: center; font-weight: 800; font-size: 14px; }
.hero-visual { min-height: 380px; position: relative; display: flex; align-items: flex-end; justify-content: center; }
.code-panel { position: absolute; left: 0; top: 44px; width: 310px; min-height: 190px; border: 1px solid rgba(116, 184, 255, .2); border-radius: 12px; padding: 24px; color: rgba(126, 207, 255, .7); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: rgba(2, 12, 30, .18); }
.mentor { position: relative; width: 350px; height: 350px; margin-left: 110px; border-radius: 48% 48% 0 0; background: linear-gradient(180deg, #17335f, #071526); }
.mentor::before {
  content: "";
  position: absolute;
  width: 138px;
  height: 138px;
  top: 24px;
  left: 106px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #f0b990 0 34%, #171f2d 35% 48%, transparent 49%);
  box-shadow: inset 0 -18px 0 #0d1829;
}
.mentor::after {
  content: "CS";
  position: absolute;
  right: 24px;
  bottom: 18px;
  width: 52px;
  height: 64px;
  border-radius: 0 0 14px 14px;
  background: #06142b;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 24px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.08);
}
.laptop { position: absolute; left: 50px; bottom: 0; width: 285px; height: 118px; border-radius: 12px 12px 4px 4px; background: linear-gradient(145deg, #d7d7db, #8b8d94); box-shadow: 0 20px 36px rgba(0,0,0,.32); }
.laptop::after { content: ""; position: absolute; left: -32px; right: -32px; bottom: -11px; height: 14px; border-radius: 999px; background: #1c2230; }
.orbit { position: absolute; right: 0; top: 72px; display: grid; gap: 28px; font-size: 45px; }

.section { padding: 28px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.section-head p { margin: 3px 0 0; color: var(--cs-muted); font-size: 14px; }
.view-link { color: var(--cs-blue); font-weight: 800; font-size: 14px; white-space: nowrap; }
.topic-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.topic-card,
.post-card,
.stat-card,
.about-card,
.series-card,
.search-empty-state,
.not-found-link-card,
.sidebar-card,
.single-sidebar .widget,
.article-shell,
.nav-card,
.author-box,
.author-profile-card,
.codersathi-tutorial-nav-card,
.learn-box,
.info-box,
.tip-box,
.helpful-box {
  border: var(--cs-card-border-width) solid var(--cs-card-border);
  border-radius: var(--cs-card-radius);
  background: var(--cs-card-bg);
  box-shadow: var(--cs-card-shadow);
}
.topic-card { min-height: 178px; padding: 25px 16px; text-align: center; color: inherit; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.topic-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(8,20,45,.1); }
.topic-card:nth-child(2n) { background: #f4fbf0; }
.topic-card:nth-child(3n) { background: #fbf6ff; }
.topic-card:nth-child(4n) { background: #fff8ef; }
.topic-icon { font-size: 42px; line-height: 1; margin-bottom: 15px; }
.topic-card h3 { margin: 0 0 7px; font-size: 18px; }
.topic-card strong { display: block; font-size: 14px; margin-bottom: 8px; }
.topic-card p { margin: 0; color: var(--cs-ink); font-size: 13px; line-height: 1.5; }

.series-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.series-card { min-height: 230px; padding: 26px; display: grid; grid-template-columns: 1fr 132px; gap: 16px; overflow: hidden; }
.series-card.green { background: linear-gradient(135deg, #f4fff0, #eef8e8); }
.series-card.blue { background: linear-gradient(135deg, #f4fbff, #edf7ff); }
.series-card.purple { background: linear-gradient(135deg, #fbf6ff, #f8f0ff); }
.badge { display: inline-flex; width: fit-content; padding: 5px 10px; border-radius: 999px; background: rgba(25,118,255,.12); color: var(--cs-blue); font-weight: 900; font-size: 11px; }
.series-card h3 { margin: 15px 0 10px; font-size: 20px; line-height: 1.25; }
.series-card p, .series-card li { font-size: 13px; line-height: 1.5; }
.series-card ul { margin: 42px 0 0; padding-left: 18px; }
.series-art { justify-self: end; font-size: 64px; opacity: .78; }

.post-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.post-card { overflow: hidden; }
.post-thumb {
  position: relative;
  min-height: 130px;
  padding: 18px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, #061632, #0d3b68);
  overflow: hidden;
}
.post-thumb.has-image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,22,50,.12), rgba(6,22,50,.82)); z-index: 1; }
.post-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-thumb > span,
.post-thumb h3 { position: relative; z-index: 2; }
.post-card:nth-child(3n) .post-thumb { background: linear-gradient(135deg, #28115a, #071632); }
.post-card:nth-child(5n) .post-thumb { background: linear-gradient(135deg, #a04c12, #5d2808); }
.post-thumb h3 { margin: 16px 0 0; font-size: 18px; line-height: 1.25; }
.post-body { padding: calc(var(--cs-card-padding) - 8px); }
.post-body h3 { margin: 0 0 10px; font-size: 15px; line-height: 1.45; }
.post-body p { margin: 0 0 16px; color: var(--cs-ink); font-size: 13px; line-height: 1.55; }
.meta { color: var(--cs-muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.meta-tax { display: inline-flex; }
.cat-pill { width: fit-content; padding: 3px 8px; border-radius: 5px; color: #fff; background: #9a4f00; font-size: 11px; font-weight: 900; }

.about-stats { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 16px; align-items: stretch; }
.about-card { padding: var(--cs-card-padding); display: grid; grid-template-columns: 86px 1fr; gap: 18px; background: var(--cs-card-soft-bg); }
.avatar { width: 86px; height: 86px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #e8b28d 0 32%, #101827 33% 52%, #07142a 53%); }
.author-avatar,
.avatar-img {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  object-fit: cover;
  background: #edf4ff;
}
.about-card h2 { margin: 0 0 4px; font-size: 22px; }
.about-card p { margin: 8px 0 14px; font-size: 14px; line-height: 1.55; }
.socials { display: flex; gap: 12px; color: var(--cs-blue); font-weight: 900; }
.stat-card { display: grid; place-items: center; text-align: center; padding: var(--cs-card-padding) 12px; }
.stat-card i { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: #edf4ff; color: var(--cs-blue); font-style: normal; font-size: 24px; }
.stat-card strong { color: var(--cs-blue); font-size: 31px; line-height: 1; margin-top: 12px; }
.stat-card span { font-weight: 900; }
.stat-card small { color: var(--cs-muted); }

.newsletter {
  margin: 12px auto 0;
  padding: 24px 80px;
  border-radius: var(--cs-radius);
  background: linear-gradient(135deg, #061632, #082363);
  color: #fff;
  display: grid;
  grid-template-columns: 74px 1fr minmax(320px, 430px);
  gap: 24px;
  align-items: center;
}
.newsletter-icon { font-size: 42px; }
.newsletter h2 { margin: 0 0 5px; }
.newsletter p { margin: 0; color: #d8e8ff; }
.newsletter-form { display: flex; }
.newsletter-form input { flex: 1; min-width: 0; border: 1px solid rgba(255,255,255,.25); background: rgba(2,11,29,.7); color: #fff; border-radius: 8px 0 0 8px; padding: 13px 16px; }
.newsletter-form button { border-radius: 0 8px 8px 0; }

.site-footer { margin-top: 36px; color: #dce8fb; background: var(--cs-navy); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 48px; padding: 34px 0 24px; }
.footer-grid h2, .footer-grid h3 { color: #fff; margin: 0 0 12px; font-size: 15px; }
.footer-grid p, .footer-grid a { color: #dce8fb; font-size: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; columns: 2; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 14px 0; display: flex; justify-content: space-between; gap: 20px; color: #b8c7dd; font-size: 13px; }
.footer-bottom a { color: #dce8fb; }
.footer-bottom a:hover { color: #fff; }

.content-wrap { background: #fff; }
.breadcrumb { padding: 22px 0; color: #3c4d66; font-size: 14px; }
.single-layout { display: grid; grid-template-columns: minmax(0, 760px) 350px; gap: 32px; align-items: start; min-width: 0; }
.single-layout.left-sidebar { grid-template-columns: 350px minmax(0, 760px); }
.single-layout.both-sidebars { width: min(1440px, calc(100% - 48px)); grid-template-columns: minmax(240px, 300px) minmax(0, 760px) minmax(240px, 300px); }
.single-layout.left-sidebar .single-sidebar-left,
.single-layout.both-sidebars .single-sidebar-left { order: 1; }
.single-layout.left-sidebar .article-shell,
.single-layout.both-sidebars .article-shell { order: 2; }
.single-layout.right-sidebar .article-shell { order: 1; }
.single-layout.right-sidebar .single-sidebar-right,
.single-layout.both-sidebars .single-sidebar-right { order: 3; }
.single-layout.no-sidebar { display: block; max-width: 980px; }
.single-layout.no-sidebar .single-sidebar { display: none; }
.single-layout.has-tutorial-nav {
  width: min(1440px, calc(100% - 48px));
  grid-template-columns: minmax(240px, 300px) minmax(0, 880px);
  gap: 28px;
}
.single-layout.has-tutorial-nav.left-sidebar {
  grid-template-columns: minmax(240px, 300px) minmax(240px, 300px) minmax(0, 760px);
}
.single-layout.has-tutorial-nav.right-sidebar {
  grid-template-columns: minmax(240px, 300px) minmax(0, 760px) minmax(240px, 300px);
}
.single-layout.has-tutorial-nav.both-sidebars {
  grid-template-columns: minmax(220px, 270px) minmax(220px, 270px) minmax(0, 700px) minmax(220px, 270px);
}
.single-layout.has-tutorial-nav.left-sidebar .single-tutorial-sidebar { order: 1; }
.single-layout.has-tutorial-nav.left-sidebar .single-sidebar-left { order: 2; }
.single-layout.has-tutorial-nav.left-sidebar .article-shell { order: 3; }
.single-layout.has-tutorial-nav.right-sidebar .single-tutorial-sidebar { order: 1; }
.single-layout.has-tutorial-nav.right-sidebar .article-shell { order: 2; }
.single-layout.has-tutorial-nav.right-sidebar .single-sidebar-right { order: 3; }
.single-layout.has-tutorial-nav.both-sidebars .single-tutorial-sidebar { order: 1; }
.single-layout.has-tutorial-nav.both-sidebars .single-sidebar-left { order: 2; }
.single-layout.has-tutorial-nav.both-sidebars .article-shell { order: 3; }
.single-layout.has-tutorial-nav.both-sidebars .single-sidebar-right { order: 4; }
.single-layout.has-tutorial-nav.no-sidebar {
  display: grid;
  max-width: none;
  grid-template-columns: minmax(240px, 300px) minmax(0, 880px);
}
.single-layout.has-tutorial-nav.no-sidebar .single-tutorial-sidebar { order: 1; }
.single-layout.has-tutorial-nav.no-sidebar .article-shell { order: 2; }
.page .single-layout { display: block; max-width: 980px; }
.page .article-shell { min-height: 260px; }
.article-shell { min-width: 0; padding: calc(var(--cs-card-padding) + 8px); overflow: hidden; }
.article-header h1 { margin: 16px 0 12px; font-size: clamp(34px, 4vw, 48px); font-weight: 760; line-height: 1.1; letter-spacing: 0; }
.article-subtitle { color: #47566e; font-size: 17px; margin: 0 0 26px; }
.byline { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 22px; }
.byline .avatar,
.byline .author-avatar,
.byline .avatar-img { width: 38px; height: 38px; }
.share { margin-left: auto; color: var(--cs-blue); font-weight: 900; display: flex; gap: 14px; align-items: center; }
.feature-diagram,
.flow-diagram {
  min-height: 210px;
  border-radius: var(--cs-card-radius);
  color: #fff;
  background: linear-gradient(135deg, #061632, #081d45);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: center;
  text-align: center;
  padding: 28px;
  margin: 18px 0;
}
.diagram-node strong { display: block; font-size: 22px; line-height: 1.1; }
.diagram-node span { font-size: 58px; line-height: 1; display: block; margin-bottom: 12px; }
.learn-box,
.info-box,
.tip-box,
.helpful-box {
  padding: 18px 22px;
  margin: 20px 0;
}
.learn-box { border-color: color-mix(in srgb, var(--cs-blue) 30%, var(--cs-card-border)); background: color-mix(in srgb, var(--cs-blue) 7%, var(--cs-card-bg)); }
.learn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; margin: 8px 0 0; padding: 0; list-style: none; }
.learn-grid li::before { content: "✓"; color: var(--cs-blue); font-weight: 900; margin-right: 10px; }
.article-content h2 { margin: 28px 0 8px; font-size: 26px; font-weight: 720; line-height: 1.25; }
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 { font-weight: 700; scroll-margin-top: 110px; }
.article-content h2 { scroll-margin-top: 110px; }
.article-content p { margin: 0 0 14px; }
.article-content strong,
.article-content b {
  font-weight: 650;
}
.article-content a,
.tutorial-page-content .article-content a,
.page .article-shell a {
  color: var(--cs-blue);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.article-content a:hover,
.article-content a:focus,
.tutorial-page-content .article-content a:hover,
.tutorial-page-content .article-content a:focus,
.page .article-shell a:hover,
.page .article-shell a:focus {
  color: #034f9d;
  text-decoration-thickness: 2px;
}
.info-box { background: color-mix(in srgb, var(--cs-blue) 6%, var(--cs-card-bg)); border-color: color-mix(in srgb, var(--cs-blue) 18%, var(--cs-card-border)); }
.flow-diagram { min-height: 150px; grid-template-columns: repeat(4, 1fr); }
.flow-diagram .diagram-node span { font-size: 40px; }
.flow-diagram .diagram-node strong { font-size: 14px; }
pre {
  max-width: 100%;
  overflow: auto;
  background: #071426;
  color: #dcecff;
  border-radius: var(--cs-radius);
  padding: 18px;
  font-size: 14px;
  -webkit-overflow-scrolling: touch;
}
pre code { white-space: pre; }
.tip-box { border-color: color-mix(in srgb, var(--cs-gold) 36%, var(--cs-card-border)); background: color-mix(in srgb, var(--cs-gold) 9%, var(--cs-card-bg)); }
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 24px 0 4px;
  color: var(--cs-muted);
  font-size: 13px;
  font-weight: 800;
}
.article-tags a {
  padding: 5px 9px;
  border: 1px solid #d7e2f1;
  border-radius: 5px;
  color: #33486f;
  background: #f8fbff;
}
.helpful-box { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: var(--cs-card-soft-bg); }
.icon-btn {
  min-width: 54px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #bdc9d9;
  border-radius: 7px;
  background: #fff;
  color: #23334d;
  cursor: pointer;
  font-weight: 800;
}
.icon-btn:hover,
.icon-btn:focus,
.icon-btn.is-selected {
  border-color: var(--cs-blue);
  color: var(--cs-blue);
  background: color-mix(in srgb, var(--cs-blue) 8%, #fff);
}
.icon-btn:disabled { cursor: wait; opacity: .7; }
.helpful-count { font-size: 12px; line-height: 1; }
.helpful-message { color: var(--cs-muted); font-size: 13px; font-weight: 700; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.nav-card { padding: 18px; font-weight: 650; line-height: 1.45; }
.nav-card small { display: block; margin-bottom: 4px; color: var(--cs-muted); font-size: 13px; font-weight: 650; }
.nav-card a {
  color: var(--cs-ink);
  text-decoration: none;
}
.nav-card a:hover,
.nav-card a:focus {
  color: var(--cs-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.author-box {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 20px;
  align-items: start;
  margin: 24px 0;
  padding: var(--cs-card-padding);
  background: var(--cs-card-soft-bg);
}
.author-box .author-avatar {
  width: 92px;
  height: 92px;
}
.author-box h2 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.25;
}
.author-box p {
  margin: 0 0 14px;
  color: #34435a;
}
.author-box-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--cs-muted);
  font-size: 14px;
  font-weight: 700;
}
.author-box-link {
  color: var(--cs-blue);
  font-weight: 900;
}

.author-archive-hero {
  padding: 52px 0 28px;
  background: linear-gradient(135deg, #f6f9ff, #fff);
}
.author-profile-card {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 26px;
  align-items: center;
  padding: calc(var(--cs-card-padding) + 6px);
}
.author-profile-card .author-avatar {
  width: 118px;
  height: 118px;
}
.archive-icon {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #075fc7, #59c2ff);
  font-size: 52px;
  font-weight: 900;
}
.author-profile-card h1 {
  margin: 0 0 8px;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.1;
}
.author-profile-card p {
  margin: 0 0 14px;
  color: #34435a;
}
.author-posts-heading {
  margin: 0 0 20px;
  font-size: 26px;
}

.single-sidebar { display: grid; gap: 28px; position: sticky; top: 86px; }
.single-tutorial-sidebar {
  position: sticky;
  top: 86px;
  min-width: 0;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
}
.single-tutorial-sidebar .codersathi-tutorial-nav-card {
  position: static;
  max-height: none;
  overflow: visible;
}
.sidebar-card,
.single-sidebar .widget { padding: var(--cs-card-padding); }
.toc { padding: 18px; }
.toc h2 { margin: 0 0 10px; font-size: 18px; line-height: 1.25; }
.toc ol { margin: 8px 0 0; padding-left: 14px; }
.toc ol ol { margin-top: 5px; padding-left: 13px; }
.toc li { margin: 0 0 6px; line-height: 1.35; }
.toc-list > li:first-child { color: inherit; font-weight: inherit; border-left: 0; padding-left: 0; margin-left: 0; }
.toc a {
  display: block;
  border-left: 3px solid transparent;
  margin-left: -12px;
  padding: 4px 8px 4px 9px;
  border-radius: 0 6px 6px 0;
  color: inherit;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.toc a:hover,
.toc a:focus { color: var(--cs-blue); background: #eef4ff; }
.toc a.is-active {
  background: #eef4ff;
  border-left-color: var(--cs-blue);
  color: var(--cs-ink);
  font-weight: 800;
}
.toc .toc-level-3,
.toc .toc-level-4,
.toc .toc-level-5,
.toc .toc-level-6 { font-size: 14px; color: var(--cs-muted); }
.download { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center; }
.download-icon { width: 52px; height: 52px; border-radius: 50%; background: #eef4ff; display: grid; place-items: center; font-size: 28px; }
.related-list { display: grid; gap: 20px; }
.related-item { display: grid; grid-template-columns: 70px 1fr; gap: 14px; align-items: start; }
.related-thumb { height: 70px; border-radius: var(--cs-radius); background: linear-gradient(135deg, #11235d, #f0528f); color: #fff; display: grid; place-items: center; font-size: 27px; }
.related-item h3 { margin: 0 0 7px; font-size: 15px; font-weight: 650; line-height: 1.3; }
.cta-card { background: linear-gradient(135deg, #071632, #2b185f); color: #fff; }

.archive-header { padding: 46px 0 10px; }
.archive-header h1 { margin: 0 0 8px; font-size: 40px; }
.search-empty-state { max-width: 720px; padding: var(--cs-card-padding); }
.search-empty-state h2 { margin: 0 0 8px; font-size: 24px; }
.search-empty-state p { margin: 0 0 18px; color: var(--cs-muted); }
.search-empty-state .search-form { margin-left: 0; }
.search-empty-state .search-field {
  border-color: var(--cs-line);
  color: var(--cs-ink);
  background: #fff;
}
.not-found-hero .author-profile-card {
  align-items: start;
}
.not-found-icon {
  font-size: 34px;
  letter-spacing: 0;
}
.not-found-section {
  padding-bottom: 64px;
}
.not-found-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, .8fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 30px;
}
.not-found-search {
  max-width: none;
}
.not-found-links {
  display: grid;
  gap: 14px;
}
.not-found-link-card {
  display: grid;
  gap: 6px;
  padding: 22px;
  color: inherit;
}
.not-found-link-card:hover {
  color: var(--cs-blue);
  border-color: #b9d5ff;
}
.not-found-link-card span {
  color: var(--cs-muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}
.not-found-link-card strong {
  font-size: 18px;
  line-height: 1.25;
}
.not-found-latest-head {
  margin-top: 6px;
}
.pagination { margin: 30px 0; display: flex; justify-content: center; gap: 8px; }
.pagination .page-numbers { padding: 9px 13px; border: 1px solid var(--cs-line); border-radius: 6px; }
.pagination .current { background: var(--cs-blue); color: #fff; }

.tutorial-page-wrap { padding: 56px 0 76px; background: #fff; }
.tutorial-page-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
}
.tutorial-left-sidebar {
  position: sticky;
  top: 92px;
  border: var(--cs-card-border-width) solid var(--cs-card-border);
  border-radius: var(--cs-card-radius);
  background: var(--cs-card-bg);
  box-shadow: var(--cs-card-shadow);
  padding: 22px;
  max-height: calc(100vh - 116px);
  overflow: auto;
}
.tutorial-menu-widget + .tutorial-menu-widget { margin-top: 24px; }
.tutorial-menu-title {
  margin: 0 0 22px;
  padding: 16px 18px;
  border-radius: var(--cs-radius);
  color: #fff;
  background: linear-gradient(135deg, var(--cs-navy), var(--cs-navy-2));
  text-align: center;
  font-size: 24px;
  font-weight: 500;
}
.tutorial-left-sidebar ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.tutorial-left-sidebar li { margin: 0; }
.tutorial-left-sidebar a {
  display: block;
  padding: 10px 8px 10px 34px;
  color: #30343b;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.28;
  position: relative;
  border-radius: 6px;
}
.tutorial-left-sidebar a::before {
  content: "+";
  position: absolute;
  left: 8px;
  top: 10px;
  color: #30343b;
  font-weight: 900;
}
.tutorial-left-sidebar .tutorial-nav-level-3 a {
  padding-left: 48px;
  font-size: 15px;
  font-weight: 700;
  color: #526176;
}
.tutorial-left-sidebar .tutorial-nav-level-3 a::before {
  left: 24px;
  content: "-";
}
.tutorial-left-sidebar .current-menu-item > a,
.tutorial-left-sidebar a:hover {
  color: var(--cs-blue);
  background: #eef6ff;
}
.tutorial-page-content {
  max-width: 100%;
  color: #2d3037;
}
.tutorial-page-content h1 {
  margin: 0 0 8px;
  color: #33486f;
  font-size: clamp(42px, 5vw, 62px);
  line-height: 1.08;
  letter-spacing: 0;
}
.tutorial-page-meta {
  margin: 0 0 34px;
  color: #3f444c;
  font-size: 18px;
}
.tutorial-page-meta a { color: #33486f; }
.tutorial-page-content .article-content {
  font-size: 19px;
  line-height: 1.55;
}
.tutorial-page-content .article-content p { margin-bottom: 28px; }
.tutorial-page-content .article-content strong { font-weight: 650; }
.tutorial-page-content .article-content h2 {
  color: #33486f;
  font-size: 34px;
  font-weight: 720;
  line-height: 1.15;
  scroll-margin-top: 92px;
}
.tutorial-page-content .article-content h3 {
  color: #33486f;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.25;
  scroll-margin-top: 92px;
}

.codersathi-tutorial-nav-card {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 18px 14px;
}
.codersathi-tutorial-nav-card::-webkit-scrollbar,
.codersathi-tutorial-nav .sub-menu::-webkit-scrollbar {
  width: 0;
}
.codersathi-tutorial-nav-title {
  margin: 0 0 14px;
  padding: 13px 14px;
  border-radius: var(--cs-radius);
  color: #fff;
  background: linear-gradient(135deg, var(--cs-navy), var(--cs-navy-2));
  text-align: center;
  font-size: 20px;
}
.codersathi-tutorial-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.codersathi-tutorial-nav li {
  position: relative;
  margin: 0;
}
.codersathi-tutorial-nav a {
  display: block;
  padding: 9px 8px 9px 34px;
  border-radius: 6px;
  color: #30343b;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}
.codersathi-tutorial-nav .menu-item-has-children > a {
  cursor: pointer;
}
.codersathi-tutorial-nav a:hover,
.codersathi-tutorial-nav .current-menu-item > a {
  background: #eef6ff;
  color: var(--cs-blue);
}
.codersathi-tutorial-nav .sub-menu {
  display: block;
  max-height: 0;
  overflow: hidden;
  margin-left: 16px;
  padding-left: 10px;
  border-left: 1px solid #d9e2ef;
  transition: max-height .22s ease;
}
.codersathi-tutorial-nav .expanded > .sub-menu,
.codersathi-tutorial-nav .current-menu-ancestor > .sub-menu,
.codersathi-tutorial-nav .current-menu-parent > .sub-menu,
.codersathi-tutorial-nav .current-menu-item > .sub-menu {
  max-height: 1200px;
}
.codersathi-tutorial-nav .sub-menu a {
  padding-left: 18px;
  font-size: 14px;
  font-weight: 600;
}
.tutorial-submenu-toggle {
  position: absolute;
  left: 8px;
  top: 5px;
  z-index: 2;
  width: 24px;
  height: 28px;
  border: 0;
  border-radius: 5px;
  color: #26364c;
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}
.tutorial-submenu-toggle:hover {
  background: #eef6ff;
  color: var(--cs-blue);
}

@media (max-width: 1100px) {
  .topic-grid { grid-template-columns: repeat(3, 1fr); }
  .post-grid { grid-template-columns: repeat(3, 1fr); }
  .about-stats { grid-template-columns: repeat(4, 1fr); }
  .about-card { grid-column: 1 / -1; }
  .single-layout { grid-template-columns: 1fr; }
  .single-layout.both-sidebars,
  .single-layout.has-tutorial-nav.left-sidebar,
  .single-layout.has-tutorial-nav.right-sidebar,
  .single-layout.has-tutorial-nav.both-sidebars {
    width: min(1160px, calc(100% - 48px));
    grid-template-columns: 1fr;
  }
  .single-layout.has-tutorial-nav {
    width: min(1160px, calc(100% - 48px));
    grid-template-columns: 1fr;
  }
  .single-layout.left-sidebar .article-shell,
  .single-layout.left-sidebar .single-sidebar,
  .single-layout.both-sidebars .single-sidebar-left,
  .single-layout.both-sidebars .single-sidebar-right,
  .single-layout.both-sidebars .article-shell,
  .single-layout.has-tutorial-nav.left-sidebar .single-tutorial-sidebar,
  .single-layout.has-tutorial-nav.left-sidebar .single-sidebar,
  .single-layout.has-tutorial-nav.left-sidebar .article-shell,
  .single-layout.has-tutorial-nav.right-sidebar .single-tutorial-sidebar,
  .single-layout.has-tutorial-nav.right-sidebar .single-sidebar,
  .single-layout.has-tutorial-nav.right-sidebar .article-shell,
  .single-layout.has-tutorial-nav.both-sidebars .single-tutorial-sidebar,
  .single-layout.has-tutorial-nav.both-sidebars .single-sidebar,
  .single-layout.has-tutorial-nav.both-sidebars .article-shell,
  .single-layout.has-tutorial-nav.no-sidebar .single-tutorial-sidebar,
  .single-layout.has-tutorial-nav.no-sidebar .article-shell {
    order: initial;
  }
  .single-tutorial-sidebar { position: static; }
  .single-sidebar { position: static; grid-template-columns: repeat(2, 1fr); }
  .tutorial-page-layout { grid-template-columns: 1fr; gap: 32px; }
  .tutorial-left-sidebar { position: static; }
  .codersathi-tutorial-nav-card {
    position: relative;
    top: auto;
    max-height: 50vh;
    margin-bottom: 20px;
  }
}

@media (max-width: 860px) {
  .container { width: min(100% - 32px, 1160px); }
  .header-inner { height: 56px; }
  .menu-toggle { display: grid; margin-left: auto; }
  .main-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 56px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    background: var(--cs-navy);
    padding: 22px 16px 28px;
    border-top: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 22px 44px rgba(0,0,0,.24);
  }
  .main-nav.is-open { display: block; }
  .main-nav > ul,
  .main-nav > div > ul { display: grid; gap: 14px; }
  .main-nav a { min-height: 36px; justify-content: space-between; font-size: 15px; }
  .main-nav > ul > .current-menu-item > a::after,
  .main-nav > div > ul > .current-menu-item > a::after { display: none; }
  .main-nav ul.sub-menu {
    position: static;
    width: auto;
    margin: 10px 0 10px 14px;
    padding: 8px;
    border-color: rgba(255,255,255,.11);
    background: #101a2b;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .main-nav ul.sub-menu::before { display: none; }
  .main-nav ul.sub-menu a { min-height: 36px; padding: 8px 10px; font-size: 14px; }
  .hero-inner { grid-template-columns: 1fr; padding-top: 34px; }
  .hero-visual { min-height: 310px; }
  .mentor { width: 285px; height: 285px; margin-left: 44px; }
  .laptop { width: 220px; left: 25px; }
  .code-panel { width: 245px; }
  .orbit { display: none; }
  .series-grid, .single-sidebar { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .newsletter { grid-template-columns: 1fr; padding: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .not-found-panel { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 16px; line-height: 1.6; overflow-x: hidden; }
  .container { width: min(100% - 30px, 1160px); }
  .header-inner { gap: 8px; }
  .brand { font-size: 21px; }
  .brand img,
  body .cs-site-header .brand img,
  body .cs-site-header .custom-logo { max-height: 36px !important; }
  .menu-toggle,
  .search-toggle { width: 34px; height: 34px; flex: 0 0 34px; }
  .hero h1 { font-size: 38px; }
  .hero-actions, .newsletter-form, .footer-bottom { flex-direction: column; align-items: stretch; }
  .topic-grid, .post-grid, .about-stats, .footer-grid { grid-template-columns: 1fr; }
  .series-card { grid-template-columns: 1fr; }
  .series-card ul { margin-top: 0; }
  .newsletter-form input,
  .newsletter-form button { border-radius: var(--cs-radius); }
  .breadcrumb {
    padding: 20px 0 18px;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .single-layout,
  .single-layout.has-tutorial-nav,
  .single-layout.has-tutorial-nav.no-sidebar,
  .single-layout.has-tutorial-nav.left-sidebar,
  .single-layout.has-tutorial-nav.right-sidebar,
  .single-layout.has-tutorial-nav.both-sidebars {
    width: min(100% - 30px, 1160px);
    gap: 20px;
    grid-template-columns: minmax(0, 1fr);
  }
  .single-tutorial-sidebar { max-height: none; overflow: visible; }
  .codersathi-tutorial-nav-card {
    max-height: none;
    margin-bottom: 0;
    padding: 18px 14px;
  }
  .codersathi-tutorial-nav-title {
    margin-left: -1px;
    margin-right: -1px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .codersathi-tutorial-nav a {
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 15px;
  }
  .codersathi-tutorial-nav .sub-menu {
    margin-left: 14px;
    padding-left: 10px;
  }
  .article-shell { padding: 24px 18px; border-left: 0; border-right: 0; border-radius: 0; }
  .article-header h1 { font-size: 30px; line-height: 1.15; }
  .article-subtitle { font-size: 15px; line-height: 1.55; margin-bottom: 20px; }
  .byline { align-items: flex-start; gap: 10px; }
  .byline > div:not(.share) { min-width: 0; flex: 1 1 calc(100% - 52px); }
  .byline .meta { display: block; overflow-wrap: anywhere; }
  .share { width: 100%; margin-left: 0; gap: 16px; }
  .article-content { overflow-wrap: anywhere; }
  .article-content h2 { font-size: 23px; line-height: 1.25; }
  .article-content ol,
  .article-content ul { padding-left: 24px; }
  pre {
    margin-left: -2px;
    margin-right: -2px;
    padding: 18px;
    font-size: 13px;
  }
  .learn-grid, .feature-diagram, .flow-diagram, .post-nav { grid-template-columns: 1fr; }
  .author-box,
  .author-profile-card { grid-template-columns: 1fr; }
  .site-footer { margin-top: 18px; }
  .footer-grid { gap: 30px; padding: 38px 0 18px; }
  .footer-grid section:first-child { overflow: hidden; }
  .footer-grid ul { columns: 2; column-gap: 36px; }
  .footer-grid li { break-inside: avoid; margin-bottom: 8px; }
  .footer-bottom { padding: 16px 0; gap: 12px; }
}

/* GeneratePress child-theme hardening. */
body .cs-site-header {
  position: sticky !important;
  top: 0;
  z-index: 999;
  width: 100%;
  background: rgba(2, 11, 29, .97) !important;
  color: #fff !important;
}
body .cs-site-header .header-inner {
  min-height: 62px;
  padding: 0;
}
body .cs-site-header .brand,
body .cs-site-header .brand:hover,
body .cs-site-header .main-nav a,
body .cs-site-header .main-nav a:hover {
  color: #fff !important;
}
body .cs-site-header .brand img,
body .cs-site-header .custom-logo {
  max-height: 42px !important;
  width: auto !important;
}
body .cs-site-main {
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  background: #fff;
}
body .cs-site-main > .hero {
  width: 100%;
  min-height: 440px;
  color: #fff !important;
  background:
    radial-gradient(circle at 75% 28%, rgba(34, 92, 196, .38), transparent 28%),
    linear-gradient(115deg, #041431 0%, #061b43 55%, #0b1f59 100%) !important;
}
body .cs-site-main > .hero h1,
body .cs-site-main > .hero p,
body .cs-site-main > .hero .hero-stack,
body .cs-site-main > .hero .btn-outline {
  color: #fff !important;
}
body .cs-site-main > .hero h1 span {
  color: var(--cs-blue-2) !important;
}
body .cs-site-main > .hero .eyebrow {
  color: #75caff !important;
  background: rgba(25, 118, 255, .22) !important;
}
body .cs-site-main > .hero .code-panel {
  background: rgba(2, 12, 30, .18) !important;
}
