/* =========================================
   1. CSS VARIABLES (Color Palette & Fonts)
   ========================================= */
:root {
    --bg-color: #fcfcfc;
    --text-color: #333333;
    --accent-color: #0056b3;
    --secondary-text: #666666;
    --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* =========================================
   2. BASIC RESET & BASE STYLES
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    max-width: 900px; /* Keeps line lengths readable */
    margin: 0 auto;   /* Centers the site on the screen */
    padding: 2rem;
}

/* =========================================
   3. TYPOGRAPHY & LINKS
   ========================================= */
h1, h2, h3 {
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--text-color);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.75rem;
    border-bottom: 2px solid var(--text-color); /* The line thickness and color */
    padding-bottom: 0.1rem;                     /* Space between the text and the line */
    margin-bottom: 1.5rem;                      /* Space between the line and the content below */
    display: inline-block;                      /* Makes the line only as wide as the text. Remove this if you want the line to go across the whole screen! */
}

p {
    margin-bottom: 1rem;
    color: var(--secondary-text);
}

/* Standard inline text links */
p a, .header-text a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.2s ease;
}

p a:hover, .header-text a:hover {
    border-bottom: 1px solid var(--accent-color);
}

.contact-links {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 1rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.contact-links a {
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.contact-links a:hover {
    color: var(--accent-color);
    border-bottom: 1px solid var(--accent-color);
}

.separator {
    color: #cccccc; /* A nice light gray so the pipe doesn't distract from the words */
    user-select: none; /* Prevents the user from accidentally highlighting the pipe when copying your email */
}

/* Groups the icon and text together seamlessly */
.social-text-item {
    display: inline-flex;
    align-items: center;
    gap: 6px; /* Adds a tiny bit of space between the logo and the word "LinkedIn" */
}

/* Colors the logo grey */
.decorative-icon {
    fill: var(--secondary-text); /* Pulls the grey from your root variables */
    display: block;
}

/* =========================================
   4. HEADER & PROFILE IMAGE
   ========================================= */
header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eaeaea;
}

/* Flexbox layout for the header */
.header-layout {
    display: flex;
    align-items: center;       
    justify-content: space-between;
    gap: 2rem;                 
}

.header-text {
    flex: 1;                   
}

/* The circular image styling */
.header-image img {
    width: 200px;              
    height: 200px;             
    border-radius: 50%;        
    object-fit: cover;         
    /* box-shadow: 0 4px 10px rgba(0,0,0,0.1); */
}

/* =========================================
   5. ICON LINKS (LinkedIn / GitHub)
   ========================================= */
.icon-only-link {
    display: inline-block;
    color: var(--text-color); 
    transition: color 0.2s; 
    margin-top: 0.5rem;
}

.icon-only-link svg {
    width: 24px;
    height: 24px;
    fill: currentColor;     
    display: block;         
}

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

/* =========================================
   6. SECTIONS & PROJECT CARDS
   ========================================= */
section {
    margin-bottom: 3rem;
}

.project-card {
    display: flex;
    gap: 1.5rem;               
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid #eaeaea; 
    align-items: flex-start;
}

/* The last card shouldn't have a border on the bottom */
.project-card:last-child {
    border-bottom: none;
}

/* Image styling */
.project-image-link {
    flex-shrink: 0;            
    width: 200px;              
    display: block;
}

.project-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #eaeaea; 
    object-fit: cover;
    transition: opacity 0.2s ease;
}

/* .project-image-link:hover .project-image {
    opacity: 0.85;             
} */

