/*
 * R-DTR Layout Manager 0.3.1 — R-DTR Visual Core
 *
 * Warstwa prezentacyjna komponentów R-DTR niezależna od motywu i Astry.
 * Nie przejmuje struktury strony ani logiki shortcode'ów.
 */

/* RG Podcast Tiles */
.rg-podcast-tiles {
    align-items: stretch;
}

.rg-podcast-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(180deg, #24364d 0%, #1b283a 100%) !important;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rg-podcast-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08);
}

.rg-podcast-card__content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px 16px 16px;
    gap: 8px;
    background: transparent !important;
}

.rg-podcast-card__title {
    margin: 0;
    line-height: 1.3;
    height: 4.1em;
    overflow: hidden;
}

.rg-podcast-card__title a {
    color: #ffffff !important;
    font-weight: 600;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rg-podcast-card__meta {
    font-size: 13px;
    line-height: 1.3;
    margin: 0;
    color: rgba(255,255,255,0.6);
}

.rg-podcast-card__excerpt {
    display: none !important;
}

.rg-podcast-card__player {
    margin-top: auto;
    padding: 8px;
    background: rgba(0,0,0,0.25);
    border-radius: 12px;
}

.rg-podcast-card__player audio {
    width: 100%;
    height: 38px;
}

.rg-podcast-card__thumb .play-button,
.rg-podcast-card__play {
    background: #1db954;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transform: scale(1);
    transition: transform 0.2s ease;
}

.rg-podcast-card:hover .play-button,
.rg-podcast-card:hover .rg-podcast-card__play {
    transform: scale(1.1);
}

/* Kategorie / archiwa — pokazuj cały obraz. */
.archive .post .post-thumb,
.blog .post .post-thumb,
.search .post .post-thumb {
    aspect-ratio: auto !important;
    min-height: unset !important;
    overflow: visible !important;
}

.archive .post .post-thumb img,
.blog .post .post-thumb img,
.search .post .post-thumb img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

/* R-DTR Reactions */
.entry-content .rdtr-reactions--v031 {
    max-width: 520px !important;
    padding: 14px 16px !important;
    border-radius: 14px !important;
    background: rgba(20, 30, 45, 0.55) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
}

.entry-content .rdtr-reactions--v031 .rdtr-reactions__grid {
    display: grid !important;
    grid-template-columns: repeat(4, max-content) !important;
    gap: 10px !important;
    justify-content: start !important;
}

.entry-content .rdtr-reactions--v031 .rdtr-reaction-btn {
    min-width: 80px !important;
    max-width: 110px !important;
    min-height: 58px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.entry-content .rdtr-reactions--v031 .rdtr-reaction-btn:hover {
    transform: translateY(-2px) scale(1.04) !important;
    background: rgba(255,255,255,0.08) !important;
}

.entry-content .rdtr-reactions--v031 .rdtr-reaction-btn.is-active {
    background: rgba(255, 180, 0, 0.18) !important;
    border: 1px solid rgba(255, 200, 0, 0.35) !important;
}

.entry-content .rdtr-reactions--v031 .rdtr-reaction-btn__emoji {
    font-size: 20px !important;
    line-height: 1 !important;
}

.entry-content .rdtr-reactions--v031 .rdtr-reaction-btn__label {
    font-size: 12px !important;
    line-height: 1.05 !important;
    opacity: 0.85 !important;
}

.entry-content .rdtr-reactions--v031 .rdtr-reaction-btn__count {
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
}

.entry-content .rdtr-reactions--v031 .rdtr-reactions__footer {
    margin-top: 10px !important;
    font-size: 12px !important;
    opacity: 0.6 !important;
}

.rdtr-hot-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff3c00, #ff9900);
    color: #fff;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    margin-bottom: 6px;
}

/* Radio DTR Player — zaakceptowana baza 1.0 */
.universal-player-wrapper {
    max-width: 860px !important;
    margin: 18px auto 38px !important;
    padding: 18px !important;
    border-radius: 14px !important;
    background: linear-gradient(145deg, #1b1f2a, #11141c) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4) !important;
    color: #fff !important;
    overflow: hidden !important;
}

.universal-player-top {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 14px !important;
    margin-bottom: 12px !important;
}

.player-main {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.radio-logo {
    width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    border-radius: 10px !important;
    background: #fff !important;
    padding: 4px !important;
    object-fit: contain !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25) !important;
}

.meta-data {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.meta-data img {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    border-radius: 10px !important;
    object-fit: cover !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
}

.meta-copy {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.meta-label {
    font-size: 11px !important;
    line-height: 1.1 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    color: #b8bec9 !important;
    margin: 0 0 4px 0 !important;
    font-weight: 600 !important;
}

.meta-nowplaying {
    font-size: 16px !important;
    line-height: 1.28 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    margin: 0 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.55) !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
}

.meta-station {
    font-size: 12px !important;
    line-height: 1.2 !important;
    color: #9ea7b5 !important;
    margin-top: 4px !important;
}

.player-headline,
.player-title {
    color: #ffffff !important;
}

.player-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #0d0f14 !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 6px 11px !important;
    border-radius: 999px !important;
    box-shadow: 0 0 10px rgba(255,0,0,0.15) !important;
    white-space: nowrap !important;
}

.player-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff2d2d;
    box-shadow: 0 0 10px rgba(255,0,0,0.75);
    animation: rdtrPulseLive 1.2s infinite;
}

@keyframes rdtrPulseLive {
    0% { opacity: 0.45; transform: scale(0.92); }
    50% { opacity: 1; transform: scale(1.08); }
    100% { opacity: 0.45; transform: scale(0.92); }
}

#grap-container {
    min-height: 130px !important;
    max-width: 450px !important;
    margin: 14px auto 0 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

.radio-footer {
    margin-top: 8px !important;
    font-size: 12px !important;
    color: #9ea7b5 !important;
    text-align: left !important;
}

audio#radio-player,
#radio-player audio,
.universal-player-wrapper audio {
    width: 100% !important;
    opacity: 0.92 !important;
    filter: invert(1) hue-rotate(180deg) !important;
}

.player-eq,
.rdtr-eq {
    margin-top: 10px !important;
    text-align: center !important;
}

.universal-player-wrapper:hover {
    box-shadow: 0 14px 36px rgba(0,0,0,0.46) !important;
    transform: translateY(-1px) !important;
    transition: box-shadow 0.2s ease, transform 0.2s ease !important;
}

@media (max-width: 768px) {
    .universal-player-wrapper {
        padding: 14px !important;
        border-radius: 12px !important;
    }

    .universal-player-top {
        gap: 10px !important;
        margin-bottom: 10px !important;
    }

    .radio-logo {
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
    }

    .meta-data img {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
    }

    .meta-nowplaying {
        font-size: 14px !important;
    }

    .meta-station,
    .meta-label {
        font-size: 11px !important;
    }

    .player-badge {
        font-size: 10px !important;
        padding: 5px 9px !important;
    }

    #grap-container {
        max-width: 100% !important;
    }
}

