/* ============================================
   Minimal Typography-First Design
   Inspired by: Remarkable e-reader, academic blogs
   ============================================ */

:root {
    /* Warm monochromatic palette */
    --color-bg: #f8f7f4;
    --color-text: #1a1a1a;
    --color-text-muted: #666660;
    --color-border: #e8e6e1;

    /* Typography */
    --font-serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --max-width: 680px;
    --spacing-page: clamp(1.5rem, 5vw, 4rem);
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-serif);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Header
   ============================================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem var(--spacing-page);
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* ============================================
   Divider
   ============================================ */
.divider {
    height: 1px;
    background: var(--color-border);
    max-width: 1200px;
    width: calc(100% - var(--spacing-page) * 2);
    margin: 0 auto;
}

/* ============================================
   Main Content
   ============================================ */
.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-page);
}

.hero {
    max-width: var(--max-width);
    padding: 0;
    padding-top: 20vh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

.tagline {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--color-text-muted);
    line-height: 1.7;
    max-width: 580px;
}

/* Main column layout for homepage with about */
.main-column {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 0;
}

.main-column .hero {
    width: 100%;
    max-width: var(--max-width);
}

.main-column .about {
    width: 100%;
}

/* ============================================
   About Section
   ============================================ */
.about {
    max-width: var(--max-width);
    padding: 3rem 0 4rem;
    border-top: 1px solid var(--color-border);
}

.about h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.about p {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 1rem;
}

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

.about del {
    text-decoration: line-through;
    color: var(--color-text-muted);
}

.about ins {
    text-decoration: none;
    font-style: italic;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem var(--spacing-page);
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.copyright {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-nav a {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* ============================================
   Writing Page
   ============================================ */
.main-top {
    align-items: flex-start;
    padding-top: 3rem;
}

.writing-page {
    max-width: var(--max-width);
    width: 100%;
}

.writing-page h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.page-intro {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
}

.post-list {
    list-style: none;
}

.post-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.post-item:first-child {
    padding-top: 0;
}

.post-item a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.post-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--color-text);
    transition: color 0.2s ease;
}

.post-item a:hover .post-title {
    color: var(--color-text-muted);
}

.post-meta {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
    margin-left: 1rem;
}

.post-summary {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* ============================================
   Blog Post Article
   ============================================ */
.post {
    max-width: var(--max-width);
    width: 100%;
}

.post-header {
    margin-bottom: 2.5rem;
}

.post-header h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.post-subtitle {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin-bottom: 0.5rem;
}

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

.post-content {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.75;
}

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

.post-content h2,
.post-content h3,
.post-content h4 {
    font-family: var(--font-serif);
    font-weight: 500;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.post-content h2 {
    font-size: 1.5rem;
}

.post-content h3 {
    font-size: 1.3rem;
}

.post-content h4 {
    font-size: 1.15rem;
}

.post-content a {
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-content a:hover {
    color: var(--color-text-muted);
}

.post-content blockquote {
    border-left: 2px solid var(--color-border);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--color-text-muted);
}

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

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

.post-content figure {
    margin: 2rem 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.post-content figcaption {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 0.75rem;
}

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

.post-content .references {
    font-size: 0.9rem;
}

.post-content .references li {
    margin-bottom: 0.75rem;
}

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

/* ============================================
   Photography Page
   ============================================ */
.photography-page {
    max-width: 1000px;
    width: 100%;
}

.photography-page h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

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

.photo-item {
    margin: 0;
}

.photo-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease;
}

.photo-item:hover img {
    opacity: 0.9;
}

.photo-item figcaption {
    padding-top: 0.75rem;
}

.photo-caption {
    display: block;
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--color-text);
    line-height: 1.4;
}

.photo-meta {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

.gallery-empty,
.no-js-message {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 2rem;
}

/* ============================================
   Lightbox
   ============================================ */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative;
    text-align: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.lightbox-caption {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--color-text);
    margin-top: 1rem;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2rem;
    color: var(--color-text);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    z-index: 1001;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: var(--color-text);
    background: none;
    border: none;
    cursor: pointer;
    padding: 1rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    font-family: var(--font-sans);
}

.lightbox-nav:hover {
    opacity: 1;
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.photo-item {
    cursor: pointer;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
    html {
        font-size: 17px;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .hero {
        text-align: center;
    }

    .tagline {
        margin: 0 auto;
    }

    .post-item a {
        flex-direction: column;
        gap: 0.25rem;
    }

    .post-meta {
        margin-left: 0;
    }
}