body {
    font-size: 11px;
    line-height: 1.4;
    margin: 0;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #fafafa; /* Slightly off-white to match index.html */
    color: #333;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header a {
    color: inherit;
    text-decoration: none;
}

nav {
    margin: 20px 0;
}

nav a {
    color: #333;
    text-decoration: none;
    padding: 5px 10px;
}

nav a:hover {
    text-decoration: underline;
}

section {
    margin-bottom: 40px;
}

section h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #333;
}

article {
    margin-bottom: 30px;
}

article h5 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
    font-size: 1em;
}

article p {
    margin-bottom: 15px;
    text-align: justify;
}

article a {
    color: inherit;
    text-decoration: none;
}

article a:hover {
    text-decoration: underline;
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    border-top: 1px solid #ddd;
    font-size: 0.8em;
}

#socials {
    margin-bottom: 40px;
}

#socials p {
    text-align: left;
}

#socials a {
    color: #333;
    text-decoration: none;
    padding: 0;
    padding-right: 20px;
}

#socials a:hover {
    text-decoration: underline;
}

.profile-image {
    float: left;
    width: 127.5px;
    height: 127.5px;
    margin: 0 20px 10px 0;
    border-radius: 0;
    object-fit: cover;
}

#bio {
    overflow: hidden;
}

#bio p {
    margin-top: 0;
}

.related-articles {
    margin-top: 1.5em;
    padding-top: 0.8em;
    border-top: 1px solid #ddd;
}

.related-articles h3 {
    margin-bottom: 15px;
}

.related-articles h4 {
    margin: 15px 0 10px 0;
}

.related-articles ul {
    list-style: none;
    padding-left: 0;
}

.related-articles li {
    margin-bottom: 8px;
}

.publication-date {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
}

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

.social-links li {
    display: inline-block;
    margin-right: 20px;
}

.social-links a {
    color: #333;
    text-decoration: none;
}

.social-links a:hover {
    text-decoration: underline;
}

#socials p {
    margin-bottom: 15px;
}

/* Reduce heading sizes proportionally */
h1 { font-size: 1.8em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.3em; }
h4 { font-size: 1.1em; }
h5 { font-size: 1em; }

/* Reduce spacing between elements */
p, ul, ol {
    margin-bottom: 0.8em;
}

/* Make essay list more compact */
#essay-list article {
    margin-bottom: 0.5em;
}

/* Adjust related articles section */
.related-articles {
    margin-top: 1.5em;
    padding-top: 0.8em;
}

.essay-description {
    font-style: italic;
    font-size: 0.9em;
    color: #666;
    margin-top: 0.3em;
}

#essay-list article {
    margin-bottom: 1.5em;
}


/* Directory Categories */
.directory-categories {
    margin-top: 20px;
}

.category {
    margin-bottom: 30px;
}

.category h4 {
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.category h4 a {
    color: #333;
    text-decoration: none;
}

.category h4 a:hover {
    text-decoration: underline;
}

.category-essays ul {
    list-style-type: none;
    padding-left: 20px;
}

.category-essays li {
    margin-bottom: 8px;
}

.category-essays a {
    color: #333;
    text-decoration: none;
}

.category-essays a:hover {
    text-decoration: underline;
}

/* Code block styling */
pre {
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    padding: 16px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1em 0;
}

pre code {
    font-family: Menlo, Monaco, 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.4;
    color: #555;
    white-space: pre;
}

.essay-list {
    font-size: 0.85em;
    margin: 0;
    padding: 0;
    list-style: none;
}

.about-section {
    font-size: 0.85em;
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid #eee;
}

/* Desktop-only elements */
.desktop-only {
    display: none;
}

/* Search container */
.search-container {
    margin-bottom: 30px;
    width: 100%;
}

.search-container input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: inherit;
}

.search-container input:focus {
    outline: none;
    border-color: #666;
}

/* Desktop layout with sidebar */
.desktop-layout {
    display: block;
}

.main-content {
    width: 100%;
}

.sidebar {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 30px;
    border: 1px solid #eee;
    height: fit-content;
    align-self: flex-start;
}

.sidebar h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #333;
}

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

.featured-essays li {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.featured-essays li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.featured-essays a {
    color: #333;
    text-decoration: none;
    font-size: 0.9em;
    line-height: 1.3;
}

.featured-essays a:hover {
    text-decoration: underline;
}

/* Desktop styles */
@media (min-width: 768px) {
    .desktop-only {
        display: block;
    }
    
    .desktop-layout {
        display: flex;
        gap: 30px;
        width: 100%;
    }
    
    .main-content {
        flex: 1;
        min-width: 0; /* Allows flex item to shrink below content size */
    }
    
    .sidebar {
        width: 200px;
        flex-shrink: 0;
        order: 2; /* Move sidebar to the right */
    }
    
    /* More space between essays on desktop */
    #essay-list article {
        margin-bottom: 2.5em;
    }
    
    /* Make search bar wider to utilize available space */
    .search-container input {
        max-width: 350px;
    }
}

.audio-preview {
    font-size: 0.7em;
    color: #ccc;
    cursor: pointer;
    margin-left: 10px;
    font-weight: normal;
    text-decoration: underline;
    vertical-align: middle;
    transition: color 0.2s;
}

.audio-preview:hover {
    color: #888;
}
  