/* ================================================================
   video-post.css — wpisy w formacie "Wideo"
   Kolory z palety Kadence (Wygląd → Dostosuj → Kolory)
   ================================================================ */

:root {
    --pm-red:    var(--global-palette1, #B82105);
    --pm-red-dk: var(--global-palette2, #8F1A04);
    --pm-text:   var(--global-palette4, #2B1E1A);
    --pm-muted:  var(--global-palette7, #9A8C87);
    --pm-border: var(--global-palette8, #EDE6E3);
    --pm-bg:     var(--global-palette9, #F9F7F6);
    --pm-radius: 8px;
}

/* ================================================================
   Ikona "play" na miniaturach wpisów wideo (strona główna, archiwa)
   Kadence dodaje klasę .format-video do <article>
   ================================================================ */

.format-video .post-thumbnail-inner,
.pm-video-card__thumb {
    position: relative;
    display: block;
}

.format-video .post-thumbnail-inner::after,
.pm-video-card__play {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    border-radius: 50%;
    background: var(--pm-red)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%23fff'/%3E%3C/svg%3E")
        no-repeat 55% 50% / 28px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
    transition: transform .2s ease;
    pointer-events: none;
}

.format-video:hover .post-thumbnail-inner::after,
.pm-video-card:hover .pm-video-card__play {
    transform: scale(1.1);
}

/* Miniatura YouTube (4:3 z czarnymi pasami) — przycinamy do proporcji kontenera */
img.pm-yt-thumb {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* ================================================================
   Single — układ
   ================================================================ */

.pm-video-single {
    max-width: 1040px;
    margin: 0 auto;
    padding: 56px 24px 80px;
}

/* ── Nagłówek ── */

.pm-video-single__header {
    max-width: 880px;
    margin: 0 0 32px;
    text-align: left;
}

.pm-video-single__meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-bottom: 18px;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.pm-video-single__badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 8px;
    background: var(--pm-red);
    color: #fff;
    font-weight: 700;
    border-radius: 3px;
}

.pm-video-single__badge svg {
    width: 12px;
    height: 12px;
}

.pm-video-single__cat {
    color: var(--pm-red);
    font-weight: 700;
    text-decoration: none;
}

.pm-video-single__cat:hover { color: var(--pm-red-dk); }

.pm-video-single__date { color: var(--pm-muted); }

.pm-video-single__title {
    font-size: clamp(28px, 4.2vw, 48px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.02em;
    color: var(--pm-text);
    margin: 0;
}

/* ── Odtwarzacz ── */

.pm-video-single__player-wrap {
    margin-bottom: 28px;
}

.pm-player {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--pm-radius);
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 20px 50px rgba(43, 30, 26, .18);
}

.pm-player__poster,
.pm-player iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    border: 0;
    object-fit: cover;
    display: block;
}

.pm-player__poster {
    transition: transform .5s ease, filter .3s;
}

.pm-player:hover .pm-player__poster {
    transform: scale(1.02);
    filter: brightness(.88);
}

.pm-player__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 84px;
    height: 60px;
    transform: translate(-50%, -50%);
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.pm-player__play svg { width: 100%; height: 100%; }

.pm-player__play-bg {
    fill: #212121;
    fill-opacity: .82;
    transition: fill .2s, fill-opacity .2s;
}

.pm-player:hover .pm-player__play-bg,
.pm-player__play:focus-visible .pm-player__play-bg {
    fill: var(--pm-red);
    fill-opacity: 1;
}

.pm-player__play:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 4px;
    border-radius: 14px;
}

/* ── Treść ── */

/* Opis bezpośrednio pod filmem, wyrównany do jego lewej krawędzi */
.pm-video-single__body {
    max-width: 760px;
    margin: 0;
}

.pm-video-single__lead {
    font-size: 20px;
    line-height: 1.6;
    font-weight: 500;
    color: var(--pm-text);
    margin: 0 0 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--pm-border);
}

.pm-video-single__content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--pm-text);
}

.pm-video-single__content > *:first-child { margin-top: 0; }

/* ── Opis filmu z YouTube ── */

.pm-yt-desc {
    margin: 0 0 36px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius);
}

