/* Blog Styles */

/* ========== Blog Index Cards ========== */

.blog-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

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

.blog-card__link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card__thumb {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

.blog-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card__thumb img {
    transform: scale(1.05);
}

.blog-card__badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.badge-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.badge-item.category {
    background: rgba(72, 127, 255, 0.9);
    color: white;
}

.badge-item i {
    font-size: 14px;
}

.blog-card__content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card__date {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.blog-card__date i {
    font-size: 14px;
}

.blog-card__title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0;
}

.blog-card__description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0;
}

.blog-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.blog-card__author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #487FFF 0%, #6366f1 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.blog-card__reactions {
    display: flex;
    gap: 8px;
}

.reaction-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.reaction-item.inspire {
    color: #10b981;
    background: #dcfce7;
}

.reaction-item.disappoint {
    color: #ef4444;
    background: #fee2e2;
}

.reaction-item i {
    font-size: 14px;
}

.thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-placeholder i {
    font-size: 48px;
}

/* ========== Blog Show Page ========== */

/* Article Section - Ensure minimum height to prevent footer issues */
.blog-article-section {
    min-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

.blog-article-section > .container {
    flex: 1;
}

/* Sidebar Layout */
.blog-sidebar {
    width: 380px;
    flex-shrink: 0;
}

/* Article Header */
.blog-article-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 32px;
}

.blog-article-title {
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
    margin-bottom: 0;
}

/* Article Content - Typography */
.blog-article-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: #374151;
}

.blog-article-content > * {
    margin-top: 0;
    margin-bottom: 1.2em;
}

/* Better spacing around images */
.blog-article-content > p + img,
.blog-article-content > h2 + img,
.blog-article-content > h3 + img,
.blog-article-content > .image-container + img {
    margin-top: 1.5em;
}

.blog-article-content > img + p,
.blog-article-content > img + h2,
.blog-article-content > img + h3 {
    margin-top: 1.5em;
}

/* Ensure images don't overflow container */
.blog-article-content img {
    max-width: 100%;
    height: auto;
}

/* Headings */
.blog-article-content h1,
.blog-article-content h2,
.blog-article-content h3,
.blog-article-content h4,
.blog-article-content h5,
.blog-article-content h6 {
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
    margin-top: 2em;
    margin-bottom: 0.8em;
}

.blog-article-content h1 {
    font-size: clamp(24px, 4vw, 32px);
}

.blog-article-content h2 {
    font-size: clamp(20px, 3.5vw, 28px);
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 12px;
}

.blog-article-content h3 {
    font-size: clamp(18px, 2.5vw, 22px);
}

.blog-article-content h4 {
    font-size: clamp(17px, 2vw, 20px);
}

.blog-article-content h5,
.blog-article-content h6 {
    font-size: 16px;
}

/* Paragraphs */
.blog-article-content p {
    margin-bottom: 1.2em;
}

/* Links */
.blog-article-content a {
    color: #2563eb;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

.blog-article-content a:hover {
    color: #1d4ed8;
    text-decoration-color: #1d4ed8;
}

/* Lists */
.blog-article-content ul,
.blog-article-content ol {
    padding-left: 2em;
    margin-bottom: 1.2em;
}

.blog-article-content li {
    margin-bottom: 0.6em;
}

.blog-article-content ul li {
    list-style-type: disc;
}

.blog-article-content ol li {
    list-style-type: decimal;
}

.blog-article-content li::marker {
    color: #2563eb;
    font-weight: 600;
}

/* Blockquotes */
.blog-article-content blockquote {
    margin: 2em 0;
    padding: 20px 24px;
    border-left: 4px solid #2563eb;
    background: linear-gradient(to right, #eff6ff, transparent);
    font-style: italic;
    color: #4b5563;
}

.blog-article-content blockquote p {
    margin-bottom: 0;
}

/* Code Blocks */
.blog-article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 2em 0;
    font-size: 15px;
    line-height: 1.6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
}

.blog-article-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-family: 'Fira Code', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: inherit;
}

.blog-article-content code {
    background: #f1f5f9;
    color: #dc2626;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.9em;
    display: inline;
}

.blog-article-content pre code {
    display: block;
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Tables */
.blog-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    font-size: 16px;
}

.blog-article-content table th,
.blog-article-content table td {
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.blog-article-content table th {
    background: #f9fafb;
    font-weight: 600;
    color: #111827;
}

.blog-article-content table tr:nth-child(even) {
    background: #f9fafb;
}

/* Horizontal Rule */
.blog-article-content hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 3em 0;
}

/* Content Images - Enhanced Display */
.blog-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2em 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.3s ease;
}

