/* --- Single Post Layout Container --- */

.mi-single-post-wrapper {
    background-color: #ffffff; /* bg-stone-50 */
    min-height: 100vh;
    padding-bottom: 3rem;
}

/* --- Hero Image/Back Button --- */

.mi-hero-image-wrap {
    position: relative;
    height: 400px; /* h-96 */
    background-color: #44403c; /* bg-stone-900 fallback */
    overflow: hidden;
}

.mi-hero-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.mi-hero-image-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    /* bg-gradient-to-t from-black/80 via-black/40 to-transparent */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0) 100%);
}

.mi-back-to-blog-btn {
    position: absolute;
    top: 2rem; /* top-8 */
    left: 1rem; /* left-4, adjust for mi-container padding */
    display: flex;
    align-items: center;
    gap: 0.5rem; /* gap-2 */
    padding: 0.5rem 1rem; /* px-4 py-2 */
    background-color: rgba(255, 255, 255, 0.9); /* bg-white/90 */
    border-radius: 0.5rem; /* rounded-lg */
    z-index: 10;
    transition: background-color 0.2s;
    font-weight: 500;
    font-size: 0.95rem;
    color: #44403c; /* text-stone-900 */
    text-decoration: none;
}

.mi-back-to-blog-btn:hover {
    background-color: #fff;
}

.mi-back-to-blog-btn svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* Responsive adjustment for back button */
@media (min-width: 768px) {
    .mi-back-to-blog-btn {
        left: 10rem; /* approximate left padding for large screen container */
    }
}


/* --- Main Content Layout --- */

.mi-single-content-container {
    max-width: 64rem; /* max-w-4xl */
    margin-left: auto;
    margin-right: auto;
}

.mi-category-badge-wrap {
    margin-bottom: 3.5rem; /* mb-6 */
    margin-top: -5rem; /* Pull up over the hero image area */
    position: relative;
    z-index: 5;
}

.mi-category-badge-pill {
    display: inline-block;
    padding: 0.5rem 1rem; /* px-4 py-2 */
    background-color: #d97706; /* bg-amber-600 */
    color: #fff;
    border-radius: 9999px; /* rounded-full */
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

.mi-category-badge-pill.mi-category-link:hover {
    background-color: #b45309; /* hover:bg-amber-700 */
}

.mi-single-title {
    color: #44403c; /* text-stone-900 */
    margin-bottom: 2.5rem; /* mb-6 */
    font-size: 1.8rem; /* Adjust as needed for H1 */
    line-height: 1.5;
}


/* --- Meta Information --- */

.mi-meta-info-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem; /* gap-6 */
    margin-bottom: 2rem; /* mb-8 */
    padding-bottom: 2rem; /* pb-8 */
    border-bottom: 1px solid #e7e5e4; /* border-b border-stone-200 */
}

.mi-author-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* gap-3 */
}

.mi-author-avatar-placeholder {
    width: 3rem; /* w-12 */
    height: 3rem; /* h-12 */
    background-color: #fef3c7; /* bg-amber-100 */
    border-radius: 9999px; /* rounded-full */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mi-author-avatar-placeholder svg {
    /* Styles for the User icon inside the placeholder */
    width: 1.5rem; /* w-6 */
    height: 1.5rem; /* h-6 */
    color: #b45309; /* text-amber-700 */
}

.mi-author-name {
    color: #44403c; /* text-stone-900 */
    font-weight: 600;
    margin: 0;
}

.mi-author-name a {
    color: inherit;
    text-decoration: none;
}

.mi-meta-label {
    font-size: 0.875rem; /* text-sm */
    color: #78716c; /* text-stone-500 */
    margin: 0;
}

.mi-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* gap-2 */
    color: #57534e; /* text-stone-600 */
    font-size: 0.9375rem;
}

.mi-meta-item svg {
    flex-shrink: 0;
}


/* --- Share Bar --- */

.mi-share-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem; /* gap-4 */
    margin-bottom: 2rem; /* mb-8 */
}

.mi-share-label {
    color: #57534e; /* text-stone-600 */
    font-weight: 500;
}

.mi-share-btn {
    padding: 0.5rem; /* p-2 */
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 0.5rem; /* rounded-lg */
    transition: background-color 0.2s;
    color: #57534e; /* text-stone-600 */
}