.pm-yt-desc__text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--pm-text);
    overflow-wrap: anywhere;
}

.pm-yt-desc__text p { margin: 0 0 1em; }
.pm-yt-desc__text p:last-child { margin-bottom: 0; }

.pm-yt-desc__text a {
    color: var(--pm-red);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Zwinięty: ok. 6 linii z wygaszeniem na dole */
.pm-yt-desc.is-collapsed .pm-yt-desc__text {
    max-height: 10.2em;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(#000 60%, transparent);
            mask-image: linear-gradient(#000 60%, transparent);
}

.pm-yt-desc__toggle {
    margin-top: 12px;
    padding: 0;
    background: none;
    border: 0;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--pm-text);
    cursor: pointer;
}

.pm-yt-desc__toggle:hover { color: var(--pm-red); }

/* Znacznik czasu 1:23 — wygląda jak link */
.pm-timestamp {
    display: inline;
    padding: 0;
    background: none;
    border: 0;
    font: inherit;
    font-weight: 600;
    color: var(--pm-red);
    cursor: pointer;
}

.pm-timestamp:hover { text-decoration: underline; }

/* ── Przyciski ── */

.pm-video-single__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 40px 0 0;
    padding-top: 32px;
    border-top: 1px solid var(--pm-border);
}

.pm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background .18s, color .18s, border-color .18s;
}

.pm-btn--primary {
    background: var(--pm-red);
    color: #fff;
    border: 2px solid var(--pm-red);
}

.pm-btn--primary:hover {
    background: var(--pm-red-dk);
    border-color: var(--pm-red-dk);
    color: #fff;
}

.pm-btn--outline {
    background: transparent;
    color: var(--pm-text);
    border: 2px solid var(--pm-border);
}

.pm-btn--outline:hover {
    border-color: var(--pm-text);
    color: var(--pm-text);
}

/* ── Tagi ── */

.pm-video-single__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.pm-video-single__tags a {
    font-size: 12px;
    padding: 5px 12px;
    background: var(--pm-border);
    color: var(--pm-text);
    border-radius: 20px;
    text-decoration: none;
    transition: background .18s, color .18s;
}

.pm-video-single__tags a:hover {
    background: var(--pm-red);
    color: #fff;
}

/* ================================================================
   Powiązane filmy
   ================================================================ */

.pm-video-related {
    margin-top: 72px;
    padding-top: 48px;
    border-top: 1px solid var(--pm-border);
}

.pm-video-related__heading {
    font-size: 22px;
    font-weight: 800;
    color: var(--pm-text);
    margin: 0 0 28px;
}

.pm-video-related__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.pm-video-card__thumb {
    aspect-ratio: 16 / 9;
    border-radius: var(--pm-radius);
    overflow: hidden;
    background: #000;
    margin-bottom: 14px;
}

.pm-video-card__thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.pm-video-card:hover .pm-video-card__thumb img { transform: scale(1.05); }

.pm-video-card__play {
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    background-size: 22px;
}

/* Karty archiwum (ea-post-card / ea-post-featured) */
.ea-post-card:hover .pm-video-card__play,
.ea-post-featured:hover .pm-video-card__play {
    transform: scale(1.1);
}

.ea-post-featured__image-wrap .pm-video-card__play {
    width: 72px;
    height: 72px;
    margin: -36px 0 0 -36px;
    background-size: 32px;
}

.pm-video-card__date {
    display: block;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--pm-muted);
    margin-bottom: 6px;
}

.pm-video-card__title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
}

.pm-video-card__title a {
    color: var(--pm-text);
    text-decoration: none;
}

.pm-video-card__title a:hover { color: var(--pm-red); }

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 860px) {
    .pm-video-related__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
    .pm-video-single { padding: 32px 16px 56px; }
    .pm-video-single__player-wrap { margin: 0 -16px 32px; }
    .pm-player { border-radius: 0; }
    .pm-video-single__lead { font-size: 18px; }
    .pm-video-related__grid { grid-template-columns: 1fr; }
    .pm-btn { flex: 1 1 100%; }
}
