body {
    margin: 0;
    padding: 0;
    font-size: 100%;
    font-size-adjust: 0.5;
    font-family: "Lora", "Palatino Linotype", "Book Antiqua", "New York", "DejaVu serif", serif;
    background-color: #fff;
    color: #111;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --text-main: #111;
    --primary-blue: #0057ff;
    --primary-blue-light: #3377ff;
    --primary-blue-dark: #0044cc;
    --chart-sky: #5f9cff;
    --chart-sun: #ffd44d;
    --chart-moss: #4caf82;
    --chart-haze: #f3f6ff;
    --text-muted: #666;
    --border-color: #eee;
    --bg-hover: #f9f9f9;
    --shadow-soft: rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.06);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease-out;
}

a {
    text-decoration: none;
    color: #0057ff;
}

a:visited {
    color: #4b44ff;
}

a:hover {
    text-decoration: underline;
}


hr {
    height: 1px;
    background: #ccc;
    max-width: 38em;
    margin: 2em auto;
    border: 0;
}

#post #wrapper,
#post pre {
    max-width: 38em;
    margin: 0 auto;
}

#post article,
#post pre {
    max-width: 38em;
    margin: 0 auto;
    padding: 0.2em 1.5em 1em;
    font-size: 1.1em;
}

#post article.norm {
    line-height: 1.45;
    white-space: normal;
}

#post article h1,
#post article h2,
#post article h3 {
    line-height: 1.2;
    margin: 0.7em 0 0.25em;
}

#post article h2#title {
    font-size: 1.4em;
    display: block;
    margin: 0 0 0.5em;
}

#post article p {
    margin: 0 0 0.6em;
}

#post article a {
    color: #0057ff;
}

#post article a:visited {
    color: #4b44ff;
}

#post article p+h2,
#post article p+h3,
#post article p+h4 {
    margin-top: 0.5em;
}

#post article ul,
#post article ol {
    margin: 1em 0;
    padding-left: 1.25em;
}

#post article li {
    margin: 0 0 0.25em;
}

#post article img,
#post audio,
#post video {
    max-width: 100%;
}

#post blockquote {
    border-left: 4px solid #ddd;
    padding: 0 0.8em;
    margin: 0.4em 0;
    color: #767676;
}

#post blockquote p {
    margin: 0.4em 0;
}

#post code {
    background-color: #f8f8f8;
    border: 1px solid #ccc;
    padding: 0.15em 0.3em;
    font-size: 0.85em;
    border-radius: 0.2em;
    font-family: Hack, consolas, Menlo, Monaco, "Ubuntu Mono", monospace;
}

#post pre {
    background: #f8f8f8;
    border: 1px solid #ccc;
    padding: 0.3em 0.5em;
    font-size: 0.85em;
    border-radius: 0.2em;
    overflow-x: auto;
}

#post pre code {
    background: transparent;
    border: 0;
    padding: 0;
    font-size: 1em;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#post article .authors,
#post article time.dt-published {
    display: block;
    color: #666;
    margin-bottom: 0.8em;
    font-size: 0.9em;
}

#post article .authors {
    margin: 0.2em 0;
}

.post-tags {
    margin-top: 1.2em;
}

.thought-item .post-tags {
    margin-top: 0.5em;
    margin-bottom: 0;
}

a.hashtag {
    color: var(--primary-blue);
    background: var(--bg-hover, #f9f9f9);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    transition: background var(--transition-fast), color var(--transition-fast);
    text-decoration: none;
    display: inline-block;
}

a.hashtag:hover {
    background: var(--primary-blue);
    color: white;
}

a.hashtag span:first-child {
    color: inherit;
    opacity: 0.7;
    margin-right: 0.1em;
    font-size: 0.9em;
}

a.hashtag:hover span+span {
    text-decoration: none;
}

footer {
    text-align: center;
    padding: 0 1.5em;
}

footer nav {
    margin: 2em 0 3em;
    color: #444;
    font-family: "Open Sans", "Segoe UI", Tahoma, Arial, sans-serif;
}

footer nav a {
    display: inline-block;
    margin-top: 0.6em;
    color: #999;
    text-decoration: none;
    font-size: 0.9em;
}

footer nav a+a {
    margin-left: 0.7em;
}

footer nav a:hover {
    color: #666;
    text-decoration: none;
}

footer nav a.home {
    color: #333;
    font-weight: 700;
}

footer nav a.home:hover {
    color: #000;
}

.writeas-footer {
    text-align: center;
    padding: 0 1.5em;
    margin: 2em auto 3em;
}

.writeas-footer-title {
    margin: 0 0 0.5em;
    font-size: 0.7em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #666;
    font-family: "Open Sans", "Segoe UI", Tahoma, Arial, sans-serif;
}

.writeas-footer-section {
    max-width: 38em;
    margin: 0 auto 1.2em;
    text-align: left;
}

.writeas-footer-section summary {
    cursor: pointer;
    list-style: none;
}

.writeas-footer-section summary::-webkit-details-marker {
    display: none;
}

.writeas-footer-section summary::after {
    content: "+";
    float: right;
    color: #999;
    font-weight: 600;
}

.writeas-footer-section[open] summary::after {
    content: "–";
}

.writeas-footer-section summary.writeas-footer-title {
    margin-bottom: 0.5em;
}

.writeas-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em 0.8em;
    font-size: 0.85em;
    color: #666;
}

.writeas-footer-links a {
    color: #999;
    text-decoration: none;
}

.writeas-footer-links a:hover {
    color: #666;
    text-decoration: none;
}

.writeas-footer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35em 0.7em;
    font-size: 0.85em;
    justify-content: flex-start;
}

.writeas-footer-tags a {
    color: #999;
    text-decoration: none;
}

.writeas-footer-tags a:hover {
    color: #666;
    text-decoration: none;
}

.writeas-webring-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em 0.7em;
    font-size: 0.85em;
}

.writeas-webring-name {
    font-weight: 600;
    color: #444;
}

.writeas-footer-credits {
    font-size: 0.8em;
    color: #777;
}

.writeas-footer-credits p {
    margin: 0.4em 0;
}

.thoughts-meta {
    font-size: 0.9em;
    color: #666;
    margin: 0 0 1.5em;
}

