/* Consistent base so rem sizes don't vary by page */
html {
    font-size: 16px;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

/* Custom Bootstrap theme colors */
:root {
    --bs-light: #fffefc;
    --bs-dark: #0b1112;
    --bs-primary: #7c3aed;
    --bs-secondary: #a855f7;
    --bs-info: #3b82f6;
    --bs-success: #256b4a;
    --bs-warning: #ecd948;
    --bs-danger: #c34638;
    --topbar-height: 60px;
    --sidebar-width: 200px;
}

main {
    background-color: transparent !important;
    flex: 1;
}


.container {
    max-width: 1200px;
    margin-top: calc(var(--topbar-height) + 2rem);
    margin-left: calc(var(--sidebar-width) + max(1rem, (100vw - var(--sidebar-width) - 1200px) / 2));
    margin-right: max(1rem, (100vw - var(--sidebar-width) - 1200px) / 2);
}

footer {
    margin-top: auto;
    padding: 1rem 2rem;
}

/* Add mobile responsive */
@media (max-width: 768px) {
    .container {
        margin-left: 1rem;
        /* Remove sidebar offset on mobile */
        margin-right: 1rem;
    }
}

/* Sidebar styles */
.sidebar {
    width: var(--sidebar-width);
    background-color: rgba(124, 58, 237, 0.75);
    /* background-color: rgba(42, 171, 122, 0.638); */
    position: fixed;
    left: 0;
    top: var(--topbar-height);
    height: calc(100vh - var(--topbar-height));
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    overflow: hidden;
}

/* Hide sidebar on mobile; full height when open, above topbar */
@media (max-width: 768px) {
    .sidebar {
        background-color: rgba(124, 58, 237, 0.95);
        will-change: auto;
        transform: translateX(-100%);
        transition: transform 0.5s ease;
        top: 0;
        height: 100vh;
        min-height: 100vh;
    }

    .sidebar.open {
        transform: translateX(0);
        pointer-events: auto;
        z-index: 1002;
    }
}


.sidebar-menu {
    list-style: none;
    padding: 0;
}


.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    /* width: 100%; */
    padding: 1rem 1rem 1rem 2rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    /* border-radius: 0; */
    /* white-space: nowrap; */
    /* position: relative; */
    z-index: 1;
}

