/*
Theme Name: Baya Blog
Theme URI: https://example.com/
Author: Baya
Description: Premium blog theme for Baya Company. Home, blog archive, single post, category/tag/author archive, search, 404, comments, widgets - sab included.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: baya
*/

:root {
    /* Primary Green (Brand) */
    --primary: #3aaa35;
    --primary-light: #51b748;
    --primary-dark: #408E37;
    /* Background */
    --bg-light: #FAFBEA;
    /* Text */
    --black: #000000;
    --gray: #646363;
    /* Useful Aliases */
    --white: #ffffff;
    /* Border / Soft UI */
    --border: rgba(0,0,0,0.08);
    /* Hover */
    --hover: #51b748;

    /* Theme tokens */
    --font-head: 'Bricolage Grotesque', 'Noto Sans Devanagari', system-ui, sans-serif;
    --font-body: 'Figtree', 'Noto Sans Devanagari', system-ui, sans-serif;
    --r-lg: 28px;
    --r-md: 16px;
    --r-sm: 10px;
    --wrap: 1200px;
    --shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px -12px rgba(64,142,55,.25);
}

*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0; background: var(--bg-light); color: var(--black);
    font-family: var(--font-body); font-size: 17px; line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
h1,h2,h3,h4 { font-family: var(--font-head); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1.2em; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.screen-reader-text { position: absolute; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }

/* Buttons */
.btn, .wp-block-button__link, input[type=submit], button.btn {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    background: var(--primary-dark); color: var(--white); border: 0;
    padding: 14px 26px; border-radius: 999px; font: 700 16px var(--font-body);
    transition: background .2s, transform .2s;
}
.btn:hover, input[type=submit]:hover { background: var(--hover); color: var(--white); transform: translateY(-2px); }
.btn-light { background: var(--white); color: var(--black); }
.btn-light:hover { background: var(--bg-light); color: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--black); border: 1.5px solid var(--black); }
.btn-ghost:hover { background: var(--black); color: var(--white); }

/* Progress bar (single) */
#progress { position: fixed; top: 0; left: 0; height: 4px; width: 0; background: var(--primary); z-index: 200; }

/* Search form */
.search-form { display: flex; gap: 8px; background: var(--white); border: 1px solid var(--border); border-radius: 999px; padding: 6px; }
.search-form input[type=search] { flex: 1; border: 0; background: transparent; padding: 10px 18px; font: 16px var(--font-body); min-width: 0; }
.search-form input:focus { outline: none; }
.search-form button { padding: 10px 22px; }

/* Home hero */
.hero { padding: 40px 0 24px; }
.hero-card { display: grid; grid-template-columns: 1.05fr 1fr; background: var(--primary-dark); color: var(--white); border-radius: var(--r-lg); overflow: hidden; min-height: 520px; }
.hero-copy { padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.hero-copy .pill { align-self: flex-start; }
.hero-copy h1 { font-size: clamp(34px, 4.6vw, 62px); margin: 0; }
.hero-copy h1 a:hover { color: var(--white); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.hero-copy p { color: rgba(255,255,255,.92); font-size: 18px; margin: 0; max-width: 52ch; }
.hero-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; color: rgba(255,255,255,.9); }
.hero-img { position: relative; min-height: 320px; background: var(--primary); }
.hero-img img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.pill { display: inline-block; background: var(--white); color: var(--primary-dark); font-weight: 700; font-size: 14px; padding: 5px 14px; border-radius: 999px; }
.pill:hover { background: var(--black); color: var(--white); }
.pill-green { background: rgba(58,170,53,.14); color: var(--primary-dark); }

/* Category chips */
.chips { display: flex; gap: 10px; flex-wrap: wrap; padding: 24px 0 8px; }
.chip { padding: 9px 20px; border-radius: 999px; border: 1px solid var(--border); background: var(--white); font-weight: 600; font-size: 15px; }
.chip:hover, .chip.active { background: var(--black); color: var(--white); border-color: var(--black); }

/* Section heading */
.sec { padding: 56px 0; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.sec-head h2 { font-size: clamp(28px, 3.4vw, 42px); margin: 0; }
.sec-head p { margin: 6px 0 0; color: var(--gray); }

/* Post grid + cards */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .25s, transform .25s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.card-img { aspect-ratio: 16/10; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); position: relative; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-img img { transform: scale(1.05); }
.card-img .ph { position: absolute; inset: 0; display: grid; place-items: center; font: 800 64px var(--font-head); color: rgba(255,255,255,.85); }
.card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-size: 22px; margin: 4px 0 0; }
.card h3 a:hover { color: var(--primary-dark); }
.card p { color: var(--gray); font-size: 16px; margin: 0; }
.meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--gray); margin-top: auto; padding-top: 10px; }
.meta span + span { padding-left: 16px; border-left: 1px solid var(--border); }

