/* General Styles */

.blog-posts {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Display 4 columns */
    gap: 40px;
    padding: 0 20px; /* Padding handled by main, but keep some for inner spacing */
}

main {
    max-width: 1200px; /* Match header width */
    margin: 0 auto; /* Center the main content */
    padding: 20px; /* Add padding to the sides of the main content */
}

.blog-post {
    display: flex;
    flex-direction: column; /* Stack content vertically */
    background-color: var(--color-background-light); /* Use theme variable */
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    overflow: hidden; /* Ensures image corners are rounded */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}

.blog-post img {
    width: 100%;
    height: 200px; /* Fixed height for images */
    object-fit: cover;
    border-radius: 12px 12px 0 0; /* Top corners rounded */
}

.blog-post-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-post h2 {
    font-size: 1.6em;
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--color-text-primary);
}

.blog-post .post-date {
    font-size: 0.85em;
    color: var(--color-text-secondary);
    margin-bottom: 15px;
}

.blog-post p {
    font-size: 0.95em;
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
    flex-grow: 1; /* Allows content to push read more to bottom */
}

.blog-post .read-more {
    display: inline-block;
    background-color: var(--color-accent);
    color: var(--color-primary); /* Text color for the button */
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    align-self: flex-start; /* Align button to the start */
    transition: background-color 0.3s ease;
}

.blog-post .read-more:hover {
    background-color: #e6e6e6; /* Slightly darker on hover */
}

/* Center the h1 heading */
h1 {
    text-align: center;
    width: 100%;
    display: block;
}

@media (max-width: 768px) {
    .blog-posts {
        grid-template-columns: 1fr; /* Single column on small screens */
        padding: 0;
    }

    .blog-post {
        flex-direction: column;
        align-items: center;
    }

    .blog-post img {
        width: 100%;
        height: 180px; /* Adjust height for mobile images */
        margin-bottom: 0; /* No margin here, padding is in content */
    }

    .blog-post-content {
        text-align: left; /* Keep text left-aligned for readability */
        padding: 15px;
    }

    .blog-post h2 {
        font-size: 1.4em;
    }

    .blog-post .post-date,
    .blog-post p {
        font-size: 0.85em;
    }

    .blog-post .read-more {
        align-self: stretch; /* Make button full width on mobile */
        text-align: center;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .blog-posts {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on medium screens */
    }
}


:root {
    --color-primary: #121212; /* Very dark background for dark mode */
    --color-secondary: #FFFFFF;
    --color-accent: #fff2af;
    --color-text-primary: #FFFFFF; /* Pure white text for dark mode */
    --color-text-secondary: #B0B0B0; /* Lighter gray for secondary text in dark mode */
    --color-background-light: #1E1E1E; /* Slightly lighter dark background for sections in dark mode */
    --color-background-dark: #121212; /* Very dark background for dark mode */
    --color-border: #444444;
    --color-portfolio-bg: var(--color-background-light); /* Portfolio matches hero background in dark mode */
    --color-profile-text: var(--color-text-primary); /* Profile text color in dark mode */
}

body.light-mode {
    --color-primary: #F8F8F8; /* Very light background for light mode */
    --color-secondary: #000000;
    --color-text-primary: #1A1A1A; /* Very dark text for light mode */
    --color-text-secondary: #555555; /* Darker gray for secondary text in light mode */
    --color-background-light: #EFEFEF; /* Slightly darker light background for sections in light mode */
    --color-background-dark: #F8F8F8; /* Very light background for light mode */
    --color-border: #BBBBBB;
    --color-portfolio-bg: var(--color-background-light); /* Portfolio matches hero background in light mode */
    --color-profile-text: #FFFFFF; /* White profile text in light mode */
}



body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-primary);
    color: var(--color-text-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background-color: var(--color-primary);
    color: var(--color-text-primary);
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
}

header nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header nav .nav-links {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0; /* Add some top margin to separate from logo */
    display: flex;
    justify-content: center; /* Center the navigation items */
    width: 100%; /* Ensure it takes full width to center */
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    max-height: 100px;
    max-width: 100%;
    height: auto;
    width: auto;
}

