.text-align-center {
    text-align: center;
    display: block;
}

.center-image {
    margin: 20px 20px 20px 20px;
    display: block;
}

.align-right {
    float: right;
    text-align: right;
    display: block;
}

/* Mermaid Diagram Styles */
.mermaid-wrapper {
    position: relative;
    text-align: center;
    margin: 20px 0;
    transition: opacity 0.2s ease;
}

.mermaid-wrapper:hover {
    opacity: 0.9;
}

.mermaid-wrapper::after {
    content: 'Click to view fullscreen';
    display: block;
    font-size: 0.8em;
    color: #999;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-style: italic;
}

.mermaid-wrapper:hover::after {
    opacity: 0.7;
}

.mermaid {
    text-align: center;
    margin: 0 -150px;
    width: calc(100% + 300px);
    margin-top: 30px;
    margin-bottom: 30px;
}

@media screen and (max-width: 800px) {
    .mermaid {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }
}

.mermaid svg {
    max-width: 100%;
    height: auto;
}

/* Ensure clicks on the wrapper are captured */
.mermaid-wrapper .mermaid svg {
    cursor: pointer;
}

/* Mermaid Fullscreen Modal */
.mermaid-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: #ffffff !important;
    z-index: 10000 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

.mermaid-modal-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mermaid-modal-control {
    background: #1c314d;
    border: 2px solid #0f1e2e;
    font-size: 16px;
    color: #ffffff;
    cursor: pointer;
    line-height: 1;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    min-width: 44px;
    min-height: 44px;
}

.mermaid-modal-control:hover,
.mermaid-modal-control:focus {
    color: #ffffff;
    background-color: #0f1e2e;
    border-color: #07111a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    outline: none;
}

.mermaid-modal-close-btn {
    margin-left: 8px;
}

.mermaid-modal-viewport {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    touch-action: none;
    background-color: #ffffff;
}

.mermaid-fullscreen {
    position: absolute;
    top: 0;
    left: 0;
    display: inline-block;
    width: auto;
    height: auto;
    margin: 0;
    text-align: left;
    transform-origin: 0 0;
}

.mermaid-fullscreen svg {
    display: block;
    max-width: none;
}

/* Post Layout Styles */
.post-meta {
    margin-bottom: 20px;
    font-size: 0.9em;
    color: #666;
}

.post-meta-primary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.reading-time {
    background-color: #f8f9fa;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    color: #1c314d;
    font-weight: 500;
}

.post-taxonomy {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.post-categories,
.post-tags {
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.taxonomy-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.85em;
    margin-right: 5px;
}

.category-tag,
.tag {
    background-color: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-tag {
    background-color: #d1ecf1;
    color: #0c5460;
}

.tag {
    background-color: #f8d7da;
    color: #721c24;
}

.category-tag:hover,
.tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Articles Page Styles - Card Layout */
.post-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e1e5e9;
    margin-bottom: 20px;
    overflow: hidden;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.post-card-content {
    padding: 20px;
}

.post-card .post-meta {
    font-size: 14px;
    color: #828282;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-card .post-link {
    display: block;
    font-size: 24px;
    color: #1c314d;
    text-decoration: none;
    margin-bottom: 10px;
    line-height: 1.3;
}

.post-card .post-link:hover {
    color: #0f1e2e;
}

.post-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.post-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.post-tag {
    background-color: #f1f3f4;
    color: #5f6368;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.post-tag:hover {
    background-color: #e8f0fe;
    color: #1a73e8;
}

.no-articles {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* Landing Page Styles */
.hero-section {
    text-align: center;
    padding: 60px 0;
    background: linear-gradient(135deg, #1c314d 0%, #2a4a6b 100%);
    margin: -30px -30px 60px -30px;
    padding: 80px 30px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #34495e;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero-description {
    font-size: 1.1rem;
    color: #5a6c7d;
    max-width: 800px;
    margin: 0 auto 2.5rem auto;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: #1c314d;
    color: white;
    border-color: #1c314d;
}

.btn-primary:hover {
    background-color: #0f1e2e;
    border-color: #0f1e2e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(28, 49, 77, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: #1c314d;
    border-color: #1c314d;
}

.btn-secondary:hover {
    background-color: #1c314d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(28, 49, 77, 0.2);
}

.featured-content {
    margin: 60px 0;
}

.featured-content h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 2rem;
}

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

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e1e5e9;
    transition: all 0.3s ease;
    text-align: center;
}

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

.service-card h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

.service-card p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.latest-articles {
    text-align: center;
    margin: 60px 0;
    padding: 40px;
    background-color: #f8f9fa;
    border-radius: 12px;
}

.latest-articles h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.latest-articles p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.view-all-link {
    display: inline-block;
    color: #1c314d;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.view-all-link:hover {
    color: #0f1e2e;
    transform: translateX(4px);
}

/* Responsive design */
@media (max-width: 768px) {
    .post-meta-primary {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .post-categories,
    .post-tags {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .taxonomy-label {
        margin-bottom: 5px;
    }
    
    .post-card-content {
        padding: 15px;
    }
    
    .post-card .post-link {
        font-size: 20px;
    }
    
    .post-tags {
        margin-top: 8px;
    }
    
    .mermaid-modal-toolbar {
        padding: 8px 10px;
        gap: 6px;
    }

    .mermaid-modal-control {
        font-size: 14px;
        padding: 8px 12px;
        min-width: 40px;
        min-height: 40px;
    }

    .mermaid-modal-close-btn {
        margin-left: 0;
        flex-basis: 100%;
        max-width: 200px;
    }

    .mermaid-modal-viewport {
        top: 108px;
    }
}

@media (max-width: 480px) {
    .post-card .post-link {
        font-size: 18px;
    }
    
    .post-card-content {
        padding: 12px;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
        text-align: center;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .featured-content h2,
    .latest-articles h2 {
        font-size: 2rem;
    }
}
