/*
Theme Name: Sunday-CMS
Description: A lightweight, modern WordPress theme designed for simplicity and performance. Perfect for blogs, personal websites, and small business sites.
Author: Grishon Munene Muchungu
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sunday-cms
Tags: blog, one-column, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, responsive-layout
Requires at least: 5.0
Tested up to: 6.3
Requires PHP: 7.4
*/

/* ==========================================================================
   Reset and Base Styles
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: #0066cc;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #004499;
}

/* ==========================================================================
   Layout Components
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
    padding: 40px 0;
}

/* ==========================================================================
   Header Styles
   ========================================================================== */

.site-header {
    background-color: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding .custom-logo {
    max-height: 60px;
    width: auto;
}

.site-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.site-title a {
    color: #333;
    text-decoration: none;
}

.site-title a:hover {
    color: #0066cc;
}

.site-description {
    font-size: 14px;
    color: #666;
    margin: 5px 0 0 0;
    font-style: italic;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 0;
    transition: color 0.3s ease;
    border-bottom: 2px solid transparent;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    color: #0066cc;
    border-bottom-color: #0066cc;
}

/* ==========================================================================
   Content Area
   ========================================================================== */

.content-area {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

.no-sidebar .content-area {
    grid-template-columns: 1fr;
}

/* ==========================================================================
   Post Styles
   ========================================================================== */

.post-item {
    margin-bottom: 50px;
    padding-bottom: 40px;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.post-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.post-thumbnail {
    margin-bottom: 25px;
    overflow: hidden;
    border-radius: 8px;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.post-thumbnail:hover img {
    transform: scale(1.05);
}

.post-content {
    padding: 0 20px 20px;
}

.post-header {
    margin-bottom: 20px;
}

.post-title {
    font-size: 32px;
    margin-bottom: 15px;
    line-height: 1.3;
    font-weight: 700;
}

.post-title a {
    color: #333;
    text-decoration: none;
}

.post-title a:hover {
    color: #0066cc;
}

.post-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-excerpt {
    margin-bottom: 25px;
    color: #555;
    line-height: 1.7;
}

.post-footer {
    border-top: 1px solid #f0f0f0;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-more {
    color: #0066cc;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border: 2px solid #0066cc;
    border-radius: 25px;
    transition: all 0.3s ease;
    display: inline-block;
}

.read-more:hover {
    background-color: #0066cc;
    color: white;
}

.post-categories {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.post-categories a {
    background-color: #f0f0f0;
    color: #666;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.post-categories a:hover {
    background-color: #0066cc;
    color: white;
}

/* ==========================================================================
   Single Post Styles
   ========================================================================== */

.single-post .post-title {
    font-size: 42px;
    margin-bottom: 20px;
}

.single-post .post-content-body {
    margin-top: 30px;
}

.single-post .post-content-body h1,
.single-post .post-content-body h2,
.single-post .post-content-body h3,
.single-post .post-content-body h4,
.single-post .post-content-body h5,
.single-post .post-content-body h6 {
    margin: 30px 0 15px;
    color: #333;
}

.single-post .post-content-body p {
    margin-bottom: 20px;
}

.single-post .post-content-body ul,
.single-post .post-content-body ol {
    margin: 20px 0;
    padding-left: 30px;
}

.single-post .post-content-body blockquote {
    margin: 30px 0;
    padding: 20px 30px;
    background-color: #f8f9fa;
    border-left: 4px solid #0066cc;
    font-style: italic;
}

/* ==========================================================================
   Sidebar Styles
   ========================================================================== */

.sidebar {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    height: fit-content;
    position: sticky;
    top: 120px;
}

.widget {
    margin-bottom: 35px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e5e5e5;
}

.widget:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.widget-title {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
}

.widget-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: #0066cc;
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget ul li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e5e5;
}

.widget ul li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.widget ul li a {
    color: #555;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.widget ul li a:hover {
    color: #0066cc;
    padding-left: 10px;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    text-align: center;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e5e5e5;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 12px 18px;
    color: #666;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 50px;
    text-align: center;
}

.pagination a:hover {
    background-color: #0066cc;
    color: white;
    border-color: #0066cc;
}

.pagination .current {
    background-color: #0066cc;
    color: white;
    border-color: #0066cc;
    font-weight: 600;
}

/* ==========================================================================
   Footer Styles
   ========================================================================== */

.site-footer {
    background-color: #2c3e50;
    color: white;
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-widgets {
    margin-bottom: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-widgets .widget {
    background: none;
    padding: 0;
    border-bottom: none;
}

.footer-widgets .widget-title {
    color: white;
    font-size: 18px;
}

.footer-widgets .widget-title:after {
    background-color: #0066cc;
}

.footer-widgets .widget ul li a {
    color: #bbb;
}

.footer-widgets .widget ul li a:hover {
    color: white;
}

.footer-info {
    text-align: center;
    color: #bbb;
    font-size: 14px;
    padding-top: 30px;
    border-top: 1px solid #34495e;
}

.footer-menu {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.footer-menu a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-menu a:hover {
    color: white;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

button,
.button,
input[type="submit"] {
    background-color: #0066cc;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

button:hover,
.button:hover,
input[type="submit"]:hover {
    background-color: #004499;
}

/* ==========================================================================
   Comments
   ========================================================================== */

.comments-area {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid #e5e5e5;
}

.comments-title {
    font-size: 24px;
    margin-bottom: 30px;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment {
    margin-bottom: 30px;
    padding: 25px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 10px;
}

.comment-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.comment-content p {
    margin-bottom: 15px;
}

/* ==========================================================================
   404 and Search
   ========================================================================== */

.error-404,
.search-no-results {
    text-align: center;
    padding: 60px 0;
}

.error-404 h1,
.search-no-results h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #333;
}

.error-404 p,
.search-no-results p {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.search-form {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.search-form input[type="search"] {
    flex: 1;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 15px;
    }
    
    .content-area {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .post-title {
        font-size: 28px;
    }
    
    .single-post .post-title {
        font-size: 32px;
    }
    
    .sidebar {
        position: static;
        margin-top: 0;
    }
    
    .footer-menu {
        flex-direction: column;
        gap: 15px;
    }
    
    .pagination .nav-links {
        gap: 5px;
    }
    
    .pagination a,
    .pagination span {
        padding: 8px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .site-main {
        padding: 20px 0;
    }
    
    .post-item {
        margin-bottom: 30px;
        padding-bottom: 20px;
    }
    
    .post-content {
        padding: 0 15px 15px;
    }
    
    .post-title {
        font-size: 24px;
    }
    
    .sidebar {
        padding: 20px;
    }
    
    .site-footer {
        padding: 30px 0 15px;
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .search-form {
        flex-direction: column;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px !important;
    height: 1px !important;
    overflow: hidden;
}

.alignleft {
    float: left;
    margin-right: 20px;
    margin-bottom: 20px;
}

.alignright {
    float: right;
    margin-left: 20px;
    margin-bottom: 20px;
}

.aligncenter {
    display: block;
    margin: 20px auto;
}

.clear {
    clear: both;
}

.no-posts {
    text-align: center;
    padding: 60px 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
}

.no-posts h2 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #333;
}

.no-posts p {
    font-size: 18px;
    color: #666;
}