.mi-share-btn:hover {
    background-color: #f5f5f4; /* hover:bg-stone-100 */
}

.mi-share-btn svg {
    /* Ensure icon size is consistent */
    width: 20px;
    height: 20px;
}

.mi-share-general-btn {
    margin-left: auto; /* ml-auto */
}


/* --- Article Content Styling (.mi-prose) --- */

.mi-post-content.mi-prose {
    /* Base for the content area */
    max-width: 100%; /* max-w-none */
    margin-bottom: 3rem; /* mb-12 */
    color: #44403c; /* Base text color (stone-900) */
    line-height: 1.7;
    font-size: 1.125rem; /* text-lg / 18px base font size for readability */
}

/* Headings */
.mi-post-content.mi-prose h2, 
.mi-post-content.mi-prose h3,
.mi-post-content.mi-prose h4,
.mi-post-content.mi-prose h5,
.mi-post-content.mi-prose h6 {
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #44403c; /* stone-900 */
    line-height: 1.25;
}

.mi-post-content.mi-prose h2 {
    font-size: 1.5rem; /* ~32px */
    padding-bottom: 0.5rem;
}

.mi-post-content.mi-prose h3 {
    font-size: 1.75rem; /* ~28px */
    color: #57534e; /* stone-700 */
}

.mi-post-content.mi-prose h4 {
    font-size: 1.5rem; /* ~24px */
    font-weight: 600;
    color: #78716c; /* stone-600 */
}

/* Paragraphs and Spacing */
.mi-post-content.mi-prose p {
    margin-bottom: 1.5rem;
}
.mi-post-content.mi-prose strong, .mi-post-content.mi-prose b, .mi-post-content.mi-prose p strong, .mi-post-content.mi-prose p b {
    margin-bottom: 1rem;
}
/* Links */
.mi-post-content.mi-prose a {
    color: #b45309; /* amber-700 */
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.mi-post-content.mi-prose a:hover {
    color: #92400e; /* amber-800 */
}

/* Lists */
.mi-post-content.mi-prose ul {
    list-style-type: disc;
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

.mi-post-content.mi-prose ol {
    list-style-type: decimal;
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

.mi-post-content.mi-prose li {
    margin-bottom: 0.5rem;
}

/* Blockquotes */
.mi-post-content.mi-prose blockquote {
    border-left: 4px solid #d97706; /* amber-600 */
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #78716c; /* stone-500 */
    background-color: #fcf6e9; /* Light background for emphasis */
}

/* Code and Preformatted Text */
.mi-post-content.mi-prose code {
    background-color: #e7e5e4; /* stone-200 */
    padding: 0.2rem 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.9rem;
    color: #57534e;
}

.mi-post-content.mi-prose pre {
    background-color: #292524; /* stone-900 */
    color: #fff;
    padding: 1rem;
    overflow-x: auto;
    border-radius: 0.5rem;
    margin: 2rem 0;
}

/* Tables */
.mi-post-content.mi-prose table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.mi-post-content.mi-prose th {
    background-color: #f5f5f4; /* stone-100 */
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid #d6d3d1; /* stone-300 */
    font-weight: 700;
    color: #44403c;
}

.mi-post-content.mi-prose td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e7e5e4; /* stone-200 */
    vertical-align: top;
}

/* Images */
.mi-post-content.mi-prose img {
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    display: block;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
}

/* Horizontal Rule */
.mi-post-content.mi-prose hr {
    margin: 3rem 0;
    border: none;
    border-top: 1px solid #e7e5e4; /* stone-200 */
}

/* Media Query for smaller screens to adjust heading sizes */
@media (max-width: 767px) {
    .mi-post-content.mi-prose {
        font-size: 1rem;
    }
    .mi-single-title {
        font-size: 1.5rem;
    }
    .mi-post-content.mi-prose h2 {
        font-size: 1.2rem;
    }
    .mi-post-content.mi-prose h3 {
        font-size: 1rem;
    }
}


/* --- Author Bio Box --- */

.mi-author-bio-box {
    background-color: #fff;
    border-radius: 0.75rem; /* rounded-xl */
    padding: 2rem; /* p-8 */
    margin-bottom: 3rem; /* mb-12 */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
}

.mi-author-title {
    font-size: 1.25rem; /* Adjust as needed */
    color: #44403c;
    margin-bottom: 1rem; /* mb-4 */
    border: none;
}

.mi-author-details {
    display: flex;
    align-items: flex-start;
    gap: 1rem; /* gap-4 */
}

.mi-author-bio-avatar {
    width: 4rem; /* w-16 */
    height: 4rem; /* h-16 */
    border-radius: 9999px; /* rounded-full */
}

.mi-author-bio-avatar svg {
    width: 2rem; /* w-8 */
    height: 2rem; /* h-8 */
}

.mi-author-name-lg {
    color: #44403c;
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0.5rem; /* mb-2 */
}

.mi-author-text {
    flex-grow: 1;
}

.mi-author-name-lg a {
    color: inherit;
    text-decoration: none;
}

.mi-author-bio-text {
    color: #57534e; /* text-stone-600 */
    margin: 0;
    font-size: 0.9375rem;
}


/* --- Related Posts --- */

.mi-related-posts-section {
    margin-bottom: 3rem; /* mb-12 */
}

.mi-related-title {
    color: #44403c;
    font-size: 1.5rem; /* Adjust as needed */
    margin-bottom: 1.5rem; /* mb-6 */
    border: none;
}

.mi-related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem; /* gap-6 */
}

@media (min-width: 768px) {
    .mi-related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.mi-related-card {
    background-color: #fff;
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    overflow: hidden;
    display: block;
    text-decoration: none;
    transition: box-shadow 0.2s;
}

.mi-related-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06); /* hover:shadow-md */
}

