/* ===== Episode Cards Grid ===== */
.ep-cards {
    display: grid;
    gap: 28px;
}

.ep-cards.ep-cols-1 { 
    grid-template-columns: 1fr; 
}

.ep-cards.ep-cols-2 { 
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
}

.ep-cards.ep-cols-3 { 
    grid-template-columns: repeat(3, minmax(0, 1fr)); 
}

/* Responsive grid */
@media (max-width: 1024px) {
    .ep-cards.ep-cols-3 { 
        grid-template-columns: repeat(2, minmax(0, 1fr)); 
    }
}

@media (max-width: 680px) {
    .ep-cards.ep-cols-2,
    .ep-cards.ep-cols-3 { 
        grid-template-columns: 1fr; 
    }
}

/* ===== Single Card ===== */
.ep-card {
    border-radius: 14px;
    border: 1px solid rgb(0 0 0 / 17%);
    background: #fff;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .22s ease, box-shadow .22s ease;
}

.ep-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
    border-color: rgba(0, 0, 0, .12);
}

/* Thumbnail with fixed aspect ratio */
.ep-thumb-link {
    display: block;
    position: relative;
    overflow: hidden;
    margin: -20px -20px 0;
}

.ep-thumb-link.ar-16x9 { 
    aspect-ratio: 16 / 9; 
}

.ep-thumb-link.ar-3x2 { 
    aspect-ratio: 3 / 2; 
}

.ep-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease, filter .25s ease;
}

.ep-card:hover .ep-thumb { 
    filter: brightness(1.08) contrast(1.05);
    transform: scale(1.05);
}

/* Card Body */
.ep-card-body {
    padding: 20px 0 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Overline */
.ep-overline {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    font-size: .78rem;
    color: #7a7a7a;
    margin-bottom: 6px;
}

/* Title with brand gradient reveal */
.ep-title {
    margin: 0 0 12px;
    line-height: 1.3;
}

.ep-title .blog-title {
    --brand: #BE0101;
    --base: #222;
    font-weight: 800;
    font-size: 1.25rem;
    text-decoration: none;
    color: var(--base);
    background: linear-gradient(to right, var(--brand), var(--brand) 50%, var(--base) 50%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 100%;
    background-position: 100%;
    transition: background-position .45s ease;
    display: inline-block;
}

.ep-card:hover .blog-title {
    background-position: 0%;
}

/* Meta row fix - Replace lines 121-135 with this */
/* Meta row */
.ep-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b6b6b;
    font-size: .75rem;
    margin-bottom: 12px;
    flex-direction: row;
    flex-wrap: nowrap;
}

/* Force episode card meta to stay horizontal */
.ep-cards .ep-card .ep-meta,
.ep-card-body .ep-meta,
.ep-card .ep-meta {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    margin-bottom: 12px !important;
}

/* Ensure meta items don't wrap */
.ep-cards .ep-meta > *,
.ep-card .ep-meta > * {
    white-space: nowrap;
}

.ep-by {
    font-weight: 500;
    white-space: nowrap;
}

.ep-dot {
    opacity: .55;
    white-space: nowrap;
}

.ep-meta time {
    white-space: nowrap;
}

/* Excerpt */
.ep-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    max-height: calc(1.5em * 3);
    margin: 0;
    font-size: .875rem;
    color: #555;
    margin-top: auto;
}

/* ===== Pagination Styles ===== */
.ep-pag {
    margin: 40px 0;
}

.ep-pag-list {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.ep-pag-item {
    margin: 0;
}

.ep-pag-item a,
.ep-pag-item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid transparent;
}

.ep-pag-item a {
    color: #333;
    background: #f5f5f5;
}

.ep-pag-item a:hover {
    background-color: rgba(190, 1, 1, 0.08);
    color: #BE0101;
    border-color: rgba(190, 1, 1, 0.2);
}

.ep-pag-item.is-current span {
    background-color: #BE0101;
    color: #fff;
    font-weight: 700;
}

/* ===== BRAND COLOR OVERRIDES + SPACING FIXES ===== */

/* Category Header - Current Location Display */
.ep-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 0;
    border-bottom: 2px solid rgba(190, 1, 1, .15);
    gap: 16px;
}

.ep-cat-viewing {
    font-size: .7rem;
    font-weight: 700;
    color:#363636;
    text-transform: uppercase;
    letter-spacing: .08em;
    white-space: nowrap;
    flex-shrink: 0;
}