.thoughts-count {
    display: inline-block;
    font-size: 2.5em;
    font-weight: 700;
    color: var(--primary-blue, #0057ff);
    line-height: 1;
    vertical-align: middle;
    margin-right: 0.15em;
}

html[data-theme="dark"] .thoughts-count {
    color: var(--primary-blue, #82a6ff);
}

.thoughts-list {
    display: flex;
    flex-direction: column;
    gap: 1.2em;
}

.thought-item {
    padding-bottom: 1.2em;
    border-bottom: 1px solid #eee;
    transition: transform var(--transition-fast);
}

.thought-item:hover {
    transform: translateX(4px);
}

.thought-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.thought-time {
    display: block;
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8em;
    color: #666;
    margin-bottom: 0.4em;
    letter-spacing: 0.02em;
}

.thought-time a {
    color: inherit;
    text-decoration: none;
    position: relative;
}

.thought-time a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary-blue);
    transition: width var(--transition-normal);
}

.thought-time a:hover {
    color: var(--primary-blue);
}

.thought-time a:hover::after {
    width: 100%;
}

/* Micro Feed (Thoughts Timeline) */
.micro-feed {
    border-left: 2px solid var(--border-color, #eee);
    padding-left: 20px;
    margin-left: 10px;
}

.micro-item {
    margin-bottom: 25px;
    position: relative;
    transition: transform var(--transition-fast);
}

.micro-item:hover {
    transform: translateX(4px);
}

.micro-dot {
    position: absolute;
    left: -26px;
    top: 4px;
    width: 10px;
    height: 10px;
    background: var(--primary-blue);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--border-color, #eee);
    transition: transform var(--transition-fast);
}

.micro-item:hover .micro-dot {
    transform: scale(1.2);
}

.micro-header {
    margin-bottom: 8px;
}

.micro-timestamp-link {
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85em;
    color: #666;
    text-decoration: none;
    position: relative;
}

.micro-timestamp-link:hover {
    color: var(--primary-blue);
}

.micro-content {
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 10px;
}

.micro-content p {
    margin: 0 0 0.5em;
}

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

.micro-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.micro-tag {
    display: inline-block;
    background: rgba(0, 87, 255, 0.1);
    color: var(--primary-blue, #0057ff);
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 0.8em;
    text-decoration: none;
    transition: all 0.2s ease;
}

.micro-tag:hover {
    background: var(--primary-blue, #0057ff);
    color: #fff !important;
}

/* Dark mode micro-tags */
html[data-theme="dark"] .micro-tag {
    background: rgba(130, 166, 255, 0.15);
    color: var(--primary-blue, #82a6ff);
}

html[data-theme="dark"] .micro-tag:hover {
    background: var(--primary-blue, #82a6ff);
    color: #111 !important;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4em;
    margin: 1.2em auto 2.5em;
}

.pagination-link {
    border: 1px solid #ddd;
    border-radius: 0.2em;
    padding: 0.2em 0.5em;
    font-size: 0.8em;
    color: #666;
    text-decoration: none;
}

.pagination-link.active {
    background: #f2f2f2;
    color: #333;
}

.writeas-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.writeas-list-item {
    display: flex;
    gap: 0.8em;
    align-items: baseline;
    padding: 0.4em 0;
    border-bottom: 1px solid #eee;
}

.writeas-list-item:last-child {
    border-bottom: 0;
}

.writeas-list-date {
    font-family: Hack, consolas, Menlo, Monaco, "Ubuntu Mono", monospace;
    font-size: 0.8em;
    color: #666;
    min-width: 80px;
}

.writeas-list-main {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
    align-items: baseline;
}

.writeas-list-title {
    font-size: 0.95em;
    color: #111;
}

.writeas-list-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.3em;
    font-size: 0.8em;
    color: #666;
}

.writeas-list-tag {
    color: #0057ff;
}

.writeas-tag-sep {
    color: #bbb;
}

.writeas-gallery-group {
    margin: 2em 0;
}

.writeas-gallery-title {
    margin: 0 0 0.6em;
    padding-bottom: 0.25em;
    border-bottom: 1px solid #eee;
    font-size: 1em;
    color: #333;
}

.writeas-masonry {
    column-count: 3;
    column-gap: 0;
}

.writeas-masonry-item {
    display: block;
    break-inside: avoid;
    margin-bottom: 0;
    border-radius: 0;
    overflow: visible;
    border: 0;
    background: transparent;
}

.writeas-masonry-item img {
    display: block;
    width: 100%;
    height: auto;
}

.writeas-masonry-item:hover {
    border-color: #ccc;
}

.writeas-gallery-single {
    margin-top: 0.8em;
}

.writeas-gallery-image {
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1em;
    background: #f8f8f8;
}

.writeas-gallery-image img {
    display: block;
    width: 100%;
    height: auto;
}

.writeas-gallery-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6em;
    font-size: 0.85em;
    color: #666;
    margin-bottom: 0.8em;
}

.writeas-gallery-description {
    margin-bottom: 0.8em;
    font-size: 0.95em;
}

.writeas-exif {
    margin: 1.2em 0;
    padding: 0.8em;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #f8f8f8;
}

.writeas-exif h3 {
    margin: 0 0 0.6em;
    font-size: 0.95em;
}

.writeas-exif-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.6em;
}

.writeas-exif-label {
    display: block;
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #666;
}

.writeas-exif-value {
    display: block;
    font-size: 0.85em;
    color: #111;
}

.writeas-gallery-actions {
    margin: 0.8em 0 0;
}

@media (max-width: 900px) {
    .writeas-masonry {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .writeas-masonry {
        column-count: 1;
    }
}

.writeas-stats {
    margin-top: 0.8em;
}

.writeas-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.8em;
    margin: 1.2em 0 1.5em;
}

.writeas-stat-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 1.2em;
}

.writeas-stat-card {
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 0.6em 0.8em;
    background: #f8f8f8;
}

.writeas-stat-label {
    display: block;
    font-size: 0.75em;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 0.25em;
}

.writeas-stat-value {
    font-size: 1.2em;
    color: #111;
}

.writeas-section {
    margin-top: 2em;
}

.writeas-section-title {
    margin: 0 0 0.6em;
    padding-bottom: 0.25em;
    border-bottom: 1px solid #eee;
    font-size: 1em;
    color: #333;
}

.writeas-chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8em;
    margin: 1.2em 0 1.5em;
}

