/* Blog CSS - Matches hermit-V2 theme */

/* Color Variables (from hermit-V2 _colors.scss) */
:root {
    --pine-green: #018472;
    --bright-grey: #eeeeee;
    --white: #ffffff;
    --davys-grey: #494f5c;
    --granite-grey: #666666;
    --sonic-silver: #777777;
    --arsenic: #3b3e48;
    --css-grey: #7d828a;
    --japanese-indigo: #2c3e50;
    --taupe-grey: #878787;
    --chinese-silver: #cccccc;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.54;
    background-color: var(--davys-grey);
    color: var(--bright-grey);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout */
.section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.thin {
    max-width: 760px;
}

/* Header */
#site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--arsenic);
    padding: 15px 0;
}

.hdr-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hdr-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.site-branding a {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--bright-grey);
    text-decoration: none;
}

.site-branding a:hover {
    color: var(--white);
}

.site-nav {
    display: flex;
    gap: 20px;
}

.site-nav a {
    color: var(--css-grey);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--bright-grey);
}

.hdr-right {
    display: flex;
    align-items: center;
}

.hdr-btn {
    background: none;
    border: none;
    color: var(--css-grey);
    cursor: pointer;
    padding: 5px;
    display: none;
}

.hdr-btn:hover {
    color: var(--bright-grey);
}

/* Mobile Menu */
#mobile-menu {
    display: none;
    background-color: var(--arsenic);
    padding: 20px;
}

#mobile-menu.show {
    display: block;
}

#mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#mobile-menu li {
    margin: 10px 0;
}

#mobile-menu a {
    color: var(--css-grey);
    text-decoration: none;
    font-size: 1rem;
}

#mobile-menu a:hover,
#mobile-menu a.active {
    color: var(--bright-grey);
}

/* Main Content */
.site-main {
    flex: 1;
    padding: 40px 20px;
}

.site-main h1 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--bright-grey);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--arsenic);
    border-top-color: var(--pine-green);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.error-state {
    text-align: center;
    padding: 60px 0;
    color: var(--taupe-grey);
}

.retry-btn {
    background-color: var(--pine-green);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 15px;
}

.retry-btn:hover {
    opacity: 0.9;
}

/* Empty State */
.empty-state {
    color: var(--taupe-grey);
    text-align: center;
    padding: 40px 0;
}

/* Posts List (matching hermit-V2) */
.posts-group {
    margin-bottom: 30px;
}

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

.post-item {
    border-bottom: 1px dashed var(--css-grey);
    padding: 15px 0;
}

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

.post-item > a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    text-decoration: none;
    color: var(--bright-grey);
    transition: color 0.2s;
}

.post-item > a:hover {
    color: var(--white);
}

.post-title {
    flex: 1;
    font-size: 1.1rem;
}

.post-day {
    color: var(--css-grey);
    font-size: 0.85rem;
    margin-left: 15px;
    white-space: nowrap;
}

.post-description {
    display: block;
    color: var(--taupe-grey);
    font-size: 0.9rem;
    margin-top: 5px;
    line-height: 1.4;
}

/* Article View */
.back-link {
    display: inline-block;
    color: var(--css-grey);
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--pine-green);
}

.article-meta {
    color: var(--taupe-grey);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.featured-image {
    margin-bottom: 30px;
}

.featured-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Content (prose styling for markdown) */
.content {
    line-height: 1.7;
}

.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
    margin-top: 2em;
    margin-bottom: 0.5em;
    color: var(--bright-grey);
}

.content h1 { font-size: 1.8rem; }
.content h2 { font-size: 1.5rem; }
.content h3 { font-size: 1.3rem; }
.content h4 { font-size: 1.1rem; }

.content p {
    margin-bottom: 1.5em;
}

.content a {
    color: var(--pine-green);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.content a:hover {
    border-bottom-color: var(--pine-green);
}

.content ul,
.content ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}

.content li {
    margin-bottom: 0.5em;
}

.content blockquote {
    margin: 1.5em 0;
    padding: 0.5em 1em;
    border-left: 3px solid var(--pine-green);
    background-color: var(--arsenic);
    color: var(--chinese-silver);
}

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

.content pre {
    background-color: var(--japanese-indigo);
    padding: 1em;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1.5em;
}

.content code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.9em;
}

.content p code,
.content li code {
    background-color: var(--arsenic);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

.content pre code {
    background: none;
    padding: 0;
}

.content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.content hr {
    border: none;
    border-top: 1px dashed var(--css-grey);
    margin: 2em 0;
}

.content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
}

.content th,
.content td {
    border: 1px solid var(--css-grey);
    padding: 0.5em 1em;
    text-align: left;
}

.content th {
    background-color: var(--arsenic);
}

/* Footer */
.site-footer {
    padding: 30px 20px;
    text-align: center;
    color: var(--taupe-grey);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 760px) {
    .hide-in-mobile {
        display: none;
    }

    .hdr-btn {
        display: block;
    }

    .post-item > a {
        flex-direction: column;
    }

    .post-day {
        margin-left: 0;
        margin-top: 5px;
    }

    .site-main h1 {
        font-size: 1.5rem;
    }
}
