/* premium multi-language blog styles */
:root {
    --primary-color: #0070f3;
    --primary-hover: #0051c3;
    --bg-color: #f9f9f9;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --text-title: #111111;
    --border-color: #eeeeee;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--bg-color);
}

header {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
    padding-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1,
h2,
h3 {
    color: var(--text-title);
    font-weight: 700;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

nav a {
    margin-left: 15px;
}

.lang-switch {
    font-size: 0.9em;
}

main {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

footer {
    margin-top: 60px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85em;
    padding-bottom: 40px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* Post list */
.post-list {
    list-style: none;
    padding: 0;
}

.post-item {
    margin-bottom: 48px;
}

.post-title {
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.post-date {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: 12px;
}

/* Post content styles */
.post-content {
    font-size: 1.1rem;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

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

.post-content code {
    background: #f0f0f0;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
}

.post-content pre {
    background: #f6f8fa;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.post-content pre code {
    background: none;
    padding: 0;
    font-size: 0.9em;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.post-content th,
.post-content td {
    padding: 12px;
    border: 1px solid #dfe2e5;
}

.post-content th {
    background-color: #f6f8fa;
    text-align: left;
}

.post-content blockquote {
    border-left: 4px solid var(--border-color);
    margin: 1.5rem 0;
    padding-left: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Code highlighting (minimal) */
.codehilite .k {
    color: #d73a49;
}

/* Keyword */
.codehilite .s {
    color: #032f62;
}

/* String */
.codehilite .c {
    color: #6a737d;
}

/* Comment */
.codehilite .nf {
    color: #6f42c1;
}

/* Function */
.codehilite .nb {
    color: #e36209;
}

/* Builtin */
.codehilite .nc {
    color: #6f42c1;
}

/* Language Dropdown */
.lang-dropdown {
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
    /* Bridge gap for hover */
    margin-bottom: -10px;
}

.dropbtn {
    background-color: var(--card-bg);
    color: var(--text-main);
    padding: 8px 16px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.dropbtn:hover {
    background-color: #f0f0f0;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 38px;
    /* Position at the end of button + tiny gap */
    background-color: var(--card-bg);
    min-width: 180px;
    box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background-color: #f5f5f5;
    text-decoration: none;
}

.dropdown-content a.active {
    font-weight: bold;
    color: var(--primary-color);
    background-color: #f0f7ff;
}

.lang-dropdown:hover .dropdown-content {
    display: block;
}

/* Post Header Fix */
.post-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 2rem !important;
}

.post-header h1 {
    margin: 0 0 0.5rem 0 !important;
    display: block;
    width: 100%;
}

.post-meta {
    display: block !important;
    width: 100%;
    margin-top: 0.25rem;
}

/* Post TOC */
.post-toc-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.post-toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.post-toc ul ul {
    padding-left: 20px;
    margin-top: 5px;
}

.post-toc li {
    margin-bottom: 8px;
}

.post-toc a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
}

.post-toc a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}