/* blog.css
   Styles for blog listing (cards) and loading/empty states
---------------------------------------------------------- */

/* Optional: keep ONLY if you don't already style body globally */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f9f9f9;
    color: #333;
    margin: 0;
    padding: 0;
}

/* ============= Blog list section ============= */

.blog-list-section {
    padding: 40px 0 60px;
    background: #f9fafb;
}

.blog-list-section .container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 16px;
}

.blog-list-header {
    text-align: center;
    margin-bottom: 30px;
}

.blog-list-title {
    font-size: 26px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.blog-list-subtitle {
    font-size: 14px;
    color: #6b7280;
    max-width: 540px;
    margin: 0 auto;
}

/* ============= Grid layout ============= */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    align-items: stretch;
}

/* ============= Blog card ============= */

.blog-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* Image area */

.blog-card-image-wrapper {
    position: relative;
    padding-top: 56.25%; /* 16:9 ratio */
    overflow: hidden;
    background: #e5edf4;
}

.blog-card-image-wrapper.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
    height: 180px;
}

.blog-card-image-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: #d1e3f1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-card-image-placeholder i {
    font-size: 24px;
    color: #1284b9;
}

.blog-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Card body */

.blog-card-body {
    padding: 16px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
}

/* Meta */

.blog-card-meta {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 10px;
}

.blog-card-date i {
    margin-right: 4px;
    color: #9ca3af;
}

/* Title & excerpt */

.blog-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.blog-card-excerpt {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
    margin: 0;
    margin-top: 4px;
    max-height: 4.4em;        /* ~3 lines */
    overflow: hidden;
}

/* Read more */

.blog-card-read-more {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #1284b9;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.blog-card-read-more i {
    font-size: 11px;
}

/* Hover effects */

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

.blog-card:hover .blog-card-image {
    transform: scale(1.05);
}

.blog-card:hover .blog-card-read-more {
    color: #0f6a96;
}

/* ============= Empty / loading states ============= */

.blog-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 14px;
}

.blog-empty-state i {
    font-size: 32px;
    margin-bottom: 12px;
    color: #1284b9;
    display: block;
}

.blog-empty-state.error i {
    color: #e11d48;
}

/* Simple spinner */

.blog-loading-spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #d1e3f1;
    border-top-color: #1284b9;
    margin: 0 auto 12px;
    animation: blog-spinner 0.7s linear infinite;
}

@keyframes blog-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ============= Responsive tweaks ============= */

@media (max-width: 768px) {
    .blog-list-section {
        padding: 24px 0 40px;
    }
}

@media (max-width: 640px) {
    .blog-card-title {
        font-size: 16px;
    }

    .blog-card-body {
        padding: 14px 14px 16px;
    }
}

/* ============================
   Blog detail page styles
   ============================ */

.blog-article-section {
    padding: 32px 0 64px;
    background: #f9fafb;
}

.blog-article-wrapper {
    max-width: 860px;
    margin: 0 auto;
}

/* Loading & error */

.blog-article-loading,
.blog-article-error {
    text-align: center;
    padding: 40px 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.blog-article-error h2 {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.blog-article-error p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
}

.blog-article-error i {
    font-size: 32px;
    color: #e11d48;
    margin-bottom: 10px;
    display: block;
}

/* Article layout */

.blog-article {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
}

.blog-article-hero {
    position: relative;
    overflow: hidden;
    max-height: 360px;
}

.blog-article-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-article-header {
    padding: 20px 22px 10px;
}

.blog-article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

.blog-article-date i {
    margin-right: 5px;
    color: #9ca3af;
}

.blog-article-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

/* Content from TinyMCE */

.blog-article-content {
    padding: 8px 22px 22px;
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
}

/* Make TinyMCE content look nice */

.blog-article-content h2,
.blog-article-content h3,
.blog-article-content h4 {
    margin-top: 18px;
    margin-bottom: 8px;
    color: #111827;
    font-weight: 600;
}

.blog-article-content h2 {
    font-size: 20px;
}
.blog-article-content h3 {
    font-size: 18px;
}
.blog-article-content h4 {
    font-size: 16px;
}

.blog-article-content p {
    margin: 10px 0;
}

.blog-article-content ul,
.blog-article-content ol {
    padding-left: 20px;
    margin: 8px 0 12px;
}

.blog-article-content li {
    margin-bottom: 4px;
}

.blog-article-content a {
    color: #1284b9;
    text-decoration: underline;
}

.blog-article-content a:hover {
    color: #0f6a96;
}

/* Source */

.blog-article-source {
    padding: 0 22px 10px;
    font-size: 13px;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
}

.blog-article-source span:first-child {
    font-weight: 600;
}

.blog-article-source a {
    color: #1284b9;
    text-decoration: underline;
}

/* Footer / back button */

.blog-article-footer {
    padding: 14px 22px 18px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-back-blog {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f3f4f6;
    color: #111827;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn-back-blog i {
    font-size: 12px;
}

.btn-back-blog:hover {
    background: #1284b9;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Responsive adjustments */

@media (max-width: 768px) {
    .blog-article-header,
    .blog-article-content,
    .blog-article-source,
    .blog-article-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .blog-article-title {
        font-size: 20px;
    }

    .blog-article-hero {
        max-height: 260px;
    }
}




