:root {
    --topbar: #2e6b34;
    --teal-1: #3a93a6;
    --teal-2: #123f52;
    --olive: #0b6e4f;
    --olive-text: #f2f9f4;
    --purple: #0b6e4f;
    --purple-dark: #0b6e4f;
    --orange: #f2a33e;
    --cream: #fdf6d8;
    --cream-border: #e8dfa8;
    --link: #106b7a;
    --link-dark: #0b4b57;
    --ink: #262b28;
    --ink-soft: #63706a;
    --paper: #eef1e9;
    --card: #ffffff;
    --border: #e0e3da;
    --shadow: 0 1px 4px rgba(20, 40, 30, 0.08);
    --shadow-lg: 0 10px 26px rgba(20, 40, 30, 0.14);
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'SolaimanLipi', 'Hind Siliguri', 'Noto Sans Bengali', -apple-system, "Segoe UI", Arial, sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

a { color: inherit; text-decoration: none; }

/* Topbar */
.topbar { background: var(--topbar); height: 6px; }

/* Header */
.site-header { background: var(--card); border-bottom: 1px solid var(--border); }

.header-inner { padding: 16px; }

.brand { display: flex; align-items: center; gap: 12px; }

.brand-logo {
    height: 46px;
    width: auto;
    flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }

.brand-name {
    font-family: 'Noto Serif Bengali', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--link-dark);
}

.brand-name .accent { color: var(--orange); }

.brand-tagline {
    font-size: 0.78rem;
    color: var(--ink-soft);
}

/* Nav */
.main-nav { background: #f7f8f4; border-bottom: 1px solid var(--border); }

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 6px 16px;
}

.nav-links { display: flex; flex-wrap: wrap; }

.nav-links a {
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--link-dark);
    border-bottom: 3px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--topbar);
    border-bottom-color: var(--olive);
}

.nav-search {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.nav-search input {
    border: none;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.88rem;
    width: 180px;
    outline: none;
}

.nav-search button {
    border: none;
    background: var(--olive);
    color: var(--olive-text);
    padding: 0 14px;
    cursor: pointer;
    font-size: 0.95rem;
}

/* Banner */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.page-banner {
    background: var(--teal-2);
    text-align: center;
}

.page-banner img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

.banner-caption {
    margin: 0;
    padding: 14px 0;
    color: #fff;
    font-size: 0.95rem;
}

/* 3-col layout */
.site-main { padding: 24px 0 48px; }

.layout-3col {
    display: grid;
    grid-template-columns: 220px 1fr 280px;
    gap: 22px;
    align-items: start;
}

.layout-3col.no-sidebar {
    grid-template-columns: 220px 1fr;
}

/* Section bar */
.section-bar {
    background: var(--olive);
    color: var(--olive-text);
    font-weight: 700;
    font-size: 1rem;
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.count-pill {
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255,255,255,0.5);
    padding: 2px 10px;
    border-radius: 999px;
}

/* Post list (main column) */
.post-list { display: flex; flex-direction: column; gap: 16px; }

.post-row {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    gap: 16px;
    padding: 16px;
}

.row-thumb {
    flex-shrink: 0;
    width: 150px;
    height: 110px;
    border-radius: 6px;
    overflow: hidden;
    background: #e6ede4;
    display: block;
}

.row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 14px;
}

.thumb-placeholder img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.row-body { flex: 1; min-width: 0; }

.row-title {
    margin: 0 0 6px;
    font-size: 1.15rem;
    line-height: 1.4;
}

.row-title a { color: var(--link); font-weight: 700; }
.row-title a:hover { color: var(--topbar); text-decoration: underline; }

.row-byline {
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin: 0 0 8px;
}

.row-byline .author { color: var(--link-dark); font-weight: 600; }

.row-cat {
    background: var(--olive);
    color: var(--olive-text);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
}

.badge-inline { display: inline-block; margin-bottom: 14px; }

.row-excerpt {
    font-size: 0.93rem;
    color: var(--ink);
    margin: 0 0 10px;
}

.row-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--ink-soft);
    border-top: 1px dashed var(--border);
    padding-top: 8px;
}

.meta-comments { color: var(--ink-soft); }

.read-more { color: var(--link); font-weight: 700; }
.read-more:hover { color: var(--topbar); }

/* Left nav */
.left-nav { display: flex; flex-direction: column; gap: 16px; }

.widget {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.menu-widget { padding: 6px; }

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    border-radius: 6px;
}

.menu-item:hover { background: var(--paper); }
.menu-item.active { background: var(--olive); color: var(--olive-text); }

.menu-icon { font-size: 1rem; }

.widget-title {
    margin: 0;
    padding: 12px 16px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    background: var(--teal-2);
}

.widget-title-purple { background: var(--purple-dark); }

.widget-list { list-style: none; margin: 0; padding: 8px 0; }

.online-widget .widget-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--ink);
}

.online-widget .widget-list li a:hover { color: var(--link); background: var(--paper); }

.online-widget .count {
    background: var(--paper);
    color: var(--ink-soft);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 999px;
}

