/*
Theme Name: Custom Blog Theme
Author: Your Name
Description: A professional custom blog theme with modern features.
Version: 3.3
*/

/* --- General Styles --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 0;
    background-color: #E6DCDC;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 30px;
}

a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #005a87;
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Smart & Professional Header --- */
.site-header {
    background-color: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #e7e7e7;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: padding 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
    padding: 10px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    padding: 0 30px;
    margin: 0 auto;
}

.site-branding img {
    max-height: 50px;
    width: auto;
    vertical-align: middle;
}

.site-branding h1 {
    margin: 0;
    font-size: 1.8em;
}

/* --- Navigation Menu --- */
.main-navigation .menu {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
}

.main-navigation li {
    margin-left: 25px;
}

.main-navigation a {
    display: block;
    color: #444;
    font-weight: 600;
    text-decoration: none !important;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.main-navigation a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    background-color: #0073aa;
    transition: width 0.3s ease, left 0.3s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    color: #0073aa;
}

.main-navigation a:hover:after,
.main-navigation .current-menu-item > a:after {
    width: 100%;
    left: 0;
}

.menu-toggle {
    display: none;
}

/* --- Search Form --- */
.search-container {
    margin: 40px 0;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.search-form {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

.search-form label {
    width: 100%;
    margin: 0;
}

.screen-reader-text {
    display: none;
}

.search-field {
    width: 100%;
    padding: 15px 50px 15px 20px; /* Space on the right for the button */
    border: 2px solid #ddd;
    border-radius: 50px; /* Fully rounded */
    font-size: 1.1em;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-field:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    outline: none;
}

.search-submit {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #0073aa;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.search-submit:hover {
    background-color: #005a87;
}

.search-submit .search-icon {
    fill: #fff;
    width: 22px;
    height: 22px;
}

/* --- Main Content and Sidebar Layout --- */
.main-content-area {
    display: flex;
    flex-wrap: wrap; 
    gap: 30px; 
    margin-top: 40px;
}

.site-main {
    flex: 1; 
    min-width: 0; 
}

.widget-area {
    flex: 0 0 300px;
}

/* --- Sidebar Widgets --- */
.widget {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    margin-bottom: 30px;
}

.widget-title {
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    display: flex; /* Added */
    justify-content: space-between; /* Added */
    align-items: center; /* Added */
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: #444;
    text-decoration: none;
}

.widget ul li a:hover {
    color: #0073aa;
}

/* For category count */
.widget_categories .count {
    background-color: #f1f1f1;
    color: #777;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
}

/* --- Post List (index.php) --- */
.post-listing {
    margin: 0;
}

.post-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 35px;
    padding: 25px;
    background-color: #fff;
    border: 1px solid #e9e9e9;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.post-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.post-thumbnail {
    flex: 0 0 220px;
    margin-right: 30px;
}

.post-thumbnail img {
    border-radius: 5px;
}

.post-content {
    flex: 1;
}

/* Post Meta (index.php) */
.post-meta {
    font-size: 0.85em;
    color: #777;
    margin-bottom: 8px;
}

.post-meta .meta-item {
    margin-right: 15px;
    display: inline-block;
}

.post-meta a {
    color: #555;
    font-weight: 600;
}

.post-meta a:hover {
    color: #0073aa;
}

.post-content h2 {
    margin-top: 0;
    margin-bottom: 5px; /* Reduced space below title */
    font-size: 1.9em;
    line-height: 1.5;
}

.post-excerpt {
    margin: 0 0 20px; /* Removed top margin */
    color: #555;
    height: 3.6em; /* Adjusted height */
    line-height: 1.4; /* Adjusted line-height for better fit */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.read-more-btn {
    display: inline-block;
    padding: 10px 18px;
    background-color: #0073aa;
    color: #fff;
    border-radius: 4px;
    font-weight: bold;
}

/* --- Pagination --- */
.pagination {
    margin-top: 40px;
    text-align: center;
}

.nav-links {
    display: inline-flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.page-numbers {
    padding: 10px 15px;
    color: #555;
    text-decoration: none;
    border-right: 1px solid #ddd;
    transition: background-color 0.2s ease, color 0.2s ease;
    line-height: 1;
}

.nav-links .page-numbers:last-child {
    border-right: none;
}

.page-numbers:hover,
.page-numbers.current {
    background-color: #0073aa;
    color: #fff;
}

/* --- Single Post Page --- */
.single-post-top-section {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin-bottom: 40px;
}

.top-section-thumbnail {
    flex: 0 0 40%;
    max-width: 40%;
}

.top-section-thumbnail img {
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.top-section-details {
    flex: 1;
}

.top-section-details .entry-title {
    font-size: 2.8em;
    margin-top: 0;
    margin-bottom: 20px;
    color: #1a2233;
}

.entry-categories a {
    background-color: rgba(255,255,255,0.7);
    color: #555;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px 25px;
    color: #556;
    font-size: 0.9em;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 15px;
    margin-top: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-author .avatar {
    border-radius: 50%;
}

.meta-icon {
    width: 18px;
    height: 18px;
    color: #556;
}

.single-post-content-wrapper {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
}

/* --- Comment Section --- */
.comments-area {
    margin-top: 30px;
    padding: 40px;
    background-color: #fff;
    border-radius: 8px;
}

.comments-title, .comment-reply-title {
    font-size: 1.8em;
    margin-bottom: 30px;
    color: #222;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
}

.comment-list li.comment {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e9e9e9;
}

.comment-list li.comment .children {
    padding-left: 20px;
    margin-top: 20px;
    list-style: none;
}

.comment-author .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.comment-body {
    flex-grow: 1;
}

.comment-meta {
    font-size: 0.9em;
    color: #777;
    margin-bottom: 5px;
}

.comment-meta .fn {
    font-weight: bold;
    color: #333;
}

.comment-content p {
    margin-top: 5px;
}

.reply .comment-reply-link {
    font-size: 0.85em;
    font-weight: bold;
    background-color: #e9e9e9;
    color: #555;
    padding: 5px 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}
.reply .comment-reply-link:hover {
    background-color: #ddd;
}

/* --- Smart & Professional Comment Form --- */
.comment-respond {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #e7e7e7;
    margin-bottom: 40px; /* Space between form and list */
}

.comment-form input[type="text"],
.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
    box-sizing: border-box;
    font-size: 1em;
    background-color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.comment-form input[type="text"]:focus,
.comment-form textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    outline: none;
}

.comment-form .submit {
    display: inline-block;
    padding: 12px 30px;
    background-color: #0073aa;
    color: #fff;
    border-radius: 5px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.comment-form .submit:hover {
    background-color: #005a87;
    transform: translateY(-2px);
}

/* --- Footer --- */
.site-footer {
    background-color: #222;
    color: #ccc;
    padding: 60px 0 0;
    margin-top: 40px;
    font-size: 0.95em;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer-column {
    width: 30%;
    margin-bottom: 40px;
    padding: 0 15px;
    box-sizing: border-box;
}

.footer-column h3 {
    color: #fff;
}

.footer-bottom-bar {
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px solid #333;
    font-size: 0.9em;
    color: #888;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .main-content-area {
        flex-direction: column;
    }
    .widget-area {
        margin-top: 40px;
    }
    .single-post-top-section {
        flex-direction: column;
        text-align: center;
    }
    .top-section-thumbnail {
        max-width: 80%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    .header-container {
        padding: 0 15px;
    }
    .menu-toggle {
        display: block;
        background: transparent;
        border: 1px solid #ccc;
        padding: 5px 10px;
        border-radius: 4px;
        cursor: pointer;
    }
    .main-navigation .menu {
        display: none;
    }
    .main-navigation.toggled .menu {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        flex-direction: column;
    }
    .main-navigation li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
        text-align: center; /* To center the menu text */
    }

    .post-item {
        flex-direction: column;
    }
    .post-thumbnail {
        margin-right: 0;
        margin-bottom: 20px;
    }
    .footer-column {
        width: 100%;
        text-align: center;
    }
}

