/* Alxarafe Content Styles (Markdown Components) */
:root {
    --alx-content-primary: #2563eb;
    --alx-content-secondary: #2c3e50;
    --alx-content-border: #e2e8f0;
    --alx-content-bg-light: #f8fafc;
    --alx-content-info: #0d6efd;
    --alx-content-info-bg: #f0f7ff;
}

/* Typography refinements for readability */
.post-content h1, .post-content h2, .post-content h3,
.markdown-showcase h1, .markdown-showcase h2, .markdown-showcase h3 {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
    color: var(--alx-content-secondary);
}

.markdown-showcase h1 {
    font-size: 3rem;
    text-align: center;
}

.markdown-showcase h3 {
    font-weight: 400;
    color: #4a5568;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
    text-align: center;
}

/* Helpers & Utilities */
.text-center { text-align: center !important; }
.text-muted { color: #6c757d !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 2rem !important; }
.mt-5 { margin-top: 4rem !important; }
.mb-5 { margin-bottom: 4rem !important; }
.my-5 { margin-top: 4rem !important; margin-bottom: 4rem !important; }

/* Markdown Showcase Layout */
.markdown-showcase {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Callout Blocks */
.callout {
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0.75rem;
    border-left: 4px solid var(--alx-content-border);
    background-color: var(--alx-content-bg-light);
    font-size: 1rem;
    line-height: 1.6;
}

.callout p:last-child {
    margin-bottom: 0;
}

.callout-info {
    border-left-color: var(--alx-content-info) !important;
    background-color: var(--alx-content-info-bg) !important;
}

.callout-warn {
    border-left-color: #f59e0b !important;
    background-color: #fffbeb !important;
}

.callout-note {
    border-left-color: #10b981 !important;
    background-color: #f0fdf4 !important;
}

.callout-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--alx-content-secondary);
}

.callout-info .callout-title { color: var(--alx-content-info); }
.callout-warn .callout-title { color: #854d0e; }
.callout-note .callout-title { color: #065f46; }

.callout p {
    color: #2c5282;
}

/* Feature Grid & Cards */
.feature-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 3rem -1rem 4rem !important; /* Force bottom margin */
}

/* If no column classes are present, behave like a standard grid */
.feature-grid:not(:has(.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12)) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 4rem !important; /* Force bottom spacing */
}

.feature-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    margin: 1rem; /* Use margin for spacing when in flex mode */
    flex: 1 1 300px;
}

.feature-grid:not(:has(.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12)) .feature-card {
    margin: 0; /* No margin when in grid mode (uses gap) */
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.feature-icon,
.icon-wrapper {
    width: 4rem;
    height: 4rem;
    background: transparent;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.feature-content h2,
.feature-title {
    font-weight: 800;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #000;
}

.feature-content p,
.feature-description {
    color: #444;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    flex-grow: 1;
}

/* Feature Card Links as Buttons */
.feature-content a,
.feature-card > .btn-outline-alx {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border: 1.5px solid var(--alx-content-primary);
    color: var(--alx-content-primary);
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: auto;
    align-self: center;
}

.feature-content a:hover,
.feature-card > .btn-outline-alx:hover {
    background-color: #eff6ff;
    color: #1e40af;
}

/* Generic Image styling */
.markdown-showcase img,
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 3rem auto !important; /* Force margins */
    display: block;
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.2);
}

/* Adjust image inside columns to stay within them */
.feature-item img {
    max-height: 500px;
    object-fit: contain;
}

/* Code Syntax */
.post-content code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    color: #e11d48;
}

.post-content pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 2rem 0;
}

/* Content Body — Unified styles for pages and blog posts */
.content-body h1 {
    font-size: calc(1.475rem + 2.7vw);
    font-weight: 800;
    color: var(--bs-secondary);
    margin-bottom: 1.5rem;
}

.content-body h2 {
    font-weight: 700;
    color: var(--alx-secondary, var(--bs-secondary));
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
}

.content-body p {
    color: #4b5563;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.content-body ul,
.content-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: #4b5563;
}

.content-body li {
    margin-bottom: 0.5rem;
}

.content-body blockquote {
    border-left: 4px solid var(--alx-primary, var(--alx-content-primary));
    padding-left: 1.5rem;
    font-style: italic;
    color: #6b7280;
    margin: 2rem 0;
}

.content-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 3rem auto !important;
    display: block;
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.2);
}

.content-body code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    color: #e11d48;
}

.content-body pre {
    background: #0d1117;
    color: #f8fafc;
    padding: 2.5rem 1.5rem 1.5rem;
    border-radius: 1rem;
    overflow-x: auto;
    margin: 2.5rem 0;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.content-body pre::before {
    content: '';
    position: absolute;
    top: 0.8rem;
    left: 1rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5f56;
    box-shadow: 20px 0 0 #ffbd2e, 40px 0 0 #27c93f;
}

.content-body pre code {
    background: transparent !important;
    padding: 0 !important;
    color: inherit !important;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Blog post listing */
.post-excerpt {
    font-size: 1.1rem;
    line-height: 1.8;
}

.blog-post .btn-outline-alx {
    margin-top: 0.5rem;
}