/*
Theme Name: CS Rebuild
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: A flexible, customizable WordPress theme boilerplate
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cs-rebuild
Tags: flexible, custom, boilerplate
*/

/* ==========================================================================
   Base Styles
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: #0073aa;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-wrapper {
    display: flex;
    gap: 30px;
    margin: 30px 0;
}

.main-content {
    flex: 1;
}

.sidebar {
    width: 300px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    background: #111827;
    padding: 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
}

.site-branding {
    margin: 0;
}

.site-logo {
    margin: 0;
    line-height: 0;
}

.site-logo a {
    display: inline-block;
    line-height: 0;
}

.site-logo-image {
    height: 40px;
    width: auto;
    display: block;
    transition: opacity 0.2s;
}

.site-logo a:hover .site-logo-image {
    opacity: 0.8;
}

.site-description {
    color: #666;
    font-size: 14px;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.main-navigation {
    margin: 0;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    margin: 0;
}

.main-navigation a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    padding: 20px 0;
    transition: opacity 0.2s;
}

.main-navigation a:hover {
    opacity: 0.8;
    text-decoration: none;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
    background: #111827;
    padding: 40px 0;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.hero-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hero-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hero-card {
    background: transparent;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hero-card-large .hero-image-link {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.hero-card-small .hero-image-link {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.hero-image-link:hover .hero-image {
    transform: scale(1.05);
}

.hero-content {
    display: flex;
    flex-direction: column;
}

.hero-title {
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.hero-title a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s;
}

.hero-title a:hover {
    color: #9ca3af;
    text-decoration: none;
}

.hero-title-large {
    font-family: 'Merriweather', serif;
    font-size: 24px;
    font-weight: 700;
}

.hero-card-small .hero-title {
    font-family: 'Merriweather', serif;
    font-size: 16px;
    font-weight: 700;
}

.hero-meta {
    color: #9ca3af;
    font-size: 13px;
    margin-bottom: 8px;
}

.hero-excerpt {
    color: #d1d5db;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 8px;
}

/* Responsive adjustments for hero */
@media (max-width: 768px) {
    .hero-container {
        grid-template-columns: 1fr;
    }

    .hero-right {
        order: -1;
    }
}

/* ==========================================================================
   Category Sections
   ========================================================================== */