.ep-cat-all-link {
    font-size: .7rem;
    font-weight: 700;
    color: #BE0101 !important;
    text-decoration: none;
    transition: all 0.25s ease;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(190, 1, 1, .08);
    border: 1px solid rgba(190, 1, 1, .15);
    white-space: nowrap;
    flex-shrink: 0;
}

.ep-cat-all-link:hover {
    background: rgba(190, 1, 1, .15);
    border-color: rgba(190, 1, 1, .3);
    transform: translateX(-3px);
    box-shadow: 0 2px 8px rgba(190, 1, 1, .15);
}

/* Spacing after header before chips */
.ep-cat-header + .ep-cat-flat-grid {
    margin-top: 20px;
}

/* Flat Grid - Better Spacing */
.ep-cat-flat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    width: 100%;
    margin-top: 20px;
}

/* Location Chips - Better Spacing */
.ep-cat-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 10px;
    background: rgba(190, 1, 1, .06);
    border: 1px solid rgba(190, 1, 1, .12);
    color: #222;
    text-decoration: none;
    font-weight: 600;
    font-size: .9rem;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    min-height: 52px;
}

.ep-cat-chip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(190, 1, 1, .08), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.ep-cat-chip:hover::before {
    opacity: 1;
}

.ep-cat-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(190, 1, 1, .15);
    border-color: rgba(190, 1, 1, .25);
}

.ep-cat-chip.is-active {
    background: linear-gradient(135deg, rgba(190, 1, 1, .18), rgba(190, 1, 1, .12));
    border-color: rgba(190, 1, 1, .35);
    color: #BE0101;
    font-weight: 700;
}

.ep-cat-chip .ep-cat-icon {
    font-size: 1.1rem;
    color: #BE0101;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    margin-right: 2px;
}

.ep-cat-chip .ep-cat-name {
    flex: 1;
    position: relative;
    z-index: 1;
    line-height: 1.3;
}

.ep-cat-chip .ep-cat-count {
    color: #666;
    font-weight: 600;
    font-size: .85em;
    margin-left: auto;
    padding-left: 8px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.ep-cat-chip.is-active .ep-cat-count {
    color: #BE0101;
    font-weight: 700;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .ep-cat-flat-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
    }
    
    .ep-cat-chip {
        padding: 12px 16px;
        font-size: .875rem;
        min-height: 48px;
    }
}

@media (max-width: 768px) {
    .ep-cat-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 10px 0;
    }
    
    .ep-cat-flat-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }
    
    .ep-cat-chip {
        padding: 12px 14px;
        font-size: .85rem;
    }
}

@media (max-width: 480px) {
    .ep-cat-flat-grid {
        grid-template-columns: 1fr;
    }
    
    .ep-cat-chip {
        padding: 14px 16px;
    }
    
    .ep-cat-header {
        gap: 10px;
    }
}

/* Widget container spacing */
.dsw-categories-widget {
    padding: 0;
}

.dsw-categories-widget.is-flat {
    margin: 0;
}

/* Ensure proper spacing in sidebar */
.elementor-widget-dsw_episode_categories {
    margin-bottom: 30px;
}

/* ===== Episode Navigation ===== */
.ep-nav {
    display: flex;
    gap: 24px;
    margin: 40px 0;
}

.ep-nav-card {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 24px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.ep-nav-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    border-color: rgba(190, 1, 1, .2);
}

.ep-nav-card.ep-prev {
    background: linear-gradient(to right, rgba(190, 1, 1, .02), transparent);
}

.ep-nav-card.ep-next {
    background: linear-gradient(to left, rgba(190, 1, 1, .02), transparent);
}

.ep-nav .ep-thumb {
    width: 120px;
    height: 80px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    margin-right: 20px;
    flex-shrink: 0;
}

.ep-nav .ep-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

.ep-dir {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #888;
    font-weight: 600;
}

.ep-nav-card .ep-title {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.4;
    color: #222;
}