.logo-dark {
    display: block;
}

.logo-light {
    display: none;
}

body.light-mode .logo-dark {
    display: none;
}

body.light-mode .logo-light {
    display: block;
}

.theme-toggle .theme-icon {
    width: 24px;
    height: 24px;
}

.theme-toggle .light-icon {
    display: block;
}

.theme-toggle .dark-icon {
    display: none;
}

body.light-mode .theme-toggle .light-icon {
    display: none;
}

body.light-mode .theme-toggle .dark-icon {
    display: block;
}



header nav ul li {
    margin: 0 15px;
}

header nav .nav-links li a {
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

header nav ul li a:hover {
    color: var(--color-yellow);
}

.btn {
    display: inline-block;
    background-color: var(--color-accent);
    color: var(--color-text-secondary);
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #e6c200;
}

/* Hero Section */
#hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    background-color: var(--color-background-light);
    color: var(--color-text-primary);
}

.dark-mode #hero {
    background-color: #1e1e1e;
}

.hero-image-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 20px; /* Adjust as needed for spacing from text */
}

/* Portfolio Section */
#projects {
    background-color: var(--color-background-light);
    padding: 50px 20px;
}

#projects h2 {
    color: var(--color-text-primary);
    text-align: center;
    margin-bottom: 40px;
}

#projects .gallery-item h3 {
    color: var(--color-text-primary);
}

body.light-mode #projects .gallery-item h3 {
    color: #555555;
}

#portfolio .gallery-item p {
    color: var(--color-text-secondary);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 15px;
    color: var(--color-text-secondary);
}

/* About Section */
#about p {
    color: var(--color-text-primary);
    font-size: 18px;
    line-height: 1.6;
}

.about-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin-top: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
}

.about-quote p {
    color: var(--color-text-primary);
    font-size: 1.5em;
    line-height: 1.6;
}

/* Accordion */
.accordion {
    background-color: var(--color-background-light);
    color: var(--color-text-primary);
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.2em;
    transition: 0.4s;
    margin-top: 20px;
    border-radius: 5px;
}

.active, .accordion:hover {
    background-color: var(--color-accent);
    color: var(--color-secondary);
}

.panel {
    padding: 0 18px;
    background-color: var(--color-background-light);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    border-radius: 5px;
}

.panel p {
    margin-bottom: 10px;
}

.panel h3 {
    color: var(--primary-color);
    margin-top: 20px;
    margin-bottom: 10px;
}

.image-caption {
    text-align: center;
    font-size: 0.9em;
    color: var(--color-text-secondary);
    margin-top: 10px;
}

/* Contact Form */
.contact-form {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
    background-color: var(--color-background-light);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.contact-form .form-group {
    margin-bottom: 15px;
}

.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--color-text-primary);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background-color: var(--color-primary);
    color: var(--color-text-primary);
    box-sizing: border-box; /* Ensures padding doesn't increase width */
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    border-color: var(--color-accent);
    outline: none;
}

.contact-form textarea {
    resize: vertical; /* Allow vertical resizing */
}

.contact-form .btn {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    background-color: var(--color-accent);
    color: #111 ;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.contact-form .btn:hover {
    background-color: #e6c200; /* A slightly darker shade of accent for hover */
}

#hero .container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    max-width: 960px;
    width: 100%;
}

.hero-content {
    flex: 1;
    padding-right: 40px;
}

.hero-content h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    line-height: 1.2;
    color: var(--color-text-secondary);
    text-align: center;
    width: 100%;
    display: block;
}

.hero-content p {
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 20px;
    color: var(--color-text-secondary);
}

.download-button {
    background-color: var(--color-accent);
    color: rgb(8, 8, 8);
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.download-button:hover {
    background-color: #eecc35;
}

.hero-image {
    flex-shrink: 0;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    overflow: hidden;
    border: 10px solid var(--color-accent);
    background-color: var(--color-accent);
    /* 3D effect */
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.hero-image:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
 }

.hero-image-caption {
    text-align: center;
    margin-top: 20px;
    font-size: 1.1em;
    color: var(--color-text-secondary);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Media Queries for responsiveness */
@media (max-width: 768px) {
    #hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        padding-right: 0;
        margin-bottom: 40px;
    }

    .hero-image {
        order: -1; /* Image on top for mobile */
        margin-bottom: 40px;
    }

    .hero-content h1 {
        font-size: 2.5em;
    }

    .hero-content p {
        font-size: 1em;
    }
}

/* About Section */
#about {
    padding: 60px 0;
    text-align: center;
}

