	/* Modern Reset & CSS Variables */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --text-muted: #64748b;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --border-color: #e2e8f0;
    --card-bg: #f8fafc;
    --max-width: 800px;
    --transition: all 0.3s ease;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --accent-color: #60a5fa;
    --accent-hover: #93c5fd;
    --border-color: #334155;
    --card-bg: #1e293b;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    margin: 0;
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout Container */
article {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 0;
}

/* Typography Styles */
h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
    border-left: 4px solid var(--accent-color);
    padding-left: 15px;
}

h3 {
    font-size: 1.4rem;
    margin-top: 2rem;
}

.meta {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 3rem;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
	align-items: center
}

/* Link Style */
p a, .section a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

p a:hover {
    border-bottom-color: var(--accent-color);
    opacity: 0.8;
}

/* Image Hover Effect (Maintain frame size) */
.section p:has(img) {
    border-radius: 16px;
    overflow: hidden; /* This keeps the edges cut off on scale */
    margin: 2.5rem 0;
    line-height: 0; /* Fixes bottom spacing in p tags */
}

.section img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.section p:has(img):hover img {
    transform: scale(1.05);
}

/* Table Design */
.section {
    overflow-x: auto; /* Makes table responsive down to 412px */
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
    min-width: 500px; /* Forces scroll on small screens instead of squishing */
}

th {
    background-color: var(--card-bg);
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background-color: var(--card-bg);
}

/* Lists and FAQ */
ul, ol {
    padding-left: 20px;
    margin: 1.5rem 0;
}

li {
    margin-bottom: 0.8rem;
}

strong {
    color: var(--accent-color);
}

/* Theme Toggle Button Style */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 15px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    body {
        padding: 15px;
    }
    
    article {
        padding: 20px 0;
    }

    h1 {
        font-size: 2.2rem;
    }
}

/* Mobile Specific (412px and below) */
@media (max-width: 412px) {
    .meta {
        font-size: 0.85rem;
        flex-direction: column;
        gap: 5px;
    }
    
    .meta span:nth-child(even) {
        display: none; /* Hide the separator pipes on tiny screens */
    }

    h2 {
        font-size: 1.5rem;
    }
}



