/* ─────────────────────────────────────────────
 * DSS Google Reviews – Frontend Styles
 * Version: 1.2.0
 * Mobile-first: stacked card layout on ≤680px,
 * grid layout on tablet (681–1024px) and desktop (≥1025px).
 * ───────────────────────────────────────────── */

/* ─────────────────────────────────────────────
 * Shortcode wrapper – neutral block container
 * ───────────────────────────────────────────── */
.dssgr-sc-wrapper {
    display: block;
    margin: 0;
    padding: 0;
}

/* ─────────────────────────────────────────────
 * Responsive visibility toggle
 * Mobile  (≤680px)  : show mobile section, hide desktop
 * Tablet+ (≥681px)  : show desktop section, hide mobile
 * ───────────────────────────────────────────── */
.dssgr-section--desktop {
    display: block;
}

.dssgr-mobile-section {
    display: none;
}

@media (max-width: 680px) {
    .dssgr-section--desktop {
        display: none !important;
    }
    .dssgr-mobile-section {
        display: block;
    }
}

/* ─────────────────────────────────────────────
 * DESKTOP / TABLET – Section Wrapper
 * ───────────────────────────────────────────── */
.dssgr-section {
    max-width: 1320px;
    margin: 60px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Section Title */
.dssgr-section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 40px;
    line-height: 1.3;
}

/* Grid Layout */
.dssgr-grid {
    display: grid;
    gap: 24px;
}

.dssgr-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.dssgr-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* ─────────────────────────────────────────────
 * Card – Shared
 * ───────────────────────────────────────────── */
.dssgr-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    overflow: hidden;
}

.dssgr-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.dssgr-card-inner {
    padding: 32px 28px;
}

/* ─────────────────────────────────────────────
 * Intro Card
 * ───────────────────────────────────────────── */
.dssgr-card-intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dssgr-intro-sub {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.dssgr-intro-heading {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 14px;
    line-height: 1.3;
}

.dssgr-intro-text {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.65;
    margin: 0 0 24px;
}

/* CTA Buttons */
.dssgr-intro-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.dssgr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
    border: none;
}

.dssgr-btn-primary {
    background: #f59e0b;
    color: #ffffff;
}

.dssgr-btn-primary:hover {
    background: #d97706;
    color: #ffffff;
    text-decoration: none;
}

.dssgr-btn-secondary {
    background: #ffffff;
    color: #1a1a1a;
    border: 1.5px solid #d1d5db;
}

.dssgr-btn-secondary:hover {
    background: #f3f4f6;
    color: #1a1a1a;
    text-decoration: none;
}

/* ─────────────────────────────────────────────
 * Review Card (Desktop / Tablet)
 * ───────────────────────────────────────────── */
.dssgr-card-review .dssgr-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Profile Photo */
.dssgr-reviewer-photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.dssgr-reviewer-photo img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.dssgr-reviewer-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    border-radius: 50%;
}

/* Reviewer Name */
.dssgr-reviewer-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px;
    line-height: 1.3;
}

/* Role / Relative Time */
.dssgr-reviewer-role {
    display: block;
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 12px;
}

/* Divider */
.dssgr-review-divider {
    width: 100%;
    height: 1px;
    background: #f0f0f0;
    margin: 4px 0 16px;
}

/* Review Text */
.dssgr-review-text {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.7;
    margin: 0 0 18px;
    flex-grow: 1;
}

/* Stars */
.dssgr-stars {
    display: flex;
    gap: 3px;
    justify-content: center;
}

.dssgr-star {
    font-size: 18px;
    line-height: 1;
}

.dssgr-star-filled {
    color: #f59e0b;
}

.dssgr-star-empty {
    color: #d1d5db;
}

/* ─────────────────────────────────────────────
 * Desktop / Tablet Responsive
 * ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .dssgr-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .dssgr-section-title {
        font-size: 26px;
    }
}

@media (max-width: 680px) {
    /* Desktop section is hidden here (see toggle above) */
    .dssgr-section {
        margin: 40px auto;
    }
}


