/* Minimal CSS for Aneesh Sathe's Linkblog */

:root {
    --font-body: 'ET Book', Palatino, 'Palatino Linotype', 'Palatino LT STD', 'Book Antiqua', Georgia, serif;
    --font-sans: 'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;
    --max-width: 720px;

    /* Light theme */
    --bg: #fffff8;
    --text: #111111;
    --text-muted: #666666;
    --link: #0066cc;
    --border: #e0e0e0;
    --nav-bg: #fafaf5;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #151515;
        --text: #e8e8e8;
        --text-muted: #999999;
        --link: #66b3ff;
        --border: #333333;
        --nav-bg: #1f1f1f;
    }
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    font-size: 1.1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navbar */
.navbar {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
}

.nav-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-brand {
    font-family: var(--font-sans);
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
    letter-spacing: 0.02em;
}

.nav-links {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.nav-links a {
    font-family: var(--font-sans);
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--link);
}

.nav-links a.external {
    opacity: 0.8;
}

/* Content */
.content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Links */
a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Date headers (Simon style) */
h2.date-header {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--link);
}

h2.date-header:first-child {
    margin-top: 0;
}

/* Linkblog posts */
.post {
    margin-bottom: 1.5rem;
}

.post-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.post-title a {
    color: var(--link);
}

.post-content {
    line-height: 1.65;
}

.post-content p:first-child {
    margin-top: 0;
}

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

.post-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

.post-meta a {
    color: var(--link);
}

.post-tags {
    color: var(--text-muted);
}