.sidebar-link:hover {
    color: rgba(255, 255, 255, 1);
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-item.active .sidebar-link {
    color: rgba(255, 255, 255, 1);
    background-color: rgba(255, 255, 255, 0.2);
}

.sidebar-link svg,
.sidebar-link i {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.sidebar-text {
    font-size: 1rem;
    opacity: 1;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1rem 1.5rem;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.sidebar-footer .sidebar-capy {
    max-width: 100%;
    width: 140px;
    height: auto;
    object-fit: contain;
}


.topbar {
    background-color: rgba(124, 58, 237, 0.75);
    padding: 0 2rem;
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1001;
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
}

.topbar-content {
    width: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.topbar-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
    background: none;
    color: inherit;
}

.topbar-icon:hover {
    opacity: 0.8;
}

.topbar-icon svg {
    width: 32px;
    height: 32px;
    filter: brightness(0) invert(1);
}

.topbar-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
}

.topbar-title-text {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fffefc;
    text-align: center;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    flex-shrink: 0;
}

.topbar-actions .btn-link {
    color: #333;
    font-size: 1.25rem;
}

.topbar-actions .btn-link:hover {
    color: #7c3aed;
}

.topbar-actions svg,
.topbar-actions .bi {
    width: 1.25rem;
    height: 1.25rem;
}

.theme-icon {
    display: inline-flex;
    align-items: center;
}

.inline-svg {
    display: inline-flex;
    align-items: center;
}

.inline-svg svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

/* Utility styles */
.bg-tags {
    background-color: #7c3aed !important;
}

.text-title {
    color: #7c3aed !important;
}

.text-subtitle {
    color: #a855f7 !important;
}

/* Post single page styles */
.post-single {
    max-width: 800px;
    margin: 0 auto;
}

.post-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.post-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.post-meta {
    font-size: 0.95rem;
    opacity: 0.8;
}

.post-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

.post-content h2 {
    color: #7c3aed;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    font-weight: 600;
}

.post-content h3 {
    color: #a855f7;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.post-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.post-content p {
    margin-bottom: 1.25rem;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.25rem;
    padding-left: 2rem;
}

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

.post-content code {
    background-color: rgba(124, 58, 237, 0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

.post-content pre {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

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

.post-content blockquote {
    border-left: 4px solid #7c3aed;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    opacity: 0.9;
    font-style: italic;
}

.post-content strong {
    color: #7c3aed;
    font-weight: 600;
}

.post-toc {
    font-size: 0.95rem;
}
.post-toc ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}
.post-toc li {
    margin-bottom: 0.35rem;
}
.post-toc a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}
.post-toc a:hover {
    color: #a855f7;
}

.post-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

/* Post list cards (match site colors) */
.row-cols-1 .card,
.row-cols-2 .card {
    background-color: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.35);
    border-radius: 0.5rem;
}
.row-cols-1 .card-header,
.row-cols-2 .card-header {
    background-color: rgba(124, 58, 237, 0.45);
    border-bottom: 1px solid rgba(124, 58, 237, 0.35);
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    border-radius: 0.5rem 0.5rem 0 0;
}
.row-cols-1 .card-header h3,
.row-cols-2 .card-header h3 {
    margin: 0;
    font-size: 1.35rem;
    color: inherit;
}
.row-cols-1 .card-body,
.row-cols-2 .card-body {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}
.row-cols-1 .card-footer,
.row-cols-2 .card-footer {
    background-color: rgba(124, 58, 237, 0.2);
    border-top: 1px solid rgba(124, 58, 237, 0.35);
    border-radius: 0 0 0.5rem 0.5rem;
}
.btn-tags {
    --bs-btn-bg: #7c3aed;
    --bs-btn-border-color: #7c3aed;
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: #6d28d9;
    --bs-btn-hover-border-color: #6d28d9;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #a855f7;
    --bs-btn-active-border-color: #a855f7;
}

/* Bootstrap button color overrides */
.btn-primary {
    --bs-btn-bg: #7c3aed;
    --bs-btn-border-color: #7c3aed;
    --bs-btn-hover-bg: #6d28d9;
    --bs-btn-hover-border-color: #6d28d9;
    --bs-btn-active-bg: #6d28d9;
    --bs-btn-active-border-color: #6d28d9;
}

.btn-secondary {
    --bs-btn-bg: #a855f7;
    --bs-btn-border-color: #a855f7;
    --bs-btn-hover-bg: #9333ea;
    --bs-btn-hover-border-color: #9333ea;
    --bs-btn-active-bg: #9333ea;
    --bs-btn-active-border-color: #9333ea;
}

.btn-info {
    --bs-btn-bg: #3b82f6;
    --bs-btn-border-color: #3b82f6;
    --bs-btn-hover-bg: #2563eb;
    --bs-btn-hover-border-color: #2563eb;
    --bs-btn-active-bg: #2563eb;
    --bs-btn-active-border-color: #2563eb;
}

.btn-success {
    --bs-btn-bg: #256b4a;
    --bs-btn-border-color: #256b4a;
    --bs-btn-hover-bg: #1e563a;
    --bs-btn-hover-border-color: #1e563a;
    --bs-btn-active-bg: #1e563a;
    --bs-btn-active-border-color: #1e563a;
}

.btn-warning {
    --bs-btn-bg: #ecd948;
    --bs-btn-border-color: #ecd948;
    --bs-btn-hover-bg: #e8d12f;
    --bs-btn-hover-border-color: #e8d12f;
    --bs-btn-active-bg: #e8d12f;
    --bs-btn-active-border-color: #e8d12f;
}

.btn-danger {
    --bs-btn-bg: #c34638;
    --bs-btn-border-color: #c34638;
    --bs-btn-hover-bg: #a83a2e;
    --bs-btn-hover-border-color: #a83a2e;
    --bs-btn-active-bg: #a83a2e;
    --bs-btn-active-border-color: #a83a2e;
}

.text-info {
    --bs-text-opacity: 1;
    color: #3b82f6 !important;
}

.bg-primary {
    --bs-bg-opacity: 1;
    background-color: rgba(124, 58, 237, var(--bs-bg-opacity)) !important;
}

.bg-secondary {
    --bs-bg-opacity: 1;
    background-color: rgba(168, 85, 247, var(--bs-bg-opacity)) !important;
}

.bg-info {
    --bs-bg-opacity: 1;
    background-color: rgba(59, 130, 246, var(--bs-bg-opacity)) !important;
}

.bg-success {
    --bs-bg-opacity: 1;
    background-color: rgba(37, 107, 74, var(--bs-bg-opacity)) !important;
}

.bg-warning {
    --bs-bg-opacity: 1;
    background-color: rgba(236, 217, 72, var(--bs-bg-opacity)) !important;
}

.bg-danger {
    --bs-bg-opacity: 1;
    background-color: rgba(195, 70, 56, var(--bs-bg-opacity)) !important;
}

/* Resume icons - make them larger */
.resume-interests svg {
    width: 1.5rem;
    height: 1.5rem;
}