* {
    box-sizing: border-box;
}


body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #222;
}

.logo img {
    width: 100px;
    height: 100px;
}

/* Header */

header {
    text-align: center;

    padding:
        45px
        20px
        25px;
}


header h1 {
    margin: 0 0 5px;

    font-size: 32px;
}


header p {
    margin: 0;

    color: #777;
}


/* Main */

main {
    width: 100%;

    max-width: 1200px;

    margin: 0 auto;

    padding: 20px;
}


/* Grid */

.grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(280px, 1fr)
        );

    gap: 20px;
}


/* Card */

.card {
    background: white;

    border-radius: 14px;

    padding: 18px;

    cursor: pointer;

    box-shadow:
        0 2px 8px
        rgba(0, 0, 0, 0.08);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}


.card:hover {
    transform:
        translateY(-3px);

    box-shadow:
        0 8px 25px
        rgba(0, 0, 0, 0.13);
}


.card h2 {
    margin:
        0 0 15px;

    font-size: 20px;
}


/* Date */

.card time {
    display: block;

    margin-top: 12px;

    font-size: 13px;

    color: #888;
}


/* Media */

.media {
    width: 100%;

    overflow: hidden;

    border-radius: 10px;
}


.media img {
    width: 100%;

    max-height: 350px;

    object-fit: cover;

    display: block;
}


.media video {
    width: 100%;

    max-height: 350px;

    display: block;
}


.media iframe {
    width: 100%;

    height: 250px;

    border: 0;

    border-radius: 10px;
}


/* Modal */

.modal {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background:
        rgba(0, 0, 0, 0.65);
}


.hidden {
    display: none;
}


/* Modal content */

.modal-content {
    position: relative;
    width: fit-content;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    background: white;
    border-radius: 16px;
}

.modal-content .media {
    width: 100%;
    display: flex;
    justify-content: center;
}

.modal-content .media img,
.modal-content .media video {
    display: block;
    width: auto;
    max-width: 90vw;
    max-height: 70vh;
    height: auto;
    object-fit: contain;
}

.modal-content .media iframe {
    width: 80vw;
    max-width: 900px;
    height: 60vh;
    border: 0;
    border-radius: 10px;
}


/* Close button */

.close {
    position: absolute;

    top: 10px;
    right: 15px;

    border: 0;

    background: transparent;

    font-size: 32px;

    line-height: 1;

    cursor: pointer;

    color: #555;
}


.close:hover {
    color: #000;
}


/* Full confession */

.content {
    margin-top: 20px;

    line-height: 1.7;

    white-space: pre-wrap;

    overflow-wrap: anywhere;
}


/* Modal timestamp */

#modalTime {
    display: block;

    margin-top: 25px;

    color: #888;

    font-size: 13px;
}


/* Loading */

.loading {
    text-align: center;

    padding: 50px;

    color: #777;
}


/* Mobile */

@media (max-width: 600px) {

    .grid {
        grid-template-columns: 1fr;
    }

    main {
        padding: 12px;
    }

    .modal-content {
        padding: 22px;
    }

}