/* 
* General Castory styles
* using a defined color palette
 */

:root {
    --cast-primary: #776CFE;   /* primary */
    --cast-accent: #00EA99;    /* accent */
    --cast-secondary: #99BE7D; /* secondary */
    --cast-hover: #A03CFF;     /* hover */
    --cast-bg-light: #2b2f32;
    --cast-bg-dark: #1A1D29;
    --cast-text-main: #111827;
    --cast-text-muted: #4B5563;
    --primary-purple: #776CFE;
    --hover-purple: #A03CFF;
    --accent-green: #00EA99;
}

.castory-discovery-wrapper {
    background-color: var(--cast-bg-light);
    color: var(--cast-text-main);
    padding: 20px;
    border-radius: 12px;
}

.castory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.castory-title {
    font-size: 1.6rem;
    font-weight: 700;
}

.castory-btn-primary {
    background-color: var(--cast-primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.castory-btn-primary:hover {
    background-color: var(--cast-hover);
    transform: translateY(-1px);
}

.castory-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
}

.castory-sidebar {
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(15,17,26,0.06);
}

.castory-sidebar h3 {
    font-size: 1rem;
    margin-bottom: 12px;
}

#castory-podcast-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#castory-podcast-list li {
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    color: var(--cast-text-main);
}

#castory-podcast-list li:hover {
    background-color: #F3F4F6;
}

.castory-main {
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(15,17,26,0.06);
}

#castory-modal {
display: none; /* first hidden */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
z-index: 999999 !important; /* above everyone elements BuddyBoss */
    justify-content: center;
    align-items: center;
}


/* Dark backdrop behind popup */
#castory-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 20, 18, 0.85);
    backdrop-filter: blur(5px);
    z-index: 999999 !important;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

/* Popup content */
#castory-modal-content {
    background: #1A1D29;
    width: 600px;
    max-width: 650px;
max-height: 90vh; /* prevent getting bigger than page */
overflow-y: auto; /* internal scroll if needed */
    padding: 30px;
    border-radius: 20px;
    border:1px solid rgba(119, 108, 254, 0.3); 
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

/* style fields */
.form-group input, .form-group textarea, .form-group select {
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 12px;
    margin-top: 5px;
    width: 100%;
}

.form-group input:focus {
    border-color: #776CFE;
    outline: none;
}

/* for BuddyBoss dark mode */
body.dark-mode .castory-modal-content {
    background: #1A1D29;
    color: #F3F4F6;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.close-modal { cursor: pointer; font-size: 24px; color: #776CFE; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
}

/* registration button with Armin brand color */
.submit-btn {
    background-color: #776CFE;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    transition: 0.3s;
}

.submit-btn:hover {
background-color: #A03CFF; /* color hover purple light */
}