/* CTA band */
.cta { background: var(--black); color: var(--white); border-radius: var(--r-lg); padding: clamp(32px, 5vw, 64px); display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.cta h2 { font-size: clamp(28px, 3.6vw, 44px); margin: 0; }
.cta p { color: rgba(255,255,255,.75); margin: 12px 0 0; }
.cta form { display: flex; gap: 8px; background: rgba(255,255,255,.1); border-radius: 999px; padding: 6px; }
.cta input[type=email] { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--white); padding: 10px 18px; font: 16px var(--font-body); }
.cta input::placeholder { color: rgba(255,255,255,.6); }
.cta input:focus { outline: none; }
.cta .btn { background: var(--primary); color: var(--black); }
.cta .btn:hover { background: var(--primary-light); color: var(--black); }

/* Page head (archive/search) */
.page-head { padding: 64px 0 24px; }
.page-head .pill { background: rgba(58,170,53,.14); color: var(--primary-dark); margin-bottom: 14px; }
.page-head h1 { font-size: clamp(36px, 5vw, 64px); margin: 0 0 12px; }
.page-head p { color: var(--gray); max-width: 60ch; margin: 0; font-size: 18px; }

/* Layout with sidebar */
.with-side { display: grid; grid-template-columns: 1fr 340px; gap: 48px; align-items: start; }
.with-side .grid { grid-template-columns: repeat(2, 1fr); }
.sidebar { position: sticky; top: 100px; display: grid; gap: 24px; }
.widget { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md); padding: 24px; }
.widget-title { font-size: 20px; margin: 0 0 14px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 9px 0; border-bottom: 1px solid var(--border); }
.widget li:last-child { border: 0; }
.widget a:hover { color: var(--primary-dark); }
.tagcloud a { display: inline-block; margin: 0 6px 8px 0; padding: 5px 14px; border-radius: 999px; background: var(--bg-light); border: 1px solid var(--border); font-size: 14px !important; }
.tagcloud a:hover { background: var(--primary-dark); color: var(--white); }
.widget-cta { background: var(--primary-dark); color: var(--white); border: 0; }
.widget-cta p { color: rgba(255,255,255,.92); }

/* Pagination */
.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.page-numbers { min-width: 46px; height: 46px; padding: 0 16px; display: grid; place-items: center; border-radius: 999px; background: var(--white); border: 1px solid var(--border); font-weight: 700; }
.page-numbers.current, a.page-numbers:hover { background: var(--primary-dark); color: var(--white); border-color: var(--primary-dark); }

/* Single post */
.post-head { padding: 56px 0 32px; text-align: center; max-width: 860px; margin-inline: auto; }
.post-head h1 { font-size: clamp(34px, 5vw, 60px); margin: 18px 0; }
.post-head .lead { color: var(--gray); font-size: 20px; max-width: 62ch; margin: 0 auto 22px; }
.post-byline { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 15px; color: var(--gray); }
.post-byline img { border-radius: 50%; }
.post-byline strong { color: var(--black); }
.post-cover { border-radius: var(--r-lg); overflow: hidden; margin-bottom: 56px; }
.post-cover img { width: 100%; max-height: 620px; object-fit: cover; }
.post-layout { display: grid; grid-template-columns: 64px minmax(0, 720px) 1fr; gap: 40px; justify-content: center; }
.share { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 10px; align-self: start; }
.share a, .share button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border); background: var(--white); display: grid; place-items: center; font-weight: 800; font-size: 14px; cursor: pointer; font-family: var(--font-body); }
.share a:hover, .share button:hover { background: var(--primary-dark); color: var(--white); }