/* ===== Responsive Styles ===== */
@media (max-width: 768px) {
    /* Navigation */
    .ep-nav {
        flex-direction: column;
    }
    
    .ep-nav .ep-thumb {
        width: 80px;
        height: 60px;
        margin-right: 16px;
    }
    
    .ep-nav-card {
        padding: 16px;
    }
    
    /* Categories */
    .ep-cat-parent {
        padding: 12px 16px;
    }
    
    .ep-cat-children {
        padding-left: 32px;
    }
    
    .ep-chip {
        font-size: .8rem;
        padding: 6px 12px;
    }
    
    /* Cards */
    .ep-title .blog-title {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    /* Pagination */
    .ep-pag-item a,
    .ep-pag-item span {
        min-width: 36px;
        height: 36px;
        padding: 6px 12px;
        font-size: .875rem;
    }
}

 /* Pagination Styles */
    .ep-pag {
        margin: 30px 0;
    }
    
    .ep-pag-list {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .ep-pag-item {
        margin: 0;
    }
    
    .ep-pag-item a,
    .ep-pag-item span {
        display: inline-block;
        padding: 8px 16px;
        border-radius: 6px;
        text-decoration: none;
        transition: all 0.3s ease;
        font-weight: 500;
    }
    
    .ep-pag-item a:hover {
        background-color: rgba(190,1,1,0.08);
        color: #BE0101;
    }
    
    .ep-pag-item.is-current span {
        background-color: rgba(190,1,1,0.1);
        color: #BE0101;
        font-weight: 700;
    }
    
    /* Navigation Styles */
    .ep-nav {
        display: flex;
        gap: 20px;
        margin: 40px 0;
    }
    
    .ep-nav-card {
        flex: 1;
        display: flex;
        align-items: center;
        padding: 20px;
        text-decoration: none;
        transition: all 0.3s ease;
        border: 1px solid #e5e5e5;
    }
    
    .ep-nav-card:hover {
        transform: translateY(-2px);
    }
    
    .ep-nav .ep-thumb {
        width: 120px;
        height: 80px;
        background-size: cover;
        background-position: center;
        border-radius: 6px;
        margin-right: 20px;
    }
    .ep-dir {
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    .ep-nav-card .ep-title {
        font-size: 1.125rem;
        font-weight: 600;
        line-height: 1.3;
    }

/* Episode Navigation Dynamic Text */
.dsw-nav-widget .ep-nav-card .ep-dir {
    position: relative;
}

/* Hide original text and show custom text from data attributes */
.dsw-nav-widget[data-prev-text] .ep-nav-card.ep-prev .ep-dir:not(:empty) {
    font-size: 0;
}

.dsw-nav-widget[data-prev-text] .ep-nav-card.ep-prev .ep-dir::after {
    content: attr(data-prev-text);
    font-size: 0.75rem;
    position: absolute;
    left: 0;
    top: 0;
}

.dsw-nav-widget[data-next-text] .ep-nav-card.ep-next .ep-dir:not(:empty) {
    font-size: 0;
}

.dsw-nav-widget[data-next-text] .ep-nav-card.ep-next .ep-dir::after {
    content: attr(data-next-text);
    font-size: 0.75rem;
    position: absolute;
    left: 0;
    top: 0;
}

/* Mobile stacking - handled by Elementor's responsive selectors */
.ep-nav-mobile-stack-yes .ep-nav {
    flex-direction: column;
}
    
    @media (max-width: 768px) {
        .ep-nav {
            flex-direction: column;
        }
        
        .ep-nav .ep-thumb {
            width: 80px;
            height: 60px;
        }
    }

/* ===== Dark Mode Support (Optional) ===== */
@media (prefers-color-scheme: dark) {
    .ep-card {
        background: #1a1a1a;
        border-color: rgba(255, 255, 255, .1);
    }
    
    .ep-title .blog-title {
        --base: #f0f0f0;
    }
    
    .ep-excerpt {
        color: #ccc;
    }
    
    .ep-nav-card {
        background: #1a1a1a;
        border-color: rgba(255, 255, 255, .1);
    }
    
    .ep-nav-card .ep-title {
        color: #f0f0f0;
    }
}

/* ===== Elementor Editor Styles ===== */
.elementor-editor-active .ep-cards,
.elementor-editor-active .ep-cat,
.elementor-editor-active .ep-nav {
    min-height: 100px;
}

/* Empty state */
.ep-cards.empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.125rem;
}

/* ===== Tag Cloud Widget ===== */
.dsw-tagcloud-wrapper {
    width: 100%;
}

.dsw-tagcloud-title {
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 1.3125rem;
    text-align: center;
    margin: 0 0 20px;
}

.dsw-tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin: 0;
}

/* Parent tags (full-width banners) */
.dsw-tag-parent {
    order: -1;
    flex: 1 1 100%;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(190,1,1,0.12), rgba(190,1,1,0.05));
    color: #222;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.02em;
    font-size: 0.98rem;
    transition: all 0.3s ease;
}

.dsw-tag-parent:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(190,1,1,0.15);
}

.dsw-tag-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

/* Dynamic parent icon from data attribute */
.dsw-tag-icon::before {
    content: none;
}

