/**
 * DGWEB — Avis Google : widget front.
 */

.dgr-widget {
    --dgr-gold: #fbbc05;
    --dgr-card: #ffffff;
    --dgr-panel: #f7f8fa;
    --dgr-border: #e8e9ee;
    --dgr-ink: #1f2430;
    --dgr-text: #3c4149;
    --dgr-muted: #70757a;
    --dgr-star-empty: #dadce0;
    box-sizing: border-box;
    width: 100%;
    color: var(--dgr-ink);
    font-family: inherit;
    -webkit-font-smoothing: antialiased;
}

.dgr-widget *,
.dgr-widget *::before,
.dgr-widget *::after {
    box-sizing: border-box;
}

/* ---------------------------------------------------------------- Header */

.dgr-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding: 18px 22px;
    background: var(--dgr-panel);
    border-radius: 16px;
    margin-bottom: 22px;
}

.dgr-head__brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    line-height: 1;
}

.dgr-gword {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.dgr-head__label {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--dgr-muted);
}

.dgr-head__score {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dgr-head__num {
    font-size: 1.35rem;
    font-weight: 700;
    color: #e7711b;
}

.dgr-head__count {
    color: var(--dgr-muted);
    font-size: 0.95rem;
}

.dgr-head__cta {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    padding: 11px 20px;
    border-radius: 999px;
    background: var(--dgr-accent, #ffc93c);
    color: #12141c;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    white-space: nowrap;
}

.dgr-head__cta:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.45);
    color: #12141c;
}

/* ----------------------------------------------------------------- Stars */

.dgr-stars {
    display: inline-flex;
    gap: 2px;
    line-height: 0;
}

.dgr-star {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
}

.dgr-star svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: var(--dgr-star-empty);
}

.dgr-star.is-full svg {
    fill: var(--dgr-gold);
}

.dgr-star.is-half::before {
    content: "";
    position: absolute;
    inset: 0;
    width: 50%;
    overflow: hidden;
    background: var(--dgr-gold);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.9 6.26L21.6 9.2l-4.8 4.68 1.14 6.62L12 17.27 6.06 20.5l1.14-6.62L2.4 9.2l6.7-.94z'/%3E%3C/svg%3E") left center / 18px 18px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.9 6.26L21.6 9.2l-4.8 4.68 1.14 6.62L12 17.27 6.06 20.5l1.14-6.62L2.4 9.2l6.7-.94z'/%3E%3C/svg%3E") left center / 18px 18px no-repeat;
}

/* ------------------------------------------------------------- Carrousel */

.dgr-body {
    position: relative;
}

.dgr-viewport {
    overflow: hidden;
    touch-action: pan-y; /* laisse le scroll vertical, on gère l'horizontal */
}

.dgr-viewport.dgr-grab {
    cursor: grab;
}

.dgr-viewport.dgr-grab.is-dragging {
    cursor: grabbing;
}

.dgr-viewport.is-dragging {
    user-select: none;
}

