/**
 * Serrurier41 - Styles des posts GMB
 * Style identique à Google Business Profile
 */

/* Section container */
.gmb-posts-section {
    margin: 40px 0;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
}

.gmb-posts-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #202124;
}

/* Slider wrapper */
.gmb-posts-slider {
    position: relative;
    overflow: hidden;
}

.gmb-posts-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
}

.gmb-posts-grid::-webkit-scrollbar {
    display: none;
}

.gmb-posts-grid > .google-post {
    min-width: calc((100% - 24px) / 3);
    max-width: calc((100% - 24px) / 3);
    flex-shrink: 0;
}

/* Flèches slider */
.gmb-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #202124;
    transition: background 0.2s, opacity 0.2s;
}

.gmb-slider-arrow:hover {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.gmb-slider-arrow:disabled {
    opacity: 0;
    pointer-events: none;
}

.gmb-slider-prev {
    left: 8px;
}

.gmb-slider-next {
    right: 8px;
}

/* Carte mini compacte - 3 par ligne */
.google-post {
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.google-post:hover {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}

.post-header {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    gap: 8px;
}

.post-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

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

.post-author {
    font-size: 15px;
    font-weight: 500;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-date {
    font-size: 10px;
    color: #5f6368;
}

.post-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f1f3f4;
}

.post-image {
    position: relative;
}

.post-image img,
.post-image video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.post-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    padding-left: 3px;
    pointer-events: none;
}

.post-body {
    padding: 8px 10px;
    flex: 1;
}

.post-text,
.post-text-short,
.post-text-full {
    font-size: 14px;
    line-height: 1.4;
    color: #202124;
}

.post-read-more {
    background: none;
    border: none;
    color: #1a73e8;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 0;
    font-weight: 500;
}

.post-read-more:hover {
    text-decoration: underline;
}

.post-actions {
    padding: 0 10px 10px;
}

.gmb-posts-section .post-cta,
.gmb-posts-section a.post-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: #1a73e8 !important;
    color: #fff !important;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none !important;
    border-radius: 4px;
    transition: background 0.2s;
    width: 100%;
    border: none;
}

.gmb-posts-section .post-cta:hover,
.gmb-posts-section a.post-cta:hover {
    background: #1557b0 !important;
    color: #fff !important;
}

/* Modal overlay */
.post-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overscroll-behavior: contain;
}

/* Modal window */
.post-modal {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 38px 3px rgba(0,0,0,0.14), 0 9px 46px 8px rgba(0,0,0,0.12), 0 11px 15px -7px rgba(0,0,0,0.2);
}

.post-modal-header {
    display: flex;
    align-items: center;
    padding: 8px 8px 8px 4px;
    border-bottom: 1px solid #e0e0e0;
    gap: 8px;
}

.post-modal-btn-back,
.post-modal-btn-close {
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.post-modal-btn-back:hover,
.post-modal-btn-close:hover {
    background: #f1f3f4;
}

.post-modal-btn-back svg,
.post-modal-btn-close svg {
    width: 28px;
    height: 28px;
    fill: #5f6368;
}

.post-modal-title {
    flex: 1;
    font-size: 18px;
    font-weight: 400;
    color: #202124;
}

.post-modal-body {
    overflow-y: auto;
    flex: 1;
}

/* Post card (version grande dans modal) */
.post-card {
    padding: 0;
}

.post-card-header {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
}

.post-card-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.post-card-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.post-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.post-card-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-card-meta {
    min-width: 0;
}

.post-card-author {
    font-size: 14px;
    font-weight: 500;
    color: #202124;
}

.post-card-date {
    font-size: 12px;
    color: #5f6368;
    margin-top: 2px;
}

.post-card-image {
    width: 100%;
    background: #f1f3f4;
}

.post-card-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-card-content {
    padding: 16px;
}

.post-card-text {
    font-size: 14px;
    line-height: 1.6;
    color: #202124;
    white-space: pre-wrap;
}

.post-card-footer {
    display: flex;
    align-items: center;
    padding: 12px 16px 16px;
    gap: 12px;
}

.post-card-cta,
a.post-card-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    background: #1a73e8 !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    border-radius: 4px;
    transition: background 0.2s;
    border: none;
}

.post-card-cta:hover,
a.post-card-cta:hover {
    background: #1557b0 !important;
    color: #fff !important;
}

.post-card-share {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    margin-left: auto;
}

.post-card-share:hover {
    background: #f1f3f4;
}

.post-card-share svg {
    fill: #5f6368;
}

/* Responsive tablette */
@media (max-width: 900px) {
    .gmb-posts-grid > .google-post {
        min-width: calc((100% - 12px) / 2);
        max-width: calc((100% - 12px) / 2);
    }
}

/* Responsive mobile */
@media (max-width: 600px) {
    .gmb-posts-section {
        overflow: hidden;
    }

    .gmb-posts-title {
        text-align: center;
    }

    .gmb-posts-section > .gmb-posts-grid {
        justify-content: center;
    }

    .gmb-posts-grid > .google-post {
        min-width: 80%;
        max-width: 80%;
    }

    .gmb-slider-prev {
        left: 4px;
    }

    .gmb-slider-next {
        right: 4px;
    }

    .post-header {
        padding: 10px 12px;
    }

    .post-avatar {
        width: 32px;
        height: 32px;
    }

    .post-author {
        font-size: 12px;
    }

    .post-body {
        padding: 10px 12px;
    }

    .post-text,
    .post-text-short,
    .post-text-full {
        font-size: 13px;
    }

    .post-modal {
        max-width: 100%;
        max-height: 100dvh;
        height: 100dvh;
        border-radius: 0;
    }

    .post-modal-overlay {
        padding: 0;
        height: 100dvh;
    }

    .post-modal-body {
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
}
