
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background-color: #0a0a0a;
    color: #fff;
}

.main-heading {
    font-size: 36px;
    color: white;
    text-align: center;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif; /* Elegant serif font */
}

.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    padding: 20px;
    max-width: 1300px;
    width: 100%;
    box-sizing: border-box; /* Ensure padding and border are included in width */
}

.poem-card {
    position: relative;
    overflow: hidden;
    padding: 15px;
    border-radius: 20px;
    background: linear-gradient(145deg, #ffffff, #e6e6e6); /* Soft gradient background */
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 4px 4px 10px #bebebe, -4px -4px 10px #ffffff;
}

.poem-card:hover {
    transform: translateY(-8px);
    box-shadow: 8px 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.poem-card img {
    width: 100%;
    height: 220px; /* Slightly taller image */
    object-fit: cover;
    border-radius: 15px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.9;
}

.poem-card:hover img {
    transform: scale(1.1); /* More pronounced zoom */
    opacity: 1;
}

.poem-card h2 {
    font-size: 24px; /* Slightly larger title */
    color: #333;
    text-align: center;
    margin: 15px 0;
    font-family: 'Merriweather', serif; /* Elegant serif font */
    text-transform: uppercase;
}

.poem-card p {
    background-color: #f9f9f9; /* Softer background for the text */
    padding: 15px;
    border-radius: 15px;
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1);
    font-size: 1.1em;
    line-height: 1.8;
    white-space: pre-wrap;
    margin-top: 10px;
    color: #555;
    display: none;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    max-height: 0; /* Hidden by default */
    opacity: 0;
    overflow: hidden;
}

.poem-card:hover p {
    display: block;
    max-height: 1000px; 
    opacity: 1;
    transition: max-height 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

@media (max-width: 600px) {
    .container {
        grid-template-columns: 1fr;
        gap: 15px; /* Reduced gap for smaller screens */
    }

    .poem-card {
        padding: 10px;
    }

    .poem-card img {
        height: 180px;
    }

    .poem-card h2 {
        font-size: 20px;
        margin: 10px 0;
    }

    .poem-card p {
        padding: 10px;
        font-size: 1em;
    }
}