.dgr-track img {
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

.dgr-track {
    display: flex;
    gap: 18px;
    margin: 0;
    padding: 6px 2px;
    list-style: none;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.dgr-layout-grid .dgr-track {
    flex-wrap: wrap;
    transition: none;
}

.dgr-card {
    flex: 0 0 300px;
    max-width: 84vw;
    background: var(--dgr-card);
    border: 1px solid var(--dgr-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 12px 30px -22px rgba(20, 25, 40, 0.5);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dgr-layout-grid .dgr-card {
    flex: 1 1 280px;
    max-width: none;
}

/* Blindage : certains thèmes stylent « #wrapper ul li » (puce ::before, padding,
   margin) et ces règles fuient sur nos cartes <li>. On neutralise, en forçant
   pour battre la spécificité d'un sélecteur à #id. */
.dgr-track,
.dgr-track > .dgr-card {
    list-style: none !important;
}

.dgr-track > .dgr-card {
    margin-bottom: 0 !important;
    padding-left: 20px !important;
    text-indent: 0 !important;
}

.dgr-track > .dgr-card::before,
.dgr-track > .dgr-card::after {
    content: none !important;
    display: none !important;
}

.dgr-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---------------------------------------------------------------- Avatar */

.dgr-avatar {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
}

.dgr-avatar__img,
.dgr-avatar__initial {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
}

.dgr-avatar__initial {
    color: #fff;
    font-weight: 600;
    font-size: 1.15rem;
    line-height: 1;
}

.dgr-avatar__badge {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

.dgr-card__id {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dgr-card__name {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--dgr-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dgr-card__check svg {
    width: 15px;
    height: 15px;
    fill: #4285f4;
    flex: 0 0 auto;
}

.dgr-card__date {
    font-size: 0.82rem;
    color: var(--dgr-muted);
}

/* ------------------------------------------------------------------ Text */

.dgr-card__text {
    font-size: 0.94rem;
    line-height: 1.55;
    color: var(--dgr-text);
}

.dgr-card__text p {
    margin: 0;
}

.dgr-card__text.is-clamped p {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dgr-card__text.is-open p {
    -webkit-line-clamp: unset;
    overflow: visible;
}

.dgr-more {
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--dgr-muted);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dgr-more:hover {
    color: var(--dgr-ink);
}

/* --------------------------------------------------------------- Nav/dots */

.dgr-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--dgr-border);
    background: #fff;
    color: #3c4149;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px -12px rgba(20, 25, 40, 0.55);
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.dgr-nav:hover {
    transform: translateY(-50%) scale(1.07);
}

.dgr-nav[disabled] {
    opacity: 0.35;
    cursor: default;
}

/* display:flex l'emporterait sur le [hidden] natif → on force le masquage. */
.dgr-nav[hidden] {
    display: none;
}

.dgr-nav svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dgr-nav--prev {
    left: -14px;
}

.dgr-nav--next {
    right: -14px;
}

.dgr-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.dgr-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #cfd3da;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.dgr-dot.is-active {
    background: var(--dgr-accent, #ffc93c);
    transform: scale(1.3);
}

/* --------------------------------------------------------------- États */

.dgr-empty {
    padding: 20px;
    border: 1px dashed var(--dgr-border);
    border-radius: 12px;
    color: var(--dgr-muted);
    text-align: center;
}

/* --------------------------------------------------------------- Thème sombre */

.dgr-theme-dark {
    --dgr-card: #12151d;
    --dgr-panel: #12151d;
    --dgr-border: #262b36;
    --dgr-ink: #eef1f6;
    --dgr-text: #eef1f6;
    --dgr-muted: #99a0ad;
    --dgr-star-empty: #3a4150;
}

.dgr-theme-dark .dgr-head {
    border: 1px solid var(--dgr-border);
}

.dgr-theme-dark .dgr-nav {
    background: #1b1f29;
    color: #eef1f6;
}

.dgr-theme-dark .dgr-avatar__badge {
    background: #f2f2f2;
}

@media (prefers-color-scheme: dark) {
    .dgr-theme-auto {
        --dgr-card: #12151d;
        --dgr-panel: #12151d;
        --dgr-border: #262b36;
        --dgr-ink: #eef1f6;
        --dgr-text: #eef1f6;
        --dgr-muted: #99a0ad;
        --dgr-star-empty: #3a4150;
    }
    .dgr-theme-auto .dgr-nav {
        background: #1b1f29;
        color: #eef1f6;
    }
}

/* --------------------------------------------------------------- Responsive */

@media (max-width: 640px) {
    .dgr-head {
        padding: 16px;
    }
    .dgr-head__cta {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    .dgr-nav {
        display: none;
    }
    .dgr-card {
        flex-basis: 86%;
        max-width: 86%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dgr-track {
        transition: none;
    }
}