/* Container for the 2-column layout */
.page-wrapper {
    display: grid;
    grid-template-columns: 1fr 280px; /* Main content | Sidebar */
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

article {
    min-width: 0; /* Prevents flex/grid blowouts */
    max-width: 800px; /* Optimal reading width */
}

/* Sidebar Styling */
.sidebar-right {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.toc {
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.toc h3 {
    margin-top: 0;
    font-size: 1.1rem;
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc li {
    margin-bottom: 10px;
}

.toc a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s;
    display: block;
}

.toc a.active {
    color: var(--accent-color);
    font-weight: bold;
    border-left: 2px solid var(--accent-color);
    padding-left: 10px;
    margin-left: -10px;
}

/* Related Section Styling */
.related-posts-section {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

 .related-posts-section { margin-top: 60px; padding-top: 30px; border-top: 2px solid var(--border-color); }
        .related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-top: 20px; }
        .related-card { background: var(--card-bg); padding: 20px; border-radius: 12px; text-decoration: none; color: inherit; border: 1px solid var(--border-color); }

/* Hide sidebar on mobile */
@media (max-width: 1024px) {
    .page-wrapper {
        display: block;
    }
    .sidebar-right {
        display: none;
    }
}

/* Blog post and author page extended styles */
.page-wrapper {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding: 20px;
}

article { flex: 1; min-width: 0; }

.sidebar-right {
    width: 280px;
    position: sticky;
    top: 40px;
    align-self: flex-start;
    height: fit-content;
}

.toc { border-left: 2px solid var(--border-color); padding-left: 20px; font-size: 0.9rem; }
.toc ul { list-style: none; padding: 0; }
.toc li { margin: 10px 0; }
.toc a { text-decoration: none; color: var(--text-muted); transition: color 0.2s; }
.toc a:hover, .toc a.active { color: var(--accent-color); font-weight: 600; }
.toc-h3 { padding-left: 15px; font-size: 0.85rem; }

.faq-section { margin-top: 50px; padding-top: 30px; border-top: 1px solid var(--border-color); }
.faq-item { margin-bottom: 10px; border: 1px solid var(--border-color); border-radius: 8px; }
summary { padding: 15px; cursor: pointer; font-weight: bold; }
.faq-answer { padding: 0 15px 15px; }

.share-panel { margin-top: 24px; border-left: 2px solid var(--border-color); padding-left: 20px; }
.share-panel h3 { margin-bottom: 12px; }
.share-links { display: flex; flex-wrap: wrap; gap: 8px; }

.share-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-color);
    background: var(--surface-color, transparent);
    transition: all 0.2s;
}

.share-link svg { width: 19px; height: 19px; display: block; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.share-link:hover { border-color: var(--accent-color); color: var(--accent-color); }

.share-x { background: #000000; border-color: #000000; color: #ffffff; }
.share-facebook { background: #1877f2; border-color: #1877f2; color: #ffffff; }
.share-linkedin { background: #0a66c2; border-color: #0a66c2; color: #ffffff; }
.share-whatsapp { background: #25d366; border-color: #25d366; color: #0d2b17; }
.share-telegram { background: #229ed9; border-color: #229ed9; color: #ffffff; }
.share-reddit { background: #ff4500; border-color: #ff4500; color: #ffffff; }
.share-pinterest { background: #e60023; border-color: #e60023; color: #ffffff; }
.share-email { background: #475569; border-color: #475569; color: #ffffff; }

.share-link.share-x:hover,
.share-link.share-facebook:hover,
.share-link.share-linkedin:hover,
.share-link.share-whatsapp:hover,
.share-link.share-telegram:hover,
.share-link.share-reddit:hover,
.share-link.share-pinterest:hover,
.share-link.share-email:hover {
    filter: brightness(0.92);
    color: #ffffff;
    border-color: transparent;
}

.mobile-share-bar { display: none; }

.author-inline { display: inline-flex; align-items: center; gap: 8px; }

.author-inline-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.author-inline a { color: inherit; text-decoration: none; }
.author-inline a:hover { text-decoration: underline; }

.site-footer {
    max-width: 1200px;
    margin: 24px auto 0;
    padding: 24px 20px 96px;
    border-top: 1px solid var(--border-color);
}

.site-footer h3 { margin-top: 0; margin-bottom: 12px; }

.footer-meta {
    margin: 16px 0 0;
    color: var(--text-muted, #666666);
    font-size: 0.9rem;
}

.footer-nav-links,
.footer-category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 10px 0 0;
}

.footer-nav-links a,
.footer-category-links a {
    color: #0f5ea8;
    text-decoration: none;
}

.footer-nav-links a:visited,
.footer-category-links a:visited { color: #0b4f8f; }

.footer-nav-links a:hover,
.footer-category-links a:hover {
    color: #0a4a82;
    text-decoration: underline;
}

[data-theme="dark"] .footer-nav-links a,
[data-theme="dark"] .footer-category-links a { color: #8fc7ff; }

[data-theme="dark"] .footer-nav-links a:visited,
[data-theme="dark"] .footer-category-links a:visited { color: #b6dcff; }

[data-theme="dark"] .footer-nav-links a:hover,
[data-theme="dark"] .footer-category-links a:hover { color: #d2eaff; }

.author-avatar {
    width: 116px;
    height: 116px;
    margin: 20px 0;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.author-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.author-gallery {
  display: grid-lanes;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem 1rem;
  margin-top: 1.5rem;
}

@supports not (display: grid-lanes) {
  .author-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
  }
}

.author-gallery img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.author-gallery img:hover { transform: scale(1.02); }

@media (max-width: 1024px) {
    .sidebar-right { display: none; }
    .page-wrapper { display: block; }
    body { padding-bottom: 72px; }

    .mobile-share-bar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
        gap: 8px;
        overflow-x: auto;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.95);
        border-top: 1px solid var(--border-color);
        backdrop-filter: blur(8px);
    }

    [data-theme="dark"] .mobile-share-bar { background: rgba(18, 18, 18, 0.92); }
    .mobile-share-bar .share-link { flex: 0 0 auto; white-space: nowrap; }
}
