/* Clean, modern design system */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --background-color: #fbf9f1;
    --text-color: #1b2037;
    --accent-color: #705e40;
    --border-color: #e5e7eb;
    --nav-bg: #f2f0e8;
    --card-bg: #fffdf7;
    --hover-bg: #faf5e5;
    --spacing-unit: 1rem;
}



body {
    font-family: "Playfair Display", Playfair, serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    padding-bottom: 60px; /* Space for footer */
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

nav {
    background-color: var(--nav-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1rem;
}

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

h1, h2, h3 {
    color: var(--primary-color);
    font-weight: normal;
}

.section {
    margin-bottom: 3rem;
}

/* Resume specific styles */
.resume-section {
    margin-bottom: 3rem;
}

.experience-item, .project-item, .skills-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-left: 2px solid var(--accent-color);
    background: var(--card-bg);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.experience-item h3, .project-item h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.experience-item .date {
    color: var(--accent-color);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.experience-item ul, .project-item ul {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.experience-item li, .project-item li {
    margin-bottom: 0.5rem;
}

/* Project link styles */
.project-link {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
}

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

.project-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.project-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Portfolio styles */
.portfolio-section {
    margin-bottom: 4rem;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.portfolio-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .portfolio-content {
        grid-template-columns: 1fr 1fr;
    }
}

.media-gallery {
    width: 100%;
    min-height: 300px;
    background: var(--card-bg);
    border-radius: 4px;
    padding: 1rem;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
}

.media-placeholder {
    border: 2px dashed var(--border-color);
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.project-details {
    padding: 1rem;
}

.project-details h3 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.project-details ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.project-links {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

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

.project-links a:hover {
    color: var(--primary-color);
}

/* Footer styles */
footer {
    text-align: center;
    padding: 1rem 0;
    font-size: 0.9rem;
    background: var(--background-color);
    position: fixed;
    bottom: -60px; /* Hide footer by default */
    width: 100%;
    color: #666;
    transition: bottom 0.3s ease;
}

footer.visible {
    bottom: 0;
}

/* Add smooth transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .portfolio-content {
        grid-template-columns: 1fr;
    }
    
    .contact-links {
        flex-direction: column;
    }
    
    .experience-item, .project-item, .portfolio-section {
        padding: 1rem;
    }
}

/* Image handling */
img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Video handling */
video {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Code snippets if needed */
pre {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    border: 1px solid var(--border-color);
}

/* Print styles */
@media print {
    body {
        background: white;
        padding-bottom: 0;
    }
    
    nav, footer {
        display: none;
    }
    
    .container {
        max-width: none;
        padding: 0;
        margin: 0;
    }
    
    .experience-item, .project-item, .portfolio-section {
        break-inside: avoid;
        page-break-inside: avoid;
        border: none;
        box-shadow: none;
    }
}

/* GIF Media Gallery Styles */
.gif-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.gif-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.gif-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

/* Optional: Pause GIF on hover */
.gif-container.pausable img:hover {
    animation-play-state: paused;
}

/* Caption for GIFs */
.gif-caption {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    color: var(--text-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gif-gallery {
        grid-template-columns: 1fr;
    }
}

.section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.about-container {
    display: flex;
    gap: 3rem;
    align-items: start;
}

.portrait-container {
    flex: 0 0 300px; /* Fixed width of 300px, won't grow or shrink */
    height: 400px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.portrait:hover {
    transform: scale(1.05);
}

.content-container {
    flex: 1;
    text-align: left;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2d3748;
}

p {
    line-height: 1.6;
    color: #4a5568;
    margin-bottom: 1.5rem;
}

.contact-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-links a {
    padding: 0.5rem 0.5rem;
    color: var(--accent-color);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.contact-links a:hover {
    background-color: var(--hover-bg);
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .about-container {
        flex-direction: column;
        gap: 2rem;
    }

    .portrait-container {
        max-width: 300px; /* Limit the maximum width of the image container */
        width: 100%; /* Allow it to shrink below max-width */
        margin: 0 auto; /* Center the image container */
        flex-basis: auto;
        height: 0; /* Set height to 0 for padding-bottom hack */
        padding-bottom: 133.33%; /* Maintain 3:4 aspect ratio (height/width * 100) */
        position: relative; /* Needed for absolute positioning of the image */
    }

    .portrait-container p {
        margin: 0; /* Remove default paragraph margins */
    }

    .portrait {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover; /* Fill the container while maintaining aspect ratio */
        object-position: center;
    }

    .contact-links {
        flex-wrap: nowrap; /* Prevent wrapping */
        justify-content: center;
        gap: 1rem; /* Adjust gap for smaller screens */
    }

}

.image-container {
  text-align: center;
  margin: 2rem 0;
}

.image-caption {
  font-style: italic;
  color: #666;
  margin-top: 0.5rem;
  font-size: 0.9em;
}

.center-image {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.image-small {
  max-width: 400px;
  width: 100%;
  height: auto;
}

.image-medium {
  max-width: 600px;
  width: 100%;
  height: auto;
}

.image-large {
  max-width: 800px;
  width: 100%;
  height: auto;
}

.video-wrapper {
    position: relative;
    width: 80%;
    max-width: 900px;
    margin: 30px auto; /* 30px top/bottom margin, auto left/right for centering */
    padding-bottom: 50.625%; /* 16:9 ratio adjusted for 900px width */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Optional: adds a nice shadow */
  }
  
  .video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px; /* Optional: rounds the corners slightly */
  }

/* Blog post preview styles */
.blog-post-preview {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.blog-thumbnail {
    flex: 0 0 150px;
    height: 100px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.blog-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-thumbnail img:hover {
    transform: scale(1.05);
}

.blog-post-content {
    flex: 1;
}

/* Blog navigation styles */
.blog-nav {
    background-color: var(--nav-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.back-arrow {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.back-arrow:hover {
    color: var(--accent-color);
}