/* ================================
   Blog Index Styles
   ================================ */

.blog-header {
    background: #007AFF;
    color: white;
    text-align: center;
    padding: 6rem 1rem 3rem;
    margin-bottom: 3rem;
    margin-top: 60px;
}

.blog-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.blog-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.blog-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.blog-search {
    margin-bottom: 3rem;
    text-align: center;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.blog-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

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

.blog-card-content {
    padding: 1.5rem;
}

.blog-card-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
}

.blog-card-title a:hover {
    color: #667eea;
}

.blog-card-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.blog-card-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.read-more-btn {
    background: #007AFF;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    transition: background 0.3s ease;
}

.read-more-btn:hover {
    background: #0056b3;
}

.blog-tag {
    background: #f0f8ff;
    color: #007AFF;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 3rem 0;
}

.pagination button {
    padding: 0.75rem 1.5rem;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background: #007AFF;
    color: white;
    border-color: #007AFF;
}

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

.pagination .current {
    background: #007AFF;
    color: white;
    border-color: #007AFF;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-results svg {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    color: #ddd;
}

/* ================================
   Blog Post Styles
   ================================ */

.post-header {
    background: #007AFF;
    color: white;
    padding: 5rem 1rem 2rem;
    margin-top: 60px;
}

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

.post-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.post-meta {
    opacity: 0.9;
    font-size: 1rem;
}

.post-meta span {
    margin: 0 1rem;
}

.post-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.post-cover {
    margin: 2rem 0;
    text-align: center;
}

.post-cover img {
    width: 100%;
    max-width: 1100px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.post-cover figcaption {
    color: #666;
    font-size: 0.9rem;
    margin-top: 1rem;
    font-style: italic;
}

.post-content {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
    line-height: 1.7;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    color: #333;
    margin: 2rem 0 1rem;
    line-height: 1.3;
}

.post-content h1 {
    font-size: 2rem;
    border-bottom: 2px solid #007AFF;
    padding-bottom: 0.5rem;
}

.post-content h2 {
    font-size: 1.5rem;
    color: #007AFF;
}

.post-content h3 {
    font-size: 1.25rem;
}

.post-content p {
    margin: 1.5rem 0;
    color: #444;
}

.post-content a {
    color: #007AFF;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.post-content a:hover {
    border-bottom-color: #007AFF;
}

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

.post-content li {
    margin: 0.5rem 0;
    color: #444;
}

.post-content blockquote {
    background: #f8faff;
    border-left: 4px solid #007AFF;
    margin: 2rem 0;
    padding: 1.5rem;
    font-style: italic;
    color: #555;
}

.post-content pre {
    background: #f4f4f4;
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 2rem 0;
}

.post-content code {
    background: #f4f4f4;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content .callout {
    background: #f8faff;
    border: 1px solid #e1e7ff;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.post-content .callout-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.post-content .callout-content {
    flex: 1;
}

.post-content .blog-image {
    text-align: center;
    margin: 2rem 0;
}

.post-content .blog-image img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.post-content .blog-image figcaption {
    color: #666;
    font-size: 0.9rem;
    margin-top: 1rem;
    font-style: italic;
}

.post-content hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 3rem 0;
}

.post-content .blog-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.post-content .blog-table th,
.post-content .blog-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.post-content .blog-table th {
    background: #f8faff;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #007AFF;
}

.post-content .blog-table tbody tr:hover {
    background: #f8faff;
}

.post-content .blog-table tbody tr:last-child td {
    border-bottom: none;
}

.table-of-contents {
    background: #f8faff;
    border: 1px solid #e1e7ff;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.table-of-contents h3 {
    margin: 0 0 1rem;
    color: #007AFF;
    font-size: 1.1rem;
}

.table-of-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.table-of-contents li {
    margin: 0.5rem 0;
}

.table-of-contents a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
    border-bottom: none;
}

.table-of-contents a:hover {
    color: #007AFF;
}

.table-of-contents .toc-level-2 {
    padding-left: 1rem;
}

.table-of-contents .toc-level-3 {
    padding-left: 2rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
    padding: 2rem 0;
    border-top: 1px solid #eee;
}

.post-tag {
    background: #f0f8ff;
    color: #007AFF;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}

.post-tag:hover {
    background: #007AFF;
    color: white;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin: 3rem 0;
}

.nav-link {
    flex: 1;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: #333;
    transition: transform 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
}

.nav-link-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.nav-link-title {
    font-weight: bold;
    color: #333;
}

.quiz-promotion {
    background: #007AFF;
    border-radius: 12px;
    padding: 3rem 2rem;
    margin: 3rem 0;
    text-align: center;
    color: white;
}

.quiz-promo-content h3 {
    font-size: 1.75rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: white;
}

.quiz-promo-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.quiz-promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: white;
    color: #007AFF;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quiz-promo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    color: #0056b3;
}

.back-to-blog {
    text-align: center;
    margin: 2rem 0;
}

.back-to-blog a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: #007AFF;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.back-to-blog a:hover {
    background: #0056b3;
}

/* ================================
   Shared Loading / Error States
   ================================ */

.loading {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.loading svg {
    width: 2rem;
    height: 2rem;
    margin-bottom: 1rem;
}

.error {
    text-align: center;
    padding: 5rem 2rem;
    color: #666;
}

.error svg {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    color: #ddd;
}

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

@media (max-width: 768px) {
    .blog-title {
        font-size: 2rem;
    }

    .blog-header {
        padding: 5rem 1rem 3rem;
    }

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

    .pagination {
        flex-wrap: wrap;
    }

    .post-title {
        font-size: 2rem;
    }

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

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

    .post-meta span {
        margin: 0 0.5rem;
    }

    .quiz-promotion {
        padding: 2rem 1.5rem;
        margin: 2rem 0;
    }

    .quiz-promo-content h3 {
        font-size: 1.5rem;
    }

    .quiz-promo-content p {
        font-size: 1rem;
    }

    .quiz-promo-btn {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}
