:root {
    --post-card-divider-color: rgba(255, 255, 255, 0.18);
}

:root[data-theme='light'] {
    --post-card-divider-color: rgba(15, 23, 42, 0.24);
}

:root[data-theme='dark'] {
    --post-card-divider-color: rgba(255, 255, 255, 0.18);
}

.post-card-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    grid-auto-rows: 1fr;
    align-items: stretch;
    gap: 12px;
}

.post-card-item {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 10px;
    height: 100%;
    min-height: 150px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0.2em 0.2em 1em #383737, -0.2em -0.2em 1em #383737;
    font-size: 0.84rem;
    font-weight: 400;
}

.post-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 4px 4px;
    border-bottom: 1px solid var(--post-card-divider-color);
}

.post-card-title {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    font-weight: 700;
    font-size: 0.7rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-card-date {
    flex: 0 0 auto;
    white-space: nowrap;
    opacity: 0.7;
    font-size: 0.72rem;
}

.post-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 10px;
    padding: 4px 4px;
}

.post-card-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.post-card-meta-line {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    line-height: 1.25;
}

.post-card-meta-prefix {
    opacity: 0.72;
}

.post-card-message-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.post-card-message-line {
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
}

.post-card-message-separator {
    width: 100%;
    margin: 1px 0;
    border: 0;
    border-top: 1px solid var(--post-card-divider-color);
    opacity: 0.7;
}

.post-card-author {
    opacity: 0.86;
}

.post-card-widget-meta-panel {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    margin-top: auto;
    overflow: hidden;
}

.post-card-widget-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--text-color);
    line-height: 1.2;
}

.post-card-widget-meta-chip-author {
    flex: 1 1 0;
}

.post-card-widget-meta-chip-share {
    flex: 1 1 0;
}

.post-card-widget-meta-chip-see {
    flex: 0 1 auto;
    white-space: nowrap;
}

.post-card-widget-meta-chip-visibility {
    flex: 0 0 auto;
    white-space: nowrap;
}

.post-card-widget-meta-chip-link {
    flex: 0 0 auto;
    text-decoration: none;
}

.post-card-widget-meta-chip-link:hover,
.post-card-widget-meta-chip-link:focus {
    text-decoration: none;
    opacity: 1;
}

.post-card-widget-meta-chip-visibility.is-public {
    color: #8ee0ac;
}

.post-card-widget-meta-chip-visibility.is-friends {
    color: #9fc1ff;
}

.post-card-widget-meta-chip-visibility.is-private {
    color: #ffb2bb;
}

.post-card-widget-meta-icon {
    flex: 0 0 auto;
    font-size: 0.72rem;
    opacity: 0.82;
}

.post-card-widget-meta-link {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.74rem;
    font-weight: 600;
}

.post-card-visibility {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    opacity: 0.9;
}

.post-card-author-link {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.post-card-visibility-icon {
    font-size: 0.88rem;
}

.post-card-visibility.is-public {
    color: #1f9d55;
    border-color: rgba(31, 157, 85, 0.35);
    background: rgba(31, 157, 85, 0.12);
}

.post-card-visibility.is-friends {
    color: #2f6fed;
    border-color: rgba(47, 111, 237, 0.35);
    background: rgba(47, 111, 237, 0.12);
}

.post-card-visibility.is-private {
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.35);
    background: rgba(220, 53, 69, 0.12);
}

.post-card-author-link:hover,
.post-card-author-link:focus {
    text-decoration: underline;
}

.post-card-excerpt {
    font-weight: 400;
    font-size: 0.76rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: calc(1.35em * 3);
}

.post-card-media {
    margin: 6px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.post-card-media img {
    width: 150px;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.post-card-media-video-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
}

.post-card-media-video {
    width: 96px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.35);
}

.post-card-media-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 1px 6px;
    font-size: 0.64rem;
    opacity: 0.9;
    text-decoration: none;
    color: inherit;
}

.post-card-media-badge:hover,
.post-card-media-badge:focus {
    text-decoration: none;
    opacity: 1;
}

.post-card-link-badge {
    border-color: rgba(56, 189, 118, 0.5);
    background: linear-gradient(135deg, rgba(17, 86, 52, 0.78), rgba(38, 140, 86, 0.52));
    color: #eafff2;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 6px 14px rgba(8, 40, 24, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.16);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.post-card-link-badge:hover,
.post-card-link-badge:focus {
    color: #ffffff;
    border-color: rgba(97, 221, 157, 0.72);
    box-shadow: 0 10px 18px rgba(10, 50, 30, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.post-card-link-badge:focus-visible {
    outline: 2px solid rgba(173, 255, 218, 0.88);
    outline-offset: 2px;
}

/* Iframe embed responsive (YouTube / Vimeo / Dailymotion) */
.post-card-embed-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.post-card-embed-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 4px;
    border-top: 1px solid var(--post-card-divider-color);
}

.post-card-footer .post-actions,
.post-card-footer .view-post-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
}

.post-card-footer .post-action-form {
    display: inline-flex;
}

.post-card-footer .view-post-actions,
.post-card-footer .post-card-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
}

.post-card-footer .post-icon-btn,
.post-card-footer .view-post-react-btn {
    min-height: 18px;
    padding: 0 4px;
    font-size: 0.7rem;
    border: none;
    line-height: 1;
}

