/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    background-color: #1a1a1a;
    color: #f0f0f0;
    line-height: 1.8;
    font-size: 16px;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

.main-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
}

.main-content {
    grid-column: 1 / 2;
}

.sidebar {
    grid-column: 2 / 3;
}

/* Header */
header {
    text-align: center;
    padding: 2rem 0;
    background-color: #111;
    margin-bottom: 2rem;
    position: relative;
}

.header-image {
    width: 100%;
    max-width: 450px;
    height: auto;
    object-fit: cover;
    margin: 1rem auto;
    -webkit-mask-image: radial-gradient(circle, black 60%, transparent 100%);
    mask-image: radial-gradient(circle, black 60%, transparent 100%);
}

header h1 {
    font-size: 2.5rem;
    margin-top: 1rem;
}

header p {
    font-size: 1.25rem;
    color: #f0f0f0;
    font-weight: bold;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #111;
    padding: 1rem 2rem;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-logo {
    height: 80px;
    vertical-align: middle;
}

nav .nav-links {
    display: flex;
    gap: 20px;
}

nav .nav-links a {
    color: #f0f0f0;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background 0.3s;
    font-size: 1rem;
}

nav .nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
}

nav .menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #f0f0f0;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Cards */
.projects-list, .blog-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.card {
    background-color: #1e1e1e;
    border: 1px solid #444;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    height: 250px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.card-front, .card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    width: 100%;
    color: #f0f0f0;
    position: absolute;
    backface-visibility: hidden;
    transition: transform 0.6s ease;
}

.card-front {
    background-size: cover;
    background-position: center;
}

.card-front h3 {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.card.has-image .card-front {
    align-items: flex-start;
    padding-top: 1.5rem;
}

.card-content {
    padding: 1.5rem;
    background-color: #2c3e50;
    transform: rotateY(180deg);
}

.card.open .card-front {
    transform: rotateY(-180deg);
}

.card.open .card-content {
    transform: rotateY(0);
}

.card-content p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.8rem;
    color: #bbb;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

.card-content .read-more {
    display: inline-block;
    margin-top: 1rem;
    background-color: #007bff;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    text-decoration: none;
    color: white;
    border-radius: 4px;
}

/* Tags on cards */
.tags-container {
    margin-top: 0.5rem;
    padding: 0 0.5rem;
}

.tag {
    display: inline-block;
    background-color: #3498db;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin: 0.25rem;
}

/* Blog Page Specifics */
.blog-post {
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #333;
}

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

.search-container {
    margin-bottom: 1.5rem;
}

#search-input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #333;
    color: #f0f0f0;
}

/* Filters */
.filter-container {
    margin-bottom: 1.5rem;
    text-align: center;
}

.filter-container button {
    background-color: #444;
    color: #f0f0f0;
    border: none;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.filter-container button:hover {
    background-color: #555;
}

.filter-container button.active {
    background-color: #007bff;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

/* Footer */
footer {
    padding: 2rem;
    text-align: center;
    color: #555;
    font-size: 0.9rem;
    border-top: 1px solid #111;
    margin-top: 2rem;
}

#contact h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #007bff;
}

.contact-list {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.contact-list img {
    width: 35px;
    height: 35px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    filter: grayscale(1) invert(1);
    opacity: 0.7;
}

.contact-list img:hover {
    transform: scale(1.1);
    opacity: 1;
}

/* Animations */
.hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 992px) {
    .main-layout, .projects-list, .blog-list {
        grid-template-columns: 1fr !important;
    }
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem;
    }
    .main-content, .sidebar {
        grid-column: auto;
        min-width: 0;
    }
    .sidebar {
        display: none;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden; /* Prevent horizontal scroll */
    }
    nav .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #1e1e1e;
    }
    nav .nav-links.open {
        display: flex;
    }
    nav .menu-toggle {
        display: block;
    }
    .container {
        padding: 1rem;
    }
    header h1 { font-size: 2rem; }
    header p { font-size: 1.1rem; }
    .header-image {
        max-width: 300px;
    }
    .card-content p { font-size: 0.85rem; }
    footer {
        padding: 1.5rem 1rem;
    }
    .contact-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 15px; /* Space for scrollbar */
        justify-content: flex-start; /* Align items to the start */
    }
    /* Style the mobile "Latest Activity" list */
    #latest-posts-list {
        list-style-type: none;
        padding: 0;
        text-align: center;
    }
    #latest-posts-list li button {
        /* Reset button styles */
        background: none;
        border: none;
        color: #f0f0f0;
        font-size: 1rem;
        font-family: inherit;
        cursor: pointer;

        /* Apply link-like styles */
        width: 100%;
        display: block;
        padding: 0.75rem;
        transition: background-color 0.2s ease-in-out;
    }
    #latest-posts-list li button:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.visible {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #2c3e50;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    color: #f0f0f0;
    background: none;
    border: none;
    cursor: pointer;
}

.modal-read-more {
    display: inline-block;
    margin-top: 1.5rem;
    background-color: #007bff;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    text-decoration: none;
    color: white;
    border-radius: 4px;
}

.modal-read-more {
    display: inline-block;
    margin-.top: 1.5rem;
    background-color: #007bff;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    text-decoration: none;
    color: white;
    border-radius: 4px;
}

/* Blog Page Sidebar */
#blog-sidebar-list {
    list-style: none;
    padding: 0;
}

#blog-sidebar-list li a {
    text-decoration: none;
    color: #f0f0f0;
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid #444;
    transition: background-color 0.2s ease-in-out;
}

#blog-sidebar-list li:last-child a {
    border-bottom: none;
}

#blog-sidebar-list li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#blog-sidebar-list li a.active {
    font-weight: bold;
    color: #00aaff;
    padding-left: 1rem;
}

/* Gallery Page Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.gallery-item {
    background-color: #2a2a2a;
    border: 3px solid #666;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 1/1;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.gallery-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Visitor Counter */
.visitor-counter {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 1001; /* Ensure it's above the sticky nav */
}
