/* ===================================
   Marketa Blog — Optimized Styles
   Clean, maintainable, performant
   =================================== */

/* ===================
   LAYOUT & CONTAINERS
   =================== */

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
}

@media (max-width: 768px) {
    .section {
        padding: 4rem 0;
    }
    
    .container-narrow {
        padding: 0 1.5rem;
    }
}

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

.blog-hero {
    padding: 10rem 0 6rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    text-align: center;
}

.blog-hero h1 {
    max-width: 800px;
    margin: 0 auto 1.5rem;
    font-size: clamp(2.5rem, 5vw, 4rem);
}

.blog-hero-lead {
    max-width: 600px;
    margin: 0 auto 3rem;
    font-size: 1.25rem;
    color: var(--gray-600);
    line-height: 1.7;
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 8rem 0 4rem;
    }
}

/* ===================
   CATEGORY FILTERS
   =================== */

.blog-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
}

.category-pill {
    padding: 0.75rem 1.5rem;
    background: var(--white);
    border: 2px solid rgba(17, 17, 17, 0.1);
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--black);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    font-family: var(--font-body);
}

.category-pill:hover {
    border-color: var(--accent);
    background: rgba(45, 90, 71, 0.05);
    transform: translateY(-2px);
}

.category-pill.active {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

.category-pill.active:hover {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

/* ===================
   FEATURED POST
   =================== */

.featured-post {
    background: var(--black);
    color: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 4rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.featured-post-image {
    height: 100%;
    min-height: 400px;
    background: linear-gradient(135deg, var(--accent) 0%, #2AB89A 100%);
    position: relative;
    overflow: hidden;
}

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

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

.featured-post-content {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: var(--white);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    width: fit-content;
}

.featured-post-content h2 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.2;
}

.featured-post-excerpt {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.featured-post-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2rem;
}

.featured-post .btn-primary {
    background: var(--accent);
    color: var(--white);
    width: fit-content;
}

.featured-post .btn-primary:hover {
    background: var(--white);
    color: var(--black);
}

@media (max-width: 968px) {
    .featured-post {
        grid-template-columns: 1fr;
    }
    
    .featured-post-image {
        min-height: 300px;
    }
    
    .featured-post-content {
        padding: 2rem;
    }
}

/* ===================
   BLOG GRID
   =================== */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 4rem;
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ===================
   BLOG CARD
   =================== */

.blog-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all var(--duration) var(--ease);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.blog-card-image {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, var(--accent) 0%, #2AB89A 100%);
    position: relative;
    overflow: hidden;
}

.blog-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
    pointer-events: none;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

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

.blog-card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.blog-card-category {
    background: var(--accent);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-card-date {
    color: var(--gray-600);
}

.blog-card h3 {
    font-size: 1.5rem;
    color: var(--black);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.blog-card-excerpt {
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.blog-card-link {
    color: var(--black);
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--duration) var(--ease);
    width: fit-content;
}

.blog-card-link:hover {
    color: var(--accent);
    gap: 0.75rem;
}

/* ===================
   NEWSLETTER SECTION
   =================== */

.section-newsletter {
    background: var(--accent);
    padding: 5rem 0;
}

.newsletter-box {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-box h2 {
    color: var(--white);
    margin-bottom: 1rem;
}

.newsletter-box p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-body);
    background: var(--white);
}

.newsletter-form input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.newsletter-form .btn-primary {
    background: var(--black);
    color: var(--white);
    white-space: nowrap;
}

.newsletter-form .btn-primary:hover {
    background: var(--gray-800);
}

.newsletter-note {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form .btn-primary {
        width: 100%;
    }
}

/* ===================
   ARTICLE PAGE
   =================== */

.blog-article {
    background: var(--white);
}

.article-header {
    padding: 10rem 0 4rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
}

.article-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    transition: all var(--duration) var(--ease);
}

.article-back:hover {
    color: var(--accent);
    gap: 0.75rem;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.tag {
    padding: 0.4rem 0.9rem;
    background: var(--accent);
    color: var(--white);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.15;
    margin-bottom: 1rem;
    color: var(--black);
}

.article-subtitle {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--gray-600);
    margin-bottom: 2rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.95rem;
    color: var(--gray-600);
}

.article-reading-time::before {
    content: '•';
    margin-right: 1.5rem;
}

@media (max-width: 768px) {
    .article-header {
        padding: 8rem 0 3rem;
    }
}

/* ===================
   ARTICLE CONTENT
   =================== */

.article-content {
    padding: 4rem 0;
}

.article-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.article-content h2 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: var(--black);
    line-height: 1.3;
}

.article-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: var(--black);
}

.article-content h4 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    color: var(--black);
}

.article-content p {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--black);
}

.article-content ul,
.article-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.article-content li {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 0.75rem;
    color: var(--black);
}

.article-content strong {
    font-weight: 600;
    color: var(--black);
}

.article-content em {
    font-style: italic;
}

.article-content a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    transition: color var(--duration) var(--ease);
}

.article-content a:hover {
    color: var(--accent-dark);
}

.article-content blockquote {
    margin: 2.5rem 0;
    padding: 2rem;
    background: var(--gray-100);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    font-style: italic;
    color: var(--black);
}

.article-content code {
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
}

.article-content pre {
    background: var(--black);
    color: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 2rem 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: var(--white);
}

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

.article-footer {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--gray-200);
}

.article-share {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.share-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.share-button:hover {
    background: var(--accent);
    color: var(--white);
    transform: translateY(-2px);
}

/* ===================
   RELATED ARTICLES
   =================== */

.related-articles {
    background: var(--gray-50);
    padding: 4rem 0;
    margin-top: 4rem;
}

.related-articles h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.related-card {
    padding: 2rem;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all var(--duration) var(--ease);
}

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

.related-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--black);
}

.related-card p {
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===================
   UTILITY & STATES
   =================== */

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-600);
}

.no-results h3 {
    color: var(--black);
    margin-bottom: 1rem;
}

/* Hidden state for filtering */
.blog-card.hidden {
    display: none;
}

/* Loading state */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Focus states for accessibility */
.category-pill:focus,
.newsletter-form input:focus,
.share-button:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .nav,
    .article-back,
    .article-share,
    .related-articles,
    .footer {
        display: none;
    }
    
    .article-content {
        max-width: 100%;
    }
}

/* Footer logo fix for dark background */
.footer-brand .logo {
    color: var(--white);
}