.post-card-footer .post-card-actions .post-icon-btn {
    color: var(--text-color, #f3f4f6);
}

.post-card-footer i {
    font-size: 0.72rem;
    line-height: 1.2;
}

.post-card-single {
    max-width: 900px;
    margin: 0 auto;
}

.post-card-widget-item {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 280px;
    max-height: 320px;
    overflow: hidden;
}

.post-card-widget-item .post-card-body {
    min-height: 0;
    justify-content: flex-start;
    overflow: hidden;
}

.post-card-widget-item .post-card-body > * {
    min-width: 0;
}

.post-card-widget-item .post-card-footer {
    margin-top: 0;
    flex-shrink: 0;
}

.post-card-widget-item .post-card-excerpt {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    min-height: calc(1.35em * 2);
}

.post-card-widget-item .post-card-meta-row {
    margin-top: 0;
}

.post-card-widget-item .post-card-media img {
    width: 120px;
    max-height: 88px;
}

.post-card-widget-item .post-card-media-video {
    width: 88px;
    height: 52px;
}

.post-card-widget-item .post-card-media {
    min-height: 94px;
}

.post-card-widget-item .post-card-media-placeholder {
    visibility: hidden;
    pointer-events: none;
}

@media (max-width: 767.98px) {
    .post-card-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .post-card-item {
        padding: 10px 9px;
        min-height: auto;
    }

    .post-card-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .post-card-list .post-card-title {
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
    }

    .post-card-widget-item {
        min-height: auto;
        max-height: none;
    }

    .post-card-widget-item .post-card-body {
        min-height: auto;
        overflow: hidden;
    }

    .post-card-widget-item .post-card-excerpt {
        -webkit-line-clamp: 3;
        line-clamp: 3;
        min-height: 0;
    }
    .post-card-meta-row {
        flex-wrap: wrap;
        align-items: center;
    }

    .post-card-footer {
        flex-wrap: nowrap;
        align-items: center;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .post-card-footer .post-actions,
    .post-card-footer .post-card-actions {
        width: auto;
        flex: 0 0 auto;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 4px;
    }

    .post-card-footer .post-card-actions {
        margin-left: auto;
    }

    .post-card-footer .post-icon-btn,
    .post-card-footer .view-post-react-btn {
        min-height: 30px;
        padding: 3px 6px;
    }

    .post-card-media {
        margin: 4px 0;
    }

    .post-card-media img,
    .post-card-widget-item .post-card-media img {
        width: 100%;
        max-width: 100%;
        max-height: 180px;
    }

    .post-card-widget-item .post-card-media {
        min-height: 0;
    }

    .post-card-widget-item .post-card-media-placeholder {
        display: none;
    }

    .post-card-media-video,
    .post-card-widget-item .post-card-media-video {
        width: min(100%, 240px);
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 575.98px) {
    .post-card-title {
        font-size: 0.82rem;
    }

    .post-card-date {
        font-size: 0.68rem;
    }

    .post-card-body {
        gap: 8px;
    }

    .post-card-meta-line {
        font-size: 0.74rem;
        gap: 6px;
    }

    .post-card-excerpt {
        font-size: 0.74rem;
        line-height: 1.4;
    }
}

@media (max-width: 575.98px) {
    .post-card-title {
        font-size: 0.94rem;
    }

    .post-card-meta-row {
        gap: 8px;
    }

    .post-card-meta-line {
        font-size: 0.74rem;
    }
}

/* ==========================================================
   Style "vraie publication" – cartes widget mode social
   ========================================================== */

/* Header : avatar + auteur + date + visibilité */
.post-card-widget-item .post-card-header {
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 8px;
}

.post-card-author-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.post-card-author-avatar {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted-color, rgba(255, 255, 255, 0.7));
}

.post-card-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-card-author-avatar i {
    display: none;
    font-size: 1.05rem;
    line-height: 1;
}

.post-card-author-avatar.is-fallback-icon i {
    display: inline-block;
}

.post-card-author-meta {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    flex: 1 1 auto;
}

.post-card-author-meta .post-card-author-link {
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.post-card-author-meta .post-card-date {
    font-size: 0.67rem;
    opacity: 0.58;
    display: block;
    white-space: nowrap;
}

.post-card-shared-by-line {
    font-size: 0.70rem;
    opacity: 0.72;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Supprimer la contrainte de hauteur max */
.post-card-widget-item {
    max-height: none;
    min-height: 200px;
}

.post-card-widget-item .post-card-body {
    overflow: visible;
}

/* Médias pleine largeur dans la carte */
.post-card-widget-item .post-card-media {
    min-height: 0;
    justify-content: stretch;
    align-items: stretch;
}

.post-card-widget-item .post-card-media img {
    width: 100%;
    max-height: 210px;
    object-fit: cover;
    border-radius: 6px;
    border-color: rgba(255, 255, 255, 0.12);
}

.post-card-widget-item .post-card-media-video-link {
    width: 100%;
    display: block;
}

.post-card-widget-item .post-card-media-video {
    width: 100%;
    max-height: 190px;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    border-color: rgba(255, 255, 255, 0.12);
}

/* Extrait plus lisible */
.post-card-widget-item .post-card-excerpt {
    font-size: 0.85rem;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    min-height: 0;
}

/* Ligne de lien externe dans le corps */
.post-card-link-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

/* Icône lien vers publication d'origine (publication partagée) */
.post-card-origin-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.06);
    color: inherit;
    font-size: 0.72rem;
    opacity: 0.75;
    text-decoration: none;
    transition: opacity 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}

.post-card-origin-link:hover,
.post-card-origin-link:focus {
    opacity: 1;
    background: rgba(255,255,255,0.14);
    text-decoration: none;
}

:root[data-theme='dark'] .form-control {
    background-color: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.22);
}

:root[data-theme='dark'] .form-control:focus {
    background-color: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.08);
}