.writeas-chart-grid--two {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.writeas-chart-card {
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 0.6em;
    background: #fff;
}

@media (max-width: 700px) {
    .writeas-stat-grid {
        grid-template-columns: 1fr;
    }
}

.writeas-search {
    margin-top: 0.8em;
}

.writeas-search-input {
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 0.4em 0.6em;
    background: #f8f8f8;
    margin-bottom: 1.2em;
}

.writeas-search-input input {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    outline: none;
}

.search-section {
    margin: 1.2em 0;
}

.section-title {
    margin: 0 0 0.6em;
    padding-bottom: 0.25em;
    border-bottom: 1px solid #eee;
    font-size: 1em;
    color: #333;
}

.blog-result {
    display: block;
    padding: 0.6em 0;
    border-bottom: 1px solid #eee;
    text-decoration: none;
}

.blog-result h3 {
    margin: 0 0 0.25em;
    font-size: 0.95em;
    color: #111;
}

.blog-meta {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 0.25em;
}

.blog-result p {
    margin: 0;
    color: #444;
    font-size: 0.9em;
}

.thoughts-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8em;
}

.thought-result {
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 0.6em;
    background: #f8f8f8;
    text-decoration: none;
    color: inherit;
}

.thought-meta {
    font-size: 0.8em;
    color: #666;
    display: flex;
    gap: 0.6em;
    margin-bottom: 0.4em;
}

.thought-content {
    color: #444;
    font-size: 0.9em;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.8em;
}

.gallery-result {
    display: block;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
    background: #f8f8f8;
    color: inherit;
}

.gallery-result img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-overlay {
    padding: 0.4em 0.6em;
    font-size: 0.85em;
    color: #444;
    background: #fff;
}

.no-image {
    padding: 1.5em;
    text-align: center;
    color: #666;
}

@media (max-width: 600px) {
    body#post header {
        padding: 0.5em 1em;
    }

    #post article,
    #post pre {
        padding: 0.2em 1em 1em;
        font-size: 1em;
    }
}

html[data-theme="dark"] body {
    background-color: #222;
    color: #fff;
}

html[data-theme="dark"] {
    --text-main: #e6e6e6;
    --primary-blue: #82a6ff;
    --chart-sky: #8ab4ff;
    --chart-sun: #f2c74b;
    --chart-moss: #5dbd90;
    --chart-haze: #1b2333;
    --text-muted: #b0b0b0;
    --border-color: #444;
    --bg-hover: #333;
}

html[data-theme="dark"] a {
    color: #ccc;
}

html[data-theme="dark"] #post article a {
    color: #82a6ff;
}

html[data-theme="dark"] #post article a:visited {
    color: #a6b8ff;
}

html[data-theme="dark"] header h1 a {
    color: #fff;
}

html[data-theme="dark"] header h1 a:hover {
    color: #e6e6e6;
}

html[data-theme="dark"] header nav a,
html[data-theme="dark"] header nav .theme-toggle {
    color: #ccc;
}

html[data-theme="dark"] header p.description {
    color: #b3b3b3;
}

html[data-theme="dark"] hr {
    background: #444;
}

html[data-theme="dark"] #post blockquote {
    border-left-color: #555;
    color: #b0b0b0;
}

html[data-theme="dark"] #post code,
html[data-theme="dark"] #post pre {
    background-color: #2a2a2a;
    border-color: #444;
    color: #e6e6e6;
}

html[data-theme="dark"] #post article .authors,
html[data-theme="dark"] #post article time.dt-published {
    color: #b0b0b0;
}

html[data-theme="dark"] footer nav a {
    color: #999;
}

html[data-theme="dark"] footer nav a.home {
    color: #fff;
}

html[data-theme="dark"] .writeas-footer-title {
    color: #b0b0b0;
}

html[data-theme="dark"] .writeas-footer-links,
html[data-theme="dark"] .writeas-footer-tags {
    color: #b0b0b0;
}

html[data-theme="dark"] .writeas-footer-links a,
html[data-theme="dark"] .writeas-footer-tags a {
    color: #999;
}

html[data-theme="dark"] .writeas-footer-links a:hover,
html[data-theme="dark"] .writeas-footer-tags a:hover {
    color: #ccc;
}

html[data-theme="dark"] .writeas-webring-name {
    color: #ddd;
}

html[data-theme="dark"] .writeas-footer-credits {
    color: #999;
}

html[data-theme="dark"] a.hashtag {
    color: #82a6ff;
}

html[data-theme="dark"] a.hashtag:hover {
    color: #fff;
}

html[data-theme="dark"] .thoughts-meta,
html[data-theme="dark"] .thought-time {
    color: #b0b0b0;
}

html[data-theme="dark"] .thought-item {
    border-bottom-color: #444;
}

html[data-theme="dark"] .thought-time a:hover {
    color: #fff;
}

html[data-theme="dark"] .pagination-link {
    border-color: #444;
    color: #b0b0b0;
}

html[data-theme="dark"] .pagination-link.active {
    background: #2a2a2a;
    color: #fff;
}

html[data-theme="dark"] .writeas-list-item {
    border-bottom-color: #444;
}

html[data-theme="dark"] .writeas-list-date,
html[data-theme="dark"] .writeas-list-tags {
    color: #b0b0b0;
}

html[data-theme="dark"] .writeas-list-title {
    color: #fff;
}

html[data-theme="dark"] .writeas-list-tag {
    color: #82a6ff;
}

html[data-theme="dark"] .writeas-gallery-title {
    border-bottom-color: #444;
    color: #ddd;
}

html[data-theme="dark"] .writeas-masonry-item {
    border-color: transparent;
    background: transparent;
}

html[data-theme="dark"] .writeas-masonry-item:hover {
    border-color: #666;
}

html[data-theme="dark"] .writeas-gallery-image {
    border-color: #444;
    background: #2a2a2a;
}

html[data-theme="dark"] .writeas-gallery-meta {
    color: #b0b0b0;
}

html[data-theme="dark"] .writeas-exif {
    border-color: #444;
    background: #2a2a2a;
}

html[data-theme="dark"] .writeas-exif-label {
    color: #b0b0b0;
}

html[data-theme="dark"] .writeas-exif-value {
    color: #eee;
}

html[data-theme="dark"] .writeas-stat-card {
    border-color: #444;
    background: #2a2a2a;
}

html[data-theme="dark"] .writeas-stat-label {
    color: #b0b0b0;
}

html[data-theme="dark"] .writeas-stat-value {
    color: #fff;
}

html[data-theme="dark"] .writeas-section-title {
    border-bottom-color: #444;
    color: #ddd;
}

