/* ==========================================================================
   Blog Styles - Magazine Layout
   ========================================================================== */

/* --------------------------------------------------------------------------
   Variables & Base
   -------------------------------------------------------------------------- */
:root {
    --blog-primary-color: var(--tm-primary);
    --blog-secondary-color: #16213e;
    --blog-accent-color: var(--tm-accent);
    --blog-text-color: #333;
    --blog-text-light: #666;
    --blog-bg-color: #f8f9fa;
    --blog-white: #ffffff;
    --blog-border-color: #e0e0e0;
    --blog-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    --blog-shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.12);
    --blog-radius: 12px;
    --blog-transition: all 0.3s ease;
}

/* --------------------------------------------------------------------------
   Blog Container
   -------------------------------------------------------------------------- */
.blog-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px 40px;
}

/* --------------------------------------------------------------------------
   Featured Post
   -------------------------------------------------------------------------- */
.featured-post {
    margin-bottom: 50px;
    border-radius: var(--blog-radius);
    overflow: hidden;
    box-shadow: var(--blog-shadow);
}

.featured-post-image {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.featured-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-post:hover .featured-post-image img {
    transform: scale(1.05);
}

.featured-post-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
    padding: 60px 40px 40px;
}

.featured-post-content {
    max-width: 700px;
}

.featured-post-content .post-category {
    display: inline-block;
    background: var(--blog-accent-color);
    color: var(--blog-white);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.featured-post-content .post-category a {
    color: var(--blog-white);
    text-decoration: none;
}

.featured-post-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--blog-white);
    margin: 0 0 15px;
    line-height: 1.3;
}

.featured-post-title a {
    color: var(--blog-white);
    text-decoration: none;
    transition: var(--blog-transition);
}

.featured-post-title a:hover {
    color: var(--blog-accent-color);
}

.featured-post-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.featured-post-meta span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.featured-post-meta i {
    margin-right: 8px;
    color: var(--blog-accent-color);
}

.featured-post-excerpt {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Blog Content Wrapper
   -------------------------------------------------------------------------- */
.blog-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 50px;
    align-items: start;
}

/* --------------------------------------------------------------------------
   Blog Posts Grid
   -------------------------------------------------------------------------- */
.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* --------------------------------------------------------------------------
   Blog Post Card
   -------------------------------------------------------------------------- */
.blog-post-card {
    background: var(--blog-white);
    border-radius: var(--blog-radius);
    overflow: hidden;
    box-shadow: var(--blog-shadow);
    transition: var(--blog-transition);
}

.blog-post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--blog-shadow-hover);
}

.post-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-post-card:hover .post-card-image img {
    transform: scale(1.08);
}

.post-card-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--blog-primary-color) 0%, var(--blog-secondary-color) 100%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 48px;
    text-decoration: none;
}

.post-card-content {
    padding: 25px;
}

.post-card-content .post-category {
    display: inline-block;
    color: var(--blog-accent-color);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.post-card-content .post-category a {
    color: var(--blog-accent-color);
    text-decoration: none;
    transition: var(--blog-transition);
}

.post-card-content .post-category a:hover {
    color: var(--blog-primary-color);
}

.post-card-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px;
    line-height: 1.4;
}

.post-card-title a {
    color: var(--blog-text-color);
    text-decoration: none;
    transition: var(--blog-transition);
}

.post-card-title a:hover {
    color: var(--blog-accent-color);
}

.post-card-excerpt {
    color: var(--blog-text-light);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 20px;
}

.post-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--blog-border-color);
}

.post-card-meta .post-date {
    color: var(--blog-text-light);
    font-size: 13px;
}

.post-card-meta .post-date i {
    margin-right: 6px;
    color: var(--blog-accent-color);
}

.post-card-meta .post-read-more a {
    color: var(--blog-accent-color);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--blog-transition);
}

.post-card-meta .post-read-more a:hover {
    color: var(--blog-primary-color);
}

.post-card-meta .post-read-more i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.post-card-meta .post-read-more a:hover i {
    transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   No Posts Found
   -------------------------------------------------------------------------- */
.no-posts-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--blog-text-light);
}

.no-posts-found i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

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

.blog-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 5px;
    border-radius: 50%;
    background: var(--blog-white);
    color: var(--blog-text-color);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--blog-transition);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.blog-pagination .page-numbers:hover {
    background: var(--blog-accent-color);
    color: var(--blog-white);
}