.castory-profile-container h3 {
    color: var(--primary-purple);
    border-bottom: 2px solid var(--accent-green);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.podcast-item {
    transition: all 0.3s ease;
    background: #fff;
}

.podcast-item:hover {
    border-color: var(--primary-purple) !important;
    box-shadow: 0 4px 12px rgba(119, 108, 254, 0.1);
    transform: translateY(-2px);
}

.podcast-item h4 a {
    color: #111827;
    text-decoration: none;
}

.podcast-item h4 a:hover {
    color: var(--primary-purple);
}

/* style buttons CTA in the form */
.castory-btn-primary {
    background-color: var(--primary-purple);
    border: 1px solid var(--primary-purple);
    color: #fff;
}

.castory-btn-primary:hover {
    background-color: var(--hover-purple);
    border-color: var(--hover-purple);
}

/* exclusive style of Castaminofen */
.castory-profile-list .podcast-card {
    transition: transform 0.3s ease, border-color 0.3s ease;
background-color: #FFFFFF; /* in light mode */
}

/* hover effect on cards */
.castory-profile-list .podcast-card:hover {
    border-color: #776CFE !important; /* purple primary */
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(119, 108, 254, 0.1);
}

/* title links */
.castory-profile-list .podcast-card h4 a {
    text-decoration: none;
    color: #776CFE;
}

.castory-profile-list .podcast-card h4 a:hover {
color: #A03CFF; /* bright purple for hover */
}

/* style for BuddyBoss dark mode */
body.dark-mode .castory-profile-list .podcast-card {
    background-color: #1A1D29;
    border-color: #2D3748 !important;
    color: #F3F4F6;
}

/* style fields in Castaminofen dark mode */
.cast-input::placeholder {
    color: #9CA3AF;
    font-size: 0.9em;
}

/* color of selected text in drop-down lists */
input[list]::-webkit-calendar-picker-indicator {
filter: invert(1); /* Feed the flash icon in dark mode */
    cursor: pointer;
}

/* hide the scroll bar for beauty */
#castory-modal-content::-webkit-scrollbar { width: 5px; }
#castory-modal-content::-webkit-scrollbar-thumb { background: #776CFE; border-radius: 10px; }

.castory-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
@media (max-width: 600px) {
    .castory-form-grid { grid-template-columns: 1fr; }
    #castory-modal-content { padding: 20px; border-radius: 15px; }
}
.castory-input {
    width:100%; background:#2D3748; border:1px solid #4A5568; 
    color:#fff; padding:12px; border-radius:10px; outline:none;
    transition: 0.3s;
}
.castory-input:focus { border-color: #776CFE; box-shadow: 0 0 10px rgba(119, 108, 254, 0.2); }

/* Modal Castory */
.castory-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 26, 0.92);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.castory-modal-content {
    background: #1A1D29;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    border-radius: 20px;
    border: 1px solid #2D3748;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.castory-modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    color: #9CA3AF;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
}

.castory-modal-title {
    color: #fff;
    text-align: center;
    margin: 0 0 6px;
}

.castory-modal-subtitle {
    color: #9CA3AF;
    text-align: center;
    margin: 0 0 20px;
    font-size: 0.85rem;
}

.castory-field {
    margin-bottom: 14px;
}

.castory-field label {
    display: block;
    color: #D1D5DB;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.castory-field input,
.castory-field select,
.castory-field textarea {
    width: 100%;
    background: #2D3748;
    border: 1px solid #4A5568;
    color: #ffffff8f;
    padding: 10px 12px;
    border-radius: 10px;
    outline: none;
}

.castory-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.castory-btn-submit {
    width: 100%;
    background: #776CFE;
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 8px;
}

.castory-btn-submit:hover {
    background: #A03CFF;
}

.castory-popup-message {
    margin-top: 12px;
    text-align: center;
    font-size: 0.9rem;
}

.castory-alert {
    padding: 16px;
    border-radius: 10px;
    background: #1A1D29;
    color: #fff;
    border: 1px solid #2D3748;
}

@media (max-width: 600px) {
    .castory-field-row {
        grid-template-columns: 1fr;
    }
}

/* ——— Explore ——— */
.explore-page .page-header,
.explore-page .explore-header,
body.page-template-explore-php .entry-header,
body.page-template-explore-php .bb-page-title,
body.page-template-explore-php .page-header {
    display: none !important;
}

.castory-explore-wrap {
    margin: 20px 0;
}

.cast-explore-header {
    margin-bottom: 20px;
}

.explore-tabs-scroll {
    position: relative;
    overflow: hidden;
}

.explore-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding: 4px 4px 12px;
    scrollbar-width: thin;
}

.explore-tabs .tab-btn {
    background: #2D3748;
    color: #F3F4F6;
    border: 1px solid #4A5568;
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.explore-tabs .tab-btn__short {
    display: none;
}

@media (max-width: 768px) {
    .explore-tabs-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -4px 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .explore-tabs.explore-tabs--profile {
        flex-wrap: nowrap;
        gap: 0;
        padding: 0;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        border-radius: 0;
    }

    .explore-tabs.explore-tabs--profile .tab-btn {
        flex: 0 0 auto;
        scroll-snap-align: start;
        border: none;
        border-radius: 0;
        border-bottom: 2px solid transparent;
        background: transparent;
        color: #9ca3af;
        min-height: 44px;
        padding: 10px 14px;
        font-size: 0.85rem;
        font-weight: 600;
    }

    .explore-tabs.explore-tabs--profile .tab-btn.active,
    .explore-tabs.explore-tabs--profile .tab-btn:hover {
        background: transparent;
        border-color: transparent;
        border-bottom-color: #a03cff;
        color: #fff;
    }
}

.explore-tabs .tab-btn.active,
.explore-tabs .tab-btn:hover {
    background: #776CFE;
    border-color: #776CFE;
}

/* desktop: small tabs */
@media (min-width: 769px) {
    .explore-tabs-scroll {
        overflow: visible;
    }

    .explore-tabs {
        flex-wrap: wrap;
        overflow-x: visible;
        scroll-snap-type: none;
        gap: 6px;
        padding: 0 0 8px;
    }

    .explore-tabs .tab-btn {
        padding: 5px 11px;
        min-height: 32px;
        font-size: 0.78rem;
        font-weight: 600;
        border-radius: 8px;
    }
}

.castory-explore-controls {
    margin-bottom: 24px;
}

.explore-toolbar {
    display: flex;
    align-items: stretch;
    gap: 10px;
    flex-wrap: nowrap;
}

.explore-toolbar__category {
    position: relative;
    flex: 0 0 auto;
}

.explore-category-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 14px;
    background: #2D3748;
    border: 1px solid #4A5568;
    color: #F3F4F6;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    font-family: inherit;
    white-space: nowrap;
    max-width: 160px;
}

.explore-category-toggle__label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.explore-category-toggle__icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    width: 16px;
    flex-shrink: 0;
}

.explore-category-toggle__icon span {
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}

.explore-category-toggle.is-open .explore-category-toggle__icon span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.explore-category-toggle.is-open .explore-category-toggle__icon span:nth-child(2) {
    opacity: 0;
}

.explore-category-toggle.is-open .explore-category-toggle__icon span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

.explore-category-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    min-width: 200px;
    max-width: min(320px, 90vw);
    max-height: 280px;
    overflow-y: auto;
    background: #1A1D29;
    border: 1px solid #4A5568;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.explore-category-panel[hidden] {
    display: none !important;
}

.category-pills {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-pills .pill {
    background: transparent;
    color: #D1D5DB;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    text-align: right;
    width: 100%;
    font-family: inherit;
}

.category-pills .pill:hover {
    background: rgba(119, 108, 254, 0.12);
}

.category-pills .pill.active {
    background: rgba(0, 234, 153, 0.12);
    color: #00EA99;
}

.explore-toolbar__search-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.explore-search-input,
.explore-sort-select {
    background: #2D3748;
    border: 1px solid #4A5568;
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.88rem;
    height: 42px;
    box-sizing: border-box;
}

.explore-search-input--compact {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
}

.explore-sort-select {
    flex: 0 0 auto;
    min-width: 118px;
    max-width: 42%;
    padding-left: 8px;
    padding-right: 8px;
}

@media (max-width: 768px) {
    .explore-toolbar {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 6px;
    }

    .explore-toolbar__filters-row {
        flex: 1 1 auto;
        min-width: 0;
        gap: 4px;
    }

    .explore-toolbar__category {
        flex: 0 0 auto;
    }

    .explore-category-toggle {
        max-width: none;
        width: 38px;
        height: 38px;
        padding: 0;
        justify-content: center;
    }

    .explore-category-toggle__label {
        display: none;
    }

    .explore-tag-toggle {
        width: 38px;
        height: 38px;
    }

    .explore-toolbar__search-sort {
        flex: 1 1 auto;
        min-width: 0;
        gap: 4px;
    }

    .explore-search-input,
    .explore-sort-select {
        height: 38px;
        padding: 6px 8px;
        font-size: 0.8rem;
    }

    .explore-sort-select {
        min-width: 72px;
        max-width: 34%;
    }
}

.cast-grid.bb-grid,
#explore-results.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.castory-explore-wrap .cast-grid.bb-grid,
.castory-explore-wrap #explore-results.cast-grid {
    grid-template-columns: repeat(var(--castory-explore-cols-desktop, 4), minmax(0, 1fr));
    align-items: stretch;
}

