body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    color: #333;
}

header {
    background-color: #fff;
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

nav h1 a {
    color: #007bff;
    text-decoration: none;
    font-size: 24px;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 15px;
}

nav ul li a {
    text-decoration: none;
    color: #555;
    font-weight: bold;
}

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

.meme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.meme-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.meme-card:hover {
    transform: translateY(-5px);
}

.meme-card h3 {
    padding: 10px 15px;
    margin: 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
    font-size: 1.2em;
}

.meme-card img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px; /* Limit image height */
    object-fit: contain; /* Ensure full image is visible, or cover for cropping */
}

.meme-info {
    padding: 10px 15px;
    font-size: 0.9em;
    color: #666;
    display: flex;
    justify-content: space-between;
}

.meme-actions {
    padding: 10px 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.vote-btn {
    background: none;
    border: 1px solid #ccc;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s, border-color 0.2s;
}

.vote-btn:hover {
    background-color: #e9e9e9;
}

.upvote-btn { color: green; border-color: green;}
.upvote-btn:hover { background-color: #e6ffe6; }
.downvote-btn { color: red; border-color: red;}
.downvote-btn:hover { background-color: #ffe6e6; }

.comment-link {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    background-color: #333;
    color: #fff;
}