:root {
    --primary: #0d6efd; /* Bootstrap primary blue */
    --primary-600: #2563eb;
    --muted: #6b7280;
    --success: #10b981;
    --danger: #ef4444;
    --dark: #0f172a;
    --bg: #ffffff;
    --surface: #f8fafc;
    --border: #e6eef8;
    --text: #22303f;
    --text-muted: #556070;
    --radius: 10px;
    --container-max: 1140px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    line-height: 1.7;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* Main content container with balanced vertical spacing */
.main-content.container { padding-top: 2.5rem; padding-bottom: 2.5rem; }

.header {
    background: var(--bg);
    border-bottom: 1px solid rgba(15,23,42,0.04);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    gap: 1.5rem;
}

.logo {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.logo i { background: rgba(13,110,253,0.08); padding: 6px; border-radius: 8px; color: var(--primary); }

.nav-menu {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.nav-link { color: var(--text); padding: .5rem .65rem; border-radius: 8px; }
.nav-link:hover, .nav-link:focus { color: var(--primary); background: rgba(13,110,253,0.04); text-decoration: none; }

.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 200px;
    display: none;
    z-index: 100;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text);
    transition: background 0.3s;
}

.dropdown-item:hover {
    background: var(--light);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-form { display:flex; gap:.5rem; align-items:center }
.search-input {
    padding: .5rem .9rem; border:1px solid var(--border); border-radius: 999px; min-width:220px; background: #fff; box-shadow:none;
}
.search-input:focus { outline:none; border-color: rgba(13,110,253,0.6); box-shadow: 0 0 0 4px rgba(13,110,253,0.06); }
.search-btn { border-radius:999px; padding:.45rem .8rem }

.main-content {
    min-height: calc(100vh - 400px);
    padding: 2rem 0;
}

.featured-section {
    margin-bottom: 3rem;
}

.section-title { font-size:1.6rem; margin-bottom:1rem; font-weight:700; color:var(--dark); }

.featured-slider {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.featured-slider > * { flex: 1 1 300px; }

.featured-card { background: #fff; border-radius: var(--radius); overflow:hidden; transition:none }

.featured-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.featured-content {
    padding: 1.5rem;
}

.featured-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: #fff;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-large {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: #fff;
    border-radius: 24px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
}

.date {
    color: var(--text-light);
    font-size: 0.875rem;
}

.featured-title a {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    display: block;
    margin-bottom: 0.75rem;
    transition: color 0.3s;
}

.featured-title a:hover {
    color: var(--primary);
}

.featured-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.featured-author {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

.content-grid {
    display: flex;
    gap: 2rem;
    align-items: start;
}

.content-grid > *:first-child { flex: 1 1 auto; }
.content-grid > *:last-child { flex: 0 0 350px; }

.posts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.posts-grid > * { flex: 1 1 280px; }

.post-card { background:#fff; border-radius: var(--radius); overflow:hidden }

.post-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-content { padding: 1rem }

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.post-title {
    margin-bottom: 0.75rem;
}

.post-title a {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s;
}

.post-title a:hover {
    color: var(--primary);
}

.post-excerpt {
    color: var(--text-light);
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

.post-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.post-footer span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

.widget {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

.popular-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.popular-post {
    display: flex;
    gap: 1rem;
}

.popular-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.popular-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-content h4 {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

.popular-content h4 a {
    color: var(--dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s;
}

.popular-content h4 a:hover {
    color: var(--primary);
}

.popular-meta {
    display: flex;
    gap: 0.75rem;
    color: var(--text-light);
    font-size: 0.8125rem;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.75rem;
}

.category-list li a {
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s;
}

.category-list li a:hover {
    color: var(--primary);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-link {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    transition: all 0.3s;
}

.page-link:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.post-detail {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.post-detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.post-detail-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    color: var(--text-light);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    font-weight: 500;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.author-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.meta-divider {
    color: var(--border);
}

.post-detail-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.post-detail-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text);
}

.post-detail-content h2 {
    font-size: 1.875rem;
    margin: 2rem 0 1rem;
}

.post-detail-content h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 0.75rem;
}

.post-detail-content p {
    margin-bottom: 1.5rem;
}

.post-detail-content img {
    margin: 2rem 0;
    border-radius: 8px;
}

.post-tags {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.tag {
    padding: 0.5rem 1rem;
    background: var(--light);
    border-radius: 20px;
    color: var(--text);
    font-size: 0.875rem;
    transition: all 0.3s;
}

.tag:hover {
    background: var(--primary);
    color: #fff;
}

.post-share {
    margin: 2rem 0;
}

.post-share h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.share-buttons {
    display: flex;
    gap: 1rem;
}

.share-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform 0.3s;
}

.share-btn:hover {
    transform: scale(1.1);
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.linkedin { background: #0077b5; }
.share-btn.whatsapp { background: #25d366; }

.author-box {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--light);
    border-radius: 12px;
    margin: 2rem 0;
}

.author-box-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-box-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-light);
    flex-shrink: 0;
}

.author-box-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.author-box-content h3 a {
    color: var(--dark);
    transition: color 0.3s;
}

.author-box-content h3 a:hover {
    color: var(--primary);
}

.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

.comments-section h2 {
    font-size: 1.875rem;
    margin-bottom: 2rem;
}

.comment-form {
    margin-bottom: 3rem;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.form-input:focus, .form-textarea:focus {
    border-color: var(--primary);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: #fff;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 12px;
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    flex-shrink: 0;
    overflow: hidden;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-date {
    color: var(--text-light);
    font-size: 0.875rem;
}

.toc-widget {
    position: sticky;
    top: 100px;
}

.toc-list {
    list-style: none;
}

.toc-item {
    margin-bottom: 0.5rem;
}

.toc-item-sub {
    margin-bottom: 0.5rem;
    margin-left: 1rem;
}

.toc-link {
    color: var(--text);
    font-size: 0.9375rem;
    transition: color 0.3s;
}

.toc-link:hover {
    color: var(--primary);
}

.page-header { text-align:center; margin-bottom:2rem }
.page-header h1 { font-size:2rem; margin-bottom:.5rem; }
.page-description { font-size:1rem; color:var(--text-muted) }

.author-profile {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 3rem;
}

.author-profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

.author-profile-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-light);
}

.author-profile-info h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.static-content {
    background: #fff;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    max-width: 800px;
    margin: 0 auto;
}

.content-section h2 {
    font-size: 1.875rem;
    margin: 2rem 0 1rem;
}

.content-section h2:first-child {
    margin-top: 0;
}

.content-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.contact-content {
    /* Rely on Bootstrap's .row and .col-* for layout. Removed custom grid to keep layout consistent with Bootstrap. */
    margin-top: 0.5rem;
}

.contact-card { width:100%; margin:0 }

/* Style info boxes (right column) to be visually consistent */
.info-box {
    background: #fff;
    padding: 1.25rem 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(16,24,40,0.06);
    text-align: center;
    border: none; /* removed thin border */
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

/* Remove borders from common card-like elements for a cleaner, borderless look */
.card, .widget, .post-card, .featured-card, .contact-card, .author-box {
    border: none !important;
}

/* Remove decorative left border on hero */
.contact-hero { border-left: none !important; }

/* Remove widget title underline */
.widget-title { border-bottom: none !important; padding-bottom: 0.5rem; }

/* ===== Visual simplification: remove heavy shadows and normalize spacing ===== */
/* Remove most box-shadows for a flat, modern look */
.card, .widget, .post-card, .featured-card, .contact-card, .author-box, .info-box, .post-detail, .static-content {
    box-shadow: none !important;
}

/* Reduce any remaining card hover lift */
.post-card:hover, .featured-card:hover { transform: none !important; box-shadow: none !important; }

/* Standardize padding inside card bodies and widgets */
.card-body, .widget .card-body, .post-content, .featured-content {
    padding: 1rem !important;
}

/* Normalize spacing for thumbnails and images */
.post-image, .popular-image { margin-bottom: 0.5rem; }
.post-image img, .popular-image img { border-radius: 8px; display: block; width: 100%; height: auto; }

/* Make popular-post items vertically centered and consistent */
.popular-post { align-items: center; }

/* Consistent card/section margins */
.card, .widget, .author-box { margin-bottom: 1.25rem; }

/* Tighter spacing for lists and meta info */
.post-meta, .featured-author, .post-footer { gap: 0.5rem; }

/* Ensure sidebar widgets don't look cramped */
.sidebar .widget { padding: 1rem; }

/* Comments box normalization */
.comment { padding: 1rem; }
.comment-avatar img { width: 48px; height: 48px; }

/* Buttons spacing */
.btn { padding: 0.6rem 1rem; }
/* End visual simplification */

@media (max-width: 992px) {
    .contact-card { max-width:100%; }
    .content-grid { flex-direction: column; gap:1rem }
    .featured-slider, .posts-grid { gap:1rem }
}
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .posts-grid {
        /* Flex wrap handles stacking */
    }

    .featured-slider {
        /* Flex wrap handles stacking */
    }

    .post-detail-title {
        font-size: 1.875rem;
    }

    .contact-content {
        /* Bootstrap handles stacking */
    }

    .author-profile {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 576px) {
  .btn-cta {
    width: 100%;
    display: block;
  }
  .form-actions { flex-direction: column-reverse; gap: .5rem; }
}