@media (max-width: 768px) {
    .cast-grid.bb-grid,
    #explore-results.cast-grid,
    .castory-explore-wrap #explore-results.cast-grid {
        grid-template-columns: repeat(var(--castory-explore-cols-mobile, 2), minmax(0, 1fr));
        gap: 10px;
    }

    .castory-explore-card--clickable,
    .castory-feed-episode--clickable {
        cursor: pointer;
    }

    .castory-explore-wrap .castory-explore-card {
        display: flex;
        flex-direction: column;
        aspect-ratio: auto;
        border-radius: 12px;
    }

    .castory-explore-wrap .castory-explore-card__thumb {
        height: 90px;
        flex-shrink: 0;
        aspect-ratio: auto;
    }

    .castory-explore-wrap .castory-explore-card__thumb img {
        height: 100%;
        aspect-ratio: auto;
    }

    .castory-explore-wrap .castory-explore-card__body {
        position: static;
        padding: 8px 10px 10px;
        background: transparent;
        pointer-events: auto;
    }

    .castory-explore-wrap .castory-explore-card__badge {
        display: inline-block;
        font-size: 0.62rem;
        margin-bottom: 4px;
    }

    .castory-explore-wrap .castory-explore-card__title {
        font-size: 0.78rem;
        line-height: 1.3;
        margin: 0 0 4px;
    }

    .castory-explore-wrap .castory-explore-card__title a {
        color: inherit;
        -webkit-line-clamp: 2;
    }

    .castory-explore-wrap .castory-explore-card__excerpt {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 0.68rem;
        margin: 0 0 6px;
    }

    .castory-explore-wrap .castory-explore-card__meta {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 8px;
        font-size: 0.62rem;
    }

    .castory-card-actions {
        display: none !important;
    }

    #explore-results .castory-following-feed {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    #explore-results .castory-feed-episode {
        flex-direction: column;
        aspect-ratio: auto;
        padding: 0;
        overflow: hidden;
        border-radius: 12px;
    }

    #explore-results .castory-feed-episode__thumb {
        width: 100%;
        height: 90px;
        aspect-ratio: auto;
        border-radius: 0;
    }

    #explore-results .castory-feed-episode__thumb-play {
        display: none;
    }

    #explore-results .castory-feed-episode__body {
        position: static;
        padding: 8px 10px 10px;
        background: transparent;
    }

    #explore-results .castory-feed-episode__podcast {
        display: block;
        font-size: 0.62rem;
        margin-bottom: 2px;
    }

    #explore-results .castory-feed-episode__title {
        font-size: 0.78rem;
        margin: 0 0 4px;
        line-height: 1.3;
        color: inherit;
    }

    #explore-results .castory-feed-episode__excerpt {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 0.68rem;
        margin: 0 0 4px;
    }

    #explore-results .castory-feed-episode__badge,
    #explore-results .castory-feed-episode__meta {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        font-size: 0.62rem;
    }

    #explore-results .castory-feed-episode__play:not(.castory-feed-episode__play--link) {
        display: none;
    }
}

.castory-explore-card {
    background: #1A1D29;
    border: 1px solid #2D3748;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.castory-explore-card:hover {
    transform: translateY(-4px);
    border-color: #776CFE;
}

@media (min-width: 769px) {
    .castory-explore-wrap .podcast-item {
        display: flex;
        min-width: 0;
        height: 100%;
    }

    .castory-explore-wrap .castory-explore-card {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100%;
    }

    .castory-explore-wrap .castory-explore-card__thumb {
        flex-shrink: 0;
        height: 180px;
        overflow: hidden;
    }

    .castory-explore-wrap .castory-explore-card__thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .castory-explore-wrap .castory-explore-card__body {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding: 16px;
    }

    .castory-explore-wrap .castory-explore-card__excerpt {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        flex: 1 1 auto;
        min-height: 0;
    }

    .castory-explore-wrap .castory-explore-card__meta,
    .castory-explore-wrap .castory-card-actions {
        flex-shrink: 0;
    }
}

.castory-explore-card__thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.castory-explore-card__body {
    padding: 16px;
}

.castory-explore-card__badge {
    display: inline-block;
    font-size: 0.75rem;
    color: #776CFE;
    margin-bottom: 8px;
}