/* ═══════════════════════════════════════════════════
 * MOBILE-FIRST SECTION
 * Shown only on ≤680px. Completely isolated CSS scope.
 * ═══════════════════════════════════════════════════ */

.dssgr-mobile-section {
    background-color: #f5f0e8;
    padding: 48px 20px 44px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.dssgr-mobile-inner {
    max-width: 500px;
    margin: 0 auto;
}

/* ── Title ── */
.dssgr-mobile-title {
    font-size: clamp(22px, 7.5vw, 30px);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #1a1a1a;
    text-align: center;
    margin: 0 0 10px;
    line-height: 1.15;
    font-style: normal;
}

/* ── Aggregate rating row: ★★★★★ 4.9 / 5 · 1,284 REVIEWS ── */
.dssgr-mobile-aggregate {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px 7px;
    margin-bottom: 30px;
}

.dssgr-mobile-aggr-stars {
    color: #f59e0b;
    font-size: 15px;
    letter-spacing: 2px;
    line-height: 1;
}

.dssgr-mobile-aggr-score {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.dssgr-mobile-aggr-sep {
    font-size: 13px;
    color: #9ca3af;
}

.dssgr-mobile-aggr-count {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.3px;
}

/* ── Card stack ── */
.dssgr-mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

/* ── Individual mobile card ── */
.dssgr-mobile-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 18px 20px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.05),
        0 4px 16px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.dssgr-mobile-card:active {
    transform: scale(0.985);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

/* ── Card header row: [avatar] [author] [stars] ── */
.dssgr-mobile-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 13px;
}

/* ── Avatar circle ── */
.dssgr-mobile-avatar {
    width: 44px;
    min-width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #f59e0b;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    line-height: 1;
}

.dssgr-mobile-avatar--photo {
    background-color: transparent;
}

.dssgr-mobile-avatar img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* ── Author name + badge (takes remaining width) ── */
.dssgr-mobile-author {
    flex: 1 1 0;
    min-width: 0;
}

.dssgr-mobile-author-name {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dssgr-mobile-author-badge {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    margin-top: 3px;
}

/* ── Stars positioned at right of card header ── */
.dssgr-mobile-card-stars {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 1px;
}

.dssgr-mobile-card-stars .dssgr-star {
    font-size: 15px;
    line-height: 1;
}

/* ── Review text body ── */
.dssgr-mobile-review-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.65;
    margin: 0;
    word-break: break-word;
}

/* ── View All button ── */
.dssgr-mobile-viewall-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 15px 20px;
    margin-top: 8px;
    background: #1a1a1a;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-decoration: none;
    border-radius: 50px;
    box-sizing: border-box;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.dssgr-mobile-viewall-btn:hover,
.dssgr-mobile-viewall-btn:focus {
    background: #333333;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    outline: none;
}

.dssgr-mobile-viewall-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ── Smooth card entrance animation on mobile ── */
@keyframes dssgr-mobile-card-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dssgr-mobile-section .dssgr-mobile-card {
    animation: dssgr-mobile-card-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dssgr-mobile-section .dssgr-mobile-card:nth-child(1) { animation-delay: 0.05s; }
.dssgr-mobile-section .dssgr-mobile-card:nth-child(2) { animation-delay: 0.12s; }
.dssgr-mobile-section .dssgr-mobile-card:nth-child(3) { animation-delay: 0.19s; }

/* ── Very small screens ── */
@media (max-width: 360px) {
    .dssgr-mobile-section {
        padding: 36px 16px 36px;
    }
    .dssgr-mobile-card {
        padding: 16px 14px 18px;
    }
    .dssgr-mobile-avatar {
        width: 38px;
        min-width: 38px;
        height: 38px;
        font-size: 16px;
    }
    .dssgr-mobile-avatar img {
        width: 38px;
        height: 38px;
    }
    .dssgr-mobile-author-name {
        font-size: 14px;
    }
}
