/* Google Reviews Embedder - Frontend Styles */

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

.gre-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Yu Gothic', sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    color: #202124;
}

/* ── Header ─────────────────────────────── */
.gre-header {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.gre-place-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #202124;
    margin-bottom: 12px;
}

.gre-overall {
    display: flex;
    align-items: center;
    gap: 20px;
}

.gre-overall-score {
    font-size: 3rem;
    font-weight: 800;
    color: #202124;
    line-height: 1;
}

.gre-overall-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gre-total-count {
    font-size: .85rem;
    color: #5f6368;
}

.gre-google-link {
    font-size: .8rem;
    color: #1a73e8;
    text-decoration: none;
}
.gre-google-link:hover { text-decoration: underline; }

/* ── Stars ───────────────────────────────── */
.gre-stars { display: inline-flex; gap: 1px; }
.gre-stars .star        { font-size: 1rem; line-height: 1; }
.gre-stars .star.full   { color: #f4b400; }
.gre-stars .star.half   { color: #f4b400; opacity: .6; }
.gre-stars .star.empty  { color: #dadce0; }

.gre-stars-lg .star { font-size: 1.4rem; }

/* ── Grid Layout ─────────────────────────── */
.gre-reviews-grid {
    display: grid;
    gap: 16px;
}

.gre-layout-grid .gre-reviews-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.gre-layout-list .gre-reviews-grid {
    grid-template-columns: 1fr;
}

/* ── Review Card ─────────────────────────── */
.gre-review-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gre-review-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    transform: translateY(-2px);
}

.gre-review-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.gre-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.gre-avatar-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gre-review-meta {
    flex: 1;
    min-width: 0;
}

.gre-author {
    font-weight: 600;
    font-size: .9rem;
    color: #202124;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gre-author:hover { color: #1a73e8; text-decoration: underline; }

.gre-time {
    font-size: .75rem;
    color: #9aa0a6;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Review Body ─────────────────────────── */
.gre-review-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gre-review-text {
    font-size: .88rem;
    line-height: 1.65;
    color: #3c4043;
    margin: 0;
    word-break: break-word;
}

.gre-toggle {
    background: none;
    border: none;
    color: #1a73e8;
    font-size: .82rem;
    cursor: pointer;
    padding: 0;
    align-self: flex-start;
}
.gre-toggle:hover { text-decoration: underline; }

/* ── Pagination ──────────────────────────── */
.gre-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.gre-page-info {
    font-size: .85rem;
    color: #5f6368;
}

.gre-count-info {
    color: #9aa0a6;
}

.gre-btn {
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: .85rem;
    color: #1a73e8;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
}
.gre-btn:hover:not(:disabled) {
    background: #f8f9fa;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.gre-btn:disabled {
    color: #bdc1c6;
    cursor: default;
}

/* ── Footer ──────────────────────────────── */
.gre-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f1f3f4;
    font-size: .75rem;
    color: #9aa0a6;
    flex-wrap: wrap;
    gap: 4px;
}

/* ── Error / Empty ───────────────────────── */
.gre-error {
    background: #fce8e6;
    border: 1px solid #f28b82;
    border-radius: 8px;
    padding: 14px 18px;
    color: #c5221f;
    font-size: .9rem;
}
.gre-error a { color: #c5221f; }

.gre-empty {
    text-align: center;
    padding: 32px;
    color: #9aa0a6;
    font-size: .9rem;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 600px) {
    .gre-layout-grid .gre-reviews-grid {
        grid-template-columns: 1fr;
    }
    .gre-overall-score { font-size: 2.4rem; }
    .gre-pagination { gap: 10px; }
    .gre-btn { padding: 7px 12px; font-size: .8rem; }
}

/* ── Owner Reply ─────────────────────────── */
.gre-owner-reply {
    background: #f8f9fa;
    border-left: 3px solid #4285f4;
    border-radius: 0 8px 8px 0;
    padding: 10px 14px;
    margin-top: 10px;
}
.gre-owner-reply-header {
    font-size: .78rem;
    font-weight: 700;
    color: #1a73e8;
    margin-bottom: 6px;
}
.gre-reply-text {
    font-size: .83rem;
    line-height: 1.6;
    color: #3c4043;
    margin: 0;
}

/* ── Admin-only fallback notice ──────────── */
.gre-admin-fallback-notice {
    background: #fff8e1;
    border: 1px solid #f4b400;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: .82rem;
    color: #7a5700;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Carousel Layout ─────────────────────── */
.gre-layout-carousel .gre-header {
    padding: 16px 20px;
    margin-bottom: 16px;
}
.gre-layout-carousel .gre-place-name { font-size: 1rem; margin-bottom: 8px; }
.gre-layout-carousel .gre-overall-score { font-size: 2.2rem; }

.gre-carousel-wrap {
    position: relative !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px;
    width: 100%;
}

.gre-carousel-track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 4px 2px 12px;
    margin: 0;
    list-style: none;
    flex: 1 1 auto;
    min-width: 0;
    /* スクロールバーを控えめに */
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.gre-carousel-track::-webkit-scrollbar { height: 6px; }
.gre-carousel-track::-webkit-scrollbar-thumb { background: #dadce0; border-radius: 3px; }
.gre-carousel-track::-webkit-scrollbar-track { background: transparent; }

.gre-carousel-track .gre-review-card {
    scroll-snap-align: start;
    flex: 0 0 260px !important;
    width: 260px !important;
    max-width: 260px;
    padding: 14px 16px;
    margin: 0;
}

.gre-carousel-track .gre-review-header { gap: 8px; }
.gre-carousel-track .gre-avatar,
.gre-carousel-track .gre-avatar-placeholder {
    width: 30px;
    height: 30px;
    font-size: .85rem;
}
.gre-carousel-track .gre-author { font-size: .82rem; }
.gre-carousel-track .gre-stars .star { font-size: .82rem; }
.gre-carousel-track .gre-review-text { font-size: .8rem; line-height: 1.55; }
.gre-carousel-track .gre-toggle { font-size: .75rem; }

.gre-verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: #1a73e8;
    color: #fff;
    border-radius: 50%;
    font-size: .6rem;
    margin-left: 2px;
    vertical-align: middle;
}

.gre-carousel-arrow {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #dadce0;
    background: #fff;
    color: #5f6368;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, box-shadow .15s;
}
.gre-carousel-arrow:hover:not(:disabled) {
    background: #f8f9fa;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.gre-carousel-arrow:disabled {
    opacity: .35;
    cursor: default;
}

/* スマホ: 1件のみ表示し、横スライドで次を見る */
@media (max-width: 600px) {
    .gre-carousel-track .gre-review-card {
        flex: 0 0 calc(100% - 8px) !important;
        width: calc(100% - 8px) !important;
        max-width: calc(100% - 8px);
    }
    .gre-carousel-arrow { width: 28px; height: 28px; font-size: 1.1rem; }
}
