﻿/* ==========================================================================
   Polycube Podcasts — Frontend styles  v2
   ========================================================================== */

/* ── Reset liste ── */
.polycube-podcasts {
    font-family: inherit;
    max-width: 100%;
}

.polycube-podcasts__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   LAYOUT : list
   ========================================================================== */
.polycube-podcasts--list .polycube-podcasts__item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1.5rem 0;
    border-bottom: 1px solid #dde1ea;
}

.polycube-podcasts--list .polycube-podcasts__item:last-child {
    border-bottom: none;
}

.polycube-podcasts--list .polycube-podcasts__thumbnail {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    background: #f0f2f7;
}

.polycube-podcasts--list .polycube-podcasts__thumbnail img {
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    display: block;
    /* filter: hue-rotate(230deg) grayscale(82%) contrast(168%); */
    transition: transform .3s;
}

.polycube-podcasts--list .polycube-podcasts__item:hover .polycube-podcasts__thumbnail img {
    transform: scale(1.04);
}

.polycube-podcasts--list .polycube-podcasts__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.polycube-podcasts--list .polycube-podcasts__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
}

.polycube-podcasts--list .polycube-podcasts__title a {
    color: #0d1b3e;
    text-decoration: none;
}

.polycube-podcasts--list .polycube-podcasts__title a:hover {
    color: #f0c132;
}

/* ==========================================================================
   LAYOUT : cards (grille)
   ========================================================================== */
.polycube-podcasts--cards .polycube-podcasts__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.polycube-podcasts--cards .polycube-podcasts__item,
.polycube-podcasts--scroll .polycube-podcasts__item {
    display: flex;
    flex-direction: column;
    background: #0d1b3e;
    color: #fff;
    /* border-radius: 4px; */
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .22);
    transition: transform .22s, box-shadow .22s;
}

.polycube-podcasts--cards .polycube-podcasts__item:hover,
.polycube-podcasts--scroll .polycube-podcasts__item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .32);
}

.polycube-podcasts--cards .polycube-podcasts__thumbnail,
.polycube-podcasts--scroll .polycube-podcasts__thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.polycube-podcasts--cards .polycube-podcasts__thumbnail img,
.polycube-podcasts--scroll .polycube-podcasts__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* filter: hue-rotate(230deg) grayscale(82%) contrast(168%); */
    transition: transform .35s;
}

.polycube-podcasts--cards .polycube-podcasts__item:hover .polycube-podcasts__thumbnail img,
.polycube-podcasts--scroll .polycube-podcasts__item:hover .polycube-podcasts__thumbnail img {
    transform: scale(1.04);
}

.polycube-podcasts--cards .polycube-podcasts__body,
.polycube-podcasts--scroll .polycube-podcasts__body {
    padding: .875rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    flex: 1;
}

