/* Typography */
body {
    font-family: "Newsreader", serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    line-height: 1.3;
    color: #1C3620;
    background-color: #FFFFFB;
    font-weight: 250;
    font-size: 20px;
}

/* Header styling */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.site-title {
    font-family: "Newsreader", serif;
    color: #659157;
    font-size: 2rem;
    font-weight: normal;
    margin: 0;
    font-weight: 400;
}

/* Navigation */
nav a {
    text-decoration: none;
    margin-left: 2rem;
    transition: color 0.3s;
}

nav a.nav-green {
    color: #659157;
}

nav a.nav-gray {
    color: #7C809B;
    font-weight: 200;
}

nav a.nav-dark {
    color: #1C3620;
}

/* ASCII art banner */
.ascii-art {
    font-family: 'Inconsolata', monospace;
    white-space: pre;
    font-size: 7.5px;
    line-height: 0.6;
    color: #1C3620;
    margin: 0;
    font-weight: 300;
    display: block;
    transform: scale(0.8);
    transform-origin: left top;
    width: max-content;
    position: relative;
    left: 0;
}

/* Hide second half of ASCII art on mobile */
@media (max-width: 768px) {
    .ascii-art {
        font-size: 6px;
        transform: scale(0.6);
        overflow: hidden;
        max-width: 100vw;
    }
}

