/* ================================
   Layouts
================================ */

/* Grid: max 3 columns */
.sgrw-reviews-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1200px) {
    .sgrw-reviews-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .sgrw-reviews-grid {
        grid-template-columns: 1fr;
    }
}

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

/* ================================
   Base / Safety
================================ */

.sgrw-container {
    font-family: system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, Arial, sans-serif;
    color: #1f1f1f;
}

/* Prevent theme overrides */
.sgrw-container *,
#sgrw-modal * {
    box-sizing: border-box;
}

/* ================================
   Card
================================ */

.sgrw-review {
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    padding: 18px 20px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    color: #1f1f1f;
}

.sgrw-clickable {
    cursor: pointer;
}

.sgrw-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* ================================
   Header
================================ */

.sgrw-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.sgrw-author {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

/* ================================
   Avatar (photo or initials)
================================ */

.sgrw-photo,
.sgrw-initials {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    flex: 0 0 88px;
}

.sgrw-photo {
    object-fit: cover;
    background: #f2f2f2;
}

.sgrw-initials {
    background: #e6e6e6;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    user-select: none;
}

/* ================================
   Author text
================================ */

.sgrw-author strong {
    display: block;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.3;
    color: #1f1f1f !important; /* force dark */
}

.sgrw-venue {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #6f6f6f;
    margin-top: 2px;
    line-height: 1.2; /* suggested */
}

.sgrw-date {
    display: block;
    font-size: 12px;
    color: #8a8a8a;
    margin-top: 2px;
    line-height: 1.2; /* suggested */
}

/* ================================
   Stars
================================ */

.sgrw-stars {
    color: #f4b400;
    font-size: 23px;
    letter-spacing: 1px;
    line-height: 1;
    white-space: nowrap;
    margin-top: 6px;
}

/* ================================
   Review text
================================ */

.sgrw-text {
    font-size: 15px;
    line-height: 1.65;
    color: #333333;
    margin-top: 8px;
}

.sgrw-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #6f6f6f;
    text-align: center;
    text-decoration: underline;
}

/* ================================
   Modal (hidden by default)
================================ */

.sgrw-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sgrw-modal.sgrw-open {
    display: flex;
}

.sgrw-modal-content {
    background: #ffffff;
    border-radius: 14px;
    max-width: 620px;
    width: 100%;
    padding: 28px 32px 48px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    color: #1f1f1f;
}

/* Close button */
.sgrw-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #777;
}

.sgrw-modal-close:hover {
    color: #000;
}

/* Suggested fix: apply spacing without relying on .sgrw-modal-review wrapper */
#sgrw-modal .sgrw-header {
    margin-top: 28px;
}

/* Modal review text */
.sgrw-full-text {
    font-size: 15px;     /* matches card text */
    line-height: 1.75;
    margin-top: 10px;
    color: #333333 !important; /* force readable */
}

/* ================================
   Modal navigation
================================ */

.sgrw-modal-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

.sgrw-modal-nav button {
    background: #750000;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 20px;
    cursor: pointer;
}

.sgrw-modal-nav button:hover {
    filter: brightness(1.15);
}

/* ================================
   Responsive tweaks
================================ */

@media (max-width: 480px) {
    .sgrw-photo,
    .sgrw-initials {
        width: 64px;
        height: 64px;
        flex: 0 0 64px;
        font-size: 18px;
    }

    .sgrw-modal-content {
        padding: 20px;
    }
}
