/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: var(--body-size);
    line-height: var(--body-line-height);
    font-weight: var(--font-body-weight);
    color: var(--color-text-primary);
    background-color: var(--color-background);
}

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

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-hover);
}

ul {
    list-style: none;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-heading-weight);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: var(--h1-size);
    line-height: var(--h1-line-height);
}

h2 {
    font-size: var(--h2-size);
    line-height: var(--h2-line-height);
}

h3 {
    font-size: var(--h3-size);
    line-height: var(--h3-line-height);
}

h6 {
    font-size: var(--h6-size);
    line-height: var(--h6-line-height);
    font-weight: var(--font-body-weight);
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.site-content {
    min-height: 50vh;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
}

.main-navigation ul {
    display: flex;
    gap: 30px;
    align-items: center;
}

.main-navigation a {
    color: var(--color-black);
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: var(--color-primary);
}

/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */

.breadcrumbs {
    background-color: var(--color-white);
    padding: 15px 0;
    border-bottom: 1px solid var(--color-border);
}

.breadcrumbs a {
    color: var(--color-text-secondary);
}

.breadcrumbs a:hover {
    color: var(--color-primary);
}

.breadcrumbs .separator {
    margin: 0 10px;
    color: var(--color-text-secondary);
}

.breadcrumbs span {
    color: var(--color-text-primary);
}

/* ==========================================================================
   BLOG HERO SECTION
   ========================================================================== */

.blog-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--section-gap);
    padding: 80px 0;
    text-align: center;
}

.blog-hero h1 {
    color: var(--color-black);
}

.blog-hero .hero-subtitle {
    color: var(--color-black);
    text-align: center;
    max-width: 800px;
}

/* ==========================================================================
   POSTS GRID
   ========================================================================== */

.posts-grid-section {
    padding: 0 0 var(--section-gap) 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--item-gap);
    margin-bottom: var(--section-gap);
}

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

.post-card {
    display: flex;
    width: 100%;
    height: 500px;
}

.post-card-link {
    width: 100%;
    display: block;
}

.post-card-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.post-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.8) 100%);
    display: flex;
    padding: 250px 30px 30px 30px;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    transition: background 0.3s ease;
}

.post-card:hover .post-card-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.9) 100%);
}

.post-card-content {
    width: 100%;
    color: var(--color-white);
    text-align: center;
}

.post-card-content h3 {
    font-size: 28px;
    line-height: 36px;
    margin-bottom: 10px;
    color: var(--color-white);
}

.post-card-content .excerpt {
    font-size: 16px;
    line-height: 24px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.post-card-content .post-meta {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 14px;
    opacity: 0.8;
}

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

.post-categories .category {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: var(--item-gap) 0;
}

.pagination-item {
    display: flex;
    width: 40px;
    height: 40px;
    padding: 10px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    aspect-ratio: 1/1;
    text-align: center;
    font-family: var(--font-primary);
    font-size: var(--button-size);
    font-weight: var(--font-heading-weight);
    line-height: var(--button-line-height);
    transition: all 0.3s ease;
    cursor: pointer;
}

.pagination-item.number {
    color: var(--color-primary);
    border-radius: var(--element-gap);
}

.pagination-item.number.active {
    border-radius: 500px;
    background: var(--color-black);
    color: var(--color-white);
}

.pagination-item.prev,
.pagination-item.next {
    color: var(--color-black);
    padding: 10px 20px;
    width: auto;
}

.pagination-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-item:not(.disabled):hover {
    opacity: 0.7;
}

/* ==========================================================================
   SINGLE POST
   ========================================================================== */

.single-post {
    padding: var(--section-gap) 0;
}

.post-featured-image {
    margin-bottom: var(--card-gap);
    border-radius: 8px;
    overflow: hidden;
}

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

.post-header {
    margin-bottom: var(--item-gap);
    text-align: center;
}

.post-header h1 {
    margin-bottom: var(--card-gap);
}

.post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--card-gap);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

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

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.author-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.author-name {
    font-weight: 600;
    color: var(--color-black);
}

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

.post-dates {
    display: flex;
    gap: 15px;
    color: var(--color-text-secondary);
    font-size: 14px;
}

.post-content {
    max-width: 900px;
    margin: 0 auto var(--item-gap) auto;
    line-height: 1.8;
}

.post-content h2 {
    margin-top: var(--card-gap);
    margin-bottom: 20px;
}

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

.post-content img {
    margin: var(--card-gap) 0;
    border-radius: 8px;
}

.post-content ul,
.post-content ol {
    list-style-position: inside;
    margin-bottom: 20px;
}

.post-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--item-gap);
}

.tags-label {
    font-weight: 600;
    color: var(--color-black);
}

.tag {
    background-color: var(--color-background);
    color: var(--color-primary);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    font-size: 14px;
}

.author-box {
    max-width: 900px;
    margin: var(--section-gap) auto;
    padding: var(--card-gap);
    background-color: var(--color-white);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    display: flex;
    gap: 25px;
    align-items: center;
}

.author-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    flex-shrink: 0;
}

.author-box-content h3 {
    margin-bottom: 10px;
}

.author-box-content p {
    color: var(--color-text-secondary);
    margin-bottom: 15px;
}

.author-social {
    display: flex;
    gap: 15px;
}

.author-social a {
    color: var(--color-primary);
    font-weight: 500;
}

/* ==========================================================================
   RELATED POSTS
   ========================================================================== */

.related-posts {
    background-color: #f9f9f9;
    padding: var(--section-gap) 0;
}

.related-posts h2 {
    text-align: center;
    margin-bottom: var(--item-gap);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    background-color: var(--color-black);
    color: var(--color-white);
    padding: var(--section-gap) 0 var(--card-gap) 0;
    margin-top: var(--section-gap);
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--card-gap);
    margin-bottom: var(--card-gap);
}

.footer-column h4 {
    margin-bottom: 20px;
    color: var(--color-primary);
}

.footer-column ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-column a {
    color: var(--color-white);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-column a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--card-gap);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-bottom p {
    margin-bottom: 10px;
    opacity: 0.8;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

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

@media (max-width: 768px) {
    :root {
        --h1-size: 36px;
        --h1-line-height: 44px;
        --h2-size: 28px;
        --h2-line-height: 36px;
        --h3-size: 24px;
        --h3-line-height: 32px;
    }

    .header-content {
        flex-direction: column;
        gap: 20px;
    }

    .main-navigation ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

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

    .post-card {
        height: 400px;
    }

    .post-card-overlay {
        padding: 150px 20px 20px 20px;
    }

    .blog-hero {
        padding: 40px 0;
    }

    .author-box {
        flex-direction: column;
        text-align: center;
    }

    .post-meta {
        flex-direction: column;
    }

    .footer-columns {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.no-posts {
    text-align: center;
    padding: var(--section-gap) 0;
    color: var(--color-text-secondary);
}