html[data-theme="dark"] .writeas-chart-card {
    border-color: #444;
    background: #1f1f1f;
}

html[data-theme="dark"] .writeas-search-input {
    border-color: #444;
    background: #2a2a2a;
}

html[data-theme="dark"] .section-title {
    border-bottom-color: #444;
    color: #ddd;
}

html[data-theme="dark"] .blog-result {
    border-bottom-color: #444;
}

html[data-theme="dark"] .blog-result h3 {
    color: #fff;
}

html[data-theme="dark"] .blog-meta,
html[data-theme="dark"] .blog-result p,
html[data-theme="dark"] .thought-meta,
html[data-theme="dark"] .thought-content,
html[data-theme="dark"] .gallery-overlay,
html[data-theme="dark"] .no-image {
    color: #b0b0b0;
}

html[data-theme="dark"] .thought-result,
html[data-theme="dark"] .gallery-result {
    border-color: #444;
    background: #2a2a2a;
}

html[data-theme="dark"] .gallery-overlay {
    background: #1f1f1f;
}

/* ===== COVER HERO ===== */
.cover-hero {
    position: relative;
    margin: -1em -1.5em 2em;
    overflow: hidden;
    border-radius: 0 0 12px 12px;
}

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

.cover-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4em 1.5em 1.5em;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.95) 0%,
            rgba(0, 0, 0, 0.6) 40%,
            transparent 100%);
}

.cover-hero-overlay #title {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    margin: 0 0 0.5em;
    font-size: 1.8em;
    line-height: 1.2;
}

/* Override the byline card styles inside the hero */
#post article .post-byline.cover-byline {
    background: none !important;
    background-image: none !important;
    border: none !important;
    border-left: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

#post article .cover-byline .author-avatar {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(4px);
}

#post article .cover-byline .authors {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

#post article .cover-byline .dt-published {
    color: rgba(255, 255, 255, 0.85) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.85) !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

@media (max-width: 600px) {
    .cover-hero {
        margin: -1em -1em 1.5em;
        border-radius: 0 0 8px 8px;
    }

    .cover-hero-overlay {
        padding: 2em 1em 1em;
    }

    .cover-hero-overlay #title {
        font-size: 1.3em;
    }
}

/* ===== ENHANCED BLOG POST STYLING ===== */

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #0057ff 0%, #6f9cff 100%);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* ===== SIDEBAR TOC LAYOUT ===== */

/* Default: single column */
.post-with-sidebar {
    max-width: none;
}

.post-with-sidebar #wrapper.wrapper-with-sidebar {
    max-width: 38em;
    margin: 0 auto;
    padding: 0 1.5em;
}

.post-with-sidebar article.norm {
    max-width: none;
}