.category-sections {
    background: #ffffff;
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.category-section {
    margin-bottom: 60px;
}

.category-section:last-child {
    margin-bottom: 0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.category-title {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    color: #111827;
    text-transform: uppercase;
}

.read-more-link {
    color: #dc2626;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.read-more-link:hover {
    color: #991b1b;
    text-decoration: none;
}

.category-posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.category-post-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.category-post-image-link {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.category-post-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.category-post-image-link:hover .category-post-image {
    transform: scale(1.05);
}

.category-post-content {
    display: flex;
    flex-direction: column;
}

.category-post-title {
    font-family: 'Merriweather', serif;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.category-post-title a {
    color: #111827;
    text-decoration: none;
    transition: color 0.2s;
}

.category-post-title a:hover {
    color: #2563eb;
    text-decoration: none;
}

.category-post-meta {
    color: #6b7280;
    font-size: 14px;
}

/* Responsive adjustments for category sections */
@media (max-width: 1024px) {
    .category-posts {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .category-posts {
        grid-template-columns: 1fr;
    }

    .category-sections {
        padding: 40px 20px;
    }

    .category-section {
        margin-bottom: 40px;
    }

    .category-title {
        font-size: 24px;
    }
}

/* ==========================================================================
   Single Post Page
   ========================================================================== */

.single-post-container {
    background: #ffffff;
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px 80px;
}

.single-post-main {
    width: 100%;
}

.single-post {
    background: #ffffff;
}

.single-post-header {
    margin-bottom: 40px;
    text-align: center;
}

.post-category-badge {
    display: inline-block;
    background: transparent;
    color: #dc2626;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 20px;
    padding: 0;
}

.single-post-title {
    font-family: 'Merriweather', serif;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 20px 0;
    color: #111827;
}

.single-post-meta {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

.single-post-featured-image {
    margin-bottom: 40px;
    border-radius: 12px;
    overflow: hidden;
}

.single-post-image {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   Gallery Slider
   ========================================================================== */

.gallery-slider {
    position: relative;
    margin-bottom: 40px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.gallery-slides {
    position: relative;
    width: 100%;
}

.gallery-slide {
    display: none;
    width: 100%;
}

.gallery-slide.active {
    display: block;
}

.gallery-slide-image {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 32px;
    line-height: 1;
    color: #111827;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.gallery-nav-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav-button:active {
    transform: translateY(-50%) scale(0.95);
}

.gallery-prev {
    left: 20px;
}

.gallery-next {
    right: 20px;
}

.gallery-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10;
}

.gallery-counter .current-slide {
    font-weight: 700;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .gallery-nav-button {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .gallery-prev {
        left: 10px;
    }

    .gallery-next {
        right: 10px;
    }

    .gallery-counter {
        bottom: 10px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

.single-post-content {
    font-size: 18px;
    line-height: 1.8;
    color: #374151;
}

.single-post-content p {
    margin-bottom: 1.5em;
}

.single-post-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 0.75em;
    color: #111827;
}

.single-post-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    color: #111827;
}

.single-post-content a {
    color: #2563eb;
    text-decoration: underline;
}

.single-post-content a:hover {
    color: #1d4ed8;
}

.single-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2em 0;
}

.single-post-content ul,
.single-post-content ol {
    margin-bottom: 1.5em;
    padding-left: 2em;
}

.single-post-content li {
    margin-bottom: 0.5em;
}

/* Responsive adjustments for single post */
@media (max-width: 768px) {
    .single-post-container {
        padding: 40px 20px 60px;
    }

    .single-post-title {
        font-size: 36px;
    }

    .single-post-content {
        font-size: 16px;
    }

    .single-post-content h2 {
        font-size: 28px;
    }

    .single-post-content h3 {
        font-size: 22px;
    }
}

/* ==========================================================================
   Related Posts Section
   ========================================================================== */

.related-posts-section {
    background: #e5e7eb;
    width: 100%;
    padding: 60px 0;
    margin: 0;
}

.related-posts-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.related-posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.related-posts-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.view-all-link {
    color: #dc2626;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.view-all-link:hover {
    color: #991b1b;
    text-decoration: none;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.related-post-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.related-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.related-post-image-link {
    display: block;
    overflow: hidden;
}

.related-post-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.related-post-image-link:hover .related-post-image {
    transform: scale(1.05);
}

.related-post-content {
    padding: 20px;
}

.related-post-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.related-post-title a {
    color: #111827;
    text-decoration: none;
    transition: color 0.2s;
}

.related-post-title a:hover {
    color: #2563eb;
    text-decoration: none;
}

.related-post-meta {
    color: #6b7280;
    font-size: 14px;
}

/* Responsive adjustments for related posts */
@media (max-width: 1024px) {
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .related-posts-section {
        padding: 40px 0;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .related-posts-title {
        font-size: 24px;
    }

    .related-posts-header {
        margin-bottom: 30px;
    }
}

/* ==========================================================================
   Category Archive Page
   ========================================================================== */

.category-archive-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px 80px;
}

.category-archive-header {
    margin-bottom: 40px;
}

.category-archive-title {
    font-family: 'Merriweather', serif;
    font-size: 36px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 10px 0;
    text-align: left;
}

.category-description {
    color: #6b7280;
    font-size: 16px;
    line-height: 1.6;
}

.category-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 60px;
}

/* Pagination */
.category-pagination {
    margin-top: 60px;
    text-align: center;
}

.pagination-list {
    list-style: none;
    display: inline-flex;
    gap: 10px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-list li {
    margin: 0;
}

.pagination-list a,
.pagination-list .current {
    display: inline-block;
    padding: 10px 16px;
    color: #111827;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.pagination-list a:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    text-decoration: none;
}

.pagination-list .current {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.pagination-list .prev,
.pagination-list .next {
    font-weight: 600;
}

/* Responsive adjustments for category archive */
@media (max-width: 1024px) {
    .category-archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .category-archive-container {
        padding: 40px 20px 60px;
    }

    .category-archive-grid {
        grid-template-columns: 1fr;
    }

    .category-archive-title {
        font-size: 28px;
    }

    .category-archive-header {
        margin-bottom: 30px;
    }

    .category-pagination {
        margin-top: 40px;
    }

    .pagination-list {
        gap: 5px;
    }

    .pagination-list a,
    .pagination-list .current {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* ==========================================================================
   Content
   ========================================================================== */

.entry-header {
    margin-bottom: 20px;
}

.entry-title {
    font-size: 32px;
    margin-bottom: 10px;
}

.entry-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.entry-content {
    margin-bottom: 30px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: #f5f5f5;
    padding: 30px 0;
    margin-top: 50px;
    border-top: 1px solid #e5e5e5;
    text-align: center;
}

/* ==========================================================================
   Widgets
   ========================================================================== */

.widget {
    margin-bottom: 30px;
}

.widget-title {
    font-size: 18px;
    margin-bottom: 15px;
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 5px 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }
}