.mi-related-image-wrap {
    position: relative;
    height: 13rem; /* h-40 */
    overflow: hidden;
}

.mi-related-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s;
}

.mi-related-card:hover .mi-related-image {
    transform: scale(1.05);
}

.mi-related-category-tag {
    position: absolute;
    top: 1rem; /* top-4 */
    left: 1rem; /* left-4 */
    padding: 0.25rem 0.75rem; /* px-3 py-1 */
    background-color: #d97706; /* bg-amber-600 */
    color: #fff;
    font-size: 0.75rem; /* text-xs */
    border-radius: 9999px; /* rounded-full */
    font-weight: 500;
    z-index: 2;
}

.mi-related-content-area {
    padding: 1rem; /* p-4 */
}

.mi-related-card-title {
    color: #44403c; /* text-stone-900 */
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    transition: color 0.2s;
}

.mi-related-card:hover .mi-related-card-title {
    color: #b45309; /* group-hover:text-amber-700 */
}


/* --- Newsletter CTA (Amber version) --- */

.mi-newsletter-cta-amber {
    /* bg-gradient-to-r from-amber-700 to-amber-600 */
    background: linear-gradient(to right, #b45309, #d97706);
    border-radius: 1rem; /* rounded-2xl */
    padding: 2rem; /* p-8 */
    color: #fff;
    text-align: center;
}

.mi-cta-title-white {
    color: #fff;
    margin-bottom: 0.75rem; /* mb-3 */
    font-size: 1.5rem;
    border: none;
}

.mi-cta-subtitle-light {
    color: #fce7b8; /* text-amber-50 */
    margin-bottom: 1.5rem; /* mb-6 */
}

.mi-newsletter-form-single {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* gap-3 */
    max-width: 28rem; /* max-w-md */
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 640px) {
    .mi-newsletter-form-single {
        flex-direction: row;
    }
}

.mi-newsletter-input-light {
    flex: 1; /* flex-1 */
    padding: 0.75rem 1rem; /* px-4 py-3 */
    border-radius: 0.5rem; /* rounded-lg */
    border: none;
    outline: none;
    color: #44403c; /* text-stone-900 */
    transition: box-shadow 0.2s;
    font-family: "DM Sans", sans-serif;
}

.mi-newsletter-input-light:focus {
    box-shadow: 0 0 0 2px #fff; /* focus:ring-2 focus:ring-white */
}

.mi-newsletter-button-light {
    padding: 0.75rem 1.5rem; /* px-6 py-3 */
    background-color: #fff;
    color: #78350f; /* text-amber-900 */
    border: none;
    border-radius: 0.5rem; /* rounded-lg */
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.mi-newsletter-button-light:hover {
    background-color: #fef3c7; /* hover:bg-amber-50 */
}