.castory-explore-card__title {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.castory-explore-card__title a {
    color: #fff;
    text-decoration: none;
}

.castory-explore-card__excerpt {
    color: #9CA3AF;
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0 0 12px;
}

.castory-explore-card__meta {
    display: flex;
    gap: 14px;
    color: #6B7280;
    font-size: 0.78rem;
}

.explore-empty,
.explore-status {
    color: #9CA3AF;
    text-align: center;
    padding: 24px;
}

/* ——— Activity Feed ——— */
.activity-list li.blogs .activity-inner .bb-post-img-link,
.activity-list li.castory_new_episode .activity-inner .bb-post-img-link {
    display: none !important;
}

.castory-activity-card--episode {
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 100%;
    width: 100%;
}

.castory-activity-card--episode .castory-activity-card__body--header,
.castory-activity-card--episode .castory-activity-card__body--footer {
    width: 100%;
}

.castory-activity-card__thumb--center {
    width: 100%;
    max-width: 320px;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 10px auto;
    border-radius: 12px;
}

.castory-activity-card__thumb--center img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.castory-activity-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--castory-border, #2d3748);
    background: var(--castory-surface, #1a1d29);
    max-width: 400px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.castory-activity-card:hover {
    border-color: #776cfe;
    box-shadow: 0 4px 16px rgba(119, 108, 254, 0.12);
}

.castory-activity-card__thumb {
    flex-shrink: 0;
    width: 68px;
    height: 68px;
    border-radius: 10px;
    overflow: hidden;
    display: block;
    background: #232735;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.castory-activity-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.castory-activity-card__body {
    flex: 1;
    min-width: 0;
}

.castory-activity-card__title {
    display: block;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--castory-text, #f3f4f6);
    text-decoration: none;
    margin-bottom: 4px;
    line-height: 1.35;
}

.castory-activity-card__title:hover {
    color: #776cfe;
}

.castory-activity-card__podcast {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #776cfe;
    text-decoration: none;
    margin-bottom: 2px;
}

.castory-activity-card__excerpt {
    margin: 4px 0 6px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--castory-text-muted, #9ca3af);
}

.castory-activity-card__cta {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #00ea99;
    text-decoration: none;
}

.castory-activity-card__cta:hover {
    color: #776cfe;
}

.castory-activity-badge,
.castory-activity-meta {
    display: inline-block;
    color: #776cfe;
    font-size: 0.72rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.castory-activity-episode-title {
    margin: 0 0 4px;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.35;
    color: inherit;
}

.castory-activity-play {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #00ea99;
    color: #0f111a !important;
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.78rem;
}

.activity-list .castory-activity-audio {
    margin-top: 6px;
}

html[data-castory-theme="light"] .castory-activity-card,
body:not(.dark-mode) .castory-activity-card {
    background: var(--bb-content-background-color, #fff);
    border-color: var(--castory-border, #e5e7eb);
}

html[data-castory-theme="light"] .castory-activity-card__title,
body:not(.dark-mode) .castory-activity-card__title {
    color: #111827;
}

/* ——— Manage episodes ——— */
.castory-manage-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 16px 48px;
    color: #e5e7eb;
}

.castory-manage-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #2d3748;
}

.castory-manage-header h1 {
    margin: 8px 0 4px;
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    color: #fff;
}

.castory-manage-back {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.85rem;
}

.castory-manage-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.castory-manage-tab {
    flex: 1 1 auto;
    min-width: 120px;
    padding: 10px 16px;
    border: 1px solid #2d3748;
    background: #1a1d29;
    color: #9ca3af;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.castory-manage-tab.is-active {
    background: #776cfe;
    border-color: #776cfe;
    color: #fff;
}

.castory-manage-panel {
    display: none;
}

.castory-manage-panel.is-active {
    display: block;
}

.castory-manage-hint {
    color: #9ca3af;
    font-size: 0.88rem;
    margin-bottom: 16px;
}

.castory-season-block {
    margin-bottom: 28px;
}

.castory-season-title {
    font-size: 1rem;
    color: #fff;
    margin: 0 0 12px;
}

.castory-season-count {
    color: #6b7280;
    font-weight: normal;
    font-size: 0.85rem;
}

.castory-episode-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.castory-episode-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #1a1d29;
    border: 1px solid #2d3748;
    border-radius: 12px;
    margin-bottom: 8px;
}

.castory-episode-item.ui-sortable-helper {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    border-color: #776cfe;
}

.castory-episode-placeholder {
    height: 56px;
    margin-bottom: 8px;
    border: 2px dashed #776cfe;
    border-radius: 12px;
    background: rgba(119, 108, 254, 0.08);
}

.castory-episode-drag {
    cursor: grab;
    color: #6b7280;
    user-select: none;
    padding: 4px;
}

.castory-episode-item__body {
    flex: 1;
    min-width: 0;
}

.castory-episode-item__title {
    display: block;
    color: #fff;
    font-size: 0.95rem;
}

.castory-episode-item__meta,
.castory-episode-item__links {
    display: block;
    font-size: 0.78rem;
    color: #9ca3af;
    margin-top: 4px;
}

.castory-episode-item__actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.castory-btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
    text-decoration: none;
    color: inherit;
    line-height: 1;
}

.castory-episode-item__actions .castory-play-episode {
    min-width: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.castory-episode-item__actions .castory-play-episode:hover {
    background: rgba(119, 108, 254, 0.15);
}

.castory-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}

.castory-btn--accent {
    background: #00ea99;
    color: #0f111a;
}

.castory-btn--ghost {
    background: transparent;
    border: 1px solid #2d3748;
    color: #e5e7eb;
}

.castory-form .castory-field {
    margin-bottom: 16px;
}

.castory-form label {
    display: block;
    margin-bottom: 6px;
    color: #d1d5db;
    font-size: 0.9rem;
}

.castory-form input[type="text"],
.castory-form input[type="url"],
.castory-form input[type="number"],
.castory-form input[type="file"],
.castory-form select,
.castory-form textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #2d3748;
    background: #0f111a;
    color: #fff;
    box-sizing: border-box;
}

.castory-field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.castory-select-multi {
    min-height: 120px;
}

.castory-field-help {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 0.8rem;
}

.castory-btn-submit {
    background: #776cfe;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    width: 100%;
    max-width: 320px;
}

.castory-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.castory-modal-content {
    background: #1a1d29;
    border: 1px solid #2d3748;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 520px;
    margin: auto;
    position: relative;
}

.castory-modal-content--wide {
    max-width: 640px;
}