/* Desktop: Sidebar floats on the right, outside content area */
@media (min-width: 1100px) {
    .post-with-sidebar #wrapper.wrapper-with-sidebar {
        position: relative;
        max-width: 42em;
        padding-right: 0;
    }

    .post-with-sidebar article.norm {
        max-width: none;
    }

    /* Hide mobile TOC on desktop */
    .toc-mobile {
        display: none !important;
    }

    /* Sidebar TOC - Fixed position, vertically centered on right side */
    .toc-sidebar {
        position: fixed;
        right: 2em;
        top: 50%;
        transform: translateY(-50%);
        width: 240px;
        z-index: 100;
        opacity: 0.85;
        transition: opacity 0.3s ease;
    }

    .toc-sidebar:hover {
        opacity: 1;
    }

    .toc-sticky {
        position: relative;
        top: 0;
    }

    .toc-sidebar-header {
        display: flex;
        align-items: center;
        gap: 0.5em;
        padding: 0.6em 1em;
        font-weight: 500;
        font-size: 0.7em;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: #888;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    /* Drag handle styling */
    .toc-drag-handle {
        cursor: grab;
        user-select: none;
    }

    .toc-drag-handle:active {
        cursor: grabbing;
    }

    .toc-drag-icon {
        font-size: 1.2em;
        letter-spacing: -0.15em;
        color: #bbb;
        transition: color 0.2s ease, transform 0.2s ease;
    }

    .toc-drag-handle:hover .toc-drag-icon {
        color: var(--primary-blue, #0057ff);
        transform: scale(1.1);
    }

    html[data-theme="dark"] .toc-drag-icon {
        color: #555;
    }

    html[data-theme="dark"] .toc-drag-handle:hover .toc-drag-icon {
        color: var(--primary-blue, #82a6ff);
    }

    .toc-sidebar-header .toc-icon {
        color: var(--primary-blue, #0057ff);
        font-size: 1em;
        opacity: 0.7;
    }

    /* iOS Liquid Glass Effect */
    .toc-sidebar .toc-nav {
        background: linear-gradient(135deg,
                rgba(255, 255, 255, 0.7) 0%,
                rgba(255, 255, 255, 0.5) 50%,
                rgba(255, 255, 255, 0.7) 100%);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-radius: 16px;
        padding: 0.5em 0;
        max-height: 50vh;
        overflow-y: auto;
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.6),
            inset 0 -1px 0 rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.5);
    }

    /* Liquid glass header */
    .toc-sidebar .toc-sidebar-header {
        background: linear-gradient(135deg,
                rgba(255, 255, 255, 0.8) 0%,
                rgba(255, 255, 255, 0.6) 100%);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-radius: 16px 16px 0 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    }

    /* Dark mode liquid glass */
    html[data-theme="dark"] .toc-sidebar .toc-sidebar-header {
        background: linear-gradient(135deg,
                rgba(40, 44, 52, 0.8) 0%,
                rgba(30, 34, 40, 0.7) 100%);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    html[data-theme="dark"] .toc-sidebar .toc-nav {
        background: linear-gradient(135deg,
                rgba(40, 44, 52, 0.75) 0%,
                rgba(30, 34, 40, 0.6) 50%,
                rgba(40, 44, 52, 0.75) 100%);
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.1),
            inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    }

    .toc-sidebar .toc-nav ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .toc-sidebar .toc-nav li {
        margin: 0;
    }

    .toc-sidebar .toc-nav a {
        display: block;
        padding: 0.5em 1em;
        color: #555;
        text-decoration: none;
        font-size: 0.88em;
        line-height: 1.4;
        position: relative;
        transition: all 0.2s ease;
    }

    .toc-sidebar .toc-nav a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%) scaleY(0);
        width: 3px;
        height: 60%;
        background: var(--primary-blue, #0057ff);
        border-radius: 0 3px 3px 0;
        transition: transform 0.2s ease;
    }

    .toc-sidebar .toc-nav a:hover {
        color: var(--primary-blue, #0057ff);
        padding-left: 1.2em;
    }

    .toc-sidebar .toc-nav a:hover::before {
        transform: translateY(-50%) scaleY(1);
    }

    .toc-sidebar .toc-nav ul ul {
        margin-left: 0;
    }

    .toc-sidebar .toc-nav ul ul a {
        font-size: 0.82em;
        color: #777;
        padding-left: 1.8em;
    }

    .toc-sidebar .toc-nav ul ul a:hover {
        padding-left: 2em;
    }

    /* Dark mode sidebar */
    html[data-theme="dark"] .toc-sidebar-header {
        color: #888;
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    html[data-theme="dark"] .toc-sidebar-header .toc-icon {
        color: var(--primary-blue, #82a6ff);
    }

    html[data-theme="dark"] .toc-sidebar .toc-nav {
        background: rgba(30, 32, 40, 0.95);
        border-color: rgba(255, 255, 255, 0.06);
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    }

    html[data-theme="dark"] .toc-sidebar .toc-nav {
        background: #1e2028;
    }

    html[data-theme="dark"] .toc-sidebar .toc-nav a {
        color: #a0a0a0;
    }

    html[data-theme="dark"] .toc-sidebar .toc-nav a::before {
        background: var(--primary-blue, #82a6ff);
    }

    html[data-theme="dark"] .toc-sidebar .toc-nav a:hover {
        color: var(--primary-blue, #82a6ff);
    }

    html[data-theme="dark"] .toc-sidebar .toc-nav ul ul a {
        color: #777;
    }

    html[data-theme="dark"] .toc-sidebar .toc-nav ul ul a:hover {
        color: var(--primary-blue, #82a6ff);
    }
}

/* Mobile: Hide sidebar, show inline TOC */
@media (max-width: 1099px) {
    .toc-sidebar {
        display: none;
    }

    .toc-mobile {
        display: block;
    }
}

/* ===== BLOG LIST CARD DESIGN ===== */
.blog-list-page {
    padding: 0 !important;
}

/* ===== COMPACT BLOG TABLE ===== */
.blog-table {
    width: 100%;
    border-collapse: collapse;
}

.blog-row td {
    padding: 0.4em 0;
    vertical-align: baseline;
    border-bottom: 1px solid #eee;
}

.blog-row:last-child td {
    border-bottom: none;
}

.blog-date {
    width: 60px;
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8em;
    color: #888;
    white-space: nowrap;
}

.blog-title {
    padding-left: 0.8em !important;
    padding-right: 0.8em !important;
}

.blog-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.blog-title a:hover {
    color: var(--primary-blue, #0057ff);
}

.blog-tags {
    text-align: right;
    font-size: 0.75em;
    color: var(--primary-blue, #0057ff);
    opacity: 0.7;
    white-space: nowrap;
}

.blog-tags span {
    margin-left: 0.4em;
}

.blog-empty {
    color: #888;
    font-style: italic;
}

/* Dark mode */
html[data-theme="dark"] .blog-row td {
    border-bottom-color: #333;
}

html[data-theme="dark"] .blog-date {
    color: #666;
}

html[data-theme="dark"] .blog-title a:hover {
    color: var(--primary-blue, #82a6ff);
}

html[data-theme="dark"] .blog-tags {
    color: var(--primary-blue, #82a6ff);
}

/* Mobile */
@media (max-width: 600px) {
    .blog-list-page {
        padding: 0 1em !important;
    }

    .blog-table,
    .blog-table tbody,
    .blog-table tr,
    .blog-table td {
        display: block;
        width: 100%;
    }

    .blog-row {
        padding: 0.6em 0;
        border-bottom: 1px solid #eee;
    }

    .blog-row td {
        border-bottom: none;
        padding: 0;
    }

    .blog-date {
        width: auto;
        font-size: 0.72em;
        margin-bottom: 2px;
    }

    .blog-title {
        padding-left: 0 !important;
        padding-right: 0 !important;
        font-size: 1rem;
    }

    .blog-tags {
        display: none;
    }
}

@media (max-width: 600px) {
    html[data-theme="dark"] .blog-row {
        border-bottom-color: #333;
    }
}

/* ===== TABLE OF CONTENTS ===== */
.toc-container {
    margin: 1.5em 0 2em;
    background: linear-gradient(135deg, #f8f9fc 0%, #f1f4f9 100%);
    border: 1px solid #e0e6f0;
    border-radius: 12px;
    overflow: hidden;
}

.toc-header {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.9em 1.2em;
    cursor: pointer;
    background: linear-gradient(135deg, #eef1f8 0%, #e4e9f4 100%);
    border-bottom: 1px solid #dce3f0;
    list-style: none;
    user-select: none;
    transition: background 0.2s ease;
}

.toc-header:hover {
    background: linear-gradient(135deg, #e4e9f4 0%, #dce3f0 100%);
}

.toc-header::-webkit-details-marker {
    display: none;
}

.toc-icon {
    font-size: 1em;
    color: #0057ff;
}

.toc-title {
    font-weight: 600;
    font-size: 0.9em;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex: 1;
}

.toc-toggle {
    font-size: 0.7em;
    color: #666;
    transition: transform 0.3s ease;
}

.toc-container[open] .toc-toggle {
    transform: rotate(180deg);
}

.toc-nav {
    padding: 1em 1.2em;
}

/* TOC List Styling */
.toc-nav nav>ul,
.toc-nav>ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-nav li {
    margin: 0;
    padding: 0;
}

.toc-nav>nav>ul>li,
.toc-nav>ul>li {
    margin-bottom: 0.4em;
}

.toc-nav a {
    display: block;
    padding: 0.4em 0.6em;
    color: #444;
    text-decoration: none;
    font-size: 0.92em;
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.toc-nav a:hover {
    background: rgba(0, 87, 255, 0.08);
    border-left-color: #0057ff;
    color: #0057ff;
}

/* Nested levels with indentation */
.toc-nav ul ul {
    margin-left: 1em;
    padding-left: 0.5em;
    border-left: 1px dashed #d0d8e8;
}

.toc-nav ul ul a {
    font-size: 0.88em;
    color: #555;
}

.toc-nav ul ul ul a {
    font-size: 0.84em;
    color: #666;
}

/* Dark Mode TOC */
html[data-theme="dark"] .toc-container {
    background: linear-gradient(135deg, #1f2128 0%, #181a20 100%);
    border-color: #2a2f3a;
}

html[data-theme="dark"] .toc-header {
    background: linear-gradient(135deg, #252830 0%, #1f2228 100%);
    border-bottom-color: #2a2f3a;
}

html[data-theme="dark"] .toc-header:hover {
    background: linear-gradient(135deg, #2a2f38 0%, #252830 100%);
}

html[data-theme="dark"] .toc-icon {
    color: #82a6ff;
}

html[data-theme="dark"] .toc-title {
    color: #d0d0d0;
}

html[data-theme="dark"] .toc-toggle {
    color: #888;
}

html[data-theme="dark"] .toc-nav a {
    color: #b0b0b0;
}

html[data-theme="dark"] .toc-nav a:hover {
    background: rgba(130, 166, 255, 0.1);
    border-left-color: #82a6ff;
    color: #82a6ff;
}

html[data-theme="dark"] .toc-nav ul ul {
    border-left-color: #3a4050;
}

html[data-theme="dark"] .toc-nav ul ul a {
    color: #999;
}

html[data-theme="dark"] .toc-nav ul ul ul a {
    color: #888;
}

/* Mobile TOC - Starts collapsed */
@media (max-width: 600px) {
    .toc-container {
        margin: 1em 0 1.5em;
    }

    .toc-header {
        padding: 0.8em 1em;
    }

    .toc-nav {
        padding: 0.8em 1em;
    }

    .toc-nav a {
        padding: 0.5em;
        font-size: 0.9em;
    }
}

/* Enhanced Post Title */
#post article h2#title {
    font-size: 2.2em;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.6em;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #111 0%, #444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

html[data-theme="dark"] #post article h2#title {
    background: linear-gradient(135deg, #fff 0%, #b0b0b0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Author & Date Byline Card */
#post article .post-byline {
    display: flex;
    align-items: center;
    gap: 1em;
    padding: 1em 1.2em;
    margin-bottom: 2em;
    background: linear-gradient(135deg, #f8f9fc 0%, #f1f3f8 100%);
    border-radius: 12px;
    border-left: 4px solid #0057ff;
}

html[data-theme="dark"] #post article .post-byline {
    background: linear-gradient(135deg, #2a2d35 0%, #1f2128 100%);
    border-left-color: #82a6ff;
}

#post article .post-byline .author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0057ff 0%, #4b44ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2em;
    flex-shrink: 0;
}

#post article .post-byline .byline-info {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
}

#post article .authors {
    display: inline;
    font-weight: 600;
    color: #333;
    font-size: 1em;
    margin: 0;
}

html[data-theme="dark"] #post article .authors {
    color: #e6e6e6;
}

#post article time.dt-published {
    display: inline;
    color: #666;
    font-size: 0.85em;
    margin: 0;
}

/* Drop Cap for First Paragraph - Only on single blog posts */
body#post article.norm .post-byline+p::first-letter {
    float: left;
    font-size: 4em;
    line-height: 0.8;
    margin: 0.05em 0.12em 0 0;
    font-weight: 700;
    color: #0057ff;
    font-family: Georgia, "Times New Roman", serif;
}

html[data-theme="dark"] body#post article.norm .post-byline+p::first-letter {
    color: #82a6ff;
}

/* Enhanced Blockquotes */
#post blockquote {
    position: relative;
    border-left: 4px solid #0057ff;
    padding: 1em 1.5em;
    margin: 1.5em 0;
    background: linear-gradient(135deg, #f8f9fc 0%, #f1f3f8 100%);
    border-radius: 0 12px 12px 0;
    font-style: italic;
}

#post blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 12px;
    font-size: 4em;
    color: #0057ff;
    opacity: 0.15;
    font-family: Georgia, serif;
    line-height: 1;
}

html[data-theme="dark"] #post blockquote {
    background: linear-gradient(135deg, #2a2d35 0%, #1f2128 100%);
    border-left-color: #82a6ff;
}

html[data-theme="dark"] #post blockquote::before {
    color: #82a6ff;
}

/* Enhanced Code Blocks */
#post pre {
    position: relative;
    background: linear-gradient(135deg, #1a1e2e 0%, #0f1219 100%);
    border: 1px solid #2a3040;
    border-radius: 12px;
    padding: 1.2em 1.5em;
    margin: 1.5em 0;
    overflow-x: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

#post pre::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 14px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5f56;
    box-shadow: 20px 0 0 #ffbd2e, 40px 0 0 #27ca40;
}

#post pre code {
    display: block;
    margin-top: 1em;
    color: #e6e8f0;
}

/* Enhanced Inline Code */
#post code {
    background: linear-gradient(135deg, #f0f3f8 0%, #e8ecf4 100%);
    border: 1px solid #d0d8e8;
    padding: 0.2em 0.5em;
    border-radius: 6px;
    font-size: 0.88em;
    color: #c7254e;
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
}

html[data-theme="dark"] #post code {
    background: linear-gradient(135deg, #2a2d35 0%, #1f2128 100%);
    border-color: #444;
    color: #e6a0b8;
}

/* Enhanced Images */
#post article img {
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#post article img:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

/* Enhanced Links - Simple underline on hover */
body#post article.norm .post-byline~p a,
body#post article.norm .post-byline~ul a,
body#post article.norm .post-byline~ol a,
body#post article.norm .post-byline~blockquote a {
    color: #0057ff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

body#post article.norm .post-byline~p a:hover,
body#post article.norm .post-byline~ul a:hover,
body#post article.norm .post-byline~ol a:hover,
body#post article.norm .post-byline~blockquote a:hover {
    border-bottom-color: #0057ff;
}

html[data-theme="dark"] body#post article.norm .post-byline~p a,
html[data-theme="dark"] body#post article.norm .post-byline~ul a,
html[data-theme="dark"] body#post article.norm .post-byline~ol a,
html[data-theme="dark"] body#post article.norm .post-byline~blockquote a {
    color: #82a6ff;
}

html[data-theme="dark"] body#post article.norm .post-byline~p a:hover,
html[data-theme="dark"] body#post article.norm .post-byline~ul a:hover,
html[data-theme="dark"] body#post article.norm .post-byline~ol a:hover,
html[data-theme="dark"] body#post article.norm .post-byline~blockquote a:hover {
    border-bottom-color: #82a6ff;
}

/* Enhanced Headings within Post - Distinct Visual Hierarchy */

/* H2 - Major Section Headers */
#post article h2:not(#title) {
    position: relative;
    font-size: 1.6em;
    font-weight: 700;
    margin: 2.5em 0 1em;
    padding-bottom: 0.5em;
    color: #1a1a2e;
    border-bottom: 2px solid #0057ff;
    letter-spacing: -0.01em;
}

#post article h2:not(#title)::before {
    content: '§';
    position: absolute;
    left: -1.3em;
    color: #0057ff;
    opacity: 0.4;
    font-weight: 400;
    transition: opacity 0.2s ease;
}

#post article h2:not(#title):hover::before {
    opacity: 1;
}

html[data-theme="dark"] #post article h2:not(#title) {
    color: #e6e6e6;
    border-bottom-color: #82a6ff;
}

html[data-theme="dark"] #post article h2:not(#title)::before {
    color: #82a6ff;
}