.online-count {
    margin: 0;
    padding: 14px 16px 4px;
    font-size: 0.86rem;
    color: var(--ink-soft);
}

.online-users-list {
    list-style: none;
    margin: 0;
    padding: 4px 16px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.online-users-list li {
    background: var(--paper);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
}

/* Login widget */
.login-widget { padding: 16px; }

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-form input {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.88rem;
}

.login-btn {
    background: var(--orange);
    color: #3a2205;
    border: none;
    border-radius: 6px;
    padding: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

.login-btn:hover { filter: brightness(0.95); }

.login-error {
    background: #fdeceb;
    color: #a33327;
    border: 1px solid #f3c6c2;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.8rem;
    margin: 0 0 10px;
}

.welcome-text {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: var(--ink);
}

.logout-btn {
    display: inline-block;
    background: var(--teal-2);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 14px;
    border-radius: 6px;
}

.logout-btn:hover { background: var(--link-dark); }

.auth-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    font-size: 0.82rem;
}

.auth-links a { color: var(--link); font-weight: 600; }
.auth-links a:hover { color: var(--topbar); }

/* Auth pages (forgot/reset/register) */
.auth-page { max-width: 420px; }

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.auth-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.88rem;
}

.auth-notice {
    background: var(--cream);
    border: 1px solid var(--cream-border);
    color: #5a5127;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.86rem;
    margin: 0 0 12px;
}

.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

/* Right sidebar */
.sidebar { display: flex; flex-direction: column; gap: 16px; }