/* Main content layouts */
.main-content {
    margin-top: 1rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/* Home page specific layout */
.main-content.home {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4rem;
    align-items: start;
    margin-top: -2rem;
}

/* Home page specific styling - keep it centered */
.main-content.home .profile-section {
    text-align: left;
}

.main-content.home .profile-section h1 {
    text-align: left;
}

/* Projects and blog page layout - match home page spacing */
.main-content.projects,
.main-content.blog {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    margin-top: -2rem;
    padding-left: 0;
}

/* Pages with breadcrumbs need different spacing */
.main-content.projects.with-breadcrumb {
    margin-top: -1rem;
}

/* Profile section */
.profile-section {
    text-align: left;
}

.profile-section h1 {
    font-family: "Newsreader", serif;
    color: #1C3620;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    margin-top: 0;
    font-weight: 300;
    text-align: left;
}

/* Text content should be left-aligned within centered blocks */
.profile-section p,
.profile-section .project-category,
.profile-section .project-section {
    text-align: left;
    max-width: 100%;
}

/* Project content blocks - no extra centering margins */
.project-category,
.project-section {
    margin-left: 0;
    margin-right: 0;
}

.profile-image {
    border-radius: 50%;
    width: 200px;
    height: 200px;
    object-fit: cover;
    border: 3px solid #aeadf0;
    margin-right: 0;
}

/* Links styling */
a {
    color: #659157;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

b {
    color: #7C809B;
    text-decoration: none;
    font-weight: 250;
}

/* Project page styling */
.project-category h2 {
    color: #659157;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 300;
}

.project-item {
    margin-bottom: 1.5rem;
}

.project-item h3 {
    color: #1C3620;
    margin-bottom: 0.5rem;
}

.project-item p {
    margin: 0;
    color: #7C809B;
}

/* Breadcrumb styling */
.breadcrumb {
    margin-top: -3rem;
    margin-bottom: 1.5rem;
    color: #7C809B;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #659157;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Project detail page styling */
.project-header h1 {
    color: #1C3620;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
    text-align: left;
}

.project-header p {
    color: #7C809B;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.project-section {
    margin-bottom: 3rem;
}

.project-section h2 {
    color: #659157;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 300;
}

.project-section h3 {
    color: #1C3620;
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    font-weight: 300;
}

.project-section ul {
    color: #7C809B;
    padding-left: 1.5rem;
}

.project-section li {
    margin-bottom: 0.5rem;
}

/* Project grid */
.projects-grid {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    background: #fafafa;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.project-card h3 {
    color: #1C3620;
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

.project-card p {
    color: #7C809B;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.project-link {
    color: #659157;
    font-weight: 400;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.project-link:hover {
    border-bottom-color: #659157;
    text-decoration: none;
}

/* Image and GIF styling */
.cropped-gif {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* More aggressive cropping for GIFs (like flowers) */
.cropped-gif-tight {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    clip-path: inset(0 8% 10% 8% round 8px);
}

/* Less aggressive cropping for photos */
.cropped-photo {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* iPhone vertical photo sizes */
.gif-small {
    width: 250px;
    height: 333px; /* iPhone aspect ratio ~3:4 */
}

.gif-medium {
    width: 350px;
    height: 467px; /* iPhone aspect ratio ~3:4 */
}

.gif-large {
    width: 500px;
    height: 667px; /* iPhone aspect ratio ~3:4 */
}

.gif-square-small {
    width: 250px;
    height: 250px; /* 1:1 aspect ratio */
}

.gif-square-medium {
    width: 350px;
    height: 350px; /* 1:1 aspect ratio */
}

.gif-square-large {
    width: 500px;
    height: 500px; /* 1:1 aspect ratio */
}

/* Landscape/GIF sizes for horizontal content */
.gif-landscape-small {
    width: 400px;
    height: 300px;
}

.gif-landscape-medium {
    width: 600px;
    height: 400px;
}

.gif-landscape-large {
    width: 800px;
    height: 500px;
}

/* Center alignment for images */
.image-center {
    display: block;
    margin: 1.5rem auto;
}

/* Image containers with captions */
.image-container {
    margin: 2rem 0;
    text-align: center;
}

.image-container img {
    display: block;
    margin: 0 auto 0.5rem auto;
    max-width: 100%;
    height: auto;
}

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

/* Project-specific caption styling for better visibility */
.project-caption {
    font-size: 1rem;
    color: #1C3620;
    font-style: italic;
    margin-top: 0.5rem;
    font-weight: 300;
}

/* Adjust caption spacing for cropped GIFs */
.cropped-gif-tight + .image-caption,
.cropped-gif-tight + .project-caption {
    margin-top: -4rem;
}

/* Print styles to fix GIF caption overlap */
@media print {
    .cropped-gif-tight + .image-caption,
    .cropped-gif-tight + .project-caption {
        margin-top: 0.5rem;
        page-break-inside: avoid;
    }
    
    .cropped-gif-tight {
        clip-path: none;
        border-radius: 8px;
        page-break-inside: avoid;
    }
    
    .image-container {
        page-break-inside: avoid;
    }
}

/* Side-by-side comparison layout */
.comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
    align-items: start;
}

.comparison-item {
    text-align: center;
}

.comparison-item img {
    display: block;
    margin: 0 auto 0.5rem auto;
}

/* Code styling */
code {
    font-family: 'Inconsolata', monospace;
    background-color: #f4f4f4;
    color: #1C3620;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9rem;
    border: 1px solid #e0e0e0;
}

pre {
    font-family: 'Inconsolata', monospace;
    background-color: #f8f8f8;
    color: #1C3620;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    overflow-x: auto;
    line-height: 1.4;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
}

.code-container {
    margin: 1.5rem 0;
}

.code-title {
    font-family: 'Inconsolata', monospace;
    font-size: 0.85rem;
    color: #659157;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Code block with title */
.code-container pre {
    margin-top: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-content {
        max-width: 100%;
        padding: 0 1rem;
    }

    .main-content.home {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .main-content.projects,
    .main-content.blog {
        max-width: 100%;
        padding: 0 1rem;
    }

    .profile-image {
        width: 200px;
        height: 200px;
        max-width: 200px;
        margin: 0 auto;
    }

    /* Allow heading to wrap on mobile */
    .profile-section h1,
    .project-header h1 {
        white-space: normal;
        font-size: 2rem;
        line-height: 1.2;
        text-align: left;
    }

    /* Stack comparison images on mobile */
    .comparison-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Responsive iPhone photo sizes */
    .gif-small, .gif-medium, .gif-large {
        width: 100%;
        max-width: 280px;
        height: auto;
    }
    
    /* Responsive square photo sizes */
    .gif-square-small, .gif-square-medium, .gif-square-large {
        width: 100%;
        max-width: 280px;
        height: auto;
    }

    /* Responsive landscape sizes */
    .gif-landscape-small, .gif-landscape-medium, .gif-landscape-large {
        width: 100%;
        max-width: 350px;
        height: auto;
    }
}
