/* Krishnadas blog theme. Builds on https://www.krishnadas.in/css/style.css */

body.admin-bar .header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .header { top: 46px; } }

/* Header search */
.header-search { background: var(--bg-color); border-top: 1px solid var(--line); padding: 14px 0; position: relative; z-index: 99; }
.search-form { display: flex; gap: 8px; }
.search-form .input { flex: 1; }
.input {
    width: 100%; padding: 11px 14px; border: 1px solid #d6cfbd; border-radius: 10px;
    background: #fff; font: inherit; font-size: 16px; color: var(--txt-color);
}
.input:focus { border-color: var(--link-color); outline: none; box-shadow: 0 0 0 3px rgba(30,88,65,.15); }
.muted { color: var(--muted); font-size: 14px; }

/* Category pills under the page title */
.cat-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.cat-pills a {
    font-family: var(--font-head); font-size: 14px; text-decoration: none;
    padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--txt-color);
}
.cat-pills a:hover, .cat-pills a.active { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }

/* Two-column layout: content + sidebar */
.blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 40px;
    padding-top: 44px;
    padding-bottom: 40px;
    align-items: start;
}
.post-grid { gap: 24px; }
.post-card .thumb-link { display: block; overflow: hidden; }
.post-card h3 a { color: inherit; text-decoration: none; }
.post-card h3 a:hover { color: var(--link-color); }
.post-card .card-link { text-decoration: none; }

/* Pagination */
.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers {
    min-width: 42px; height: 42px; padding: 0 12px; display: grid; place-items: center;
    border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
    text-decoration: none; color: var(--txt-color); font-family: var(--font-head); font-size: 14px;
}
.pagination .page-numbers.current, .pagination a.page-numbers:hover { background: var(--green-dark); color: #fff; border-color: var(--green-dark); }

/* ---------- Single post ---------- */
.article {
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
    padding: 40px 48px; box-shadow: var(--shadow-sm);
}
.crumbs { font-family: var(--font-head); font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--link-color); text-decoration: none; }
.crumbs i { font-size: 10px; margin: 0 6px; }
.article-head h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 14px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-family: var(--font-head); font-size: 14px; color: var(--muted); }
.article-meta a { color: var(--muted); text-decoration: none; }
.article-meta i { color: var(--gold); margin-right: 4px; }
.article-cover { margin: 28px -48px; }
.article-cover img { width: 100%; max-height: 520px; object-fit: cover; }