.castory-modal-close {
    position: absolute;
    top: 12px;
    left: 16px;
    font-size: 28px;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
}

.castory-modal-title {
    margin: 0 0 20px;
    padding-right: 32px;
    color: #fff;
}

.castory-modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.castory-manage-empty,
.castory-alert {
    padding: 20px;
    text-align: center;
    border-radius: 12px;
    background: #1a1d29;
    border: 1px dashed #2d3748;
}

/* ——— buttons card podcast (profile + Explore) ——— */
.castory-profile-card-actions,
.castory-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    width: 100%;
    justify-content: center;
}

.castory-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none !important;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transition: 0.2s ease;
    white-space: nowrap;
}

.castory-card-btn--view {
    color: #00ea99 !important;
    border-color: rgba(0, 234, 153, 0.35);
    background: rgba(0, 234, 153, 0.12);
}

.castory-card-btn--manage {
    color: #c4bfff !important;
    border-color: rgba(119, 108, 254, 0.4);
    background: rgba(119, 108, 254, 0.14);
}

.castory-card-btn--edit {
    color: #e0b3ff !important;
    border-color: rgba(160, 60, 255, 0.35);
    background: rgba(160, 60, 255, 0.12);
}

.castory-card-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

body:not(.dark-mode) .castory-card-btn {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

body:not(.dark-mode) .castory-card-btn--view {
    color: #047857 !important;
    background: rgba(0, 234, 153, 0.2);
}

body:not(.dark-mode) .castory-card-btn--manage {
    color: #4c46b6 !important;
    background: rgba(119, 108, 254, 0.18);
}

body:not(.dark-mode) .castory-card-btn--edit {
    color: #7c3aed !important;
    background: rgba(160, 60, 255, 0.15);
}

.castory-explore-card__body .castory-card-actions {
    padding-top: 12px;
    border-top: 1px solid #2d3748;
}

body:not(.dark-mode) .castory-explore-card__body .castory-card-actions {
    border-top-color: #e5e7eb;
}

.castory-channel-badge,
.castory-episode-media-badge,
.episode-media-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
    background: rgba(119, 108, 254, 0.15);
    color: #776cfe;
}

.castory-episode-media-badge,
.episode-media-badge {
    margin-bottom: 4px;
}

/* ——— Light mode (BuddyBoss: no body.dark-mode) ——— */
body:not(.dark-mode) .castory-modal-content {
    background: #ffffff;
    color: #111827;
    border-color: #e5e7eb;
}

body:not(.dark-mode) .castory-modal-title,
body:not(.dark-mode) .castory-modal-subtitle {
    color: #111827;
}

body:not(.dark-mode) .castory-modal-subtitle {
    color: #6b7280;
}

body:not(.dark-mode) .castory-modal-close {
    color: #6b7280;
}

body:not(.dark-mode) .castory-field label,
body:not(.dark-mode) .castory-form label {
    color: #374151;
}

body:not(.dark-mode) .castory-field input,
body:not(.dark-mode) .castory-field select,
body:not(.dark-mode) .castory-field textarea,
body:not(.dark-mode) .castory-form input[type="text"],
body:not(.dark-mode) .castory-form input[type="url"],
body:not(.dark-mode) .castory-form input[type="number"],
body:not(.dark-mode) .castory-form input[type="file"],
body:not(.dark-mode) .castory-form select,
body:not(.dark-mode) .castory-form textarea {
    background: #ffffff;
    color: #111827;
    border-color: #d1d5db;
}

body:not(.dark-mode) .castory-field input:focus,
body:not(.dark-mode) .castory-field select:focus,
body:not(.dark-mode) .castory-field textarea:focus,
body:not(.dark-mode) .castory-form input:focus,
body:not(.dark-mode) .castory-form select:focus,
body:not(.dark-mode) .castory-form textarea:focus {
    background: #ffffff;
    color: #111827;
    border-color: #776cfe;
    box-shadow: 0 0 0 2px rgba(119, 108, 254, 0.2);
}

body:not(.dark-mode) .castory-field input::placeholder,
body:not(.dark-mode) .castory-field textarea::placeholder,
body:not(.dark-mode) .castory-form input::placeholder,
body:not(.dark-mode) .castory-form textarea::placeholder {
    color: #9ca3af;
}

body:not(.dark-mode) .castory-field-help {
    color: #6b7280;
}

body:not(.dark-mode) .castory-manage-wrap {
    color: #111827;
}

body:not(.dark-mode) .castory-manage-header h1,
body:not(.dark-mode) .castory-season-title,
body:not(.dark-mode) .castory-episode-item__title {
    color: #111827;
}

body:not(.dark-mode) .castory-manage-hint,
body:not(.dark-mode) .castory-manage-back,
body:not(.dark-mode) .castory-episode-item__meta,
body:not(.dark-mode) .castory-episode-item__links {
    color: #6b7280;
}

body:not(.dark-mode) .castory-manage-tab {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #4b5563;
}

body:not(.dark-mode) .castory-episode-item {
    background: #ffffff;
    border-color: #e5e7eb;
}

body:not(.dark-mode) .castory-btn--ghost {
    border-color: #d1d5db;
    color: #374151;
}

body:not(.dark-mode) .castory-audio-current {
    color: #059669;
    font-size: 0.85rem;
    margin-top: 8px;
}

body:not(.dark-mode) .castory-audio-current a {
    color: #776cfe;
}

@media (max-width: 768px) {
    .castory-manage-header__actions {
        width: 100%;
    }

    .castory-manage-header__actions .castory-btn {
        width: 100%;
    }

    .castory-episode-item {
        flex-wrap: wrap;
    }

    .castory-episode-item__actions {
        width: 100%;
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid #2d3748;
    }

    .castory-manage-tab {
        flex: 1 1 45%;
    }

    .castory-modal-footer .castory-btn,
    .castory-modal-footer .castory-btn-submit {
        flex: 1 1 100%;
        max-width: none;
    }
}

