* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    min-height: 100%;
    font-family: Georgia, "Times New Roman", serif;
}

body {
    background-image: url("images/reviews-wallpaper.webp");
    background-repeat: repeat;
    background-size: auto;
    background-position: top left;
    color: #2f2430;
}

body.modal-open {
    overflow: hidden;
}

.page-shell {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 48px 20px;
}

.reviews-board {
    width: min(980px, 100%);
    background: #8f5c70;
    padding: 26px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
}

.board-header {
    position: relative;
    background: #bc8fa1;
    text-align: center;
    padding: 22px 20px;
    margin-bottom: 26px;
}

.header-left {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.back-home,
.back-home:link,
.back-home:visited,
.back-home:hover,
.back-home:active,
.back-home:focus {
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
    display: inline-block;
}

.back-home:hover,
.back-home:focus {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.7);
}

.board-header h1 {
    color: #f8eff3;
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3.2rem);
    letter-spacing: 0.5px;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.review-card {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 22px;
    background: #bc8fa1;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-left: 8px solid #8f5c70;
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    align-items: start;
}

.review-card-clickable {
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.review-card-clickable:hover,
.review-card-clickable:focus {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
    background: #c798ab;
    outline: none;
}

.review-card-clickable:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 10px 24px rgba(0, 0, 0, 0.14);
}

.review-image-wrap {
    width: 180px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.review-image {
    width: 100%;
    max-width: 180px;
    height: 270px;
    object-fit: cover;
    display: block;
    border-radius: 14px;
    border: 2px solid #8f5c70;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    background: #ffffff;
}

.review-content {
    min-width: 0;
}

.review-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.review-heading h2 {
    font-size: 2rem;
    line-height: 1.15;
    margin-bottom: 6px;
    color: #ffffff;
}

.review-author {
    font-size: 1rem;
    color: #f0e4ea;
    margin-bottom: 4px;
}

.review-date {
    font-size: 0.95rem;
    color: #f0e4ea;
}

.review-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.25);
    margin: 16px 0;
}

.review-body p,
.review-body div,
.review-body li,
.review-body blockquote {
    font-size: 1.22rem;
    line-height: 1.7;
    color: #ffffff;
}

.review-body ul,
.review-body ol {
    margin-left: 24px;
}

.review-body blockquote {
    padding-left: 16px;
    border-left: 3px solid rgba(255, 255, 255, 0.28);
}

.review-body-full {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
}

.review-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.tag {
    display: inline-block;
    background: #8f5c70;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.85rem;
    color: #ffffff;
}

.review-empty {
    background: #bc8fa1;
    border-radius: 16px;
    padding: 24px;
    color: #ffffff;
}

.star-rating {
    position: relative;
    display: inline-block;
    margin-right: 0px;
    font-size: 40px;
    line-height: 1;
    flex-shrink: 0;
}

.star-rating::before {
    content: "★★★★★";
    color: #ccc;
}

.star-rating::after {
    content: "★★★★★";
    color: gold;
    position: absolute;
    top: 0;
    left: 0;
    width: var(--rating);
    overflow: hidden;
    white-space: nowrap;
}

.star-rating-modal {
    position: relative;
    display: inline-block;
    margin-right: 80px;
    font-size: 40px;
    line-height: 1;
    flex-shrink: 0;
}
.star-rating-modal::before {
    content: "★★★★★";
    color: #ccc;
}

.star-rating-modal::after {
    content: "★★★★★";
    color: gold;
    position: absolute;
    top: 0;
    left: 0;
    width: var(--rating);
    overflow: hidden;
    white-space: nowrap;
}

.review-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.review-modal.is-open {
    display: block;
}

.review-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(33, 19, 27, 0.72);
    backdrop-filter: blur(3px);
}

.review-modal-dialog {
    position: relative;
    width: min(1040px, calc(100% - 32px));
    max-height: calc(100vh - 40px);
    margin: 20px auto;
    z-index: 1;
    overflow: auto;
}

.review-card-modal {
    position: relative;
    margin-top: 10px;
    border-left-width: 10px;
    min-height: 50vh;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

/* top: 34px; was modified to move close button down in modal */
.review-modal-close {
    position: absolute;
    top: 34px;
    right: 14px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background 0.18s ease, transform 0.18s ease;
}

.review-modal-close:hover,
.review-modal-close:focus {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.04);
    outline: none;
}

@media (max-width: 860px) {
    .review-card {
        grid-template-columns: 150px 1fr;
        gap: 18px;
    }
    
    .review-card-modal {
        min-height: unset; /* or 0 / auto */
    }

    .review-image-wrap {
        width: 150px;
    }

    .review-image {
        max-width: 150px;
        height: 225px;
    }

    .review-heading h2 {
        font-size: 1.6rem;
    }

    .review-body p,
    .review-body div,
    .review-body li,
    .review-body blockquote {
        font-size: 1.08rem;
    }

    /* Added for mobile.  top: 54px; was modified to move close button down in model */
    .review-modal-close {
        top: 34px;
        right: 10px;
    }
    
}

@media (max-width: 640px) {
    .page-shell {
        padding: 20px 12px;
    }

    .reviews-board {
        padding: 14px;
    }

    .board-header {
        padding: 16px 12px;
        margin-bottom: 16px;
    }

    .header-left {
        position: static;
        transform: none;
        margin-bottom: 10px;
        text-align: left;
    }

    .board-header h1 {
        margin-top: 5px;
    }

    .review-card {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .review-image-wrap {
        width: 100%;
        justify-content: flex-start;
    }

    .review-image {
        width: 150px;
        max-width: 150px;
        height: 225px;
    }

    .review-top {
        flex-direction: column;
        gap: 10px;
    }

    .review-heading h2 {
        font-size: 1.4rem;
    }

    .review-body p,
    .review-body div,
    .review-body li,
    .review-body blockquote {
        font-size: 1rem;
    }

    .review-modal-dialog {
        width: min(100% - 20px, 1040px);
        margin: 10px auto;
        max-height: calc(100vh - 20px);
    }

    .review-modal-close {
        top: 34px;
        right: 10px;
    }

    .review-body-full {
        max-height: none;
        overflow: visible;
        padding-right: 0;
        padding-bottom: 50px;
    }
}