.notice-widget { background: var(--cream); border: 1px solid var(--cream-border); box-shadow: none; }
.notice-widget .widget-title { background: transparent; color: var(--link-dark); padding-bottom: 0; }
.notice-text { padding: 8px 16px 16px; margin: 0; font-size: 0.86rem; color: #5a5127; }

.pinned-notice-widget {
    background: #fff6e5;
    border: 1px solid #f0d9a0;
    box-shadow: none;
}

.widget-title-pinned {
    background: transparent;
    color: #8a5b00;
    padding-bottom: 0;
}

.recent-posts { padding: 4px 0; }

.recent-posts li {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.recent-posts li:last-child { border-bottom: none; }

.recent-posts a { font-size: 0.87rem; font-weight: 600; color: var(--ink); line-height: 1.4; }
.recent-posts a:hover { color: var(--link); }


/* Single post */
.single-post {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px clamp(16px, 3vw, 34px);
}

.single-post h1 {
    font-family: 'Noto Serif Bengali', serif;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    line-height: 1.4;
    color: var(--link-dark);
    margin: 0 0 10px;
}

.single-post .featured-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin: 16px 0 22px;
}

.featured-placeholder {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 20px;
}

.featured-placeholder img {
    max-width: 60%;
    max-height: 100%;
    object-fit: contain;
}

.post-content { font-size: 1.03rem; }
.post-content p { margin: 0 0 1.1em; }
.post-content img { max-width: 100%; height: auto; border-radius: 6px; margin: 10px 0; }

.post-tags {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-tags a {
    background: var(--paper);
    color: var(--link-dark);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
}

.post-tags a:hover { background: var(--olive); color: var(--olive-text); }

.back-link { margin: 16px 2px 0; }
.back-link a { color: var(--link); font-weight: 700; }

/* Comments */
.comments-section {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 2px solid var(--border);
}

.comments-heading {
    font-family: 'Noto Serif Bengali', serif;
    font-size: 1.15rem;
    color: var(--link-dark);
    margin: 0 0 16px;
}

.comment-list { list-style: none; margin: 0 0 20px; padding: 0; }

.comment-item {
    padding: 12px 16px;
    background: var(--paper);
    border-radius: 8px;
    margin-bottom: 10px;
}

.comment-author { margin: 0 0 4px; font-weight: 700; font-size: 0.88rem; color: var(--link-dark); }
.comment-content { margin: 0; font-size: 0.92rem; }
.comment-content p { margin: 0 0 0.6em; }
.comment-content p:last-child { margin-bottom: 0; }

.no-comments { color: var(--ink-soft); font-size: 0.9rem; margin: 0 0 16px; }

.comment-editor {
    min-height: 100px;
}

.comment-form .ql-toolbar.ql-snow {
    border-radius: 6px 6px 0 0;
    font-family: inherit;
}

.comment-form .ql-container.ql-snow {
    border-radius: 0 0 6px 6px;
    font-family: inherit;
    font-size: 0.92rem;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 26px 0 0;
    flex-wrap: wrap;
}

.pagination a {
    padding: 7px 13px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink);
}

.pagination a:hover { border-color: var(--teal-1); color: var(--link); }

.pagination a.active {
    background: var(--teal-2);
    border-color: var(--teal-2);
    color: #fff;
}

.pagination a.page-nav {
    background: var(--olive);
    border-color: var(--olive);
    color: var(--olive-text);
}

/* Footer */
.site-footer { background: var(--teal-2); color: rgba(255,255,255,0.75); margin-top: 32px; }

.footer-inner { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; padding: 32px 16px 22px; }

.footer-logo-badge {
    display: inline-flex;
    background: #fff;
    border-radius: 8px;
    padding: 10px 14px;
}

.footer-logo-badge img { height: 34px; width: auto; display: block; }

.footer-brand p { max-width: 340px; color: rgba(255,255,255,0.6); font-size: 0.88rem; margin-top: 12px; }

.footer-links h4 { color: #fff; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 10px; }
.footer-links { display: flex; flex-direction: column; flex-wrap: wrap; max-height: 170px; gap: 6px 20px; }
.footer-links a { color: rgba(255,255,255,0.72); font-size: 0.86rem; }
.footer-links a:hover { color: var(--orange); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 14px 16px;
    font-size: 0.78rem;
    text-align: center;
    color: rgba(255,255,255,0.55);
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.dashboard-wide { grid-column: 1 / -1; }

.dashboard-card h2 {
    margin: 0 0 14px;
    font-size: 1.1rem;
    color: var(--link-dark);
    font-family: 'Noto Serif Bengali', serif;
}

.dashboard-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.dashboard-card-header h2 { margin: 0; }

.dashboard-new-btn {
    display: inline-block;
    width: auto;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.profile-table { width: 100%; border-collapse: collapse; }
.profile-table th { text-align: left; color: var(--ink-soft); font-weight: 600; padding: 7px 10px 7px 0; width: 38%; font-size: 0.88rem; }
.profile-table td { padding: 7px 0; font-size: 0.92rem; }

.my-posts-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.my-posts-table th { text-align: left; padding: 8px 10px; font-size: 0.82rem; color: var(--ink-soft); border-bottom: 2px solid var(--border); }
.my-posts-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.my-posts-table a { color: var(--link); font-weight: 600; }
.my-posts-table a:hover { color: var(--topbar); }

.status-pill {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-publish { background: #e2f5e9; color: #1a7d42; }
.status-draft { background: #fdeee0; color: #b8560c; }
.status-pending { background: #f0eafc; color: #6c3fc9; }

/* Post data table (dashboard "আমার পোস্ট" / my-posts.php) */
.post-data-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 4px;
}

.post-data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

.post-data-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-soft);
    background: var(--paper);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.post-data-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    white-space: nowrap;
}

.post-data-table tbody tr:last-child td { border-bottom: none; }
.post-data-table tbody tr:hover { background: var(--paper); }

.post-data-table a { color: var(--link); font-weight: 600; }
.post-data-table a:hover { color: var(--topbar); }

.muted-cell { color: var(--ink-soft); }

.admin-users-table select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 0.85rem; }
.inline-role-form { margin: 0; }

.delete-user-btn {
    background: #fdeceb;
    color: #a33327;
    border: 1px solid #f3c6c2;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.delete-user-btn:hover { background: #f8d5d1; }

.delete-post-form { margin-top: 16px; }

/* Post editor (WP-admin-style: main column + Publish/Category sidebar) */
.post-editor-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    align-items: start;
}

.post-editor-main {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.post-title-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px 18px;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: inherit;
    margin-bottom: 14px;
    line-height: 1.3;
    height: calc(3.64rem + 32px);
    resize: none;
    overflow-y: auto;
}

.quill-editor {
    background: #fff;
    border-radius: 0 0 6px 6px;
    font-family: inherit;
    font-size: 1.02rem;
    min-height: 480px;
}

.post-editor-main .ql-toolbar.ql-snow {
    border-radius: 6px 6px 0 0;
    font-family: inherit;
}

.post-editor-main .ql-container.ql-snow {
    border-radius: 0 0 6px 6px;
    font-family: inherit;
    font-size: 1.02rem;
}

.field-hint { margin: 8px 0 0; font-size: 0.78rem; color: var(--ink-soft); }

.post-editor-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.editor-box {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.editor-box-title {
    margin: 0;
    padding: 12px 16px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    background: var(--teal-2);
}

.editor-box-body { padding: 16px; }

.editor-box-body select,
.editor-box-body input[type="text"] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
}

.editor-box-body .field-hint { margin-top: 6px; }

.status-line { margin: 0 0 12px; font-size: 0.86rem; color: var(--ink); }

.publish-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-draft,
.btn-publish {
    padding: 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid var(--border);
}

.btn-draft { background: var(--card); color: var(--ink); }
.btn-draft:hover { background: var(--paper); }

.btn-publish { background: var(--olive); color: var(--olive-text); border-color: var(--olive); }
.btn-publish:hover { filter: brightness(0.95); }

@media (max-width: 760px) {
    .post-editor-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* Responsive */
@media (max-width: 980px) {
    .layout-3col { grid-template-columns: 1fr; }
    .left-nav { order: 2; }
    .sidebar { order: 3; }
}

@media (max-width: 560px) {
    .nav-inner { flex-direction: column; align-items: stretch; }
    .nav-search input { width: auto; flex: 1; }
    .post-row { flex-direction: column; }
    .row-thumb { width: 100%; height: 170px; }
    .single-post { padding: 20px 16px; }
}