/* H3 - Sub-section Headers */
#post article h3 {
    position: relative;
    font-size: 1.35em;
    font-weight: 600;
    margin: 2em 0 0.8em;
    padding-left: 1em;
    color: #2a2a4e;
    border-left: 4px solid #0057ff;
}

#post article h3::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 1em;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, #0057ff 0%, transparent 100%);
}

html[data-theme="dark"] #post article h3 {
    color: #d0d0d0;
    border-left-color: #82a6ff;
}

html[data-theme="dark"] #post article h3::after {
    background: linear-gradient(90deg, #82a6ff 0%, transparent 100%);
}

/* H4 - Minor Section Headers */
#post article h4 {
    position: relative;
    font-size: 1.15em;
    font-weight: 600;
    margin: 1.8em 0 0.6em;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.95em;
}

#post article h4::before {
    content: '—';
    margin-right: 0.5em;
    color: #0057ff;
    font-weight: 700;
}

html[data-theme="dark"] #post article h4 {
    color: #b8b8b8;
}

html[data-theme="dark"] #post article h4::before {
    color: #82a6ff;
}

/* H5 - Small Headers */
#post article h5 {
    font-size: 1em;
    font-weight: 600;
    margin: 1.5em 0 0.5em;
    color: #555;
    font-style: italic;
}