/* Hover effect for better interactivity */
.blog-article-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Different image sizes based on content */
.blog-article-content img[width="100%"],
.blog-article-content img.full-width {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
}

/* Medium sized images */
.blog-article-content img.medium {
    max-width: 80%;
    margin: 2em auto;
}

/* Small images */
.blog-article-content img.small {
    max-width: 50%;
    margin: 1.5em auto;
}

/* Float images to left or right */
.blog-article-content img.float-left {
    float: left;
    width: 45%;
    margin: 1em 1.5em 1em 0;
    shape-outside: margin-box;
}

.blog-article-content img.float-right {
    float: right;
    width: 45%;
    margin: 1em 0 1em 1.5em;
    shape-outside: margin-box;
}

/* Full-width banner images */
.blog-article-content img.banner {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 16px;
    margin: 2em 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Gallery-style images */
.blog-article-content .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin: 2em 0;
}

.blog-article-content .gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0;
}

/* Figure and Figcaption styling */
figure {
    margin: 2em 0;
    text-align: center;
}

figcaption {
    margin-top: 0.75em;
    font-style: italic;
    color: #6b7280;
    font-size: 0.9em;
    text-align: center;
    padding: 8px 0;
}

/* Image containers for better layout */
.image-container {
    position: relative;
    margin: 2em 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.image-container figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: white;
    text-align: left;
    font-size: 0.9em;
}

/* Responsive image handling */
@media (max-width: 768px) {
    .blog-article-content img.float-left,
    .blog-article-content img.float-right {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 1.5em 0;
    }

    .blog-article-content img.medium {
        max-width: 100%;
    }

    .blog-article-content img.small {
        max-width: 100%;
    }

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

/* Strong and Em */
.blog-article-content strong {
    font-weight: 700;
    color: #111827;
}

.blog-article-content em {
    font-style: italic;
    color: #4b5563;
}

/* Feedback Section */
.blog-feedback-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.blog-feedback-btn--inspire:hover {
    border-color: #10b981;
    background: #dcfce7;
}

.blog-feedback-btn--inspire.active {
    border-color: #10b981;
    background: #dcfce7;
}

.blog-feedback-btn--disappoint:hover {
    border-color: #ef4444;
    background: #fee2e2;
}

.blog-feedback-btn--disappoint.active {
    border-color: #ef4444;
    background: #fee2e2;
}

.blog-feedback-count {
    font-size: 18px;
    font-weight: 700;
    margin-left: auto;
}

.blog-feedback-btn--inspire .blog-feedback-count {
    color: #10b981;
}

.blog-feedback-btn--disappoint .blog-feedback-count {
    color: #ef4444;
}

/* Icon states for filled/outline */
.blog-feedback-btn .icon-fill {
    display: none;
}

.blog-feedback-btn .icon-outline {
    display: inline-block;
}

.blog-feedback-btn.active .icon-fill {
    display: inline-block;
}

.blog-feedback-btn.active .icon-outline {
    display: none;
}

/* Related Cards */
.blog-related-card {
    text-decoration: none;
    color: inherit;
    padding: 16px;
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: white;
}

.blog-related-card:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.blog-related-thumb {
    width: 100px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.blog-related-card:hover .blog-related-thumb {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.blog-related-content {
    flex: 1;
}

.blog-related-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    margin-top: 0;
}

.blog-related-date {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 0;
}

/* Article Info List */
.blog-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.blog-info-item:last-child {
    border-bottom: none;
}

.blog-info-item i {
    color: #6366f6;
    font-size: 18px;
}

.info-label {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    margin-right: 4px;
}

.info-value {
    color: #111827;
    font-size: 14px;
    font-weight: 600;
}

/* Featured Image inside Article Info */
.blog-featured-image-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    position: relative;
}

.blog-featured-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.blog-featured-image:hover {
    transform: scale(1.03);
}

/* Zoom button for sidebar image */
.image-zoom-button {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.blog-featured-image-container:hover .image-zoom-button {
    opacity: 1;
}

.image-zoom-button:hover {
    background: white;
    transform: scale(1.1);
}

.image-zoom-button i {
    font-size: 18px;
    color: #4b5563;
}

/* Share Article Styles */
.blog-share-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
    text-align: center;
}

.blog-share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.blog-share-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.blog-share-btn i {
    font-size: 20px;
}

.blog-share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.blog-share-btn.facebook {
    background: #1877f2;
}

.blog-share-btn.facebook:hover {
    background: #166fe5;
}

.blog-share-btn.twitter {
    background: #000000;
}

.blog-share-btn.twitter:hover {
    background: #333333;
}

.blog-share-btn.linkedin {
    background: #0a66c2;
}

.blog-share-btn.linkedin:hover {
    background: #004182;
}

.blog-share-btn.whatsapp {
    background: #25d366;
}

.blog-share-btn.whatsapp:hover {
    background: #128c7e;
}

.blog-url-copy-section {
    margin-top: 16px;
}

.blog-url-copy-wrapper {
    display: flex;
    gap: 8px;
}

.blog-url-copy-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    font-size: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #4b5563;
}

