/*
Theme Name: AbhiAndroid
Description: Clean, fast tutorial theme for the merged abhiandroid.com. Section-aware sidebar menus, readable code blocks, PHP 8.x ready.
Version: 1.3.0
Requires PHP: 7.4
Requires at least: 6.0
Text Domain: abhiandroid
*/

:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --text: #1c2421;
  --muted: #5d6b66;
  --line: #e2e8e5;
  --brand: #0f8a4f;
  --brand-dark: #0a6b3d;
  --brand-soft: #e7f5ee;
  --header: #10231b;
  --code-bg: #0f1a16;
  --code-text: #e6efe9;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 35, 27, .06), 0 4px 16px rgba(16, 35, 27, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1180px; /* narrow enough to leave room for 160px side rails on wide screens */
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 17px/1.7 var(--font); }
img, video { max-width: 100%; height: auto; }
iframe { max-width: 100%; }
a { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand); }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 999; background: #fff; padding: 8px 12px; clip: auto; width: auto; height: auto; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--header); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.header-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -.2px; white-space: nowrap; }
.brand:hover { color: #fff; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: #3ddc84; display: grid; place-items: center; color: var(--header); font-size: 16px; font-weight: 800; }
.brand img { max-height: 40px; width: auto; }
.section-nav { flex: 1; overflow-x: auto; scrollbar-width: none; }
.section-nav::-webkit-scrollbar { display: none; }
.section-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.section-nav a { display: block; padding: 8px 12px; border-radius: 8px; color: #cfe3d8; text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap; }
.section-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.section-nav .current a { background: #3ddc84; color: var(--header); }
.header-search { position: relative; }
.header-search input { width: 200px; height: 36px; border-radius: 8px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.08); color: #fff; padding: 0 12px; font: inherit; font-size: 14px; }
.header-search input::placeholder { color: #9fb8ab; }
.header-search input:focus { outline: 2px solid #3ddc84; background: rgba(255,255,255,.14); }
.menu-toggle { white-space: nowrap; display: none; background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; height: 36px; padding: 0 12px; font: inherit; font-size: 14px; cursor: pointer; }

/* ---------- Layout ---------- */
.layout { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 24px 16px 48px; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.content { min-width: 0; }

/* ---------- Tutorial sidebar ---------- */
.toc-sidebar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px; box-shadow: var(--shadow); scrollbar-width: thin; }
.toc-sidebar h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 4px 10px 10px; }
.toc-sidebar ul { list-style: none; margin: 0; padding: 0; }
.toc-sidebar li a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 15px; line-height: 1.4; }
.toc-sidebar li a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.toc-sidebar .current-menu-item > a, .toc-sidebar .current_page_item > a { background: var(--brand); color: #fff; font-weight: 600; }
.toc-sidebar .sub-menu { margin-left: 10px; padding-left: 8px; border-left: 2px solid var(--line); display: none; }
.toc-sidebar li.open > .sub-menu, .toc-sidebar .current-menu-ancestor > .sub-menu, .toc-sidebar .current-menu-item > .sub-menu { display: block; }
.toc-sidebar .menu-item-has-children > a { position: relative; padding-right: 28px; font-weight: 600; }
.toc-sidebar .menu-item-has-children > a::after { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); opacity: .5; transition: transform .2s; }
.toc-sidebar li.open > a::after, .toc-sidebar .current-menu-ancestor > a::after { transform: translateY(-30%) rotate(-135deg); }

/* ---------- Article ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.entry { padding: 32px 40px 40px; }
.breadcrumbs { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand-dark); }
.breadcrumbs span.sep { margin: 0 6px; opacity: .5; }
.entry-title { font-size: clamp(28px, 3.2vw, 38px); line-height: 1.2; letter-spacing: -.5px; margin: 0 0 12px; }
.entry-meta { font-size: 14px; color: var(--muted); margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { font-size: 26px; line-height: 1.3; margin: 2em 0 .6em; letter-spacing: -.3px; }
.entry-content h3 { font-size: 21px; margin: 1.6em 0 .5em; }
.entry-content h4 { font-size: 18px; margin: 1.4em 0 .4em; }
.entry-content p, .entry-content ul, .entry-content ol { margin: 0 0 1.1em; }
.entry-content li { margin-bottom: .35em; }
.entry-content img { border-radius: 8px; }
.entry-content figure { margin: 1.5em 0; }
.entry-content blockquote { margin: 1.5em 0; padding: 12px 20px; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 8px 8px 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 15px; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.entry-content th { background: #f1f5f3; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.entry-content code { font-family: var(--mono); font-size: .88em; background: #eef3f0; padding: 2px 6px; border-radius: 5px; }
.entry-content pre, .entry-content pre.prettyprint { font-family: var(--mono); font-size: 14px; line-height: 1.6; background: var(--code-bg) !important; color: var(--code-text); padding: 18px 20px !important; border-radius: 10px; border: 0 !important; overflow-x: auto; margin: 1.4em 0; tab-size: 4; }
.entry-content pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
/* prettify token colours on dark (beat the plugin's light theme) */
.entry-content pre.prettyprint, .entry-content pre.prettyprint * { text-shadow: none; }
.entry-content pre.prettyprint .kwd { color: #7dd3fc !important; } .entry-content pre.prettyprint .str { color: #a7f3a0 !important; }
.entry-content pre.prettyprint .com { color: #8fa39a !important; font-style: italic; } .entry-content pre.prettyprint .typ { color: #fcd34d !important; }
.entry-content pre.prettyprint .lit { color: #f9a8d4 !important; } .entry-content pre.prettyprint .pun, .entry-content pre.prettyprint .opn, .entry-content pre.prettyprint .clo { color: #cbd5d0 !important; }
.entry-content pre.prettyprint .pln { color: var(--code-text) !important; } .entry-content pre.prettyprint .tag { color: #7dd3fc !important; }
.entry-content pre.prettyprint .atn { color: #fcd34d !important; } .entry-content pre.prettyprint .atv { color: #a7f3a0 !important; } .entry-content pre.prettyprint .dec, .entry-content pre.prettyprint .var { color: #f9a8d4 !important; }
.entry-content pre.prettyprint ol.linenums { margin: 0; padding-left: 2.5em; color: #6b7d75; } .entry-content pre.prettyprint li { background: none !important; }
.entry-title + .entry-content { margin-top: 20px; }
.alignleft { float: left; margin: .3em 1.4em 1em 0; } .alignright { float: right; margin: .3em 0 1em 1.4em; } .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; } .wp-caption-text { font-size: 14px; color: var(--muted); text-align: center; }

/* prev / next */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.post-nav a { display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); background: #fbfdfc; transition: border-color .15s, background .15s; }
.post-nav a:hover { border-color: var(--brand); background: var(--brand-soft); }
.post-nav small { display: block; color: var(--muted); font-size: 13px; }
.post-nav .next { text-align: right; grid-column: 2; }

/* listings */
.list-item { padding: 22px 28px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item h2 { font-size: 21px; margin: 0 0 6px; line-height: 1.3; }
.list-item h2 a { text-decoration: none; color: var(--text); }
.list-item h2 a:hover { color: var(--brand-dark); }
.list-item p { margin: 0; color: var(--muted); font-size: 15px; }
.archive-head { padding: 24px 28px; border-bottom: 1px solid var(--line); }
.archive-head h1 { margin: 0; font-size: 28px; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; padding: 20px 28px; }
.pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--line); border-radius: 7px; text-decoration: none; }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* section cards on home */
.section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin: 0 0 24px; }
.section-card { display: block; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.section-card:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--text); }
.section-card strong { display: block; font-size: 18px; margin-bottom: 4px; }
.section-card span { font-size: 14px; color: var(--muted); }

/* right sidebar */
.right-sidebar { position: sticky; top: 84px; }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; box-shadow: var(--shadow); font-size: 15px; }
.widget-title { font-size: 15px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.widget ul { margin: 0; padding-left: 18px; }

/* comments */
.comments { margin-top: 24px; padding: 28px 40px; }
.comments h2 { font-size: 22px; margin-top: 0; }
.comment-list, .comment-list .children { list-style: none; padding: 0; margin: 0; }
.comment-list .children { margin-left: 28px; border-left: 2px solid var(--line); padding-left: 16px; }
.comment-body { padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment-meta { font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.comment-meta .avatar { border-radius: 50%; }
.comment-author .fn { font-weight: 600; color: var(--text); font-style: normal; }
.comment-content { font-size: 16px; }
.reply a { font-size: 14px; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.comment-form .submit, .button { background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 10px 20px; font: inherit; font-weight: 600; cursor: pointer; }
.comment-form .submit:hover { background: var(--brand-dark); }

/* footer */
.site-footer { background: var(--header); color: #a9c2b5; font-size: 15px; margin-top: 24px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; padding-top: 48px; padding-bottom: 40px; }
.site-footer a { color: #d6e7de; text-decoration: none; }
.site-footer a:hover { color: #3ddc84; }
.site-footer h3 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; margin: 6px 0 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-about p { margin: 14px 0 18px; line-height: 1.65; max-width: 420px; }
.footer-about .search-form input[type=search] { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); color: #fff; }
.footer-about .search-form input::placeholder { color: #9fb8ab; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); font-size: 14px; }
.footer-bottom .footer-inner { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; padding-top: 18px; padding-bottom: 110px; /* room for the sticky bottom ad */ }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 260px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
  .left-col { display: contents; }
  .left-col > .ad-slot, .side-sticky { display: none; }
  .toc-sidebar { position: fixed; top: 60px; left: 0; bottom: 0; width: min(320px, 86vw); max-height: none; border-radius: 0; z-index: 60; transform: translateX(-105%); transition: transform .25s; }
  body.toc-open .toc-sidebar { transform: none; }
  body.toc-open::after { content: ""; position: fixed; inset: 60px 0 0; background: rgba(0,0,0,.35); z-index: 55; }
  .menu-toggle { display: inline-block; }
  .header-search input { width: 130px; }
  .entry { padding: 22px 18px 28px; }
  .comments { padding: 22px 18px; }
  .list-item, .archive-head, .pagination { padding-left: 18px; padding-right: 18px; }
  body { font-size: 16px; }
}
@media (max-width: 560px) {
  .section-nav { display: none; }
  .header-inner { gap: 10px; }
  .brand { font-size: 18px; }
  .header-search { margin-left: auto; flex: 1; min-width: 0; }
  .header-search input { width: 100%; }
  .menu-toggle .label { display: none; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: 1; }
}
.mobile-sections { display: none; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 560px) { .mobile-sections { display: block; } }
.search-form { display: flex; gap: 8px; } .search-form input[type=search] { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.search-form .search-submit { background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 0 18px; font: inherit; cursor: pointer; }

/* converted page-builder blocks */
.entry-content .button { display: inline-block; text-decoration: none; color: #fff; }
.entry-content .button:hover { color: #fff; background: var(--brand-dark); }
.btn-wrap { margin: 1.2em 0; }
.cta-box, .notice-box, .price-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin: 1.5em 0; background: #fbfdfc; }
.cta-box { border-left: 4px solid var(--brand); }
.cta-box h2, .cta-box h4, .price-box h3 { margin-top: 0; }
.notice-box { background: #fff8e6; border-color: #f3dfa6; }
.price-box { text-align: center; }
.price-box .price { font-size: 32px; font-weight: 700; color: var(--brand-dark); margin: 4px 0 12px; }
.wp-block-image { margin: 1.5em 0; }

/* ---------- Layout columns & ad slots ---------- */
.left-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.toc-scroll { max-height: 62vh; overflow-y: auto; scrollbar-width: thin; }
.side-sticky { position: sticky; top: 84px; }
.ad-slot { text-align: center; overflow: hidden; }
.ad-slot .ad-code > * { margin-left: auto; margin-right: auto; }
.ad-label { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #9aa8a2; margin-bottom: 4px; }
.ad-wide { max-width: var(--maxw); margin: 16px auto 0; padding: 0 16px; }
.ad-header { min-height: 250px; }
.ad-side-top { min-height: 620px; }
.ad-before, .ad-after { min-height: 110px; margin: 8px 0 24px; }
.ad-side-bottom { min-height: 620px; }
.ad-in-1, .ad-in-2 { min-height: 270px; margin: 24px auto; clear: both; }
.ad-rail { min-height: 0; }
@media (max-width: 900px) {
  .ad-header { min-height: 100px; }
  .ad-before, .ad-after { min-height: 60px; }
  .toc-scroll { max-height: none; }
}

/* --- Settings applied live on the temp site (kept here so a re-upload keeps them) --- */
:root { --maxw: 100%; }
/* wide screens: use the full width, keep 168px each side free for the 120-160px Moneytizer side rails */
@media (min-width: 1280px) { .layout, .header-inner, .footer-inner, .ad-wide { max-width: none; padding-left: 168px; padding-right: 168px; } }
.left-col { align-self: stretch; }
.side-sticky { min-height: 640px; }
@media (min-width: 901px) { .layout { grid-template-columns: minmax(0, 1fr) 300px; } .left-col { order: 2; } .content { order: 1; } }
@media (min-width: 901px) and (max-width: 1100px) { .layout { grid-template-columns: minmax(0, 1fr) 260px; } }
.ad-header iframe { height: 250px; }
.ad-side-top iframe, .ad-side-bottom iframe { height: 600px; }
.ad-in-1 iframe, .ad-in-2 iframe { height: 250px; }
.ad-before iframe, .ad-after iframe { height: 90px; }
.ad-slot iframe[height], .entry-content iframe[height] { height: attr(height px, auto); }
.ad-slot { overflow: visible; }