/* Content styling */
.project-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-title {
    font-size: 1.1rem;
    font-weight: 650;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

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

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

.project-summary {
    font-size: 1rem;
    color: var(--secondary-text);
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Date and Read More link */
.project-footer {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.project-date {
    font-weight: 700;
    color: var(--secondary-text);
    font-size: 0.95rem;
}

.read-more {
    font-size: 0.95rem;
    color: var(--secondary-text);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    align-self: flex-start; 
    transition: all 0.2s ease;
}

.read-more:hover {
    color: var(--accent-color);
    border-bottom: 1px solid var(--accent-color);
}

/* =========================================
   7. FOOTER
   ========================================= */
footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eaeaea;
    font-size: 0.9rem;
    text-align: center;
    color: var(--secondary-text);
    
    /* The CSS magic to break out of the body's max-width container */
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* =========================================
   8. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 650px) {
    body {
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    /* Mobile Header Layout */
    .header-layout {
        flex-direction: column-reverse; 
        text-align: center;             
    }
    
    .header-image img {
        margin-bottom: 1rem;            
    }

    /* Center the icons on mobile header */
    .header-layout .icon-only-link {
        margin: 0.5rem auto;
    }

    /* Mobile Project Cards */
    .project-card {
        flex-direction: column; 
        gap: 1rem;
    }
    
    .project-image-link {
        width: 100%;            
        max-width: 400px;
    }
}

/* =========================================
   9. SUB-PAGE (ARTICLE) STYLES
   ========================================= */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--secondary-text);
    margin-bottom: 2rem;
    text-decoration: none;
    border: none;
}

.back-link:hover {
    color: var(--accent-color);
    border: none;
}

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

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: var(--secondary-text);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-family: monospace;
}

.article-image {
    width: 25%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #eaeaea;
    margin-bottom: 2.5rem;
}

.article-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

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

/* =========================================
   10. IMAGE GALLERY / ROW
   ========================================= */
.image-row {
    display: flex;
    gap: 1.5rem;               /* Space between the images */
    margin-bottom: 2.5rem;
    align-items: stretch;      /* Makes sure both images stretch to the same height if possible */
}

/* We need to apply flex: 1 to direct children so they share the space 50/50 */
.image-row > img, 
.image-row > picture {
    flex: 1;
    display: block;
    width: 50%;                /* Prevents one image from dominating the other */
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;         /* Crops the images nicely if they are different heights */
    border-radius: 8px;
    border: 1px solid #eaeaea;
}

/* Make them stack on mobile screens so they don't shrink too much */
@media (max-width: 650px) {
    .image-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .image-row > img, 
    .image-row > picture {
        width: 100%;
    }
}

/* =========================================
   11. EXPANDABLE PROJECT CARDS
   ========================================= */
details.expandable-card {
    display: block;
    background-color: #ffffff !important; /* Forces white card background */
    border: 1px solid #eaeaea !important;
    border-radius: 8px !important;
    margin-bottom: 1.25rem !important;
    overflow: hidden;
    width: 100%;
}

/* The clickable header of the card */
details.expandable-card summary {
    padding: 1.25rem 1.5rem !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    cursor: pointer;
    color: var(--text-color) !important;
    background-color: #ffffff !important;
    transition: background-color 0.2s ease, color 0.2s ease;
    list-style: none !important; /* Hides default browser arrow */
    display: flex !important;
    justify-content: space-between;
    align-items: center;
}

/* Hides default browser arrow in Safari/Chrome */
details.expandable-card summary::-webkit-details-marker {
    display: none !important; 
}

/* Adds a sleek '+' icon to the right side */
details.expandable-card summary::after {
    content: '+' !important;
    font-size: 1.5rem !important;
    font-weight: 400 !important;
    color: var(--secondary-text) !important;
    line-height: 1 !important;
}

/* Changes the '+' to a '−' when the card is clicked open */
details.expandable-card[open] summary::after {
    content: '−' !important;
}

details.expandable-card summary:hover {
    background-color: #f9f9f9 !important;
    color: var(--accent-color) !important;
}

/* Adds a crisp separator line between title and content when open */
details.expandable-card[open] summary {
    border-bottom: 1px solid #eaeaea !important;
}

/* Container for hidden content inside the card */
.card-content {
    padding: 1.5rem !important;
    background-color: #ffffff !important;
}

/* Fixes list items specifically when trapped inside an expandable card */
.card-content ul {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    padding-left: 1.25rem !important;
    list-style-type: disc !important;
}

.card-content li {
    margin-bottom: 0.5rem !important;
    color: var(--secondary-text) !important;
    font-size: 1rem !important;
}

.card-content p {
    margin-bottom: 1rem !important;
    color: var(--secondary-text) !important;
}

.card-content p:last-child {
    margin-bottom: 0 !important;
}

/* Cleans up image alignment rules when inserted inside a card */
.card-content .image-row,
.card-content .gallery-image {
    margin-bottom: 0 !important; 
    margin-top: 1rem !important;
}