/* Tufte CSS Blog Enhancements */

/* Adjust social icons for Tufte style */
.social {
    margin-top: 2rem;
    text-align: left;
}

.social a {
    text-decoration: none;
    margin-right: 1rem;
    display: inline-block;
}

.icon {
    font-size: 1.5rem;
    color: #111;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

body[data-theme="dark"] .icon {
    color: #e4e4e4;
}

.icon:hover {
    opacity: 1;
}

/* Override some Tufte defaults for better blog styling */
body {
    font-family: et-book, Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
}

/* Light theme (default) */
body {
    background-color: #fffff8;
    color: #111;
}

/* Dark theme overrides */
body[data-theme="dark"] {
    background-color: #1a1a1a;
    color: #e4e4e4;
}

/* Enhance typography for blog posts */
p {
    text-align: left;
}

/* Style the post list - Light theme */
article section p a {
    text-decoration: none;
    color: #111;
    border-bottom: 1px solid #ccc;
    padding-bottom: 0.1em;
}

article section p a:hover {
    border-bottom-color: #111;
}

/* Style the post list - Dark theme */
body[data-theme="dark"] article section p a {
    color: #e4e4e4;
    border-bottom: 1px solid #555;
}

body[data-theme="dark"] article section p a:hover {
    border-bottom-color: #e4e4e4;
}

/* Homepage specific adjustments */
article h1 {
    font-weight: 400;
    margin-top: 4rem;
    margin-bottom: 1.5rem;
}

article p.subtitle {
    font-style: italic;
    margin-top: 1rem;
    margin-bottom: 3rem;
    font-size: 1.1rem;
    color: #555;
}

body[data-theme="dark"] article p.subtitle {
    color: #aaa;
}

/* Code highlighting adjustments */
code, pre {
    font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

pre code {
    padding: 0;
}

/* Navigation header styles for Tufte layout */
.navbar {
    background: transparent;
    border-bottom: 1px solid #ddd;
    margin-bottom: 2rem;
}

body[data-theme="dark"] .navbar {
    border-bottom: 1px solid #555;
}

.menu .menu-link {
    color: #111;
    opacity: 0.7;
}

.menu .menu-link:hover {
    opacity: 1;
}

.menu .menu-link.active {
    opacity: 1;
    font-weight: 600;
}

body[data-theme="dark"] .menu .menu-link {
    color: #e4e4e4;
}

/* Mode toggle icon - Header */
a#mode .mode-moon line,
a#mode .mode-moon circle {
    stroke: #111 !important;
    fill: #111 !important;
}

body[data-theme="dark"] a#mode .mode-sunny line,
body[data-theme="dark"] a#mode .mode-sunny circle {
    stroke: #e4e4e4 !important;
    fill: none !important;
}

body[data-theme="dark"] a#mode .mode-moon {
    display: none !important;
}

body[data-theme="dark"] a#mode .mode-sunny {
    display: block !important;
}

a#mode .mode-sunny {
    display: none;
}

a#mode .mode-moon {
    display: block;
}

/* Mode toggle icon - Footer */
a#mode-footer .mode-moon line,
a#mode-footer .mode-moon circle {
    stroke: #555 !important;
    fill: #555 !important;
}

body[data-theme="dark"] a#mode-footer .mode-sunny line,
body[data-theme="dark"] a#mode-footer .mode-sunny circle {
    stroke: #aaa !important;
    fill: none !important;
}

body[data-theme="dark"] a#mode-footer .mode-moon {
    display: none !important;
}

body[data-theme="dark"] a#mode-footer .mode-sunny {
    display: block !important;
}

a#mode-footer .mode-sunny {
    display: none;
}

a#mode-footer .mode-moon {
    display: block;
}

/* Logo icon */
.logo svg {
    opacity: 0.7;
}

.logo:hover svg {
    opacity: 1;
}

/* Footer styling */
.footer {
    margin-top: 3rem;
    padding: 1rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer_item {
    color: #555;
    font-size: 0.9rem;
}

body[data-theme="dark"] .footer_item {
    color: #aaa;
}

.footer-icon {
    opacity: 0.7;
    transition: opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.footer-icon:hover {
    opacity: 1;
}

.footer-icon svg {
    color: #555;
}

body[data-theme="dark"] .footer-icon svg {
    color: #aaa;
}

/* Mobile responsiveness */
@media (max-width: 760px) {
    .social {
        margin-top: 1rem;
    }
    
    .icon {
        font-size: 1.2rem;
        margin-right: 0.5rem;
    }
    
    .navbar {
        background-color: #fffff8;
    }
    
    body[data-theme="dark"] .navbar {
        background-color: #1a1a1a;
    }
    
    .footer {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        gap: 0.8rem;
    }
}