#post article h5::before {
    content: '◆';
    margin-right: 0.5em;
    color: #0057ff;
    font-size: 0.7em;
}

html[data-theme="dark"] #post article h5 {
    color: #a0a0a0;
}

html[data-theme="dark"] #post article h5::before {
    color: #82a6ff;
}

/* H6 - Smallest Headers */
#post article h6 {
    font-size: 0.9em;
    font-weight: 600;
    margin: 1.2em 0 0.4em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

#post article h6::before {
    content: '›';
    margin-right: 0.4em;
    color: #0057ff;
    font-size: 1.1em;
}

html[data-theme="dark"] #post article h6 {
    color: #888;
}

html[data-theme="dark"] #post article h6::before {
    color: #82a6ff;
}

/* Mobile adjustments for headings */
@media (max-width: 600px) {

    #post article h2:not(#title)::before,
    #post article h3::before {
        display: none;
    }

    #post article h2:not(#title) {
        font-size: 1.4em;
        padding-left: 0;
    }

    #post article h3 {
        font-size: 1.2em;
        padding-left: 0.8em;
    }

    #post article h4::before,
    #post article h5::before,
    #post article h6::before {
        display: none;
    }
}

/* Enhanced Post Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6em;
    margin-top: 2em;
    padding-top: 1.5em;
    border-top: 1px solid #eee;
}

html[data-theme="dark"] .post-tags {
    border-top-color: #444;
}

a.hashtag {
    display: inline-flex;
    align-items: center;
    gap: 0.2em;
    padding: 0.4em 0.9em;
    background: linear-gradient(135deg, #f0f3f8 0%, #e8ecf4 100%);
    border: 1px solid #d8e0f0;
    border-radius: 20px;
    font-size: 0.85em;
    color: #0057ff;
    text-decoration: none;
    transition: all 0.25s ease;
    font-weight: 500;
}

a.hashtag:hover {
    background: linear-gradient(135deg, #0057ff 0%, #4b44ff 100%);
    border-color: transparent;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 87, 255, 0.3);
}

a.hashtag:hover span {
    color: white !important;
}

html[data-theme="dark"] a.hashtag {
    background: linear-gradient(135deg, #2a2d35 0%, #1f2128 100%);
    border-color: #444;
    color: #82a6ff;
}

html[data-theme="dark"] a.hashtag:hover {
    background: linear-gradient(135deg, #82a6ff 0%, #a6b8ff 100%);
    color: #111 !important;
}

html[data-theme="dark"] a.hashtag:hover span {
    color: #111 !important;
}

/* Horizontal Rule Enhancement */
#post hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ccc, transparent);
    margin: 2.5em auto;
    max-width: 200px;
}

html[data-theme="dark"] #post hr {
    background: linear-gradient(90deg, transparent, #444, transparent);
}

/* Lists Enhancement */
#post article ul,
#post article ol {
    padding-left: 1.5em;
}

#post article li {
    margin: 0.5em 0;
    line-height: 1.7;
}

#post article ul li::marker {
    color: #0057ff;
}

#post article ol li::marker {
    color: #0057ff;
    font-weight: 600;
}

html[data-theme="dark"] #post article ul li::marker,
html[data-theme="dark"] #post article ol li::marker {
    color: #82a6ff;
}

/* Article Footer Decoration */
#post article::after {
    content: '◆ ◆ ◆';
    display: block;
    text-align: center;
    margin-top: 3em;
    color: #ccc;
    letter-spacing: 1em;
    font-size: 0.6em;
}

html[data-theme="dark"] #post article::after {
    color: #444;
}

/* Mobile Responsiveness for Enhanced Styles */
@media (max-width: 600px) {
    #post article h2#title {
        font-size: 1.6em;
    }

    #post article .post-byline {
        padding: 0.8em 1em;
        gap: 0.8em;
    }

    #post article .post-byline .author-avatar {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }

    #post article.norm>p:first-of-type::first-letter {
        font-size: 3em;
    }

    #post blockquote {
        padding: 0.8em 1em;
        margin: 1em 0;
    }

    #post blockquote::before {
        font-size: 3em;
        top: -5px;
        left: 8px;
    }

    #post pre {
        padding: 1em;
        border-radius: 8px;
    }

    #post article h2:not(#title)::before,
    #post article h3::before {
        display: none;
    }

    .post-with-sidebar #wrapper.wrapper-with-sidebar {
        padding: 0;
    }
}