.blog-pagination .page-numbers.current {
    background: var(--blog-accent-color);
    color: var(--blog-white);
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.blog-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: var(--blog-white);
    border-radius: var(--blog-radius);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--blog-shadow);
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--blog-primary-color);
    margin: 0 0 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--blog-accent-color);
    position: relative;
}

/* Search Widget */
.widget-search .search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.widget-search input[type="search"] {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--blog-border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--blog-transition);
}

.widget-search input[type="search"]:focus {
    outline: none;
    border-color: var(--blog-accent-color);
}

.widget-search button {
    background: var(--blog-accent-color);
    color: var(--blog-white);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--blog-transition);
}

.widget-search button:hover {
    background: var(--blog-primary-color);
}

/* Categories Widget */
.widget-categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-categories li {
    margin-bottom: 12px;
}

.widget-categories li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--blog-text-color);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--blog-border-color);
    transition: var(--blog-transition);
}

.widget-categories li a:hover {
    color: var(--blog-accent-color);
    padding-left: 10px;
}

.widget-categories .count {
    background: var(--blog-bg-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--blog-text-light);
}

/* Recent Posts Widget */
.widget-recent-posts ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-recent-posts li {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--blog-border-color);
}

.widget-recent-posts li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-post-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.recent-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.recent-post-info a {
    color: var(--blog-text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 5px;
    transition: var(--blog-transition);
}

.recent-post-info a:hover {
    color: var(--blog-accent-color);
}

.recent-post-info .post-date {
    color: var(--blog-text-light);
    font-size: 12px;
}

/* Tags Widget */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-link {
    display: inline-block;
    padding: 6px 14px;
    background: var(--blog-bg-color);
    color: var(--blog-text-light);
    font-size: 13px;
    text-decoration: none;
    border-radius: 20px;
    transition: var(--blog-transition);
}

.tag-link:hover {
    background: var(--blog-accent-color);
    color: var(--blog-white);
}

/* ==========================================================================
   Single Post Styles
   ========================================================================== */

.single-post-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* --------------------------------------------------------------------------
   Post Header
   -------------------------------------------------------------------------- */
.single-post-header {
    margin-bottom: 40px;
}

.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.post-category-tag {
    display: inline-block;
    background: var(--blog-accent-color);
    color: var(--blog-white);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    transition: var(--blog-transition);
}

.post-category-tag:hover {
    background: var(--blog-primary-color);
    color: var(--blog-white);
}

.single-post-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--blog-primary-color);
    margin: 0 0 25px;
    line-height: 1.3;
}

.single-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 0;
    border-top: 1px solid var(--blog-border-color);
    border-bottom: 1px solid var(--blog-border-color);
}

.meta-author {
    display: flex;
    align-items: center;
    gap: 15px;
}

.author-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-size: 14px;
    color: var(--blog-text-color);
}

.author-name a {
    color: var(--blog-accent-color);
    text-decoration: none;
    font-weight: 600;
}

.meta-details {
    display: flex;
    gap: 20px;
}

.meta-details span {
    color: var(--blog-text-light);
    font-size: 14px;
}

.meta-details i {
    margin-right: 6px;
    color: var(--blog-accent-color);
}

/* --------------------------------------------------------------------------
   Featured Image
   -------------------------------------------------------------------------- */
.single-post-featured-image {
    margin-bottom: 40px;
    border-radius: var(--blog-radius);
    overflow: hidden;
    box-shadow: var(--blog-shadow);
}

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

/* --------------------------------------------------------------------------
   Post Content
   -------------------------------------------------------------------------- */
.single-post-content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--blog-text-color);
}

.single-post-content p {
    margin-bottom: 25px;
}

.single-post-content h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--blog-primary-color);
    margin: 40px 0 20px;
}

.single-post-content h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--blog-primary-color);
    margin: 35px 0 15px;
}

.single-post-content ul,
.single-post-content ol {
    margin-bottom: 25px;
    padding-left: 30px;
}

.single-post-content li {
    margin-bottom: 10px;
}

.single-post-content blockquote {
    border-left: 4px solid var(--blog-accent-color);
    margin: 30px 0;
    padding: 20px 30px;
    background: var(--blog-bg-color);
    border-radius: 0 var(--blog-radius) var(--blog-radius) 0;
    font-style: italic;
    color: var(--blog-text-light);
}

.single-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--blog-radius);
    margin: 20px 0;
}

.single-post-content a {
    color: var(--blog-accent-color);
    text-decoration: underline;
    text-decoration-color: rgba(233, 69, 96, 0.3);
    transition: var(--blog-transition);
}

