/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Papers page styling */
.content ul li {
    font-size: 1.1em;
    margin-bottom: 1em;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: url('https://c2.staticflickr.com/2/1872/42917149790_bb3f553f13_o.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

/* Main content wrapper */
.page-wrapper {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    min-height: calc(100vh - 40px);
    overflow: hidden;
    max-width: 1400px;
    margin: 0 auto;
}

/* Layout */
header {
    background: #c41e3a;
    color: white;
    padding: 1rem 0;
    margin: 0;
    border-radius: 16px 16px 0 0;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav h1 a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    white-space: nowrap;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    flex-wrap: nowrap;
}

nav ul li {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Responsive menu adjustments */
@media (max-width: 768px) {
    nav ul {
        gap: 1rem;
        font-size: 0.9rem;
    }

    nav {
        padding: 0 1rem;
    }

    nav h1 a {
        font-size: 1.3rem;
    }
}

@media (max-width: 640px) {
    nav ul {
        gap: 0.5rem;
        font-size: 0.8rem;
    }

    nav {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    nav h1 a {
        font-size: 1.1rem;
    }
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 300px);
}

footer {
    background: rgba(245, 245, 245, 0.9);
    text-align: center;
    padding: 2rem;
    margin: 0;
    color: #666;
    border-radius: 0 0 16px 16px;
}

/* Content styles */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    margin-bottom: 3rem;
    background: linear-gradient(rgba(196, 30, 58, 0.85), rgba(220, 53, 69, 0.85)),
                url('https://c2.staticflickr.com/2/1872/42917149790_bb3f553f13_o.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    position: relative;
}

/* Slide images styling */
.content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: 700;
}

.hero p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.content {
    max-width: 800px;
    margin: 0 auto 3rem;
}

.content h1, .content h2, .content h3 {
    margin: 2rem 0 1rem;
    color: #2c5aa0;
}

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

.content ul, .content ol {
    margin: 1rem 0 1rem 2rem;
}

.content blockquote {
    border-left: 4px solid #2c5aa0;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #666;
}

/* Post styles */
.post-summary {
    border-bottom: 1px solid #eee;
    padding: 2rem 0;
}

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

.post-summary h2, .post-summary h3 {
    margin-bottom: 0.5rem;
}

.post-summary h2 a, .post-summary h3 a {
    color: #2c5aa0;
    text-decoration: none;
}

.post-summary h2 a:hover, .post-summary h3 a:hover {
    text-decoration: underline;
}

.post-summary time {
    color: #666;
    font-size: 0.9rem;
}

.post-summary p {
    margin: 1rem 0;
    color: #666;
}

/* Tags */
.tags {
    margin: 1rem 0;
}

.tag {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

/* Article styles */
article header {
    background: none;
    color: inherit;
    padding: 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 2rem;
}

article h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #1f4e79;
}

article time {
    color: #666;
    font-size: 1rem;
}

/* Portfolio section */
.portfolio {
    margin: 3rem 0;
}

.portfolio h2 {
    color: #2c5aa0;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    text-align: center;
}

.portfolio-section {
    margin-bottom: 4rem;
}

.portfolio-section h3 {
    color: #2c5aa0;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.portfolio-item {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.portfolio-item img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.portfolio-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2c5aa0, #4a90e2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(31, 78, 121, 0.15);
    border-color: #1f4e79;
}

.portfolio-item:hover::before {
    transform: scaleX(1);
}

.portfolio-item h4 {
    margin-bottom: 1rem;
    color: #2c5aa0;
}

.portfolio-item h4 a {
    color: inherit;
    text-decoration: none;
}

.portfolio-item h4 a:hover {
    text-decoration: underline;
}

.portfolio-item p {
    margin-bottom: 1rem;
    color: #666;
    line-height: 1.5;
}

.portfolio-type {
    background: #2c5aa0;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Recent posts section */
.recent-posts {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid #e9ecef;
}

.recent-posts h2 {
    color: #2c5aa0;
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* Responsive design */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        gap: 1rem;
    }

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

    main {
        padding: 0 1rem;
    }
}