/* Personal blog theme for yoav.sh */

@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('/fonts/source-sans-3-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/jetbrains-mono-400-latin.woff2') format('woff2');
}

:root {
    --breakpoint-mobile: 1200px;
    --bg: #111411;
    --bg-secondary: #1a1e1a;
    --text: #d4dbd4;
    --text-secondary: #8a948a;
    --accent: #6a9e6a;
    --accent-hover: #7eb87e;
    --accent-warm: #c9a66a;
    --muted: #5a665a;
    --border: #283028;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    max-width: 896px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
    transition:
        text-decoration-color 0.2s ease,
        color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration-color: var(--accent-hover);
}

/* Header/Nav */
body > header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

nav {
    display: flex;
    gap: 1.5rem;
    align-items: baseline;
}

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

nav a:hover {
    color: var(--text);
}

.site-title {
    font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
    font-weight: 600;
    font-size: 1.5rem;
    margin-right: auto;
    color: var(--accent);
}

.site-title::before {
    content: "~$ ";
    color: var(--text-secondary);
}

.site-title::after {
    content: "_";
    animation: blink 2s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .site-title::after { animation: none; }
}

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

/* Content */
main {
    min-height: 60vh;
    overflow: visible;
    position: relative;
}

h1,
h2,
h3 {
    line-height: 1.35;
    color: var(--accent-hover);
    font-weight: 600;
    letter-spacing: -0.02em;
    text-shadow: 0 0 12px rgba(106, 158, 106, 0.3);
}

h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}
h2 {
    font-size: 1.35rem;
    margin-top: 2rem;
}
h3 {
    font-size: 1.15rem;
    margin-top: 1.5rem;
}

article header {
    margin-bottom: 0.25rem;
}

article header h1 {
    margin-bottom: 0.2rem;
}

article time {
    color: var(--accent-warm);
    font-size: 0.9rem;
}

.content {
    margin-top: 0;
}

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

.intro p {
    color: var(--text-secondary);
}

.content p {
    margin: 1.2rem 0;
}

/* Images */
main img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Post entries */
.post-entry {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

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

.post-entry header {
    margin-bottom: 0.25rem;
}

.post-entry header h2 {
    margin-bottom: 0.2rem;
}

.post-entry time {
    color: var(--accent-warm);
    font-size: 0.85rem;
}

/* Posts layout with sidebar */
.posts-index {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 2rem;
    width: max-content;
    max-width: 200px;
    font-size: 0.85rem;
}

.posts-index h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    text-shadow: none;
}

.posts-index .index-title {
    display: inline;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-hover);
    text-shadow: none;
}

.posts-index h4 {
    font-size: 0.9rem;
    color: var(--accent);
    margin: 1rem 0 0.5rem;
    text-shadow: none;
}

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

.posts-index li {
    margin-bottom: 0.3rem;
}

.posts-index .month {
    color: var(--muted);
    font-size: 0.8rem;
}

.posts-index ul ul {
    padding-left: 0.8rem;
    margin-top: 0.3rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.pagination .page-info {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Index collapsible - desktop: always open, mobile: collapsible */
.posts-index details summary {
    list-style: none;
}

.posts-index details summary::-webkit-details-marker {
    display: none;
}

.posts-index details summary {
    pointer-events: none;
}

/* Responsive: stack on mobile */
@media (max-width: 1200px) {
    .posts-layout {
        display: flex;
        flex-direction: column;
    }

    .posts-index {
        position: static;
        width: 100%;
        margin-left: 0;
        order: -1;
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--border);
    }

    .posts-index details,
    .posts-index details summary {
        pointer-events: auto;
    }

    .posts-index details summary {
        cursor: pointer;
    }

    .posts-index details summary .index-title::before {
        content: "► ";
        font-size: 0.8em;
    }

    .posts-index details[open] summary .index-title::before {
        content: "▼ ";
    }
}

/* Code */
pre {
    background: var(--bg-secondary);
    padding: 1rem 1.25rem;
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid var(--border);
}

code {
    font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
    font-size: 0.85em;
    color: var(--text-secondary);
}

pre code {
    color: var(--text);
}

/* Inline code */
p code,
li code {
    background: var(--bg-secondary);
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    color: var(--accent);
}

/* Blockquotes */
blockquote {
    border-left: 3px solid var(--accent-warm);
    margin: 1.5rem 0;
    padding-left: 1.25rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
}

/* Selection */
::selection {
    background: var(--accent);
    color: var(--bg);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}