/* ——— Subscribe / follow ——— */
.castory-subscribe-wrap {
    margin: 12px 0 0;
}

.castory-subscribe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 999px;
    border: 2px solid #776CFE;
    background: transparent;
    color: #776CFE;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.castory-subscribe-btn:hover,
.castory-subscribe-btn.is-subscribed {
    background: #776CFE;
    color: #fff;
    border-color: #776CFE;
}

.castory-subscribe-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.castory-subscribe-btn--login {
    border-color: #00EA99;
    color: #00EA99;
}

.castory-subscribe-btn--login:hover {
    background: #00EA99;
    color: #0F111A;
    border-color: #00EA99;
}

body:not(.dark-mode) .castory-subscribe-btn--login {
    color: #059669;
    border-color: #059669;
}

body:not(.dark-mode) .castory-subscribe-btn--login:hover {
    background: #059669;
    color: #fff;
}

/* ——— Explore: feed followed ——— */
.explore-tabs .tab-btn--following.is-active,
.explore-tabs .tab-btn--following:hover {
    background: linear-gradient(135deg, #776CFE, #A03CFF);
    border-color: #776CFE;
}

.castory-explore-controls.is-following-mode .explore-toolbar__category,
.castory-explore-controls.is-following-mode .explore-toolbar__tags,
.castory-explore-controls.is-following-mode .explore-sort-select {
    opacity: 0.45;
    pointer-events: none;
}

#explore-results.cast-grid--following {
    display: block;
}

.castory-following-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.castory-feed-episode {
    display: flex;
    gap: 16px;
    background: #1A1D29;
    border: 1px solid #2D3748;
    border-radius: 14px;
    padding: 16px;
    transition: border-color 0.2s, transform 0.2s;
}

.castory-feed-episode:hover {
    border-color: #776CFE;
    transform: translateY(-2px);
}

.castory-feed-episode__thumb {
    position: relative;
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    border-radius: 10px;
    overflow: hidden;
}

.castory-feed-episode__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.castory-feed-episode__thumb-play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(119, 108, 254, 0.92);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.castory-feed-episode:hover .castory-feed-episode__thumb-play,
.castory-feed-episode__thumb-play:focus {
    opacity: 1;
}

.castory-feed-episode__thumb-play:hover {
    transform: scale(1.06);
}

.castory-feed-episode__body {
    flex: 1;
    min-width: 0;
}

.castory-feed-episode__podcast {
    display: inline-block;
    font-size: 0.78rem;
    color: #776CFE;
    font-weight: 700;
    margin-bottom: 4px;
    text-decoration: none;
}

.castory-feed-episode__title {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.castory-feed-episode__title a {
    color: #F3F4F6;
    text-decoration: none;
}

.castory-feed-episode__badge {
    display: inline-block;
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(119, 108, 254, 0.15);
    color: #776CFE;
    margin-bottom: 8px;
}

.castory-feed-episode__excerpt {
    margin: 0 0 10px;
    color: #9CA3AF;
    font-size: 0.88rem;
    line-height: 1.5;
}

.castory-feed-episode__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.78rem;
    color: #6B7280;
    align-items: center;
}

