/* Serverless Blog Styles for NextStep BHS */

/* Import shared styles from main site */
@import url('../css/shared-styles.css');

/* Blog-specific styles */
.blog-hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    color: var(--white);
    padding: 150px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
                radial-gradient(ellipse at 40% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
}

.blog-hero-content {
    position: relative;
    z-index: 2;
}

.blog-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--white) 0%, var(--gray-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-hero p {
    font-size: clamp(1.1rem, 2.5vw, 1.25rem);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Loading states */
.loading {
    text-align: center;
    padding: 4rem 0;
    color: var(--gray);
}

.loading::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Blog posts section */
.blog-posts {
    background: var(--gray-lighter);
    padding: 100px 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.post-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--gray-lighter);
    position: relative;
    cursor: pointer;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

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

.post-card-content {
    padding: 2rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--gray);
    flex-wrap: wrap;
}

.post-date {
    color: var(--secondary);
    font-weight: 500;
}

.post-category {
    background: rgba(30, 64, 175, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.8rem;
}

.post-card h2 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.post-excerpt {
    color: var(--gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.read-more:hover {
    color: var(--primary-light);
    transform: translateX(5px);
}

.read-more::after {
    content: '→';
    transition: transform 0.3s ease;
}

.read-more:hover::after {
    transform: translateX(3px);
}

/* Single blog post styles */
.post-hero {
    background: var(--gray-lighter);
    padding: 150px 0 50px;
}

.post-header {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.post-title {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--dark);
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.post-meta-single {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    color: var(--gray);
}

.post-excerpt-single {
    font-size: 1.2rem;
    color: var(--gray);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Blog content */
.post-content {
    padding: 50px 0;
    background: var(--white);
}

.post-article {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--dark);
}

.post-article h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin: 3rem 0 1.5rem;
    font-weight: 700;
}

.post-article h2 {
    font-size: 2rem;
    color: var(--primary);
    margin: 3rem 0 1.5rem;
    font-weight: 700;
}

.post-article h3 {
    font-size: 1.5rem;
    color: var(--dark);
    margin: 2.5rem 0 1rem;
    font-weight: 600;
}

.post-article h4 {
    font-size: 1.25rem;
    color: var(--dark);
    margin: 2rem 0 1rem;
    font-weight: 600;
}

.post-article p {
    margin-bottom: 1.5rem;
}

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

.post-article li {
    margin-bottom: 0.75rem;
}

.post-article blockquote {
    background: var(--gray-lighter);
    border-left: 4px solid var(--secondary);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    font-style: italic;
    font-size: 1.2rem;
    border-radius: 0 8px 8px 0;
}

.post-article code {
    background: var(--gray-lighter);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
}

.post-article pre {
    background: var(--dark);
    color: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
}

.post-article pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.post-article img {
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Back to blog */
.back-to-blog {
    text-align: center;
    padding: 50px 0;
    background: var(--white);
}

.back-to-blog a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.back-to-blog a:hover {
    color: var(--primary-light);
    transform: translateX(-5px);
}

.back-to-blog a::before {
    content: '←';
    transition: transform 0.3s ease;
}

.back-to-blog a:hover::before {
    transform: translateX(-3px);
}

/* Error states */
.error-message {
    text-align: center;
    padding: 4rem 0;
    color: var(--gray);
}

.error-message h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

/* Category filter */
.category-filter {
    text-align: center;
    margin: 2rem 0;
}

.category-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.category-tag {
    background: var(--white);
    color: var(--gray);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid var(--gray-lighter);
    cursor: pointer;
}

.category-tag:hover,
.category-tag.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Admin panel styles */
.admin-panel {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-lighter);
}

.admin-panel h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.admin-form {
    display: grid;
    gap: 1rem;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-lighter);
    border-radius: 8px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
    outline: none;
    border-color: var(--primary);
}

.admin-form textarea {
    min-height: 200px;
    resize: vertical;
}

.admin-form button {
    background: var(--primary);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-form button:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

/* Responsive design */
@media (max-width: 768px) {
    .blog-hero {
        padding: 120px 0 50px;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .post-card-content {
        padding: 1.5rem;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .post-article {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .post-article h2 {
        font-size: 1.75rem;
        margin: 2rem 0 1rem;
    }
    
    .post-article h3 {
        font-size: 1.35rem;
        margin: 1.5rem 0 0.75rem;
    }
    
    .category-tags {
        flex-direction: column;
        align-items: center;
    }
    
    .category-tag {
        width: 100%;
        max-width: 200px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .post-hero {
        padding: 120px 0 30px;
    }
    
    .post-content {
        padding: 30px 0;
    }
    
    .back-to-blog {
        padding: 30px 0;
    }
    
    .post-article blockquote {
        padding: 1rem 1.5rem;
        margin: 1.5rem 0;
        font-size: 1.1rem;
    }
    
    .post-article pre {
        padding: 1rem;
        margin: 1.5rem 0;
        font-size: 0.9rem;
    }
}