.polycube-podcasts--cards .polycube-podcasts__title,
.polycube-podcasts--scroll .polycube-podcasts__title {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.polycube-podcasts--cards .polycube-podcasts__title a,
.polycube-podcasts--scroll .polycube-podcasts__title a {
    color: #fff;
    text-decoration: none !important;
}

.polycube-podcasts--cards .polycube-podcasts__title a:hover,
.polycube-podcasts--scroll .polycube-podcasts__title a:hover {
    color: #f0c132;
}

/* ==========================================================================
   LAYOUT : scroll (carrousel horizontal)
   ========================================================================== */
.polycube-podcasts--scroll .polycube-podcasts__list {
    display: flex;
    overflow-x: auto;
    gap: 1.25rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-top: 2rem;
    padding-bottom: 2rem;
    padding-right: 1rem;
    scrollbar-width: thin;
    scrollbar-color: #f0c132 rgba(13, 27, 62, .4);
}

.polycube-podcasts--scroll .polycube-podcasts__list::-webkit-scrollbar {
    height: 4px;
}

.polycube-podcasts--scroll .polycube-podcasts__list::-webkit-scrollbar-track {
    background: rgba(13, 27, 62, .4);
    border-radius: 2px;
}

.polycube-podcasts--scroll .polycube-podcasts__list::-webkit-scrollbar-thumb {
    background: #f0c132;
    border-radius: 2px;
}

.polycube-podcasts--scroll .polycube-podcasts__item {
    flex: 0 0 280px;
    scroll-snap-align: start;
}

/* ==========================================================================
   Description
   ========================================================================== */
.polycube-podcasts__description {
    font-size: .825rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.polycube-podcasts--cards .polycube-podcasts__description,
.polycube-podcasts--scroll .polycube-podcasts__description {
    color: #8faad8;
    font-size: 1.15rem;
    }

    .polycube-podcasts--cards .polycube-podcasts__description {
        -webkit-line-clamp: inherit !important;
}

/* ==========================================================================
   Player maison (pcp)
   ========================================================================== */

/* Reset préventif — neutralise les styles globaux du thème sur input/button */
.pcp-player *,
.pcp-player *::before,
.pcp-player *::after {
    box-sizing: border-box;
}

.pcp-player input[type="range"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 2px !important;
    box-shadow: none !important;
    outline: none !important;
    color: inherit !important;
    font-size: inherit !important;
}

.pcp-player button {
    min-height: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    font-size: inherit !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.polycube-podcasts__player {
    margin: .25rem 0;
}

.pcp-player {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: rgba(8, 15, 50, .70);
    backdrop-filter: blur(4px);
    border-radius: 8px;
    padding: .5rem .75rem;
    width: 100%;
    box-sizing: border-box;
}

/* Sur layout list, fond plus neutre */
.polycube-podcasts--list .pcp-player {
    background: #eef1f8;
}

/* ── Bouton play : cercle doré ── */
.pcp-play {
    flex-shrink: 0 !important;
    width: 34px !important;
    height: 34px !important;
    min-height: 0 !important;
    border-radius: 50% !important;
    background: #f0c132 !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    transition: background .15s, transform .15s;
    line-height: 1 !important;
    color: #0d1b3e !important;
    font-size: inherit !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.pcp-play:hover {
    background: #c9a000;
    transform: scale(1.08);
}

.pcp-icon {
    display: block;
    fill: #0d1b3e;
    width: 14px;
    height: 14px;
    margin-left: 2px;
    /* compensation optique play */
}

.pcp-icon-pause {
    display: none;
    margin-left: 0;
}

.pcp-play[data-playing] .pcp-icon-play {
    display: none;
}

.pcp-play[data-playing] .pcp-icon-pause {
    display: block;
}

/* ── Barre de progression ── */
.pcp-progress {
    -webkit-appearance: none !important;
    appearance: none !important;
    flex: 1 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 3px !important;
    border-radius: 2px !important;
    outline: none !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: linear-gradient(to right, #f0c132 0%, rgba(255, 255, 255, .15) 0%) !important;
    color: inherit !important;
}

.polycube-podcasts--list .pcp-progress {
    background: linear-gradient(to right, #f0c132 0%, #d0d6e8 0%) !important;
}

.pcp-progress::-webkit-slider-runnable-track {
    height: 3px;
    border-radius: 2px;
    background: transparent;
}

/* Thumb : fine barre verticale blanche */
.pcp-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 3px;
    height: 13px;
    border-radius: 2px;
    background: #fff;
    cursor: pointer;
    margin-top: -5px;
}

.polycube-podcasts--list .pcp-progress::-webkit-slider-thumb {
    background: #1a3060;
}

.pcp-progress::-moz-range-track {
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .15);
    border: none;
}

.polycube-podcasts--list .pcp-progress::-moz-range-track {
    background: #d0d6e8;
}

.pcp-progress::-moz-range-progress {
    height: 3px;
    border-radius: 2px;
    background: #f0c132;
}

.pcp-progress::-moz-range-thumb {
    width: 3px;
    height: 13px;
    border-radius: 2px;
    background: #fff;
    border: none;
    cursor: pointer;
}

/* ── Temps ── */
.pcp-time {
    font-size: .68rem;
    color: rgba(255, 255, 255, .55);
    white-space: nowrap;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
}

.polycube-podcasts--list .pcp-time {
    color: #6b7280;
}

/* ── Bouton volume ── */
.pcp-vol-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: rgba(255, 255, 255, .55);
    display: flex;
    align-items: center;
    transition: color .15s;
    line-height: 1;
}

.pcp-vol-btn:hover {
    color: #f0c132;
}

.polycube-podcasts--list .pcp-vol-btn {
    color: #6b7280;
}

.polycube-podcasts--list .pcp-vol-btn:hover {
    color: #f0c132;
}

.pcp-vol-icon {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    width: 16px;
    height: 16px;
}

/* ── Volume slider ── */
.pcp-volume {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 60px !important;
    height: 3px !important;
    min-height: 0 !important;
    border-radius: 2px !important;
    outline: none !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: linear-gradient(to right, #f0c132 100%, rgba(255, 255, 255, .15) 100%) !important;
    color: inherit !important;
}

.polycube-podcasts--list .pcp-volume {
    background: linear-gradient(to right, #f0c132 100%, #d0d6e8 100%) !important;
}

.pcp-volume::-webkit-slider-runnable-track {
    height: 3px;
    border-radius: 2px;
    background: transparent;
}

.pcp-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    margin-top: -3.5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}

.polycube-podcasts--list .pcp-volume::-webkit-slider-thumb {
    background: #1a3060;
}

.pcp-volume::-moz-range-track {
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .15);
    border: none;
}

.polycube-podcasts--list .pcp-volume::-moz-range-track {
    background: #d0d6e8;
}

.pcp-volume::-moz-range-progress {
    height: 3px;
    background: #f0c132;
}

.pcp-volume::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
}

/* Volume caché sur cards/scroll */
.polycube-podcasts--cards .pcp-vol-btn,
.polycube-podcasts--cards .pcp-volume,
.polycube-podcasts--scroll .pcp-vol-btn,
.polycube-podcasts--scroll .pcp-volume {
    display: none;
}

/* ==========================================================================
   Méta (date / durée / téléchargement)
   ========================================================================== */
.polycube-podcasts__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
    font-size: .75rem;
    color: #9ca3af;
    margin-top: auto;
    padding-top: .25rem;
}

.polycube-podcasts--cards .polycube-podcasts__meta,
.polycube-podcasts--scroll .polycube-podcasts__meta {
    color: #64748b;
    font-size: 1rem;
}

.polycube-podcasts__date,
.polycube-podcasts__duration {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.polycube-podcasts__date::before {
    content: "";
    display: inline-block;
    width: 11px;
    height: 11px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.polycube-podcasts__duration::before {
    content: "";
    display: inline-block;
    width: 11px;
    height: 11px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.polycube-podcasts__download {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .75rem;
    border-radius: 20px;
    background: #f0c132;
    color: #0d1b3e;
    text-decoration: none;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    transition: background .15s, transform .15s;
    margin-left: auto;
    white-space: nowrap;
}

.polycube-podcasts__download:hover {
    background: #c9a000;
    color: #0d1b3e;
    transform: scale(1.04);
}

/* ==========================================================================
   Messages erreur / vide
   ========================================================================== */
.polycube-podcasts-error,
.polycube-podcasts-empty {
    padding: 1rem 1.25rem;
    background: #fef2f2;
    border-left: 4px solid #f87171;
    border-radius: 4px;
    color: #991b1b;
    font-size: .9rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 520px) {
    .polycube-podcasts--list .polycube-podcasts__item {
        flex-direction: column;
    }

    .polycube-podcasts--list .polycube-podcasts__thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        border-radius: 8px;
    }

    .polycube-podcasts--cards .polycube-podcasts__list {
        grid-template-columns: 1fr;
    }

    .pcp-volume,
    .pcp-vol-btn {
        display: none !important;
    }

    .polycube-podcasts--scroll .polycube-podcasts__item {
        flex: 0 0 240px;
    }
}
/* ==========================================================================
   Infinite scroll (layout=list, infinite=yes)
   ========================================================================== */
.polycube-podcasts__sentinel {
    width: 100%;
    height: 1px;
    margin-top: -1px;
    pointer-events: none;
}

.polycube-podcasts__loader {
    display: none;
    /* affiché par JS pendant un fetch */
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.polycube-podcasts__loader-text {
    font-weight: 500;
}

.polycube-podcasts__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: pcp-spin 0.7s linear infinite;
}

@keyframes pcp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Petit indicateur quand l'observer est armé mais pas encore en chargement */
.polycube-podcasts--infinite .polycube-podcasts__list {
    margin-bottom: 8px;
}

.eti-podcasts-wrapper {
    position: relative;
}

.eti-podcasts-wrapper .eti-ads {
    position: sticky;
    top: 120px;
}