/* =====================================================
   RoofAdvisor Project Map v2 — Public CSS
   ===================================================== */

/* ── Toolbar ──────────────────────────────────────── */
.rapm-wrap { width: 100%; font-family: inherit; }

.rapm-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 0 14px;
}
.rapm-filter-group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Type pills */
.rapm-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 4px;
    border: 1px solid #d0d0d0;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .12s, background .12s;
    user-select: none;
    white-space: nowrap;
}
.rapm-pill:hover, .rapm-pill--active { border-color: #185FA5; background: #E6F1FB; }
.rapm-dot { width: 8px; height: 8px; border-radius: 4px; display: inline-block; }
.rapm-dot--all    { background: #888; }
.rapm-dot--review { background: #185FA5; }
.rapm-dot--project{ background: #3B6D11; }

/* Job type select */
.rapm-toolbar select {
    padding: 6px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    color: #333;
}

/* Map buttons */
.rapm-map-btns { display: flex; gap: 6px; }
.rapm-map-btn {
    width: 34px; height: 34px;
    border-radius: 4px;
    border: 1px solid #d0d0d0;
    background: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #444;
    transition: background .12s, border-color .12s;
}
.rapm-map-btn:hover, .rapm-map-btn--active { background: #E6F1FB; border-color: #185FA5; color: #185FA5; }

.rapm-count { font-size: 13px; color: #666; margin-left: auto; }

/* ── Map ─────────────────────────────────────────── */
.rapm-body { border-radius: 4px; overflow: hidden; border: 1px solid #e0e0e0; }
.rapm-map-col { width: 100%; }
#rapm-map { width: 100%; display: block; }

/* ── Info window ─────────────────────────────────── */
.rapm-iw { max-width: 260px; font-family: inherit; }
.rapm-iw-body { padding: 10px 12px 12px; }
.rapm-iw-badge {
    display: inline-block; font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 4px; text-transform: uppercase;
    letter-spacing: .04em; margin-bottom: 6px;
}
.rapm-iw-badge--review  { background: #E6F1FB; color: #0C447C; }
.rapm-iw-badge--project { background: #EAF3DE; color: #27500A; }
.rapm-iw-loc   { font-size: 13px; font-weight: 600; color: #222; margin: 0 0 4px; }
.rapm-iw-stars { color: #EF9F27; font-size: 14px; margin: 0 0 6px; }
.rapm-iw-review{ font-size: 12px; color: #555; font-style: italic; margin: 0 0 8px; line-height: 1.5; }
.rapm-iw-link  { font-size: 12px; font-weight: 600; color: #185FA5; text-decoration: none; }
.rapm-iw-link:hover { text-decoration: underline; }
.gm-style-iw-c { border-radius: 4px !important; }

/* ── Cards below map ─────────────────────────────── */
.rapm-cards-wrap { margin-top: 24px; }
.rapm-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}
.rapm-cards-grid.rapm-masonry-ready,
.rapm-reviews-grid.rapm-masonry-ready {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}
.rapm-masonry-col {
    flex: 1 1 33.333%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.rapm-post-card {
    display: flex; flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: 4px; overflow: hidden;
    text-decoration: none; color: inherit;
    background: #fff;
    transition: box-shadow .15s;
    box-sizing: border-box;
    margin: 0;
    vertical-align: top;
    width: 100%;
}
.rapm-post-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.10); }
.rapm-post-card-img img { width: 100%; height: 160px; object-fit: cover; display: block; }
.rapm-post-card-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.rapm-map-card-media .rapm-ra-slider {
    margin: 0;
    border-radius: 4px 4px 0 0;
}
.rapm-map-card-media .ra-slider__viewport {
    border-radius: 4px 4px 0 0;
}
.rapm-map-card-body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rapm-map-card-body .rapm-review-project-content {
    font-size: 14px;
}
.rapm-post-badge {
    display: inline-block; font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 4px; text-transform: uppercase;
    width: fit-content;
}
.rapm-post-card--review  .rapm-post-badge { background: #E6F1FB; color: #0C447C; }
.rapm-post-card--project .rapm-post-badge { background: #EAF3DE; color: #27500A; }
.rapm-post-title  { font-size: 14px; font-weight: 600; color: #222; margin: 0; line-height: 1.3; }
.rapm-post-loc    { font-size: 12px; color: #888; margin: 0; }
.rapm-post-stars  { color: #EF9F27; font-size: 13px; margin: 0; }
.rapm-post-review { font-size: 12px; color: #555; font-style: italic; margin: 0; line-height: 1.5; }
.rapm-no-results  { color: #888; font-size: 14px; padding: 20px 0; }

/* ── Reviews grid ────────────────────────────────── */
.rapm-reviews-wrap { width: 100%; }
.rapm-agg { display: flex; align-items: center; gap: 10px; padding: 16px 0 20px; flex-wrap: wrap; }
.rapm-agg .star      { color: #EF9F27; font-size: 24px; }
.rapm-agg .star.empty{ color: #ddd; }
.rapm-agg-val   { font-size: 28px; font-weight: 700; color: #222; }
.rapm-agg-label { font-size: 13px; color: #666; }

.rapm-reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.rapm-review-card {
    background: #fff; border: 1px solid #e0e0e0;
    border-radius: 4px; padding: 16px 18px;
    display: flex; flex-direction: column; gap: 8px;
    overflow: hidden;
    box-sizing: border-box;
    margin: 0;
    vertical-align: top;
    width: 100%;
}
.rapm-review-media {
    margin: -16px -18px 10px;
}
.rapm-review-media .rapm-ra-slider {
    margin: 0;
    border-radius: 4px 4px 0 0;
}
.rapm-review-media .ra-slider__viewport {
    border-radius: 4px 4px 0 0;
}
.rapm-review-project-top {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 4px;
}
.rapm-review-project-meta {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    align-items: flex-start;
    font-size: 12px;
    color: #667085;
    line-height: 1.35;
}
.rapm-review-project-location {
    display: inline-flex;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
}
.rapm-review-project-location > span {
    display: flex;
    flex-direction: column;
}
.rapm-review-project-location svg {
    margin-top: 1px;
    flex-shrink: 0;
}
.rapm-review-project-date {
    color: #475467;
    flex-shrink: 0;
    white-space: nowrap;
}
.rapm-review-project-title {
    margin: 0;
    color: #111;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 700;
}
.rapm-review-project-content {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
}
.rapm-review-project-content > :first-child { margin-top: 0; }
.rapm-review-project-content > :last-child { margin-bottom: 0; }
.rapm-review-header { display: flex; align-items: center; gap: 10px;     margin-top: var(--space-0-5);
    padding-top: var(--space-2);
    border-top: 1px solid;}
.rapm-avatar-wrap {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}
.rapm-avatar-wrap .rapm-avatar-init {
    position: absolute;
    inset: 0;
}
.rapm-avatar-wrap .rapm-avatar {
    position: absolute;
    inset: 0;
}
.rapm-avatar { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.rapm-avatar-init {
    width: 40px; height: 40px; border-radius: 4px;
    background: #185FA5; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.rapm-reviewer-meta { flex: 1; }
.rapm-reviewer-name { display: block; font-weight: 600; font-size: 14px; color: #222; }
.rapm-review-date   { font-size: 11px; color: #888; display: block; }
.rapm-google-logo   { margin-left: auto; opacity: .7; }
.rapm-google-logo a { display: inline-flex; line-height: 0; }

.rapm-review-stars .star      { color: #EF9F27; font-size: 15px; }
.rapm-review-stars .star.empty{ color: #ddd; }

.rapm-review-text   { font-size: 14px; color: #444; line-height: 1.6; margin: 0; }
.rapm-owner-response{
    background: #f5f5f5; border-left: 3px solid #185FA5;
    border-radius: 0 4px 4px 0; padding: 8px 12px;
    font-size: 13px; color: #444; line-height: 1.5;
}
.rapm-owner-response strong { color: #185FA5; }
.rapm-owner-response p { margin: 4px 0 0; }

.rapm-review-loc    { font-size: 12px; color: #888; display: flex; align-items: center; gap: 4px; }
.rapm-google-link   { font-size: 12px; color: #185FA5; text-decoration: none; }
.rapm-google-link:hover { text-decoration: underline; }
.rapm-card-link     { font-size: 13px; font-weight: 600; color: #185FA5; text-decoration: none; }

.rapm-cta-wrap { text-align: center; margin-top: 28px; }
.rapm-cta-btn  {
    display: inline-block; background: #185FA5; color: #fff;
    padding: 12px 28px; border-radius: 4px; font-size: 15px;
    font-weight: 600; text-decoration: none;
}
.rapm-cta-btn:hover { background: #0C447C; color: #fff; }

/* ── Slideshow ───────────────────────────────────── */
.rapm-slideshow {
    position: relative; overflow: hidden;
    border-radius: 4px; background: #111;
    margin: 1.5rem 0;
    outline: none;
}
.rapm-ss-track { position: relative; width: 100%; }
.rapm-ss-slide { display: none; }
.rapm-ss-slide.active { display: block; }
.rapm-ss-slide img {
    width: 100%; max-height: 500px;
    object-fit: cover; display: block;
}
.rapm-ss-label {
    position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,.55); color: #fff;
    padding: 4px 14px; border-radius: 4px; font-size: 13px; white-space: nowrap;
}
.rapm-ss-prev, .rapm-ss-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,.45); color: #fff;
    border: none; border-radius: 4px; width: 36px; height: 36px;
    font-size: 22px; line-height: 1; cursor: pointer; z-index: 10;
    display: flex; align-items: center; justify-content: center;
}
.rapm-ss-prev { left: 10px; }
.rapm-ss-next { right: 10px; }
.rapm-ss-prev:hover, .rapm-ss-next:hover { background: rgba(0,0,0,.75); }

.rapm-ss-dots {
    position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 5px; z-index: 10;
}
.rapm-ss-dot {
    width: 8px; height: 8px; border-radius: 4px;
    background: rgba(255,255,255,.5); border: none; cursor: pointer; padding: 0;
    transition: background .15s;
}
.rapm-ss-dot.active { background: #fff; }

.rapm-ss-counter {
    position: absolute; top: 10px; right: 12px;
    background: rgba(0,0,0,.45); color: #fff;
    font-size: 12px; padding: 3px 9px; border-radius: 4px; z-index: 10;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 640px) {
    .rapm-cards-grid,
    .rapm-reviews-grid { grid-template-columns: 1fr; }
    .rapm-cards-grid.rapm-masonry-ready,
    .rapm-reviews-grid.rapm-masonry-ready { flex-direction: column; }
    .rapm-masonry-col { width: 100%; }
    .rapm-toolbar { gap: 8px; }
}

/* ── City list (map-reviews) ─────────────────────────────────────────── */
.rapm-city-list { padding: 16px 0; border-bottom: 1px solid #e8e8e8; margin-bottom: 20px; }
.rapm-city-list-title { font-size: 14px; font-weight: 600; color: #444; margin: 0 0 10px; }
.rapm-city-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.rapm-city-btn {
    padding: 5px 12px; border-radius: 4px; border: 1px solid #d0d0d0;
    background: #fff; font-size: 13px; cursor: pointer; color: #444;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background .12s, border-color .12s;
}
.rapm-city-btn:hover, .rapm-city-btn--active {
    background: #E6F1FB; border-color: #185FA5; color: #185FA5;
}
.rapm-city-count {
    background: #e0e0e0; color: #555; font-size: 11px;
    padding: 1px 6px; border-radius: 4px; min-width: 20px; text-align: center;
}
.rapm-city-btn--active .rapm-city-count { background: #185FA5; color: #fff; }
.rapm-card--active { outline: 2px solid #185FA5; }

/* ── Slider ──────────────────────────────────────────────────────────── */
.rapm-slider {
    position: relative; overflow: hidden; padding: 0 0 32px;
    margin: 1rem 0;
}
.rapm-slider-track {
    display: flex; transition: transform 0.35s ease; will-change: transform;
}
.rapm-slider-slide {
    flex: 0 0 calc(100% / 3); padding: 0 8px;
    box-sizing: border-box;
}
@media (max-width:900px) { .rapm-slider-slide { flex: 0 0 50%; } }
@media (max-width:600px) { .rapm-slider-slide { flex: 0 0 100%; padding: 0; } }

@media (max-width: 900px) {
    .rapm-cards-grid,
    .rapm-reviews-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .rapm-cards-grid,
    .rapm-reviews-grid { grid-template-columns: 1fr; }
    .rapm-cards-grid.rapm-masonry-ready,
    .rapm-reviews-grid.rapm-masonry-ready { flex-direction: column; }
}

.rapm-slider-card {
    display: flex; flex-direction: column;
    border: 1px solid #e0e0e0; border-radius: 4px;
    overflow: hidden; text-decoration: none; color: inherit;
    background: #fff; height: 100%;
    transition: box-shadow .15s;
}
.rapm-slider-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.10); }
.rapm-slider-img img { width: 100%; height: 180px; object-fit: cover; display: block; }
.rapm-slider-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.rapm-slider-title { font-size: 14px; font-weight: 600; color: #222; margin: 0; line-height: 1.3; }
.rapm-slider-author { font-size: 12px; color: #888; margin: 0; font-style: italic; }

.rapm-slider-prev, .rapm-slider-next {
    position: absolute; top: 40%; transform: translateY(-50%);
    background: rgba(0,0,0,.4); color: #fff; border: none;
    border-radius: 4px; width: 34px; height: 34px;
    font-size: 22px; line-height: 1; cursor: pointer; z-index: 5;
    display: flex; align-items: center; justify-content: center;
}
.rapm-slider-prev { left: 4px; }
.rapm-slider-next { right: 4px; }
.rapm-slider-prev:hover, .rapm-slider-next:hover { background: rgba(0,0,0,.7); }

.rapm-slider-dots {
    position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 5px;
}
.rapm-slider-dot {
    width: 8px; height: 8px; border-radius: 4px;
    background: #ccc; border: none; cursor: pointer; padding: 0;
    transition: background .15s;
}
.rapm-slider-dot.active { background: #185FA5; }

/* Structured review fields on post cards */
.rapm-review-extras {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-top: 8px; padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}
.rapm-extra-tag {
    font-size: 11px; background: #f5f5f5; color: #555;
    padding: 2px 8px; border-radius: 4px;
}
.rapm-extra-tag strong { color: #333; }

/* ── Single post template ─────────────────────────────────────────────── */
.rapm-post-header {
    margin: 1.5rem 0 2rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
}
.rapm-post-reviewer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.rapm-post-reviewer-img {
    width: 56px; height: 56px;
    border-radius: 4px; object-fit: cover; flex-shrink: 0;
}
.rapm-post-reviewer-init {
    width: 56px; height: 56px; border-radius: 4px;
    background: #185FA5; color: #fff; font-size: 22px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rapm-post-reviewer-info { flex: 1; }
.rapm-post-reviewer-name { display: block; font-size: 17px; font-weight: 700; color: #222; }
.rapm-post-reviewer-date { font-size: 13px; color: #888; display: block; margin-top: 2px; }
.rapm-post-google-badge  { margin-left: auto; opacity: .75; }

.rapm-post-stars { margin-bottom: 10px; }
.rapm-star--full  { color: #EF9F27; font-size: 22px; }
.rapm-star--empty { color: #ddd;    font-size: 22px; }

.rapm-post-meta-row {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    padding-top: 10px; border-top: 1px solid #f0f0f0;
    font-size: 13px;
}
.rapm-post-meta-loc     { display: flex; align-items: center; gap: 4px; color: #555; }
.rapm-post-meta-service { background: #E6F1FB; color: #0C447C; padding: 2px 10px; border-radius: 4px; font-weight: 600; font-size: 12px; }
.rapm-post-google-link  { margin-left: auto; color: #185FA5; text-decoration: none; font-weight: 500; }
.rapm-post-google-link:hover { text-decoration: underline; }

/* Structured fields */
.rapm-post-fields {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    background: #f8f8f8;
    border-radius: 4px;
    border: 1px solid #ebebeb;
}
.rapm-post-field {
    display: flex; flex-direction: column; gap: 2px;
    min-width: 140px; flex: 1;
}
.rapm-post-field-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: #888;
}
.rapm-post-field-value { font-size: 14px; color: #333; }

/* Location block */
.rapm-post-location {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
}
.rapm-post-location-title {
    font-size: 14px; font-weight: 700; color: #444;
    margin: 0 0 12px; text-transform: uppercase; letter-spacing: .04em;
}
.rapm-post-location-grid { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.rapm-post-location-row  { display: flex; gap: 12px; align-items: baseline; }
.rapm-post-location-row dt { font-size: 12px; font-weight: 700; color: #888; min-width: 90px; flex-shrink: 0; }
.rapm-post-location-row dd { font-size: 14px; color: #333; margin: 0; }
.rapm-post-map-link { color: #185FA5; text-decoration: none; display: inline-flex; align-items: center; }
.rapm-post-map-link:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .rapm-post-fields   { flex-direction: column; }
    .rapm-post-meta-row { flex-direction: column; align-items: flex-start; }
    .rapm-post-google-link { margin-left: 0; }
}

/* Review text and owner response inside post header */
.rapm-post-reviewer-img-wrap {
    position: relative; width: 56px; height: 56px; flex-shrink: 0;
}
.rapm-post-reviewer-img-wrap .rapm-post-reviewer-init {
    position: absolute; inset: 0; border-radius: 4px;
}
.rapm-post-reviewer-img-wrap .rapm-post-reviewer-img {
    position: absolute; inset: 0; border-radius: 4px; object-fit: cover;
}

.rapm-post-review-text {
    margin: 14px 0 0;
    padding: 14px 18px;
    background: #f8f8f8;
    border-left: 4px solid #185FA5;
    border-radius: 0 4px 4px 0;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    font-style: italic;
}

.rapm-post-owner-response {
    margin: 12px 0 0;
    padding: 12px 16px;
    background: #EAF3DE;
    border-left: 4px solid #3B6D11;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}
.rapm-post-response-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #3B6D11;
    margin-bottom: 6px;
}
.rapm-post-owner-response p { margin: 0; }

/* Reviewer row as link */
.rapm-post-reviewer--link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: opacity .15s;
}
.rapm-post-reviewer--link:hover { opacity: .8; }

/* Inline fields inside review box */
.rapm-post-fields--inline {
    margin-top: 14px;
    padding: 12px 14px;
    background: #f5f5f5;
    border-radius: 4px;
    border: 1px solid #ebebeb;
}

/* RA slider wrapper spacing */
.rapm-ra-slider { margin: 1.5rem 0; border-radius: 4px; overflow: hidden; }

/* Plain reviewer row (no full-row link) */
.rapm-post-reviewer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
}
/* Google icon link — subtle hover only on the icon */
a.rapm-post-google-badge { text-decoration: none; opacity: .8; transition: opacity .15s; }
a.rapm-post-google-badge:hover { opacity: 1; }

/* Detail links in project location block */
.rapm-post-detail-link { color: #185FA5; text-decoration: none; }
.rapm-post-detail-link:hover { text-decoration: underline; }
