/* General responsive adjustments */
@media screen and (max-width: 768px) {

    /* Container adjustments */
    .container {
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    main {
        padding: 1.25rem;
        width: 100%;
        box-sizing: border-box;
    }

    /* Project grid - force single column on small screens */
    .projects-grid {
        grid-template-columns: 1fr;
        width: 100%;
        padding: 0;
        margin-top: 1.5rem;
    }

    /* Card adjustments for smaller screens */
    .project-card {
        width: 100%;
        box-sizing: border-box;
        margin-left: 0;
        margin-right: 0;
        min-height: auto;
        /* Allow height to be determined by content */
        padding: 1.25rem;
    }

    /* Text size adjustments */
    .project-card h3 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }

    /* Ensure tags wrap properly */
    .project-tags {
        flex-wrap: wrap;
        max-width: 100%;
    }

    .tag {
        margin-bottom: 0.25rem;
        padding: 0.2rem 0.6rem;
        font-size: 0.85rem;
    }

    /* Handle long text */
    .project-card p,
    .project-card h3 {
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
        max-width: 100%;
    }
    
    /* Project page specific adjustments */
    .project-header-meta {
        margin: 0 1rem 1em;
    }
}

/* For very small screens */
@media screen and (max-width: 480px) {
    main {
        padding: 1rem;
    }

    .project-card {
        padding: 1rem;
    }

    /* Adjust meta info layout on very small screens */
    .card-meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .project-header-meta {
        margin: 0 0.5rem 0.75em;
    }

    .date-display {
        margin-right: 0;
    }

    .star-rating {
        align-self: flex-end;
        margin-top: 0.5rem;
    }

    /* Further reduce padding */
    .project-card {
        padding: 0.875rem;
    }

    /* Make sure show more button fits */
    .show-more-container {
        width: 100%;
        margin-top: 1.5rem;
    }

    #showMoreBtn {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
}

/* Ensure images and other media are responsive */
img,
pre,
code,
table {
    max-width: 100%;
    height: auto;
}