/* ============================================
   Home Page Styles - Literary Magazine Aesthetic
   Design Direction: Bold Typography + Elegant Minimalism
   Inspired by: The New Yorker, Kinfolk, Monocle
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@400;500;600&display=swap');

:root {
    /* Typography - Distinctive choices */
    --font-display: 'Playfair Display', 'Noto Serif SC', serif;
    --font-body: 'IBM Plex Sans', 'Noto Sans SC', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    
    /* Colors - Warm editorial palette */
    --color-bg: #fffef9;
    --color-surface: #ffffff;
    --color-text: #1a1614;
    --color-text-secondary: #6b6560;
    --color-accent: #d4511e;
    --color-accent-soft: #f4e8e3;
    --color-border: #e8e3dd;
    
    /* Spacing - Generous breathing room */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 3rem;
    --spacing-xl: 5rem;
    
    /* Effects */
    --shadow-subtle: 0 1px 3px rgba(26, 22, 20, 0.04);
    --shadow-soft: 0 4px 16px rgba(26, 22, 20, 0.06);
}

[data-theme="dark"] {
    --color-bg: #1a1614;
    --color-surface: #252220;
    --color-text: #f5f3f0;
    --color-text-secondary: #a8a29e;
    --color-accent: #ff6b3d;
    --color-accent-soft: #3d2a24;
    --color-border: #3d3935;
}

/* ============================================
   Hero Section - Dramatic Introduction
   ============================================ */

.hero-section {
    min-height: 65vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-md);
    background: 
        linear-gradient(165deg, 
            rgba(212, 81, 30, 0.03) 0%, 
            rgba(212, 81, 30, 0.08) 50%,
            rgba(212, 81, 30, 0.02) 100%
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(212, 81, 30, 0.015) 2px,
            rgba(212, 81, 30, 0.015) 4px
        );
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(
        ellipse at center,
        rgba(212, 81, 30, 0.12) 0%,
        transparent 60%
    );
    animation: breathe 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes breathe {
    0%, 100% { 
        transform: scale(1) translateY(0); 
        opacity: 0.6;
    }
    50% { 
        transform: scale(1.1) translateY(-30px); 
        opacity: 0.8;
    }
}

.hero-content {
    text-align: center;
    z-index: 1;
    max-width: 900px;
    animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.03em;
    line-height: 0.95;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-quote {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--color-text);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    padding: 0 2rem;
}

.hero-quote::before,
.hero-quote::after {
    content: '"';
    font-size: 3rem;
    color: var(--color-accent);
    opacity: 0.3;
    position: absolute;
    font-family: var(--font-display);
}

.hero-quote::before {
    left: -0.5rem;
    top: -1rem;
}

.hero-quote::after {
    right: -0.5rem;
    bottom: -2rem;
}

/* ============================================
   Posts Section - Editorial List Layout
   ============================================ */

.posts-section {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 2px solid var(--color-border);
}

/* ============================================
   Post Item - Refined List Entry
   ============================================ */

.post-item {
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: slideIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.post-item:nth-child(1) { animation-delay: 0.05s; }
.post-item:nth-child(2) { animation-delay: 0.1s; }
.post-item:nth-child(3) { animation-delay: 0.15s; }
.post-item:nth-child(4) { animation-delay: 0.2s; }
.post-item:nth-child(5) { animation-delay: 0.25s; }
.post-item:nth-child(6) { animation-delay: 0.3s; }
.post-item:nth-child(7) { animation-delay: 0.35s; }
.post-item:nth-child(8) { animation-delay: 0.4s; }

.post-item:hover {
    background-color: var(--color-accent-soft);
}

.post-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg) var(--spacing-md);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-link:hover .post-title {
    color: var(--color-accent);
    transform: translateX(8px);
}

.post-link:hover .post-date {
    color: var(--color-accent);
}

.post-link:hover .post-thumbnail img {
    transform: scale(1.08);
}

.post-main {
    flex: 1;
    min-width: 0;
}

.post-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
    line-height: 1.25;
    letter-spacing: -0.02em;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-date {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

.post-thumbnail {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 4px;
    background: var(--color-accent-soft);
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   Pagination - Elegant Navigation
   ============================================ */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 2px solid var(--color-border);
    gap: var(--spacing-md);
}

.pagination-link {
    padding: 0.875rem 2rem;
    background: var(--color-surface);
    color: var(--color-text);
    text-decoration: none;
    border: 2px solid var(--color-border);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.pagination-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--color-accent);
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: -1;
}

.pagination-link:hover {
    color: white;
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.pagination-link:hover::before {
    left: 0;
}

.pagination-info {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.02em;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .hero-section {
        min-height: 50vh;
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .hero-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-quote {
        font-size: 1.15rem;
        padding: 0 1.5rem;
    }
    
    .posts-section {
        padding: var(--spacing-lg) var(--spacing-sm);
    }
    
    .post-link {
        flex-direction: column;
        align-items: flex-start;
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .post-title {
        font-size: 1.5rem;
    }
    
    .post-thumbnail {
        width: 100%;
        height: 200px;
        order: -1;
        margin-bottom: var(--spacing-sm);
    }
    
    .pagination {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .pagination-link {
        width: 100%;
        text-align: center;
    }
    
    .pagination-info {
        order: -1;
    }
}

@media (max-width: 480px) {
    .hero-section {
        min-height: 40vh;
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .hero-quote {
        font-size: 1rem;
    }
    
    .post-link {
        padding: var(--spacing-md) var(--spacing-xs);
    }
    
    .post-title {
        font-size: 1.35rem;
    }
    
    .post-date {
        font-size: 0.8rem;
    }
    
    .pagination-link {
        padding: 0.75rem 1.5rem;
        font-size: 0.85rem;
    }
}

/* ============================================
   Accessibility & Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
}

@media (prefers-contrast: high) {
    .post-item {
        border-bottom: 2px solid var(--color-text);
    }
    
    .post-link:hover {
        text-decoration: underline;
    }
}

/* ============================================
   Dark Mode Transitions
   ============================================ */

body,
.post-item,
.pagination-link {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .hero-section,
    .pagination {
        display: none;
    }
    
    .post-item {
        break-inside: avoid;
        border-bottom: 1px solid #ccc;
    }
    
    .post-thumbnail {
        display: none;
    }
}
