/* =====================================================
   Blog Styles - Public Blog Pages
   ===================================================== */

/* Blog Header */
.blog-header {
    background: linear-gradient(135deg, #2563eb 0%, #10b981 100%);
    color: white;
    padding: 4rem 0 3rem;
    margin-top: 80px;
    text-align: center;
}

.blog-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.blog-header p {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* Blog Section */
.blog-section {
    padding: 3rem 0;
    min-height: 60vh;
}

/* Blog Controls */
.blog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.blog-filters {
    flex: 1;
    min-width: 300px;
}

.filter-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-form .search-input {
    flex: 2;
    min-width: 200px;
}

.filter-form .category-select {
    flex: 1;
    min-width: 150px;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
}

/* Blog Posts Container */
.blog-posts {
    display: grid;
    gap: 2rem;
}

/* List View */
.blog-view-list .blog-posts {
    grid-template-columns: 1fr;
}

.blog-view-list .blog-post-card {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.blog-view-list .blog-post-image {
    width: 300px;
    flex-shrink: 0;
}

/* Grid View */
.blog-view-grid .blog-posts {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.blog-view-grid .blog-post-card {
    flex-direction: column;
}

.blog-view-grid .blog-post-image {
    width: 100%;
}

/* Blog Post Card */
.blog-post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.blog-post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f1f5f9;
}

.blog-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-post-card:hover .blog-post-image img {
    transform: scale(1.05);
}

.blog-post-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.blog-post-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: #64748b;
    align-items: center;
}

.blog-post-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.blog-post-meta .meta-item i {
    flex-shrink: 0;
}

.blog-post-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s ease;
}

.blog-category:hover {
    background: #c7d2fe;
}

.blog-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-views {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-post-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.blog-post-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-post-title a:hover {
    color: #2563eb;
}

.blog-post-excerpt {
    color: #64748b;
    line-height: 1.7;
    margin: 0;
}

.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.blog-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f1f5f9;
    color: #475569;
    border-radius: 20px;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease;
}

.blog-tag:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.blog-post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.blog-post-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
}

/* Blog Post Detail Page */
.blog-post-page {
    padding: 2rem 0 4rem;
    margin-top: 80px;
}

.blog-breadcrumb {
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: #64748b;
}

.blog-breadcrumb a {
    color: #2563eb;
    text-decoration: none;
}

.blog-breadcrumb a:hover {
    text-decoration: underline;
}

.blog-breadcrumb span {
    color: #1e293b;
    font-weight: 600;
}

.blog-post-header {
    margin-bottom: 2rem;
}

.blog-post-category {
    display: inline-block;
    margin-bottom: 1rem;
}

.blog-post-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #1e293b;
}

.blog-post-page .blog-post-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 1rem 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
}

.blog-post-page .blog-post-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-post-featured-image {
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.blog-post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.blog-post-featured-video {
    margin: 2rem 0;
}

.video-player-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.video-player-container .video-iframe,
.video-player-container .video-html5 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-caption {
    margin-top: 1rem;
    text-align: center;
    color: #64748b;
    font-style: italic;
}

.blog-post-content {
    margin: 2rem 0;
    line-height: 1.8;
    color: #334155;
    font-size: 1.125rem;
}

.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #1e293b;
}

.blog-post-content p {
    margin-bottom: 1.5rem;
}

.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.blog-post-content ul,
.blog-post-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.blog-post-content li {
    margin-bottom: 0.5rem;
}

.blog-post-content code {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.blog-post-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.blog-post-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.blog-post-content blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #64748b;
    font-style: italic;
}

.blog-post-content a {
    color: #2563eb;
    text-decoration: underline;
}

.blog-post-content a:hover {
    color: #1d4ed8;
}

/* Additional Videos */
.blog-post-videos {
    margin: 3rem 0;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 12px;
}

.blog-post-videos h3 {
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.video-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.video-item .video-player-container {
    margin: 0;
}

.video-item h4 {
    padding: 1rem 1rem 0.5rem;
    margin: 0;
    color: #1e293b;
}

.video-item p {
    padding: 0 1rem 1rem;
    margin: 0;
    color: #64748b;
    font-size: 0.875rem;
}

/* Social Sharing */
.blog-post-sharing {
    margin: 3rem 0;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 12px;
    text-align: center;
}

.blog-post-sharing h3 {
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.social-share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
}

.social-share-btn.facebook {
    background: #1877f2;
}

.social-share-btn.facebook:hover {
    background: #166fe5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.social-share-btn.twitter {
    background: #000000;
}

.social-share-btn.twitter:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.social-share-btn.linkedin {
    background: #0077b5;
}

.social-share-btn.linkedin:hover {
    background: #006ba1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3);
}

.social-share-btn.whatsapp {
    background: #25d366;
}

.social-share-btn.whatsapp:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.social-share-btn.copy {
    background: #64748b;
}

.social-share-btn.copy:hover {
    background: #475569;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

/* Related Posts */
.blog-related-posts {
    margin: 3rem 0;
}

.blog-related-posts h3 {
    margin-bottom: 2rem;
    color: #1e293b;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.related-post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.related-post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f1f5f9;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-card:hover .related-post-image img {
    transform: scale(1.05);
}

.related-post-content {
    padding: 1.5rem;
}

.related-post-content h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
}

.related-post-content h4 a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-post-content h4 a:hover {
    color: #2563eb;
}

.related-post-excerpt {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0 0 1rem 0;
}

.related-post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Blog Empty State */
.blog-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
}

.blog-empty i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

.blog-empty h2 {
    margin: 1rem 0 0.5rem;
    color: #475569;
}

/* Blog Pagination */
.blog-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    color: #64748b;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .blog-header h1 {
        font-size: 2rem;
    }
    
    .blog-header p {
        font-size: 1rem;
    }
    
    .blog-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-form {
        flex-direction: column;
    }
    
    .filter-form .search-input,
    .filter-form .category-select {
        width: 100%;
    }
    
    .blog-view-list .blog-post-card {
        flex-direction: column;
    }
    
    .blog-view-list .blog-post-image {
        width: 100%;
        height: 200px;
    }
    
    .blog-view-grid .blog-posts {
        grid-template-columns: 1fr;
    }
    
    .blog-post-title {
        font-size: 1.75rem;
    }
    
    .blog-post-content {
        font-size: 1rem;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .social-share-buttons {
        flex-direction: column;
    }
    
    .social-share-btn {
        width: 100%;
        justify-content: center;
    }
    
    .blog-pagination {
        flex-direction: column;
        text-align: center;
    }
}

/* Video Player Responsive */
.video-player-container {
    max-width: 100%;
}

@media (max-width: 768px) {
    .video-player-container {
        padding-bottom: 56.25%; /* Maintain 16:9 aspect ratio */
    }
}

/* Loading State */
.video-player-container:not(.video-player-loaded) {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e293b;
    color: white;
}

.video-player-container:not(.video-player-loaded)::before {
    content: 'Loading video...';
    font-size: 1rem;
}