.single-post-content a:hover {
    text-decoration-color: var(--blog-accent-color);
}

/* --------------------------------------------------------------------------
   Post Footer
   -------------------------------------------------------------------------- */
.single-post-footer {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px solid var(--blog-border-color);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
}

.tags-label {
    color: var(--blog-text-color);
    font-weight: 600;
    font-size: 14px;
}

.tags-label i {
    margin-right: 6px;
    color: var(--blog-accent-color);
}

.post-tags .tag-link {
    background: var(--blog-bg-color);
    color: var(--blog-text-light);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    transition: var(--blog-transition);
}

.post-tags .tag-link:hover {
    background: var(--blog-accent-color);
    color: var(--blog-white);
}

/* --------------------------------------------------------------------------
   Share Buttons
   -------------------------------------------------------------------------- */
.post-share {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.share-label {
    color: var(--blog-text-color);
    font-weight: 600;
    font-size: 14px;
}

.share-buttons {
    display: flex;
    gap: 12px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--blog-white);
    font-size: 18px;
    text-decoration: none;
    transition: var(--blog-transition);
}

.share-facebook { background: #3b5998; }
.share-twitter { background: #1da1f2; }
.share-linkedin { background: #0077b5; }
.share-email { background: #666; }

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* --------------------------------------------------------------------------
   Post Navigation
   -------------------------------------------------------------------------- */
.post-navigation {
    margin-top: 40px;
}

.nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.nav-link {
    display: flex;
    flex-direction: column;
    padding: 25px;
    background: var(--blog-bg-color);
    border-radius: var(--blog-radius);
    text-decoration: none;
    transition: var(--blog-transition);
}

.nav-link:hover {
    background: var(--blog-white);
    box-shadow: var(--blog-shadow);
}

.nav-next {
    text-align: right;
}

.nav-label {
    color: var(--blog-text-light);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.nav-label i {
    margin: 0 5px;
}

.nav-title {
    color: var(--blog-text-color);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Related Posts
   -------------------------------------------------------------------------- */
.related-posts-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--blog-border-color);
}

.related-posts-title {
    text-align: center;
    margin: 0 0 40px;
    font-size: 28px;
    font-weight: 600;
    color: var(--blog-primary-color);
    position: relative;
}

.related-posts-title span {
    background: var(--blog-white);
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.related-posts-title::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--blog-border-color);
}

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

.related-post-card {
    background: var(--blog-white);
    border-radius: var(--blog-radius);
    overflow: hidden;
    box-shadow: var(--blog-shadow);
    transition: var(--blog-transition);
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--blog-shadow-hover);
}

.related-post-image {
    height: 180px;
    overflow: hidden;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-post-card:hover .related-post-image img {
    transform: scale(1.08);
}

.related-post-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--blog-primary-color) 0%, var(--blog-secondary-color) 100%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 36px;
    text-decoration: none;
}

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

.related-post-content .post-category {
    display: inline-block;
    color: var(--blog-accent-color);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.related-post-content .post-category a {
    color: var(--blog-accent-color);
    text-decoration: none;
}

.related-post-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px;
    line-height: 1.4;
}

.related-post-content h3 a {
    color: var(--blog-text-color);
    text-decoration: none;
    transition: var(--blog-transition);
}

.related-post-content h3 a:hover {
    color: var(--blog-accent-color);
}

.related-post-content .post-date {
    color: var(--blog-text-light);
    font-size: 12px;
}

/* --------------------------------------------------------------------------
   Comments Section
   -------------------------------------------------------------------------- */
.single-post-comments {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--blog-border-color);
}

/* --------------------------------------------------------------------------
   Responsive Design
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .blog-content-wrapper {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .sidebar-widget {
        margin-bottom: 0;
    }

    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .featured-post-image {
        height: 350px;
    }

    .featured-post-overlay {
        padding: 40px 25px 30px;
    }

    .featured-post-title {
        font-size: 26px;
    }

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

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

    .single-post-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        grid-template-columns: 1fr;
    }

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

    .blog-sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .blog-container {
        padding: 20px 15px;
    }

    .featured-post-image {
        height: 280px;
    }

    .featured-post-title {
        font-size: 22px;
    }

    .featured-post-meta {
        flex-direction: column;
        gap: 10px;
    }

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

    .post-card-title {
        font-size: 18px;
    }

    .single-post-container {
        padding: 20px 15px;
    }

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

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

    .share-buttons {
        flex-wrap: wrap;
    }
}
