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

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

header h1 {
    margin: 0;
    color: #1c1e21;
    font-size: 2.5rem;
}

header p {
    margin: 5px 0 0;
    color: #606770;
    font-size: 1rem;
}

main {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

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

.meme-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

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

.meme-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.meme-card-title {
    padding: 15px;
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
}

/* Modal Styles */
.hidden {
    display: none !important;
}

#modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 100;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 101;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}


#modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

#modal-close-btn:hover {
    color: #333;
}

#modal-img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 20px;
}

#modal-title {
    margin-top: 0;
    font-size: 2rem;
}

#modal-year {
    font-weight: normal;
}

#modal-origin {
    line-height: 1.6;
}