.castory-feed-episode__play {
    color: #00EA99;
    font-weight: 700;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.castory-feed-episode__play--link {
    cursor: pointer;
}

.castory-profile-following__header {
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--castory-surface, #1A1D29);
    border: 1px solid var(--castory-border, #2D3748);
    border-radius: 12px;
}

.castory-profile-following__header h3 {
    margin: 0 0 6px;
    color: var(--castory-text, #fff);
}

.castory-profile-following__header p {
    margin: 0;
    color: var(--castory-text-muted, #9CA3AF);
    font-size: 0.9rem;
}

html[data-castory-theme="light"] .castory-profile-following__header,
body:not(.dark-mode) .castory-profile-following__header {
    background: #fff;
    border-color: #e5e7eb;
    box-shadow: 0 2px 8px rgba(15, 17, 26, 0.06);
}

html[data-castory-theme="light"] .castory-profile-following__header h3,
body:not(.dark-mode) .castory-profile-following__header h3 {
    color: #111827;
}

html[data-castory-theme="light"] .castory-profile-following__header p,
body:not(.dark-mode) .castory-profile-following__header p {
    color: #6b7280;
}

@media (max-width: 768px) {
    .castory-feed-episode {
        flex-direction: column;
    }

    .castory-feed-episode__thumb {
        width: 100%;
        height: 140px;
    }
}

/* ——— phase 3: for you, bookmark, manage stats ——— */
.explore-tabs .tab-btn--for-you.is-active,
.explore-tabs .tab-btn--for-you:hover {
    background: linear-gradient(135deg, #00EA99, #776CFE);
    border-color: #00EA99;
    color: #0F111A;
}

.explore-tabs .tab-btn--bookmarks.is-active,
.explore-tabs .tab-btn--bookmarks:hover {
    background: #F59E0B;
    border-color: #F59E0B;
    color: #0F111A;
}

.castory-for-you-intro {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0 0 16px;
    padding: 12px 16px;
    background: rgba(0, 234, 153, 0.08);
    border: 1px solid rgba(0, 234, 153, 0.25);
    border-radius: 10px;
    color: #00EA99;
    font-size: 0.88rem;
}

#explore-results.cast-grid--for-you {
    display: grid;
}

.castory-feed-episode__saved {
    color: #F59E0B;
    font-weight: 700;
}

.castory-manage-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: #1A1D29;
    border: 1px solid #2D3748;
    border-radius: 12px;
}

.castory-manage-stat {
    text-align: center;
    min-width: 90px;
}

.castory-manage-stat__value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #776CFE;
}

.castory-manage-stat--accent .castory-manage-stat__value {
    color: #00EA99;
}

.castory-manage-stat__label {
    font-size: 0.78rem;
    color: #9CA3AF;
}

.castory-btn--outline {
    background: transparent;
    border: 1px solid #776CFE;
    color: #776CFE;
    margin-right: auto;
}

.castory-btn--outline:hover {
    background: #776CFE;
    color: #fff;
}

.castbox-page .episode-details__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.castory-bookmark-btn {
    background: none;
    border: none;
    color: #9CA3AF;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.castory-bookmark-btn:hover,
.castory-bookmark-btn.is-saved {
    color: #F59E0B;
    background: rgba(245, 158, 11, 0.12);
}

.castbox-page .episode-guest {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: #9CA3AF;
}

/* Mobile episode grid — see castory-mobile-ui.css (Castbox-style 3-col) */

/* ——— Explore Hero Slider ——— */
.castory-explore-hero {
    position: relative;
    margin: 0 0 24px;
    border-radius: 18px;
    overflow: hidden;
    background: #12121a;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
    --castory-hero-title-color: #ffffff;
    --castory-hero-text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.castory-explore-hero--ready .castory-explore-hero__slide {
    animation: castory-hero-fade-in 0.5s ease;
}

@keyframes castory-hero-fade-in {
    from { opacity: 0.85; }
    to { opacity: 1; }
}

.castory-explore-hero__track {
    display: flex;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
    touch-action: pan-y pinch-zoom;
}

.castory-explore-hero__slide {
    flex: 0 0 100%;
    min-width: 100%;
}

.castory-explore-hero__link {
    display: block;
    color: #fff;
    text-decoration: none;
}

.castory-explore-hero__layout {
    display: flex;
    align-items: stretch;
    min-height: 240px;
}

.castory-explore-hero__cover {
    flex: 0 0 38%;
    max-width: 38%;
    aspect-ratio: 1 / 1;
    background: #0d0d14;
}

.castory-explore-hero__cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.castory-explore-hero__panel {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.castory-explore-hero__blur {
    position: absolute;
    inset: -20%;
    background-size: cover;
    background-position: center;
    filter: blur(32px) saturate(1.35);
    transform: scale(1.1);
}

.castory-explore-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        rgba(6, 6, 14, 0.92) 0%,
        rgba(8, 8, 18, 0.78) 42%,
        rgba(10, 10, 20, 0.55) 68%,
        rgba(12, 12, 22, 0.4) 100%
    );
}

.castory-explore-hero__overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.45) 100%);
    pointer-events: none;
}

.castory-explore-hero__content {
    position: relative;
    z-index: 2;
    padding: 32px 28px;
    max-width: 100%;
}

.castory-explore-hero__badge {
    display: inline-block;
    background: rgba(119, 108, 254, 0.35);
    border: 1px solid rgba(119, 108, 254, 0.6);
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 14px;
    color: #fff;
}

.castory-explore-hero__title {
    margin: 0 0 10px;
    font-size: clamp(1.35rem, 3vw, 2rem);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--castory-hero-title-color);
    text-shadow: var(--castory-hero-text-shadow);
}

.castory-explore-hero__host {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: var(--castory-hero-text-shadow);
}

.castory-explore-hero__excerpt {
    margin: 0 0 12px;
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.castory-explore-hero__views {
    margin: 0;
    font-size: 0.88rem;
    color: #00EA99;
    font-weight: 700;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.castory-explore-hero__dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}

.castory-explore-hero__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
}

.castory-explore-hero__dot.is-active {
    background: #776CFE;
    width: 22px;
    border-radius: 4px;
}

.castory-explore-hero__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.castory-explore-hero__nav--prev {
    right: 12px;
}

.castory-explore-hero__nav--next {
    left: 12px;
}

@media (max-width: 768px) {
    .castory-explore-hero {
        margin-bottom: 16px;
        border-radius: 14px;
    }

    .castory-explore-hero__layout {
        flex-direction: column;
        min-height: 0;
    }

    .castory-explore-hero__cover {
        flex: none;
        max-width: 100%;
        width: 100%;
        max-height: min(42vw, 168px);
        aspect-ratio: 16 / 9;
    }

    .castory-explore-hero__cover img {
        object-position: center top;
    }

    .castory-explore-hero__panel {
        min-height: 0;
    }

    .castory-explore-hero__content {
        padding: 16px 16px 40px;
    }

    .castory-explore-hero__title {
        font-size: 1.15rem;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .castory-explore-hero__excerpt {
        -webkit-line-clamp: 2;
        font-size: 0.82rem;
        margin-bottom: 8px;
    }

    .castory-explore-hero__nav {
        display: none;
    }

    .castory-explore-hero__dots {
        bottom: 10px;
    }
}

/* ——— Single podcast tabs ——— */
.castbox-page .tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
}