/* ===== THOUGHT MODAL - GLASSMORPHISM ===== */

/* Make thought entries clickable */
.micro-item {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.micro-item:hover {
    transform: translateX(4px);
}

/* Modal Overlay */
.thought-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.thought-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container - Liquid Glass */
.thought-modal {
    position: relative;
    width: 90%;
    max-width: 550px;
    max-height: 80vh;
    overflow-y: auto;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.85) 0%,
            rgba(255, 255, 255, 0.65) 50%,
            rgba(255, 255, 255, 0.85) 100%);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-radius: 20px;
    padding: 2em;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.2),
        0 8px 24px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.thought-modal-overlay.active .thought-modal {
    transform: scale(1) translateY(0);
}

/* Close Button */
.thought-modal-close {
    position: absolute;
    top: 0.8em;
    right: 0.8em;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    font-size: 1.4em;
    line-height: 1;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
}

.thought-modal-close:hover {
    background: rgba(0, 0, 0, 0.15);
    color: #333;
    transform: scale(1.1);
}

/* Modal Content */
.thought-modal-date {
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8em;
    color: #888;
    margin-bottom: 1em;
    padding-bottom: 0.8em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.thought-modal-body {
    font-size: 1.05em;
    line-height: 1.7;
    color: #333;
    margin-bottom: 1.2em;
}

.thought-modal-body p {
    margin: 0 0 0.8em;
}

.thought-modal-body p:last-child {
    margin-bottom: 0;
}

.thought-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
    margin-bottom: 1.2em;
}

.thought-modal-tag {
    font-size: 0.8em;
    color: var(--primary-blue, #0057ff);
    background: rgba(0, 87, 255, 0.1);
    padding: 0.3em 0.7em;
    border-radius: 12px;
}

.thought-modal-link {
    display: inline-block;
    font-size: 0.9em;
    color: var(--primary-blue, #0057ff);
    text-decoration: none;
    padding: 0.6em 1.2em;
    background: rgba(0, 87, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.thought-modal-link:hover {
    background: var(--primary-blue, #0057ff);
    color: #fff;
    transform: translateX(4px);
}

/* Dark Mode Modal */
html[data-theme="dark"] .thought-modal-overlay {
    background: rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .thought-modal {
    background: linear-gradient(135deg,
            rgba(40, 44, 52, 0.9) 0%,
            rgba(30, 34, 40, 0.75) 50%,
            rgba(40, 44, 52, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.5),
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .thought-modal-close {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

html[data-theme="dark"] .thought-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

html[data-theme="dark"] .thought-modal-date {
    color: #888;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .thought-modal-body {
    color: #d0d0d0;
}

html[data-theme="dark"] .thought-modal-tag {
    color: var(--primary-blue, #82a6ff);
    background: rgba(130, 166, 255, 0.15);
}

html[data-theme="dark"] .thought-modal-link {
    color: var(--primary-blue, #82a6ff);
    background: rgba(130, 166, 255, 0.15);
}

html[data-theme="dark"] .thought-modal-link:hover {
    background: var(--primary-blue, #82a6ff);
    color: #111;
}

/* Mobile Modal */
@media (max-width: 600px) {
    .thought-modal {
        width: 95%;
        padding: 1.5em;
        max-height: 85vh;
    }

    .thought-modal-body {
        font-size: 1em;
    }
}

/* ===== RETRO NAVBAR ===== */
.retro-header {
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    border-bottom: 2px solid var(--border-color);
    position: relative;
    z-index: 1000;
}

.retro-navbar {
    max-width: 900px;
    margin: 0 auto;
    padding: 0.5em 1em;
    font-family: "Courier New", Courier, monospace;
}

/* Top Row: Brand + Marquee + Toggle */
.retro-top {
    display: flex;
    align-items: center;
    gap: 1em;
    margin-bottom: 0.5em;
}

.retro-brand h1 {
    margin: 0;
    font-size: 1.4em;
    line-height: 1;
    white-space: nowrap;
}

.retro-brand a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -1px;
}

/* Marquee */
.retro-marquee {
    flex: 1;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    height: 24px;
    overflow: hidden;
    position: relative;
    border-radius: 4px;
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85em;
}

.marquee-track {
    display: flex;
    white-space: nowrap;
    animation: marquee 20s linear infinite;
    padding-left: 100%;
    /* Start from outside */
}

/* Ensure animation flows */
.marquee-track:hover {
    animation-play-state: paused;
}

.marquee-content {
    padding-right: 2em;
    display: inline-block;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

.cursor-blink {
    display: inline-block;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Mobile Toggle */
.retro-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    cursor: pointer;
    font-size: 1.2em;
    color: var(--text-main);
    border-radius: 4px;
}

.retro-toggle:hover {
    background: var(--bg-hover);
}

/* Links Row */
.retro-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    align-items: center;
}

.retro-btn {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.1s;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.retro-btn:hover {
    background: var(--bg-hover);
    color: var(--primary-blue);
    border-color: var(--primary-blue);
    text-decoration: none;
    box-shadow: 2px 2px 0 var(--border-color);
    transform: translate(-1px, -1px);
}

.retro-btn:active {
    transform: translate(1px, 1px);
    box-shadow: none;
}

.retro-btn.active {
    background: var(--primary-blue);
    color: white !important;
    border-color: var(--primary-blue-dark);
}

.icon-btn {
    padding: 4px 8px;
}

/* Mobile Responsive */
@media (max-width: 650px) {
    .retro-navbar {
        padding: 0.5em;
    }

    .retro-top {
        margin-bottom: 0.5em;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .retro-brand {
        order: 1;
    }

    .retro-toggle {
        display: block;
        order: 2;
    }

    .retro-marquee {
        flex: none;
        width: 100%;
        order: 3;
        margin-top: 0.5em;
    }

    .retro-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-top: 1em;
        border-top: 1px dashed var(--border-color);
        padding-top: 1em;
    }

    .retro-links.open {
        display: flex;
    }

    .retro-btn {
        text-align: center;
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
}