.about-section {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.about-quote {
    flex: 1;
    text-align: right;
    font-size: 1.5em;
    font-style: italic;
    color: var(--text-color);
    padding-right: 20px;
    border-right: 2px solid var(--primary-color);
}

.about-content {
    flex: 2;
    text-align: left;
    color: var(--text-color);
}

.about-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.about-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .about-section {
        flex-direction: column;
        align-items: center;
    }

    .about-quote {
        text-align: center;
        padding-right: 0;
        border-right: none;
        border-bottom: 2px solid var(--primary-color);
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .about-content {
        text-align: center;
    }
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px; /* Adjust size as needed */
    height: 30px; /* Adjust size as needed */
    margin-left: 15px; /* Space from other nav items */
}

.theme-toggle img {
    width: 100%;
    height: 100%;
    fill: var(--color-text-primary); /* Use CSS variable for color */
    transition: fill 0.3s ease;
}

.theme-toggle:hover img {
    fill: var(--color-accent); /* Hover effect */
}

/* Hide one icon based on theme */
body.light-mode .theme-toggle .sun-icon {
    display: none;
}

body.dark-mode .theme-toggle .moon-icon {
    display: none;
}

body.light-mode .theme-toggle .moon-icon {
    display: block;
}

body.dark-mode .theme-toggle .sun-icon {
    display: block;
}
.theme-toggle {
    background-color: var(--color-accent);
    color: var(--color-text-secondary);
    border: none;
    padding: 5px 5px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Hamburger Menu */
.hamburger-menu {
    display: none; /* Hidden by default, shown on mobile */
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
}

.hamburger-menu .bar {
    width: 25px;
    height: 3px;
    background-color: var(--color-text-primary);
    margin: 4px 0;
    transition: 0.4s;
}

/* Responsive Design */
@media (max-width: 768px) {
    header nav {
        flex-direction: column;
        align-items: center;
    }

    header nav .nav-links {
        display: none; /* Hide navigation links by default on mobile */
        flex-direction: column;
        width: 100%;
        text-align: center;
    }

    header nav .nav-links.active {
        display: flex; /* Show when active */
        position: absolute;
        top: 100%; /* Position below the header */
        left: 0;
        background-color: var(--color-primary); /* Same as header background */
        width: 100%;
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
        z-index: 999; /* Ensure it's above other content */
    }

    header nav .nav-links li {
        opacity: 0;
        transform: translateY(-20px);
        transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    }

    header nav .nav-links.active li {
        opacity: 1;
        transform: translateY(0);
        display: block; /* Ensure items are displayed */
        margin: 10px 0; /* Add some vertical spacing */
    }

    header nav .nav-links.active li.fade:nth-child(1) { transition-delay: 0.1s; }
    header nav .nav-links.active li.fade:nth-child(2) { transition-delay: 0.2s; }
    header nav .nav-links.active li.fade:nth-child(3) { transition-delay: 0.3s; }
    header nav .nav-links.active li.fade:nth-child(4) { transition-delay: 0.4s; }
    header nav .nav-links.active li.fade:nth-child(5) { transition-delay: 0.5s; }
    header nav .nav-links.active li.fade:nth-child(6) { transition-delay: 0.6s; }
    header nav .nav-links.active li.fade:nth-child(7) { transition-delay: 0.7s; }
    header nav .nav-links.active li.fade:nth-child(8) { transition-delay: 0.8s; }
    header nav .nav-links.active li.fade:nth-child(9) { transition-delay: 0.9s; }
    header nav .nav-links.active li.fade:nth-child(10) { transition-delay: 1.0s; }

    .hamburger-menu {
        display: flex; /* Show hamburger on mobile */
    }

    .hero {
        flex-direction: column;
        padding: 40px 20px;
    }

    .hero-content {
        max-width: 100%;
        text-align: center;
        margin-bottom: 30px;
    }

    .hero-image {
        width: 250px;
        height: 250px;
    }

    .gallery {
        grid-template-columns: 1fr;
    }
}

/* Portfolio Section */
#portfolio {
    background-color:  var(--color-background-light);
    padding: 80px 20px;
    text-align: center;
}

#portfolio h2 {
    font-size: 36px;
    margin-bottom: 40px;
    color: var(--color-text-secondary);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-item {
    background-color: var(--color-primary);
    border: 1px solid var(--color-border);
    padding: 15px;
    border-radius: 8px;
    text-align: left;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 10px;
}

.gallery-item h3 {
    font-size: 20px;
    margin-bottom: 5px;
    color: #fff;
}

.gallery-item p {
    font-size: 16px;
    color: #aaa;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.8); /* Black w/ opacity */
    padding-top: 60px;
}

.modal-content {
    background-color: var(--color-background-light);
    margin: 5% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 700px;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    animation-name: animatetop;
    animation-duration: 0.4s
}

/* Add Animation */
@-webkit-keyframes animatetop {
    from {top:-300px; opacity:0}
    to {top:0; opacity:1}
}

@keyframes animatetop {
    from {top:-300px; opacity:0}
    to {top:0; opacity:1}
}

.close-button {
    color: var(--color-text-primary);
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

#modal-text {
    color: var(--color-text-primary);
    line-height: 1.6;
}

#modal-text h3 {
    color: var(--color-text-primary);
    margin-top: 15px;
    margin-bottom: 10px;
}

