/* 
   Enterprise Level Blog Typography 
   Target: .entry-content
   Design: Modern, Clean, High Readability
*/

.entry-content {
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
    font-size: 1.125rem;
    /* 18px for better reading */
    line-height: 1.75;
    color: #374151;
    /* Gray-700 */
    max-width: 100%;
    overflow-wrap: break-word;
}

/* Headings */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    color: #111827;
    /* Gray-900 */
    font-weight: 700;
    line-height: 1.25;
    /* Tighter line height */
    margin-top: 2rem;
    /* Reduced margin */
    margin-bottom: 0.75rem;
    /* Reduced margin */
    letter-spacing: -0.025em;
}

.entry-content h1 {
    font-size: 2.25rem;
}

.entry-content h2 {
    font-size: 1.875rem;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 0.5rem;
}

.entry-content h3 {
    font-size: 1.5rem;
}

.entry-content h4 {
    font-size: 1.25rem;
}

/* Paragraphs & Text */
.entry-content p {
    margin-bottom: 1.5em;
}

.entry-content strong,
.entry-content b {
    font-weight: 700;
    color: #000;
}

/* Links */
.entry-content a {
    color: var(--bs-primary, #0d6efd);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

.entry-content a:hover {
    color: var(--bs-primary-dark, #0a58ca);
    text-decoration-thickness: 2px;
    background: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.1);
}

/* Lists */
.entry-content ul {
    list-style-type: disc;
}

.entry-content ol {
    list-style-type: decimal;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
    position: relative;
}

.entry-content ul>li::marker {
    color: var(--bs-primary, #0d6efd);
}

/* Blockquotes */
.entry-content blockquote {
    position: relative;
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: #f9fafb;
    border-left: 4px solid var(--bs-primary, #0d6efd);
    border-radius: 0.5rem;
    font-size: 1.25rem;
    font-style: italic;
    color: #4b5563;
}

.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Images & Figures */
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.entry-content figure {
    margin: 2rem 0;
    text-align: center;
}

.entry-content figcaption {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.75rem;
    text-align: center;
}

/* Tables - Bootstrap Style */
.entry-content table {
    width: 100%;
    margin-bottom: 2rem;
    color: #212529;
    border-color: #dee2e6;
    vertical-align: top;
    border-collapse: collapse;
}

.entry-content table th,
.entry-content table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    background-color: transparent;
}

.entry-content table th {
    font-weight: 600;
    text-align: left;
    background-color: #f8f9fa;
    /* gray-100 */
    border-bottom-width: 2px;
}

.entry-content table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Striped variant for readability */
.entry-content table tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.015);
}

/* Utilities (Makalu Editor / WordPress compat) */
.entry-content p.has-background,
.entry-content ol.has-background,
.entry-content ul.has-background {
    padding: 1.25rem 2rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

/* Code */
.entry-content pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.entry-content code {
    background: #eff6ff;
    color: #1e40af;
    padding: 0.2em 0.4em;
    border-radius: 0.25em;
    font-size: 0.875em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.entry-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Markers / Highlights */
.entry-content mark {
    background: #fef3c7;
    color: #92400e;
    padding: 0.1em 0.3em;
    border-radius: 0.2em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .entry-content {
        font-size: 1.0625rem;
        /* 17px */
    }

    .entry-content h2 {
        font-size: 1.5rem;
    }

    .entry-content h3 {
        font-size: 1.25rem;
    }
}

/* RankMath Inspired Table of Contents */
.toc-container {
    background: #fdfdfd;
    /* Lighter bg */
    border: 1px solid #edf2f7;
    /* Finer border */
    border-radius: 8px;
    /* Standard rounding */
    margin: 2rem 0;
    /* Reduced margin */
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    /* Subtle shadow */
}

.toc-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: #ffffff;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.toc-container:not(.collapsed) .toc-header {
    border-bottom-color: #e2e8f0;
}

/* RankMath Style Hamburger Toggle */
.toc-toggle {
    width: 20px;
    height: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.toc-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: #64748b;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.toc-container:not(.collapsed) .toc-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.toc-container:not(.collapsed) .toc-toggle span:nth-child(2) {
    opacity: 0;
}

.toc-container:not(.collapsed) .toc-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.toc-content {
    padding: 1.5rem;
}

.toc-container.collapsed .toc-content {
    display: none;
}

/* TOC List Styling */
.toc-list {
    list-style: none !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
    counter-reset: toc-counter;
}

.toc-list .toc-list {
    padding-left: 1.75rem !important;
    margin-top: 0.5rem !important;
}

.toc-list-item {
    margin-bottom: 0.75rem !important;
    font-size: 0.9375rem !important;
    line-height: 1.4 !important;
    counter-increment: toc-counter;
}

.toc-list-item::before {
    content: counters(toc-counter, ".") ". ";
    color: #94a3b8;
    font-weight: 500;
    margin-right: 0.75rem;
    font-size: 0.875rem;
    min-width: 1.5rem;
    flex-shrink: 0;
}

.toc-link {
    color: #475569 !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.2s ease !important;
}

.toc-link:hover {
    color: var(--bs-primary, #0d6efd) !important;
    transform: translateX(4px);
}

.toc-list-item.is-active-li>.toc-link {
    color: var(--bs-primary, #0d6efd) !important;
    font-weight: 600 !important;
}