/* ============================================================
   Listen App — Podcast Players
   Styling for Buzzsprout embeds per location.
   Brand colors from LNN Brand Guidelines Dec 2024.
   ============================================================ */

:root {
    --lnn-listen-gap: 2.5rem;
    --lnn-listen-orange: #FF8200;          /* PMS 151C */
    --lnn-listen-grey: #4B4F54;            /* PMS 7540C */
    --lnn-listen-dark: #151719;            /* Darkest brand shade */
    --lnn-listen-light-bg: #ECEDED;        /* Lightest grey tint */
    --lnn-listen-border: #B7B9BC;          /* Mid grey tint */
    --lnn-listen-font: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

.lnn-listen-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    font-family: var(--lnn-listen-font);
}

.lnn-listen-instances {
    display: flex;
    flex-direction: column;
    gap: var(--lnn-listen-gap);
}

.lnn-listen-instance {
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lnn-listen-instance.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Location header ---- */
.lnn-listen-location-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--lnn-listen-orange);
}

.lnn-listen-location-name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--lnn-listen-white-primary);
    text-transform: capitalize;
    letter-spacing: 0.01em;
}

/* ---- Player wrapper ---- */
.lnn-listen-player-wrapper {
    width: 100%;
    min-height: 200px;
    padding: 30px;
    background: var(--lnn-listen-dark);
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

/* Buzzsprout embeds generate iframes — ensure they fill the wrapper */
.lnn-listen-player-wrapper iframe {
    width: 100% !important;
    border: none;
}

/* ---- Empty state ---- */
.lnn-listen-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--lnn-listen-grey);
    font-family: var(--lnn-listen-font);
    font-size: 1rem;
}

/* ---- Skeleton loading screen ---- */
@keyframes lnn-listen-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.lnn-listen-skeleton {
    background: #1e2023;
    border-radius: 8px;
    padding: 24px;
    overflow: hidden;
}

.lnn-listen-skeleton-bone {
    background: linear-gradient(
        90deg,
        #2a2d31 0%,
        #3a3d42 40%,
        #3a3d42 60%,
        #2a2d31 100%
    );
    background-size: 800px 100%;
    animation: lnn-listen-shimmer 1.6s ease-in-out infinite;
    border-radius: 4px;
}

/* Top section: art + meta */
.lnn-listen-skeleton-top {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.lnn-listen-skeleton-art {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    border-radius: 6px;
}

.lnn-listen-skeleton-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}

.lnn-listen-skeleton-title {
    height: 24px;
    width: 85%;
}

.lnn-listen-skeleton-subtitle {
    height: 14px;
    width: 45%;
}

.lnn-listen-skeleton-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
}

.lnn-listen-skeleton-play {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.lnn-listen-skeleton-waveform {
    flex: 1;
    height: 32px;
    border-radius: 4px;
}

.lnn-listen-skeleton-time {
    height: 12px;
    width: 90px;
    margin-top: auto;
    align-self: flex-end;
}

/* Episode list rows */
.lnn-listen-skeleton-divider {
    height: 1px;
    background: #2a2d31;
    margin: 0 0 4px 0;
}

.lnn-listen-skeleton-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
}

.lnn-listen-skeleton-thumb {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 4px;
}

.lnn-listen-skeleton-episode-title {
    flex: 1;
    height: 14px;
}

.lnn-listen-skeleton-row:nth-child(2) .lnn-listen-skeleton-episode-title { width: 70%; }
.lnn-listen-skeleton-row:nth-child(3) .lnn-listen-skeleton-episode-title { width: 55%; }
.lnn-listen-skeleton-row:nth-child(4) .lnn-listen-skeleton-episode-title { width: 60%; }
.lnn-listen-skeleton-row:nth-child(5) .lnn-listen-skeleton-episode-title { width: 50%; }

.lnn-listen-skeleton-duration {
    flex-shrink: 0;
    height: 12px;
    width: 36px;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .lnn-listen-location-name {
        font-size: 1.25rem;
    }

    .lnn-listen-instances {
        gap: 2rem;
    }
}