/* Artykuł sponsorowany — strona główna */
.rdtr-sponsored-box {
    border: 2px solid #e30613;
    padding: 15px;
    margin: 20px 0;
    border-radius: 10px;
    background: #ffffff;
    position: relative;
    color: #111111 !important;
}

.rdtr-sponsored-box a,
.rdtr-sponsored-box h1,
.rdtr-sponsored-box h2,
.rdtr-sponsored-box h3,
.rdtr-sponsored-box h4,
.rdtr-sponsored-box p,
.rdtr-sponsored-box span {
    color: #111111 !important;
    text-decoration: none;
}

.rdtr-sponsored-box a:hover,
.rdtr-sponsored-box h3:hover {
    color: #e30613 !important;
}

.rdtr-sponsored-label {
    position: absolute;
    top: -10px;
    left: 15px;
    background: #e30613;
    color: #ffffff !important;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 5px;
    z-index: 2;
}

.rdtr-sponsored-box img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.rdtr-sponsored-box h3 {
    margin: 0 0 12px 0;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 700;
}

/* 404 i podcasty */
body.error404 #primary,
body.single-podcast #primary,
body.single-podcast_episode #primary {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 0 auto !important;
}


/* Kafelki podcastów */
.rdtr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.rdtr-tile {
    display: block;
    background: #111827;
    border-radius: 12px;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    transition: 0.3s;
}

.rdtr-tile:hover {
    transform: translateY(-5px);
}

.rdtr-thumb {
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
}

.rdtr-title {
    padding: 10px;
    font-size: 14px;
}

/* Studio YouTube */
.r-dtr-tile {
    transition: all .25s ease;
}

.r-dtr-tile:hover {
    transform: scale(1.04);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.r-dtr-tile:hover .play-symbol {
    transform: scale(1.2);
    opacity: 1;
}

/* Kody rabatowe */
.rdtr-smart-deals,
.rdtr-smart-deals * {
    color: #111111 !important;
}

.rdtr-smart-deals .rdtr-deal-code,
.rdtr-smart-deals .rdtr-deal-code *,
.rdtr-smart-deals .rdtr-code-value,
.rdtr-smart-deals [data-code] {
    color: #000000 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.rdtr-smart-deals .rdtr-code-label,
.rdtr-smart-deals .rdtr-code-title {
    color: #c40000 !important;
    font-weight: 800 !important;
}

.rdtr-smart-deals button,
.rdtr-smart-deals .rdtr-copy-code {
    color: #ffffff !important;
}

/* Baner pojedynczego artykułu 16:9 — bez przycinania. */
.single-post .post-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.single-post .post-thumb img,
.single-post img.wp-post-image {
    display: block;
    width: 100%;
    height: 100% !important;
    aspect-ratio: 16 / 9;
    object-fit: contain !important;
    object-position: center center;
}

/* Responsywna siatka podcastów — brakowało jej w starym Custom CSS. */
@media (max-width: 900px) {
    .rdtr-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .rdtr-grid {
        grid-template-columns: 1fr;
    }

    .entry-content .rdtr-reactions--v031 .rdtr-reactions__grid {
        grid-template-columns: repeat(2, minmax(0, max-content)) !important;
    }
}