#modal-text p {
    margin-bottom: 10px;
}

/* Contact Section */
#contact {
    padding: 50px 20px;
    text-align: center;
    background-color: var(--color-background-light);
}

#contact h2 {
    color: var(--color-text-primary);
    margin-bottom: 30px;
}

#contact p {
    color: var(--color-text-secondary);
    margin-bottom: 15px;
}

.contact-info {
    margin-bottom: 30px;
}

.contact-info p {
    margin: 5px 0;
}

.contact-info a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: bold;
}

.contact-info a:hover {
    text-decoration: underline;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.social-icon img {
    width: 30px;
    height: 30px;
    filter: invert(100%); /* This will make the black SVG white */
}

body.light-mode .social-icon img {
    filter: invert(0%); /* This will make the white SVG black */
}

body.light-mode .social-icon img:hover {
    filter: brightness(0) saturate(100%) invert(89%) sepia(18%) saturate(6000%) hue-rotate(350deg) brightness(102%) contrast(101%); /* This filter approximates --color-accent */
}

.social-icon img:hover {
    filter: brightness(0) saturate(100%) invert(89%) sepia(18%) saturate(6000%) hue-rotate(350deg) brightness(102%) contrast(101%); /* This filter approximates --color-accent */
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-text-primary);
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    background-color: var(--color-primary);
    color: var(--color-text-primary);
    box-sizing: border-box; /* Ensure padding doesn't increase width */
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.contact-form .btn {
    align-self: center;
    padding: 15px 40px;
    font-size: 1.1em;
}

body.light-mode #contact h2,
body.light-mode .form-group label {
    color: var(--color-text-primary);
}

body.light-mode .form-group input[type="text"],
body.light-mode .form-group input[type="email"],
body.light-mode .form-group textarea {
    background-color: var(--color-background-light);
    border-color: var(--color-border);
    color: var(--color-text-primary);
}

body.light-mode .contact-info a {
    color: var(--color-text-secondary);
}

body.light-mode .contact-info a:hover {
    color: var(--color-accent);
}
#contact {
    background-color: var(--color-background-dark);
    padding: 80px 20px;
    text-align: center;
}

#contact h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: var(--color-accent); /* Stylish Yellow Accent */
}

#contact p {
    font-size: 18px;
    color: #ccc;
    margin-bottom: 10px;
}

#contact a {
    color: var(--color-accent); /* Stylish Yellow Accent */
    text-decoration: none;
    font-weight: bold;
}

#contact a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: #111;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #333;
    font-size: 14px;
}