.entry { font-size: 19px; line-height: 1.8; }
.entry h2 { font-size: 34px; margin: 1.6em 0 .5em; }
.entry h3 { font-size: 26px; margin: 1.4em 0 .5em; }
.entry a { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }
.entry a:hover { color: var(--black); }
.entry img { border-radius: var(--r-md); }
.entry blockquote { margin: 2em 0; padding: 8px 0 8px 28px; border-left: 5px solid var(--primary); font: 600 26px/1.4 var(--font-head); }
.entry ul, .entry ol { padding-left: 1.3em; margin-bottom: 1.4em; }
.entry li { margin-bottom: .4em; }
.entry li::marker { color: var(--primary-dark); font-weight: 700; }
.entry pre { background: var(--black); color: #e8f5e6; padding: 22px; border-radius: var(--r-md); overflow-x: auto; font-size: 15px; }
.entry code { background: rgba(58,170,53,.12); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.entry pre code { background: none; padding: 0; }
.entry table { width: 100%; border-collapse: collapse; margin-bottom: 1.4em; }
.entry th, .entry td { border: 1px solid var(--border); padding: 12px 14px; text-align: left; }
.entry th { background: var(--primary-dark); color: var(--white); }
.entry figcaption { font-size: 14px; color: var(--gray); text-align: center; margin-top: 8px; }
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 40px 0; }

.author-box { display: flex; gap: 22px; background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md); padding: 28px; margin: 40px 0; }
.author-box img { border-radius: 50%; flex: none; }
.author-box h4 { margin: 0 0 6px; font-size: 20px; }
.author-box p { margin: 0; color: var(--gray); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 40px 0; }
.post-nav a { display: block; background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md); padding: 22px; }
.post-nav a:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.post-nav small { color: var(--gray); display: block; margin-bottom: 4px; }
.post-nav strong { font: 700 18px var(--font-head); }
.post-nav .next { text-align: right; }

/* Comments */
.comments { margin-top: 56px; }
.comments h3 { font-size: 28px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 40px; }
.comment-list .children { list-style: none; padding-left: 28px; }
.comment-body { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md); padding: 22px; margin-bottom: 16px; }
.comment-author { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.comment-author img { border-radius: 50%; }
.comment-metadata { font-size: 13px; color: var(--gray); margin: 4px 0 10px; }
.comment-metadata a { color: var(--gray); }
.reply a { font-weight: 700; color: var(--primary-dark); font-size: 15px; }
.comment-respond { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md); padding: 28px; }
.comment-form p { margin-bottom: 16px; }
.comment-form label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg-light); padding: 13px 16px; font: 16px var(--font-body); }
.comment-form input:focus, .comment-form textarea:focus { outline: 2px solid var(--primary); background: var(--white); }

/* 404 */
.nf { text-align: center; padding: 96px 0; }
.nf .big { font: 800 clamp(120px, 22vw, 260px)/1 var(--font-head); color: var(--primary); letter-spacing: -.06em; }
.nf p { color: var(--gray); font-size: 18px; max-width: 46ch; margin: 0 auto 28px; }
.nf .search-form { max-width: 520px; margin: 0 auto 28px; }

/* WP core */
.alignleft { float: left; margin: 0 1.5em 1em 0; } .alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-inline: auto; } .wp-caption { max-width: 100%; }
.sticky .card { border-color: var(--primary); } .bypostauthor {} .gallery-caption {}

/* Fixed search icon + popup */
.search-fab { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 90; width: 54px; height: 54px; border: 0; border-radius: 16px 0 0 16px; background: var(--primary-dark); color: var(--white); cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); transition: background .2s, width .2s; }
.search-fab:hover { background: var(--hover); width: 60px; }
.search-modal { position: fixed; inset: 0; z-index: 300; display: none; align-items: flex-start; justify-content: center; padding: 14vh 20px 20px; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); }
.search-modal.open { display: flex; }
.search-box { position: relative; width: min(640px, 100%); background: var(--bg-light); border-radius: var(--r-lg); padding: 36px 32px 32px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
.search-box h2 { font-size: 28px; margin: 0 0 18px; }
.search-close { position: absolute; top: 14px; right: 16px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--white); font-size: 26px; line-height: 1; cursor: pointer; }
.search-close:hover { background: var(--primary-dark); color: var(--white); }

/* Responsive */
@media (max-width: 1024px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
    .with-side { grid-template-columns: 1fr; }
    .sidebar { position: static; grid-template-columns: 1fr 1fr; }
    .hero-card { grid-template-columns: 1fr; }
    .hero-img { min-height: 300px; order: -1; }
    .post-layout { grid-template-columns: minmax(0, 720px); }
    .share { position: static; flex-direction: row; order: 2; }
    .cta { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    body { font-size: 16px; }
    .grid, .with-side .grid, .sidebar, .post-nav { grid-template-columns: 1fr; }
    .entry { font-size: 17px; }
    .author-box { flex-direction: column; }
    .cta form { flex-direction: column; border-radius: var(--r-md); }
    .search-fab { width: 48px; height: 48px; }
    .search-box { padding: 32px 20px 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
