/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400&family=Newsreader:ital,wght@0,400;1,400&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --max-width: 640px;
    --spacing: 3rem;
    --color-text-primary: #293A41;
    --color-text-secondary: #4D646D;
    --color-text-medium: #414F55;
    --color-text-light: #7D8E95;
    --color-bg: #FAFEFF;
    --color-accent: #0099FF;
    --color-border: rgba(225, 232, 235, 0.24);
    --color-line: #E1E8EB;
    --color-line-dark: #ABBBC2;
    --font-sans: Sora, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-serif: Newsreader, 'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, Georgia, serif;
    --font-mono: 'SF Mono', Menlo, Monaco, 'Courier New', Courier, monospace;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 120px;
}

body {
    font-family: var(--font-sans);
    line-height: 1.7;
    color: var(--color-text-medium);
    background: var(--color-bg);
    font-size: 17px;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
.site-header {
    padding: 1.5rem 1.5rem 2rem;
    margin-bottom: var(--spacing);
}

.site-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.7;
}

.logo img {
    display: block;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    text-decoration: none;
    color: var(--color-text-light);
    font-size: 0.95rem;
    font-weight: 300;
    transition: color 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--color-text-medium);
}

/* Main Content */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
    min-height: calc(100vh - 300px);
}

/* Home Page */
.hero {
    padding: 0;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: 1.125rem;
    font-weight: 300;
    color: var(--color-text-secondary);
    margin-bottom: 0;
    line-height: 1.56;
    letter-spacing: 0;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--color-text-light);
    font-weight: 300;
}

.intro {
    margin: 0 0 3rem;
    font-size: 1.125rem;
    line-height: 1.56;
    color: var(--color-text-secondary);
    font-weight: 300;
}

.intro p {
    margin-bottom: 1.5rem;
}

/* Blog Posts */
.recent-posts {
    margin-top: 4rem;
}

.recent-posts h2,
.list h1 {
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--color-text-primary);
    text-transform: none;
    letter-spacing: 0;
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.post-preview {
    padding-bottom: 0;
}

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

.post-preview h2,
.post-preview h3 {
    margin-bottom: 0.5rem;
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1.4;
}

.post-preview h2 a,
.post-preview h3 a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-preview h2 a:hover,
.post-preview h3 a:hover {
    color: var(--color-accent);
}

.post-preview time {
    display: block;
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
    font-weight: 300;
}

.post-preview p {
    color: var(--color-text-medium);
    font-size: 1.05rem;
    line-height: 1.7;
    display: none;
}

/* Single Post/Page */
.single header {
    margin-bottom: 3rem;
}

.single h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 400;
    color: var(--color-text-primary);
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.single time {
    display: block;
    color: var(--color-text-light);
    font-size: 0.95rem;
    font-weight: 300;
}

.content {
    line-height: 1.8;
    color: var(--color-text-medium);
    font-size: 1.05rem;
}

.content h2 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
}

.content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--color-text-primary);
}

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

.content a {
    color: var(--color-accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.content a:hover {
    opacity: 0.7;
}

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

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

.content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: #f5f5f5;
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

.content pre {
    background: #f5f5f5;
    padding: 1rem;
    overflow-x: auto;
    border-radius: 5px;
    margin-bottom: 1rem;
}

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

.content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1rem 0;
}

/* Photography Gallery */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.photo-gallery img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 5px;
    transition: transform 0.2s;
}

.photo-gallery img:hover {
    transform: scale(1.02);
}

/* Gear/Tools Page */
.gear-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.gear-item {
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    border-radius: 5px;
}

.gear-item h3 {
    margin-bottom: 0.5rem;
}

.gear-item .category {
    display: inline-block;
    background: #f0f0f0;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    text-align: right;
    color: var(--color-text-light);
    font-size: 0.875rem;
    font-weight: 400;
    font-style: italic;
    font-family: var(--font-serif);
    width: 144px;
    z-index: 10;
}

/* When page has scroll (content is taller than viewport) */
body.has-scroll .site-footer {
    position: static;
    margin: 4rem 1rem 2rem auto;
}

.site-footer p {
    margin-bottom: 0;
    line-height: 1.43;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 0;
    flex-wrap: wrap;
}

.social-links a {
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    font-style: normal;
    font-family: var(--font-sans);
    transition: color 0.2s ease;
    position: relative;
}

.social-links a:hover {
    color: var(--color-text-medium);
}

.social-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 1px;
    background: var(--color-line);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.social-links a:hover::after {
    opacity: 1;
}

/* Table of Contents */
.toc-container {
    position: fixed;
    left: 1.5rem;
    z-index: 100;
}

.toc {
    position: relative;
    background: rgba(225, 232, 235, 0.32);
    border-radius: 8px;
    padding: 8px;
}

/* Default state - always visible lines */
.toc-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 1;
    visibility: visible;
    transition: opacity 0s, visibility 0s;
}

.toc-line {
    height: 2px;
    width: 12px;
    background: #889FA9;
}

.toc-line.active {
    background: #4D646D;
}

/* Hover state - text overlay appears on top */
.toc-items {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(225, 232, 235, 0.32);
    border-radius: 8px;
    padding: 4px 8px;
    width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease-out, visibility 0.15s ease-out;
}

.toc:hover .toc-lines {
    opacity: 0;
    visibility: hidden;
}

.toc:hover .toc-items {
    opacity: 1;
    visibility: visible;
}

.toc-item {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: #889FA9;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    padding: 4px 0;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toc-item.active {
    color: #4D646D;
}

.toc-item:hover {
    color: #4D646D;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --max-width: 100%;
        --spacing: 2rem;
    }

    body {
        font-size: 16px;
    }

    main {
        padding: 0 1.5rem 3rem;
    }

    .site-header {
        padding: 1.5rem 1rem 2rem;
    }

    .hero h1 {
        font-size: 1.125rem;
    }

    .nav-menu {
        gap: 1rem;
    }

    .nav-menu a {
        font-size: 0.875rem;
    }

    .post-preview h2,
    .post-preview h3 {
        font-size: 1.2rem;
    }

    .single h1 {
        font-size: 2rem;
    }

    .photo-gallery {
        grid-template-columns: 1fr;
    }

    .site-footer {
        position: static;
        text-align: left;
        margin: 3rem 1rem 2rem;
        width: auto;
    }

    body.has-scroll .site-footer {
        margin: 3rem 1rem 2rem;
    }

    .toc-container {
        display: none;
    }
}