.dsw-tagcloud-wrapper[data-parent-icon] .dsw-tag-icon::before {
    content: attr(data-parent-icon);
}

/* Categories widget icon */
.dsw-categories-widget .ep-cat-pin {
    font-style: normal;
}

.dsw-categories-widget .ep-cat-pin::before {
    content: none;
}

.dsw-categories-widget[data-parent-icon] .ep-cat-pin::before {
    content: attr(data-parent-icon);
}

/* Child tags (chips) */
.dsw-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(190,1,1,0.10);
    color: #BE0101;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.2;
    font-size: 0.9rem;
    transition: background 0.18s ease, transform 0.06s ease;
}

.dsw-tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: currentColor;
    flex-shrink: 0;
}

.dsw-tag-chip:hover {
    background: rgba(190,1,1,0.18);
    transform: translateY(-1px);
}

/* Count styling */
.dsw-tag-count {
    font-weight: 500;
    color: #6b6b6b;
    margin-left: 2px;
    font-size: 0.8em;
}

.dsw-tag-parent .dsw-tag-count {
    margin-left: auto;
}

/* Episode Navigation Dynamic Text */
.dsw-nav-widget[data-prev-text] .ep-nav-card.ep-prev .ep-dir,
.dsw-nav-widget[data-next-text] .ep-nav-card.ep-next .ep-dir {
    font-size: 0;
}

.dsw-nav-widget[data-prev-text] .ep-nav-card.ep-prev .ep-dir::after {
    content: attr(data-prev-text);
    font-size: 0.75rem;
}

.dsw-nav-widget[data-next-text] .ep-nav-card.ep-next .ep-dir::after {
    content: attr(data-next-text);
    font-size: 0.75rem;
}

/* Mobile stacking for navigation */
@media (max-width: 768px) {
    .dsw-nav-widget[data-stack-mobile="yes"] .ep-nav {
        flex-direction: column;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .dsw-tagcloud {
        gap: 8px;
    }
    
    .dsw-tag-chip {
        font-size: 0.9rem;
        padding: 6px 10px;
    }
    
    .dsw-tag-parent {
        font-size: 0.95rem;
        padding: 9px 12px;
    }
}

@media (max-width: 480px) {
    .dsw-tag-chip {
        font-size: 0.85rem;
        padding: 5px 10px;
    }
    
    .dsw-tag-parent {
        font-size: 0.92rem;
        padding: 8px 12px;
    }
    
    .dsw-tag-dot {
        width: 6px;
        height: 6px;
    }
}

/* Child tags (chips) */
.dsw-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(190,1,1,0.10);
    color: #BE0101;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.2;
    font-size: 0.9rem;
    transition: background 0.18s ease, transform 0.06s ease;
}

.dsw-tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: currentColor;
    flex-shrink: 0;
}

.dsw-tag-chip:hover {
    background: rgba(190,1,1,0.18);
    transform: translateY(-1px);
}

/* Count styling */
.dsw-tag-count {
    font-weight: 500;
    color: #6b6b6b;
    margin-left: 2px;
    font-size: 0.8em;
}

.dsw-tag-parent .dsw-tag-count {
    margin-left: auto;
}

/* Episode Navigation Dynamic Text */
.dsw-nav-widget[data-prev-text] .ep-nav-card.ep-prev .ep-dir,
.dsw-nav-widget[data-next-text] .ep-nav-card.ep-next .ep-dir {
    font-size: 0;
}

.dsw-nav-widget[data-prev-text] .ep-nav-card.ep-prev .ep-dir::after {
    content: attr(data-prev-text);
    font-size: 0.75rem;
}

.dsw-nav-widget[data-next-text] .ep-nav-card.ep-next .ep-dir::after {
    content: attr(data-next-text);
    font-size: 0.75rem;
}

/* Mobile stacking for navigation */
@media (max-width: 768px) {
    .dsw-nav-widget[data-stack-mobile="yes"] .ep-nav {
        flex-direction: column;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .dsw-tagcloud {
        gap: 8px;
    }
    
    .dsw-tag-chip {
        font-size: 0.9rem;
        padding: 6px 10px;
    }
    
    .dsw-tag-parent {
        font-size: 0.95rem;
        padding: 9px 12px;
    }
}

@media (max-width: 480px) {
    .dsw-tag-chip {
        font-size: 0.85rem;
        padding: 5px 10px;
    }
    
    .dsw-tag-parent {
        font-size: 0.92rem;
        padding: 8px 12px;
    }
    
    .dsw-tag-dot {
        width: 6px;
        height: 6px;
    }
}