.entry-content { font-size: 18px; line-height: 1.85; margin-top: 28px; overflow-wrap: break-word; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content p { font-size: inherit; margin: 0; }
.entry-content h2 { font-size: 28px; margin-top: 1.8em; }
.entry-content h3 { font-size: 22px; margin-top: 1.6em; }
.entry-content h4 { margin-top: 1.4em; }
.entry-content a { color: var(--link-color); text-underline-offset: 3px; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li + li { margin-top: .4em; }
.entry-content img { border-radius: 12px; height: auto; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 8px; }
.entry-content blockquote {
    border-left: 4px solid var(--gold); background: #fbf6e6; padding: 18px 24px; border-radius: 0 12px 12px 0;
    font-size: 19px; font-style: italic;
}
.entry-content blockquote p { margin: 0; }
.entry-content pre { background: #1b2a24; color: #eae6da; padding: 18px; border-radius: 12px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.entry-content code { background: #efe9d8; padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.entry-content pre code { background: none; padding: 0; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 16px; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px; text-align: left; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.alignwide { margin-left: -24px; margin-right: -24px; }
.alignfull { margin-left: -48px; margin-right: -48px; }
.aligncenter { margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin: .3em 1.4em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.4em; }

.article-foot { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.post-tags { font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); }
.post-tags a { font-family: var(--font-head); font-size: 13px; padding: 3px 10px; border-radius: 999px; background: #e9f1ec; color: var(--link-color); text-decoration: none; }
.share { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: 14px; color: var(--muted); }
.share a, .social-links a {
    width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
    background: var(--bg-color); color: var(--green-dark); text-decoration: none; transition: background .2s, color .2s, transform .2s;
}
.share a:hover, .social-links a:hover { background: var(--green-dark); color: var(--gold); transform: translateY(-2px); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.post-nav a {
    display: block; height: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px;
    text-decoration: none; color: var(--txt-color); font-family: var(--font-head); font-weight: 500; font-size: 15px; line-height: 1.4;
}
.post-nav a:hover { border-color: var(--link-color); }
.post-nav span { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-bottom: 4px; }
.post-nav .next { text-align: right; }

/* Comments */
.comments { margin-top: 48px; }
.comments-title, .comment-reply-title { font-size: 22px; margin-bottom: 18px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 28px; }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.comment-author { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 500; }
.comment-author img { border-radius: 50%; }
.comment-author .says { display: none; }
.comment-meta a, .comment-metadata a { font-size: 13px; color: var(--muted); text-decoration: none; }
.comment-content { margin-top: 8px; }
.reply a { font-family: var(--font-head); font-size: 13px; color: var(--link-color); }
.comment-form p { margin-bottom: 14px; }
.comment-form label { display: block; font-family: var(--font-head); font-size: 14px; margin-bottom: 6px; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea {
    width: 100%; padding: 11px 14px; border: 1px solid #d6cfbd; border-radius: 10px; font: inherit; font-size: 16px; background: #fff;
}
.comment-form .comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.comment-form .comment-form-cookies-consent label { font-family: inherit; }

/* ---------- Sidebar ---------- */
.blog-sidebar { display: grid; gap: 24px; position: sticky; top: calc(var(--header-h) + 20px); }
.side-box {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow-sm);
}
.side-title { font-size: 17px; margin-bottom: 14px; }
.side-title i { color: var(--gold); margin-right: 6px; }

.subscribe-box { background: var(--green-dark); border: 0; color: #e6e0cf; }
.subscribe-box .side-title { color: #fff; margin-bottom: 6px; }
.subscribe-box .muted { color: #cfc9b8; margin-bottom: 16px; }
.subscribe-box .icon-circle { background: rgba(255,255,255,.08); width: 46px; height: 46px; font-size: 18px; margin-bottom: 14px; }
.kd-subscribe { display: grid; gap: 10px; }
.kd-subscribe .input { border-color: transparent; }
.kd-subscribe .btn { justify-content: center; background: var(--gold); border-color: var(--gold); color: var(--green-dark); font-weight: 600; }
.kd-subscribe .btn:hover { background: #d8b45c; border-color: #d8b45c; }
.kd-subscribe .btn:disabled { opacity: .6; cursor: wait; }
.kd-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.kd-sub-msg { font-size: 14px; margin: 0; min-height: 0; }
.kd-sub-msg.ok { color: #b9e5c5; }
.kd-sub-msg.err { color: #ffc2b8; }
.fine-print { font-size: 12px; line-height: 1.5; color: #a9b8ae; margin: 0; }

.popular-list { list-style: none; padding: 0; display: grid; gap: 4px; }
.popular-list a { display: flex; gap: 12px; align-items: center; padding: 8px; margin: 0 -8px; border-radius: 10px; text-decoration: none; color: inherit; }
.popular-list a:hover { background: var(--bg-color); }
.pop-rank {
    width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
    background: var(--green-dark); color: var(--gold); font-family: var(--font-head); font-size: 13px; font-weight: 600;
}
.popular-list li:first-child .pop-rank { background: var(--gold); color: var(--green-dark); }
.pop-thumb { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.pop-body { min-width: 0; }
.pop-title { display: block; font-family: var(--font-head); font-size: 14px; font-weight: 500; line-height: 1.4; }
.pop-meta { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.social-links { display: flex; flex-wrap: wrap; gap: 10px; }
.side-social a { width: 44px; height: 44px; font-size: 18px; }
.footer-social { margin-top: 16px; }
.footer-social a { background: rgba(255,255,255,.08); color: #e6e0cf; }
.footer-social a:hover { background: var(--gold); color: var(--green-dark); }

/* Extra widgets */
.side-box ul { list-style: none; padding: 0; }
.side-box li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.side-box li:last-child { border-bottom: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
    .blog-layout { grid-template-columns: 1fr; }
    .blog-sidebar { position: static; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 700px) {
    .blog-layout { padding-top: 24px; gap: 28px; }
    .article { padding: 24px 20px; border-radius: 14px; }
    .article-cover { margin: 22px -20px; }
    .alignwide, .alignfull { margin-left: -20px; margin-right: -20px; }
    .entry-content { font-size: 17px; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav .next { text-align: left; }
    .blog-sidebar { grid-template-columns: 1fr; }
    .alignleft, .alignright { float: none; margin: 1em 0; }
}

/* ---------- Share buttons ---------- */
.share-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.share-icon {
    width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--green-dark); color: var(--gold); font-size: 16px;
}
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn {
    position: relative;
    width: 40px; height: 40px; padding: 0; border-radius: 50%;
    display: inline-grid; place-items: center;
    border: 1px solid var(--line); background: var(--surface);
    font-size: 17px; text-decoration: none; cursor: pointer;
    transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.share-btn:hover { transform: translateY(-2px); color: #fff; }
.share-whatsapp { color: #25d366; }
.share-facebook { color: #1877f2; }
.share-x        { color: #000; }
.share-copy     { color: var(--green-dark); }
.share-whatsapp:hover { background: #25d366; border-color: #25d366; }
.share-facebook:hover { background: #1877f2; border-color: #1877f2; }
.share-x:hover        { background: #000;    border-color: #000; }
.share-copy:hover     { background: var(--green-dark); border-color: var(--green-dark); }
.share-copy.copied    { background: var(--link-color); border-color: var(--link-color); color: #fff; }
/* "Link copied" bubble */
.share-copy::after {
    content: "Link copied"; position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%) translateY(4px); white-space: nowrap;
    background: var(--green-dark); color: #fff; font: 500 12px var(--font-head);
    padding: 5px 10px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.share-copy.copied::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* row under the title */
.share-compact { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }

/* box after the post */
.share-box {
    margin-top: 40px; padding: 22px 24px; border-radius: 14px;
    background: var(--bg-color); border: 1px solid var(--line);
    justify-content: center;
}
.share-box .share-icon { width: 44px; height: 44px; font-size: 18px; }
.share-box .share-btn { width: 44px; height: 44px; font-size: 19px; }



/* ==========================================================
   WordPress widgets in the sidebar (Search, Recent Posts,
   Recent Comments, Archives, Categories…) styled like
   the built-in boxes
   ========================================================== */
.blog-sidebar .side-box > *:first-child { margin-top: 0; }
.blog-sidebar .wp-block-group { margin: 0; padding: 0; }

/* Widget headings → same as "Popular this month" */
.blog-sidebar .side-box h2,
.blog-sidebar .side-box .wp-block-heading,
.blog-sidebar .wp-block-search__label {
    font-family: var(--font-head);
    font-size: 17px !important;
    line-height: 1.3;
    font-weight: 600;
    color: var(--heading-color);
    margin: 0 0 14px;
    letter-spacing: 0;
}
.blog-sidebar .side-box h2::before,
.blog-sidebar .wp-block-search__label::before {
    font-family: "Font Awesome 6 Free"; font-weight: 900;
    color: var(--gold); margin-right: 8px; font-size: 15px;
}
.blog-sidebar .wp-block-search__label::before                     { content: "\f002"; } /* magnifier */
.blog-sidebar .side-box:has(.wp-block-latest-posts) h2::before     { content: "\f017"; font-weight: 400; } /* clock */
.blog-sidebar .side-box:has(.wp-block-latest-comments) h2::before  { content: "\f075"; font-weight: 400; } /* comment */
.blog-sidebar .side-box:has(.wp-block-archives) h2::before         { content: "\f187"; } /* archive box */
.blog-sidebar .side-box:has(.wp-block-categories) h2::before       { content: "\f07b"; font-weight: 400; } /* folder */
.blog-sidebar .side-box:has(.wp-block-tag-cloud) h2::before        { content: "\f02c"; } /* tags */

/* ---- Search ---- */
.blog-sidebar .wp-block-search__label { display: block; }
.blog-sidebar .wp-block-search__inside-wrapper {
    display: flex; align-items: center; gap: 0;
    border: 1px solid #d6cfbd; border-radius: 999px; background: #fff;
    padding: 4px 4px 4px 16px; transition: border-color .2s, box-shadow .2s;
}
.blog-sidebar .wp-block-search__inside-wrapper:focus-within { border-color: var(--link-color); box-shadow: 0 0 0 3px rgba(30,88,65,.15); }
.blog-sidebar .wp-block-search__input {
    flex: 1; min-width: 0; border: 0 !important; outline: 0; background: transparent;
    padding: 8px 0; font: inherit; font-size: 15px; color: var(--txt-color); box-shadow: none !important;
}
.blog-sidebar .wp-block-search__button {
    width: 40px; height: 40px; flex-shrink: 0; margin: 0 !important; padding: 0 !important;
    border: 0; border-radius: 50%; background: var(--green-dark) !important; color: transparent !important;
    font-size: 0 !important; cursor: pointer; position: relative; overflow: hidden;
}
.blog-sidebar .wp-block-search__button::before {
    content: "\f002"; font-family: "Font Awesome 6 Free"; font-weight: 900;
    font-size: 15px; color: var(--gold); position: absolute; inset: 0; display: grid; place-items: center;
}
.blog-sidebar .wp-block-search__button svg { display: none; }
.blog-sidebar .wp-block-search__button:hover { background: var(--link-color) !important; }

/* ---- Recent posts: numbered list like Popular ---- */
.blog-sidebar .wp-block-latest-posts { list-style: none; padding: 0; margin: 0; counter-reset: kdpost; display: grid; gap: 2px; }
.blog-sidebar .wp-block-latest-posts li {
    counter-increment: kdpost; position: relative;
    padding: 9px 8px 9px 48px; margin: 0 -8px; border: 0 !important; border-radius: 10px;
    transition: background .2s;
}
.blog-sidebar .wp-block-latest-posts li:hover { background: var(--bg-color); }
.blog-sidebar .wp-block-latest-posts li::before {
    content: counter(kdpost); position: absolute; left: 8px; top: 9px;
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    background: var(--bg-color); border: 1px solid var(--line); color: var(--green-dark);
    font: 600 12px var(--font-head);
}
.blog-sidebar .wp-block-latest-posts li:hover::before { background: var(--green-dark); color: var(--gold); border-color: var(--green-dark); }
.blog-sidebar .wp-block-latest-posts__post-title {
    display: block; font-family: var(--font-head); font-size: 14px; font-weight: 500; line-height: 1.45;
    color: var(--txt-color); text-decoration: none;
}
.blog-sidebar .wp-block-latest-posts__post-title:hover { color: var(--link-color); }
.blog-sidebar .wp-block-latest-posts__post-date,
.blog-sidebar .wp-block-latest-posts__post-author { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.blog-sidebar .wp-block-latest-posts__post-excerpt { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.blog-sidebar .wp-block-latest-posts__featured-image { display: none; }

/* ---- Recent comments ---- */
.blog-sidebar .wp-block-latest-comments { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.blog-sidebar .wp-block-latest-comments__comment {
    position: relative; margin: 0 -8px !important; padding: 9px 8px 9px 48px !important;
    border: 0 !important; border-radius: 10px; line-height: 1.45; transition: background .2s;
}
.blog-sidebar .wp-block-latest-comments__comment:hover { background: var(--bg-color); }
.blog-sidebar .wp-block-latest-comments__comment::before {
    content: "\f4ad"; font-family: "Font Awesome 6 Free"; font-weight: 400;
    position: absolute; left: 8px; top: 9px; width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center; font-size: 13px;
    background: var(--bg-color); border: 1px solid var(--line); color: var(--green-dark);
}
.blog-sidebar .wp-block-latest-comments__comment article { margin: 0; }
.blog-sidebar .wp-block-latest-comments__comment-avatar { display: none; }
.blog-sidebar .wp-block-latest-comments__comment-meta { font-size: 13px; color: var(--muted); margin: 0; }
.blog-sidebar .wp-block-latest-comments__comment-meta a { text-decoration: none; }
.blog-sidebar .wp-block-latest-comments__comment-author {
    display: block; font-family: var(--font-head); font-size: 13px; font-weight: 600; color: var(--green-dark);
}
.blog-sidebar .wp-block-latest-comments__comment-link {
    font-family: var(--font-head); font-size: 14px; font-weight: 500; color: var(--txt-color);
}
.blog-sidebar .wp-block-latest-comments__comment-link:hover { color: var(--link-color); }
.blog-sidebar .wp-block-latest-comments__comment-date { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.blog-sidebar .wp-block-latest-comments__comment-excerpt p { font-size: 13px; color: var(--muted); margin: 4px 0 0; }

/* ---- Archives / Categories / Pages lists ---- */
.blog-sidebar .wp-block-archives,
.blog-sidebar .wp-block-categories,
.blog-sidebar .wp-block-page-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.blog-sidebar .wp-block-archives li,
.blog-sidebar .wp-block-categories li,
.blog-sidebar .wp-block-page-list li {
    margin: 0 -8px; padding: 8px; border: 0 !important; border-radius: 10px;
    display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted);
}
.blog-sidebar .wp-block-archives li:hover,
.blog-sidebar .wp-block-categories li:hover,
.blog-sidebar .wp-block-page-list li:hover { background: var(--bg-color); }
.blog-sidebar .wp-block-archives a,
.blog-sidebar .wp-block-categories a,
.blog-sidebar .wp-block-page-list a { font-family: var(--font-head); font-weight: 500; color: var(--txt-color); text-decoration: none; }
.blog-sidebar .wp-block-archives a::before,
.blog-sidebar .wp-block-categories a::before { content: "›"; color: var(--gold); margin-right: 8px; font-weight: 700; }

/* ---- Tag cloud ---- */
.blog-sidebar .wp-block-tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.blog-sidebar .wp-block-tag-cloud a {
    font: 500 13px var(--font-head) !important; padding: 4px 12px; border-radius: 999px;
    background: #e9f1ec; color: var(--link-color); text-decoration: none; margin: 0 !important;
}
.blog-sidebar .wp-block-tag-cloud a:hover { background: var(--green-dark); color: #fff; }

/* Old-style (classic) widgets */
.blog-sidebar .widget_search .search-form { display: flex; gap: 8px; }
.blog-sidebar .widget_recent_entries a,
.blog-sidebar .widget_recent_comments a { font-family: var(--font-head); font-size: 14px; text-decoration: none; color: var(--txt-color); }

/* ---------- Slim blog header bar (replaces the big title block) ---------- */
.blog-bar { background: var(--bg-color); border-bottom: 1px solid var(--line); padding: 22px 0; }
.blog-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; }
.blog-bar-title { min-width: 0; }
.blog-bar .eyebrow { font-size: 12px; margin-bottom: 2px; }
.blog-bar h1 { font-size: clamp(22px, 2.6vw, 28px); line-height: 1.25; margin: 0; }
.blog-bar p { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.blog-bar .cat-pills { margin: 0; justify-content: flex-end; }
.blog-bar .cat-pills a { padding: 5px 14px; font-size: 13px; }

@media (max-width: 700px) {
    .blog-bar { padding: 16px 0; }
    .blog-bar-inner { flex-direction: column; align-items: stretch; gap: 12px; }
    /* one swipeable row of categories on phones */
    .blog-bar .cat-pills {
        flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto;
        margin: 0 -18px; padding: 2px 18px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .blog-bar .cat-pills::-webkit-scrollbar { display: none; }
    .blog-bar .cat-pills a { flex-shrink: 0; }
}
