{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* UT Austin brand colors: https://brand.utexas.edu/identity/color/ */
:root {
    --primary-color: #bf5700;   /* Burnt Orange */
    --primary-hover: #994400;   /* Darker burnt orange (hover) */
    --text-color: #333f48;     /* UT Charcoal */
    --text-secondary: #666;
    --background: #fff;
    --background-secondary: #f5f5f5;
    --border-color: #ddd;
    --nav-bracket-color: #999;
}

body,
input,
button,
textarea,
select {
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background);
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top navigation bar: brand left, search center, nav right */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: nowrap;
}

.top-bar-brand {
    flex-shrink: 0;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.site-title a {
    color: var(--primary-color);
    text-decoration: none;
}

.site-title a:hover {
    color: var(--primary-hover);
}

.top-bar-search {
    flex: 1;
    min-width: 0;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.search-form {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 320px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    background: var(--background);
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-form button {
    padding: 8px 16px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--primary-color);
    color: var(--background);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.search-form button:hover {
    background: var(--primary-hover);
}

.top-bar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.top-bar-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 6px 10px;
}

.top-bar-nav a:hover,
.top-bar-nav a.nav-tab--active {
    color: var(--primary-color);
}

.top-bar-nav .nav-sep {
    color: var(--border-color);
    font-size: 0.8rem;
    user-select: none;
}

.stats {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 16px 0 0 0;
}

/* Layout: main + sidebar */
.layout-with-sidebar {
    display: flex;
    gap: 40px;
    flex: 1;
    padding: 32px 0 48px;
    align-items: start;
}

.main-content {
    flex: 1;
    min-width: 0;
}

/* Post list (home): single column, cards with hr */
.posts-list {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
}

.posts-list .post-card {
    list-style: none;
    padding-bottom: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border-color);
    background: none;
    box-shadow: none;
    border-radius: 0;
    border: none;
    transition: none;
}

.posts-list .post-card:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.posts-list .post-card:hover {
    transform: none;
    box-shadow: none;
}

.post-card-figure {
    margin: 0 0 16px 0;
    border-radius: 0;
    overflow: hidden;
    background: var(--background-secondary);
}

.post-card-figure a {
    display: block;
    line-height: 0;
}

.post-card-figure img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    display: block;
}

.post-card-figure--pdf .post-pdf-render-host {
    width: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--background-secondary);
}

.post-card-figure--pdf canvas {
    width: 100% !important;
    display: block;
}

.post-card-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.post-card-meta .post-date::after {
    content: '';
}

.post-card-tags {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.post-card-tags a {
    color: var(--text-secondary);
    text-decoration: none;
}

.post-card-tags a:hover {
    color: var(--primary-color);
}

.post-card h2 {
    font-size: 1.75rem;
    margin-bottom: 12px;
    line-height: 1.3;
    font-weight: 700;
}

.post-card h2 a {
    color: var(--text-color);
    text-decoration: none;
}

.post-card h2 a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-color);
    margin-bottom: 0;
    line-height: 1.65;
    font-size: 1rem;
}

.read-more {
    display: inline-block;
    margin-top: 12px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* Sidebar */
.sidebar {
    width: 280px;
    flex-shrink: 0;
}

.sidebar-widget {
    margin-bottom: 32px;
}

.sidebar-widget h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.sidebar-widget ul {
    list-style: none;
}

.sidebar-widget li {
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.sidebar-widget a {
    color: var(--text-color);
    text-decoration: none;
}

.sidebar-widget a:hover {
    color: var(--primary-color);
}

.sidebar-post-item {
    display: block;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-post-item:last-child {
    border-bottom: none;
}

.sidebar-post-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 2px;
}

.older-posts {
    margin-top: 24px;
    text-align: center;
}

.older-posts a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
}

.older-posts a:hover {
    text-decoration: underline;
}

/* Loading / error */
.posts-loading,
.posts-error {
    padding: 24px 0;
    color: var(--text-secondary);
}

.posts-error {
    color: #a00;
}

/* Static page content (About, etc.) */
.page-content {
    background: var(--background);
    padding: 0;
    max-width: 720px;
    margin: 0 auto;
}

.about-section {
    margin-bottom: 36px;
}

.about-section:last-child {
    margin-bottom: 0;
}

.about-section h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--text-color);
    font-weight: 700;
}