.castbox-page .tabs-nav .tab-btn {
    flex: 1 1 auto;
    min-width: 100px;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--castory-border, #2d3748);
    background: var(--castory-surface, #1a1d29);
    color: var(--castory-text-muted, #9ca3af);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-family: inherit;
}

.castbox-page .tabs-nav .tab-btn.active {
    background: #776cfe;
    border-color: #776cfe;
    color: #fff;
}

.castbox-page .tab-panel {
    display: none;
}

.castbox-page .tab-panel.active {
    display: block;
}

/* ——— Comments ——— */
.castory-comments-wrap .comment-respond,
.castory-comments-wrap #respond {
    margin-top: 0;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--castory-border, #2d3748);
    background: var(--castory-surface, #1a1d29);
}

.castory-comments-wrap textarea,
.castory-comments-wrap input[type="text"],
.castory-comments-wrap input[type="email"],
.castory-comments-wrap input[type="url"] {
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid var(--castory-border, #4a5568);
    background: rgba(15, 17, 26, 0.35);
    color: inherit;
    padding: 10px 12px;
}

.castory-comments-wrap .form-submit input {
    background: #776cfe;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-weight: 700;
    cursor: pointer;
    min-height: 44px;
}

.castory-comments-login {
    margin-bottom: 12px;
    color: var(--castory-text-muted, #9ca3af);
}

/* ——— Discussions ——— */
.castory-discussion-form textarea {
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid var(--castory-border, #4a5568);
    background: rgba(15, 17, 26, 0.35);
    color: inherit;
    padding: 12px;
    margin-bottom: 10px;
    min-height: 90px;
    resize: vertical;
}

.castory-discussion-form__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.castory-discussion-form__message {
    font-size: 0.85rem;
    color: #00ea99;
}

.castory-discussion-list {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
}

.castory-discussion-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--castory-border, #2d3748);
}

.castory-discussion-item__avatar img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.castory-discussion-item__action {
    font-size: 0.82rem;
    margin-bottom: 6px;
    color: var(--castory-text-muted, #9ca3af);
}

.castory-discussion-item__time {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    color: var(--castory-text-muted, #9ca3af);
}

.castory-discussion-card__ref {
    margin: 0 0 6px;
    font-size: 0.82rem;
    color: #776cfe;
}

.castory-discussion-card__text {
    margin: 0 0 8px;
}

.castory-discussion-card__link {
    font-size: 0.78rem;
    font-weight: 700;
    color: #00ea99;
    text-decoration: none;
}

.castory-episode-discuss {
    background: none;
    border: none;
    color: #776cfe;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
}

.castory-episode-discuss:hover {
    color: #00ea99;
}

/* Player error toast */
.castbox-player-error {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 72px;
    z-index: 5;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(248, 113, 113, 0.92);
    color: #0f111a;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
}

html[data-castory-theme="light"] .castbox-page .tabs-nav .tab-btn,
body:not(.dark-mode) .castbox-page .tabs-nav .tab-btn {
    background: #fff;
    border-color: #e5e7eb;
    color: #4b5563;
}

html[data-castory-theme="light"] .castory-comments-wrap .comment-respond,
body:not(.dark-mode) .castory-comments-wrap .comment-respond {
    background: #fff;
    border-color: #e5e7eb;
}

/* ——— Episode card navigation + intro media ——— */
.castbox-page .episode-card--clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.castbox-page .episode-card--clickable:focus-visible {
    outline: 2px solid #a03cff;
    outline-offset: 2px;
}

.castbox-page .castory-episode-view-link,
.castbox-page .castory-episode-discuss {
    position: relative;
    z-index: 2;
}

.castory-intro-media {
    margin-top: 1.5rem;
}

.castory-intro-media__player {
    display: block;
    width: 100%;
    max-width: 720px;
    margin-top: 0.75rem;
    border-radius: 12px;
    background: #0f111a;
}

.castory-discussions-hint {
    margin-bottom: 12px;
    color: var(--castory-text-muted, #9ca3af);
    font-size: 0.9rem;
}

.castory-tab-intro {
    margin: 0 0 14px;
    color: var(--castory-text-muted, #9ca3af);
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 62ch;
}

.castory-explore-library {
    display: none;
    gap: 8px;
    margin-bottom: 12px;
}

.castory-library-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--castory-border, rgba(119, 108, 254, 0.35));
    background: var(--castory-surface, rgba(119, 108, 254, 0.1));
    color: var(--castory-text, #f3f4f6);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.castory-library-btn:hover {
    border-color: rgba(119, 108, 254, 0.55);
    background: rgba(119, 108, 254, 0.16);
}

.castory-library-btn.is-active {
    background: linear-gradient(135deg, #776cfe, #a03cff);
    border-color: transparent;
    color: #fff;
}

html[data-castory-theme="light"] .castory-library-btn,
body:not(.dark-mode) .castory-library-btn {
    background: #fff;
    border-color: #d1d5db;
    color: #374151;
}

html[data-castory-theme="light"] .castory-library-btn:hover,
body:not(.dark-mode) .castory-library-btn:hover {
    background: #f9fafb;
    border-color: #776cfe;
    color: #4c1d95;
}

html[data-castory-theme="light"] .castory-library-btn.is-active,
body:not(.dark-mode) .castory-library-btn.is-active {
    background: linear-gradient(135deg, #776cfe, #a03cff);
    border-color: transparent;
    color: #fff;
}

@media (max-width: 768px) {
    .castory-explore-library {
        display: flex;
    }

    .explore-tabs.explore-tabs--profile .tab-btn--following,
    .explore-tabs.explore-tabs--profile .tab-btn--bookmarks {
        display: none;
    }
}

/* ——— Share buttons ——— */
.castory-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.castory-share__label {
    font-size: 0.85rem;
    color: #9ca3af;
}

.castory-share__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.castory-share__btn:hover {
    background: rgba(160, 60, 255, 0.1);
    border-color: #a03cff;
    color: #7c3aed;
}

.castory-share__count {
    font-size: 0.8rem;
    color: #9ca3af;
}

.castory-share__toast {
    font-size: 0.8rem;
    color: #10b981;
}

/* ——— Widget: top podcasts ——— */
.castory-widget-top-podcasts .castory-explore-hero {
    margin: 0;
}

.castory-widget-top-podcasts .castory-explore-hero__cover {
    flex-basis: 42%;
    max-width: 42%;
}

.castory-widget-top-podcasts .castory-explore-hero__title {
    font-size: 1.1rem;
}

.widget.castory-widget {
    overflow: hidden;
}