hr.post-separator {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* Blockquotes */
blockquote {
    border-left: 3px solid var(--link);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: var(--text-muted);
}

/* Code */
code {
    font-family: var(--font-mono);
    background: var(--nav-bg);
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

pre {
    background: var(--nav-bg);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

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

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Lead text */
.lead {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Garden sidebar */
.garden-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .garden-layout {
        grid-template-columns: 1fr;
    }
}

.garden-sidebar {
    font-size: 0.9rem;
}

.garden-sidebar h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 1.5rem 0 0.5rem 0;
}

.garden-sidebar h3:first-child {
    margin-top: 0;
}

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

.garden-sidebar li {
    padding: 0.25rem 0;
}

.garden-main {
    min-width: 0;
}

/* ==========================================
   LOG PAGE STYLES
   ========================================== */

.log-page {
    max-width: 960px;
    margin: 0 auto;
}

.log-header {
    text-align: center;
    margin-bottom: 2rem;
}

.log-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.log-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 3rem;
    align-items: start;
}

@media (max-width: 768px) {
    .log-layout {
        grid-template-columns: 1fr;
    }

    .log-sidebar {
        order: 2;
    }
}

/* Log Sidebar */
.log-sidebar {
    position: sticky;
    top: 1rem;
    height: fit-content;
}

.log-sidebar h3 {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.archive-nav {
    font-size: 0.9rem;
}

/* Inbox Link in Sidebar */
.inbox-link {
    margin-bottom: 1rem;
}

.sidebar-inbox {
    display: block;
    padding: 0.6rem 0.75rem;
    background: var(--nav-bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--link);
    border-radius: 0.375rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-inbox:hover {
    background: var(--link);
    color: white;
    border-color: var(--link);
    text-decoration: none;
    transform: translateX(2px);
}

.year-group {
    margin-bottom: 0.5rem;
}

.year-group summary {
    cursor: pointer;
    padding: 0.4rem 0;
    font-weight: 600;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.year-group summary:hover {
    color: var(--link);
}

.year-group .count {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.month-list {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0.5rem 0.75rem;
}

.month-list li {
    margin-bottom: 0.15rem;
}

.month-link {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0.25rem;
    transition: all 0.15s ease;
}

.month-link:hover {
    background: var(--nav-bg);
    color: var(--link);
    text-decoration: none;
}

.month-link .month-name {
    color: var(--text);
}

.month-link:hover .month-name {
    color: var(--link);
}

/* Log Main Content */
.log-main {
    min-width: 0;
    max-width: 680px;
}

.section-header {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--link);
}

.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.pinned-section .post.pinned {
    background: var(--nav-bg);
    padding: 1.25rem;
    border-radius: 0.5rem;
    border-left: 3px solid var(--link);
}

/* Log Entries */
.log-entry {
    margin-bottom: 1.5rem;
}

.entry-date {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.entry-date a {
    color: var(--link);
    text-decoration: none;
}

.entry-date a:hover {
    text-decoration: underline;
}

.entry-preview {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.read-more {
    font-size: 0.85rem;
    color: var(--link);
}

.entry-separator {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

.empty-state {
    color: var(--text-muted);
    font-style: italic;
}

/* Archive Button */
.view-all-section {
    margin-top: 2rem;
    text-align: center;
}

.btn-archive {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--nav-bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-archive:hover {
    background: var(--link);
    color: white;
    border-color: var(--link);
    text-decoration: none;
}

/* ==========================================
   ARCHIVE PAGE STYLES
   ========================================== */

.archive-page {
    max-width: 720px;
    margin: 0 auto;
}

.archive-header {
    text-align: center;
    margin-bottom: 2rem;
}

.archive-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.back-link {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--link);
}

.year-section {
    margin-bottom: 2.5rem;
}

.year-header {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--link);
}

.month-section {
    margin-bottom: 1.5rem;
    margin-left: 1rem;
}

.month-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

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

.archive-entry {
    display: flex;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.archive-entry:last-child {
    border-bottom: none;
}

.entry-day {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 100px;
}

.entry-link {
    color: var(--link);
    flex: 1;
}

/* ==========================================
   DIGITAL GARDEN STYLES (Maggie Appleton Inspired)
   ========================================== */

.garden-page {
    max-width: 960px;
    margin: 0 auto;
}

.garden-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.garden-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.garden-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Growth Stage Badges */
.stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stage-seedling {
    background: #e8f5e9;
    color: #2e7d32;
}

.stage-budding {
    background: #fff3e0;
    color: #ef6c00;
}

.stage-evergreen {
    background: #e3f2fd;
    color: #1565c0;
}

@media (prefers-color-scheme: dark) {
    .stage-seedling {
        background: #1b3a1f;
        color: #81c784;
    }

    .stage-budding {
        background: #3d2f1f;
        color: #ffb74d;
    }

    .stage-evergreen {
        background: #1a2f42;
        color: #64b5f6;
    }
}

/* Garden Cards Grid */
.garden-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.garden-card {
    background: var(--nav-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.garden-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--link);
}

@media (prefers-color-scheme: dark) {
    .garden-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

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

.card-title a:hover {
    color: var(--link);
}

.card-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 0.75rem;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Topic Sections */
.topic-section {
    margin-bottom: 2.5rem;
}

.topic-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.topic-icon {
    font-size: 1.2rem;
}

/* Recently Updated Section */
.recently-updated {
    background: linear-gradient(135deg, var(--nav-bg) 0%, var(--bg) 100%);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}

.recently-updated h2 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 1rem 0;
}

.recent-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

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

.recent-title {
    color: var(--link);
    font-weight: 500;
}

.recent-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Simple List View (fallback) */
.garden-list {
    list-style: none;
    padding: 0;
}

.garden-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

/* ==========================================
   SEARCH STYLES (Pagefind)
   ========================================== */

#search {
    margin-left: auto;
}

/* Hide the default Pagefind search icon */
.pagefind-ui__search-clear {
    display: none !important;
}

.pagefind-ui__form::before {
    display: none !important;
}

/* Override Pagefind default styles to match site theme */
.pagefind-ui__search-input {
    background: var(--bg) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: 0.5rem !important;
    padding: 0.5rem 0.75rem !important;
    padding-left: 0.75rem !important;
    font-family: var(--font-sans) !important;
    font-size: 0.9rem !important;
    width: 250px !important;
    background-image: none !important;
}

.pagefind-ui__search-input:focus {
    outline: none !important;
    border-color: var(--link) !important;
}

.pagefind-ui__results-area {
    background: var(--bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0.5rem !important;
    margin-top: 0.5rem !important;
}

.pagefind-ui__result {
    border-bottom: 1px solid var(--border) !important;
    padding: 0.75rem !important;
}

.pagefind-ui__result:last-child {
    border-bottom: none !important;
}

.pagefind-ui__result-link {
    color: var(--link) !important;
    text-decoration: none !important;
}

.pagefind-ui__result-link:hover {
    text-decoration: underline !important;
}

.pagefind-ui__result-title {
    color: var(--text) !important;
    font-weight: 600 !important;
}

.pagefind-ui__result-excerpt {
    color: var(--text-muted) !important;
    font-size: 0.85rem !important;
}

@media (max-width: 768px) {
    #search {
        width: 100%;
        margin-top: 0.5rem;
    }

    .pagefind-ui__search-input {
        width: 100% !important;
    }
}

/* ==========================================
   HEADING ANCHOR LINKS
   ========================================== */

.heading-anchor {
    color: var(--text-muted);
    text-decoration: none;
    opacity: 0;
    margin-right: 0.3rem;
    font-weight: 400;
    transition: opacity 0.2s ease;
}

h1:hover .heading-anchor,
h2:hover .heading-anchor,
h3:hover .heading-anchor,
h4:hover .heading-anchor,
h5:hover .heading-anchor,
h6:hover .heading-anchor {
    opacity: 1;
}

.heading-anchor:hover {
    color: var(--link);
    text-decoration: none;
}

/* Ensure headings have IDs for anchor links */
h1[id],
h2[id],
h3[id],
h4[id],
h5[id],
h6[id] {
    scroll-margin-top: 2rem;
}