.about-section p,
.about-section ul {
    margin-bottom: 16px;
    line-height: 1.7;
    font-size: 1rem;
}

.about-section a {
    color: var(--primary-color);
    text-decoration: none;
}

.about-section a:hover {
    text-decoration: underline;
}

.about-section code {
    background: var(--background-secondary);
    padding: 2px 6px;
    font-size: 0.9em;
    font-family: Georgia, 'Times New Roman', serif;
}

/* Full post content */
.post-content {
    background: var(--background);
    padding: 0 0 40px;
    margin-top: 0;
}

#post-body {
    font-size: 1.05rem;
}

#post-body h1 {
    font-size: 2.25rem;
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: 700;
}

#post-body h2 {
    font-size: 1.75rem;
    margin-top: 32px;
    margin-bottom: 16px;
    line-height: 1.3;
    font-weight: 700;
}

#post-body h3 {
    font-size: 1.35rem;
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 700;
}

#post-body p {
    margin-bottom: 18px;
    line-height: 1.75;
}

#post-body ul, #post-body ol {
    margin-bottom: 18px;
    padding-left: 28px;
}

#post-body li {
    margin-bottom: 8px;
    line-height: 1.65;
}

#post-body code {
    background: var(--background-secondary);
    padding: 2px 6px;
    font-size: 0.9em;
    font-family: Georgia, 'Times New Roman', serif;
}

#post-body pre {
    background: var(--background-secondary);
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

#post-body pre code {
    background: none;
    padding: 0;
}

#post-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 20px 0;
    color: var(--text-secondary);
    font-style: italic;
}

#post-body a {
    color: var(--primary-color);
    text-decoration: none;
}

#post-body a:hover {
    text-decoration: underline;
}

#post-body img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
}

#post-body .post-pdf-as-image {
    margin: 20px 0;
    max-width: 100%;
}

#post-body .post-pdf-as-image figcaption {
    margin-top: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
    font-style: italic;
}

#post-body .post-pdf-render-host {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
}

#post-body .post-pdf-as-image canvas {
    max-width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--border-color);
    background: #fff;
}

#post-body .post-pdf-error {
    margin: 0;
    padding: 12px 16px;
    font-size: 0.95rem;
}

#post-body hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 32px 0;
}

.post-navigation {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.back-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
}

.back-link:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    font-size: 0.9rem;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer a:hover {
    color: var(--primary-color);
}

.footer-legal {
    margin-bottom: 8px;
}

/* Search results page */
.search-results-title {
    font-size: 1.25rem;
    margin: 24px 0 16px;
    color: var(--text-secondary);
}

.search-results-list {
    list-style: none;
}

.search-results-list li {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.search-results-list li:last-child {
    border-bottom: none;
}

.search-result-snippet {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.5;
}

.search-results-empty {
    color: var(--text-secondary);
    margin-top: 24px;
}

/* Responsive */
@media (max-width: 900px) {
    .layout-with-sidebar {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .site-title {
        font-size: 1.35rem;
    }

    .top-bar-nav {
        justify-content: flex-end;
    }
}

@media (max-width: 700px) {
    .top-bar {
        flex-wrap: wrap;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .top-bar-search {
        max-width: none;
        order: 3;
        margin: 0;
    }

    .search-form {
        max-width: none;
    }

    .post-card-figure img {
        height: 220px;
    }

    .post-card-figure--pdf .post-pdf-render-host {
        min-height: 160px;
    }

    .post-card h2 {
        font-size: 1.4rem;
    }

    .page-content {
        padding: 0;
    }

    .post-content {
        padding: 0 0 24px;
    }

    #post-body h1 {
        font-size: 1.85rem;
    }

    #post-body h2 {
        font-size: 1.45rem;
    }
}