.blog-url-copy-btn {
    flex-shrink: 0;
    padding: 10px 14px;
    background: #487FFF;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.blog-url-copy-btn:hover {
    background: #3b6de0;
}

.blog-url-copy-btn.copied {
    background: #10b981;
}

/* Responsive */
@media (max-width: 1024px) {
    /* Stack main content and sidebar vertically */
    .blog-article-section .d-flex.gap-24 {
        flex-direction: column;
    }

    /* Main content takes full width and comes first */
    .blog-article-section main {
        width: 100%;
        order: 1;
    }

    /* Sidebar comes after main content */
    .blog-sidebar {
        width: 100%;
        order: 2;
        margin-top: 24px;
    }

    .blog-article-content {
        font-size: 16px;
    }

    .blog-article-content h1 {
        font-size: 28px;
    }

    .blog-article-content h2 {
        font-size: 22px;
    }

    .blog-article-content h3 {
        font-size: 19px;
    }

    .blog-article-content pre {
        font-size: 13px;
        padding: 16px;
    }

    /* Tablet sidebar related cards */
    .blog-related-thumb {
        width: 90px;
        height: 70px;
    }
}

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

    /* Ensure sidebar stays full width on mobile */
    .blog-sidebar {
        width: 100%;
        max-width: 100%;
    }

    /* Responsive sidebar related cards */
    .blog-related-thumb {
        width: 80px;
        height: 60px;
    }
}

/* ========== Blog Language Segmented Control ========== */
.blog-language-segmented-control {
    position: absolute;
    top: 20px;
    right: 20px;
    display: inline-flex;
    background: #f3f4f6;
    border-radius: 20px;
    padding: 4px;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.blog-segment-btn {
    position: relative;
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.blog-segment-btn .segment-label {
    position: relative;
    z-index: 1;
}

.blog-segment-btn:hover {
    color: #6b7280;
}

.blog-segment-btn.active {
    background: #ffffff;
    color: #1f2937;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.blog-segment-btn:focus {
    outline: 2px solid #487FFF;
    outline-offset: 2px;
    border-radius: 16px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .blog-language-segmented-control {
        top: 16px;
        right: 16px;
    }

    .blog-segment-btn {
        padding: 8px 16px;
        font-size: 12px;
        min-width: 45px;
    }
}

/* RTL support */
[dir="rtl"] .blog-language-segmented-control {
    right: auto;
    left: 20px;
}

@media (max-width: 768px) {
    [dir="rtl"] .blog-language-segmented-control {
        left: 16px;
        right: auto;
    }
}

/* Fade transition for content updates */
#blog-title,
#blog-content {
    transition: opacity 0.2s ease-in-out;
}

/* ==================== DARK MODE ==================== */
html.dark-mode .blog-article-content {
    color: #d1d5db !important;
}

html.dark-mode .blog-article-content h1,
html.dark-mode .blog-article-content h2,
html.dark-mode .blog-article-content h3,
html.dark-mode .blog-article-content h4,
html.dark-mode .blog-article-content h5,
html.dark-mode .blog-article-content h6 {
    color: #f5f5f5 !important;
}

html.dark-mode .blog-article-content h2 {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

html.dark-mode .blog-article-content strong {
    color: #f5f5f5 !important;
}

html.dark-mode .blog-article-content em {
    color: #a0a0a0 !important;
}

html.dark-mode .blog-article-content blockquote {
    background: rgba(59, 130, 246, 0.05) !important;
    border-left-color: #3b82f6 !important;
    color: #a0a0a0 !important;
}

html.dark-mode .blog-article-content a {
    color: #60a5fa !important;
}

html.dark-mode .blog-article-content a:hover {
    color: #93c5fd !important;
}

html.dark-mode .blog-article-content code {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f87171 !important;
}

html.dark-mode .blog-article-content table th {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #f5f5f5 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html.dark-mode .blog-article-content table td {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html.dark-mode .blog-article-content table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03) !important;
}

html.dark-mode .blog-article-content hr {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

html.dark-mode .blog-article-content li::marker {
    color: #60a5fa !important;
}

html.dark-mode .blog-article-title {
    color: #f5f5f5 !important;
}

