body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #AA8D5B;
    background-image: url("img/couv.png");
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    color: #2c241b;
}

.page-container {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 30px;
    padding: 40px;
    box-sizing: border-box;
}

h1 {
    text-align: center;
    margin: 30px 0;
    color: #AA8D5B;
    text-decoration: underline;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.card {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    cursor: pointer;
    background: #ddd;
    border: 1px solid #000;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
}

.card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

.overlay {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    box-sizing: border-box;
    background: white;
    color: #000;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    border-top: 1px solid #000;
    border-bottom-left-radius: 22px;
    border-bottom-right-radius: 22px;
}

.empty-message {
    font-size: 20px;
    margin-top: 20px;
}

.back-btn {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 20px;
    background: #d8c4a2;
    color: #000;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-sizing: border-box;
    z-index: 9999;
}

.modal.active {
    display: flex;
}

.modal-box {
    width: 100%;
    max-width: 950px;
    background: #fff;
    border-radius: 28px;
    padding: 28px;
    box-sizing: border-box;
    position: relative;
}

.modal-content {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 28px;
    align-items: start;
}

.modal-left img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 20px;
    display: block;
    margin-bottom: 20px;
}

.modal-title {
    margin: 0 0 20px 0;
    font-size: 22px;
    font-weight: bold;
}

.modal-text,
.modal-side-text {
    font-size: 18px;
    line-height: 1.35;
    font-weight: 700;
    word-break: break-word;
}

.modal-close,
.modal-back {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: #d8c4a2;
    color: #000;
    font-weight: bold;
    cursor: pointer;
}

@media (max-width: 1100px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 800px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 540px) {
    .page-container {
        width: 94%;
        padding: 22px;
    }

    h1 {
        font-size: 34px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .card img {
        height: 220px;
    }
}