/* ===== CORE LAYOUT & BANNER STYLES ===== */
button {
    background-color: var(--primary-color);
    color: rgb(255, 255, 255);
    border: 1px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    text-transform: uppercase;
    font-family: var(--font-family);
    font-weight: 500;
    transition: all 0.3s ease;

}

button:hover {
    background-color: white;
    color: var(--primary-color);
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid var(--primary-color);
}

/* Button utility classes */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    text-transform: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: white;
    color: var(--primary-color);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.btn-secondary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

body {
    margin: 0;
}

.banner-content {
    margin-top: 0;
    width: 100%;
    margin-bottom: 2em;
    text-align: left;
    position: relative;
    min-height: 375px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

.banner-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.banner-content-inner {
    position: relative;
    z-index: 2;
}

.banner-content h1,
.banner-content h4,
.banner-content p {
    color: white;
}

.banner-content h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 0.5em;
}

.banner-content h4 {
    font-size: 1.2em;
    font-weight: 400;
    margin-bottom: 1em;
    opacity: 0.9;
}

.banner-content .subtext {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 2em;
    opacity: 0.95;
}

.column-2 {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: stretch;
    gap: 2em;
    margin: 0 auto;
    width: 100%;
}

.column-fill {
    width: 100%;
    max-width: 700px;
    padding-right: 2em;
    padding-left: 2em;
    align-self: stretch;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
}

.column-fill button {
    width: fit-content;
    padding: 1em 2em;
}

.image-wrapper {
    width: 225px;
    height: 225px;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
}

/* ===== DESCRIPTION CONTENT ===== */
.description-content {
    background-color: var(--background-color);
    margin-bottom: 2em;
    border-radius: 8px;
    padding: 0.5em 0;

}

.description-content p {
    color: var(--secondary-color);
    font-size: 16px;
    font-weight: 300;
    line-height: 1.6;
    margin: 1.2em;
}

.episode-date {
    color: var(--secondary-color);
    font-size: 14px;
    margin-bottom: 0.5em;
}

.episode-guest {
    color: var(--primary-color);
    font-weight: 300;
    font-style: italic;
    margin-bottom: 1em;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Desktop: apply elegant truncation to keep cards tidy */
@media (min-width: 769px) {
    .latest-episode-card h3,
    .latest-episode-card h3 a {
        display: -webkit-box;
        line-clamp: 2;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .episode-guest {
        display: -webkit-box;
        line-clamp: 1;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Desktop truncation for broadcast cards */
    .broadcast-item h4,
    .broadcast-item h4 a {
        display: -webkit-box;
        line-clamp: 2;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .guest-subheading {
        display: -webkit-box;
        line-clamp: 1;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.latest-episode-card p {
    margin-bottom: 1.5em;
}

.latest-episode-card audio {
    width: 100%;
    margin-top: 1em;
}

.latest-transcript-toggle {
    background-color: #f7f7f8;
    border: 1px solid #e2e2e6;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--secondary-color);
    padding: 6px 12px;
    border-radius: 999px;
    margin: 12px 0 8px 0;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
    font-family: 'helvetica-w01-light', sans-serif;
    line-height: 1;
}

.latest-transcript-toggle:hover {
    background-color: #efeff1;
    border-color: #d7d7dc;
    color: var(--primary-color);
    transform: translateY(-1px);
}

.latest-transcript-content {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    border-radius: 12px;
    background-color: rgba(250, 250, 250, 0.95);
    margin: 8px 0 16px 0;
    border: 1px solid rgba(224, 224, 224, 0.5);
    backdrop-filter: blur(10px);
    line-height: 1.6;
    font-family: 'helvetica-w01-light', sans-serif;
    color: var(--text-alt);
}

/* ===== SEARCH & FILTER ===== */
.search-and-filter {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 2em;
    flex-wrap: wrap;
}

.sort-and-items-per-page {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sort-dropdown select {
    border: none;
    outline: none;
    background-color: #f0f0f0;
    padding: 15px 20px;
    border-radius: 5px;
    font-family: 'helvetica-w01-light', sans-serif;
    font-size: 14px;
    color: var(--secondary-color);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(96,94,94)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 45px;
    min-width: 110px;
}

.search-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 450px;
  border-radius: 5px;
  margin-left:7px; /* final fine-tune for perfect alignment */
}




.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    background-color: transparent;
    color: var(--secondary-color);
    font-family: 'helvetica-w01-light', sans-serif;
    font-size: 14px;
}

.search-bar input::placeholder {
    color: var(--secondary-color);
    font-weight: 300;
}

.search-bar i {
    color: var(--secondary-color);
    margin-left: 8px;
    font-size: 14px;
}

/* Search highlighting */
.search-highlight {
    background-color: #ffeb3b;
    color: #333;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ===== PAGINATION CONTROLS ===== */
.items-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    margin-right: 5px; /* increased for perfect right-edge alignment */
}


.items-per-page label {
    font-weight: 500;
    color: var(--secondary-color);
    font-family: 'helvetica-w01-light', sans-serif;
    font-size: 14px;
}

.items-per-page select {
    border: none;
    outline: none;
    background-color: #f0f0f0;
    padding: 15px 20px;
    border-radius: 5px;
    font-family: 'helvetica-w01-light', sans-serif;
    font-size: 14px;
    color: var(--secondary-color);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(96,94,94)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 45px;
    min-width: 80px;
    box-sizing: border-box;
}


.pagination-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid #e8e8e8;
    gap: 20px;
}

.pagination-info {
    color: var(--secondary-color);
    font-size: 14px;
    font-family: 'helvetica-w01-light', sans-serif;
    font-weight: 300;
    text-align: center;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-page {
    padding: 8px 12px;
    border: 1px solid #e8e8e8;
    background: white;
    color: var(--secondary-color);
    border-radius: 25px;
    cursor: pointer;
    min-width: 40px;
    transition: all 0.3s ease;
    font-family: 'helvetica-w01-light', sans-serif;
    font-size: 14px;
    font-weight: 400;
}

.btn-page:hover:not(.active) {
    background: #f0f0f0;
    border-color: #d0d0d0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
}

.btn-page.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 56, 184, 0.25);
}

.btn-page:disabled {
    opacity: 1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background: white;
    color: #999;
    border-color: #d0d0d0;
}   

.btn-secondary:disabled {
    opacity: 1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background: white;
    color: #999;
    border-color: #d0d0d0;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .search-and-filter {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        gap: 15px;

        margin: 0 auto;
        margin-bottom: 1em;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .sort-dropdown select,
    .items-per-page select {
        width: 100%;
    }
}

/* ===== BROADCAST LIST & EPISODES ===== */
.broadcast-list-title {
    font-weight: 600;
    margin-bottom: 24px;
    margin-top: 24px;
    font-size: 1.5em;
}

.broadcast-item-container {
    border: 1px solid #e8e8e8;
    border-radius: 16px;    
    transition: all 0.3s ease;
    margin-bottom: 24px;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

/* Add inner padding to episodes scroll container so card edges aren't clipped */
#episodes-container {
    box-sizing: border-box;
    padding: 8px 6px;
}

@media (max-width: 768px) {
    #episodes-container {
        padding: 0px;
    }
}

.broadcast-item-container:hover {
    cursor: pointer;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #d0d0d0;
}

.broadcast-item-container.active {
    border: 0.75px solid var(--primary-color);
    box-shadow: 0 8px 25px rgba(0, 56, 184, 0.25);
    transform: translateY(-2px);
}

.broadcast-item {
    padding: 24px 28px;
    flex: 1;
    min-height: 180px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.broadcast-item::after {
    content: '';
    display: block;
    height: 0;
    opacity: 0;
    transition: height 0.3s ease-out, opacity 0.3s ease-out;
}

/* Ensure long titles and guest names wrap within the card */
.broadcast-item h4 {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;

}

.broadcast-item h4 a {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.broadcast-item h4, .broadcast-item h5{
    position: relative;
    width: fit-content;
    padding-right: 5%;
}

.broadcast-item h4::before, .broadcast-item h5::before {
    content: "";
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--color-yellow-logo) 10%, 
        var(--color-yellow-logo) 90%, 
        transparent 100%);
    width: 0;
    height: 5px;
    position: absolute;
    z-index: -1;
    left: -1em;
    bottom: 0;
    transition: width 0.5s ease;
    opacity: 0.8;
    transform: rotate(1deg);
}

.broadcast-item:hover h4::before, .broadcast-item:hover h5::before {
    width: 80%;
}



.guest-subheading {
    color: var(--text-alt);
    font-family: var(--font-family);
    font-weight: 300;
    font-size: 14px;
    margin-top: 4px;
    opacity: 0.9;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}



/* ===== EXPAND BUTTON & HIDDEN CONTENT ===== */
.broadcast-expand-button {
    cursor: pointer;
    transition: all 0.3s ease;
    color: #888;
    flex-shrink: 0;
    width: 60px;
    background: rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #f0f0f0;
    position: relative;
}
/* 
.broadcast-expand-button.expanded {
    background: rgba(255, 255, 255, 0.2);
    border-left-color: transparent;
} */

.expand-arrow {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.broadcast-expand-button.expanded .expand-arrow {
    transform: rotate(180deg);
}

.broadcast-item-container:hover .expand-arrow {
    opacity: 1;
}



.broadcast-hidden-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out, padding 0.4s ease-out;
}

.broadcast-hidden-content.active {
    max-height: 3000px; /* allow taller content on mobile */
    opacity: 1;
}

/* ===== AUDIO PLAYER ===== */
audio {
    width: 100%;
    max-width: 100%;
    margin: 16px 0;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
}

.broadcast-item-container.active audio {
    background: rgba(255, 255, 255, 0.1);
}

.transcript-toggle {
    background-color: transparent !important;
    border: 1px solid #e2e2e6;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--secondary-color);
    padding: 6px 12px;
    border-radius: 999px;
    margin: 12px 0 8px 0;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.transcript-toggle:hover {
    background-color: #efeff1;
    border-color: #d7d7dc;
    color: var(--primary-color);
    transform: translateY(-1px);
}

.broadcast-item-container.active .transcript-toggle {
    background-color: #f7f7f8;
    border: 1px solid #e2e2e6;
    color: var(--secondary-color);
}

.broadcast-item-container.active .transcript-toggle:hover {
    background-color: #efeff1;
}

.transcript-content {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    border-radius: 12px;
    background-color: rgba(250, 250, 250, 0.95);
    margin: 8px 0 16px 0;
    border: 1px solid rgba(224, 224, 224, 0.5);
    backdrop-filter: blur(10px);
    line-height: 1.6;
    font-family: 'helvetica-w01-light', sans-serif;
    color: var(--text-alt);
}

.broadcast-item-container.active .transcript-content {
    background-color: rgba(255, 255, 255, 0.15);
    border: 0.75px solid grey;
    color: var(--secondary-color);
}

/* ===== UTILITY STYLES ===== */
hr {
    border: 0.5px solid var(--text-alt);
    margin: 0 auto;
    width: 60%;
}

.column-30 {
    width: 30%;
}

/* ===== ADDITIONAL MOBILE ENHANCEMENTS ===== */
@media (max-width: 768px) {
    /* Nudge yellow title accent a bit to the right on mobile */
    .broadcast-item h4::before,
    .broadcast-item h5::before {
        left: 0px;
    }
    .banner-content {
        width: 100%;
        padding: 0;
        margin: 0 auto;
        margin-bottom: 1em;
    }
    .banner-content-inner {
        padding: 1em 0;
    }

    .content {
        width: 80%;
        margin: 0 auto;
        padding: 1em;
    }

    .content-mobile {
        width: 80%;
        margin: 0 auto;
        padding: 1em;
    }

    .column-2 {
        flex-direction: column;
        gap: 2em;
        align-items: center;
        max-width: 100%;
        margin: 0 auto;
    }

    .column-fill {
        padding: 1.25em 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        max-width: 100%;
    }

    .image-wrapper {
        display: flex;
        justify-content: center;
        width: 250px;
        height: 250px;
    }

    .image-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    /* Broadcast list layout stacks vertically */
    .broadcast-item-container {
        flex-direction: column;
    }

    .broadcast-item {
        padding: 20px;
        min-height: 180px;
    }

    /* Expand button becomes full-width footer on card */
    .broadcast-expand-button {
        width: 100%;
        height: 44px;
        border-left: none;
        border-top: 1px solid #f0f0f0;
    }

    .expand-arrow {
        width: 20px;
        height: 20px;
    }

    .latest-episode-card {
        padding: 1.25em;
    }

    .banner-content h1 {
        font-size: 2em;
    }

    .banner-content h4 {
        font-size: 1.1em;
    }

    .banner-content .subtext {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    button {
        width: 100%;
        padding: 10px 14px;
    }

    .latest-episode h2 {
        font-size: 1.4em;
    }

    .latest-episode-card h3 {
        font-size: 1.2em;
    }

    .pagination-controls {
        gap: 10px;
        padding: 12px 0;
    }


}

/* ===== Ensure desktop truncation takes precedence ===== */
@media (min-width: 769px) {
    .broadcast-item h4,
    .broadcast-item h4 a {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
        
    }

    .guest-subheading {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

/* ===== CAP (Custom Audio Player) Global Styles ===== */
/* Show audio player when content is expanded */
.broadcast-hidden-content.active .inline-audio-card audio.cap-audio { display: block !important; }
.broadcast-hidden-content.active .inline-audio-card .cap-player { display: none !important; }

/* Mobile: use CAP player instead of native when expanded */
@media (max-width: 768px) {
  .broadcast-hidden-content.active .inline-audio-card audio.cap-audio { display: none !important; }
  .broadcast-hidden-content.active .inline-audio-card .cap-player { display: grid !important; }
}

.cap-player {
  height: 60px;
  width: 100%;
  max-width: 960px; /* wider on desktop */
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  font-family: var(--font-family);
  color: var(--text-alt);
  font-size: 12px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 6px auto;
  border-radius: 8px;
}

#episodes p {
  margin-left: 7px; /* match .search-bar’s margin */
  text-align: left;
}

.cap-timeline { background: #fff; width: 100%; position: relative; cursor: pointer; box-shadow: 0 2px 10px 0 #00000014; }
.cap-progress { background: var(--primary-color); width: 0%; height: 100%; transition: 0.25s; }
.cap-controls { display: flex; justify-content: space-between; align-items: stretch; padding: 0 16px; }
.cap-controls > * { display: flex; justify-content: center; align-items: center; }
.cap-toggle-play.cap-play { cursor: pointer; position: relative; left: 0; height: 0; width: 0; border: 7px solid transparent; border-left: 13px solid #111; }
.cap-toggle-play.cap-play:hover { transform: scale(1.05); }
.cap-toggle-play.cap-pause { height: 15px; width: 20px; cursor: pointer; position: relative; }
.cap-toggle-play.cap-pause:before, .cap-toggle-play.cap-pause:after { position: absolute; top: 0; content: ""; height: 15px; width: 3px; background: #111; }
.cap-toggle-play.cap-pause:before { left: 0; }
.cap-toggle-play.cap-pause:after { right: 8px; }
.cap-time { display: flex; gap: 4px; align-items: center; }
.cap-name { display: block; font-weight: 500; color: var(--text-alt); }
.cap-volume-container { position: relative; cursor: pointer; }
.cap-volume-button { height: 26px; display: flex; align-items: center; }
.cap-volume { transform: scale(0.7); width: 14px; height: 14px; position: relative; }
.cap-volume-slider { position: absolute; left: -3px; top: 15px; z-index: 1; width: 0; height: 15px; background: #111; box-shadow: 0 0 20px #0000001a; transition: .25s; }
.cap-volume-percentage { background: var(--primary-color); height: 100%; width: 75%; }
.cap-volume-container:hover .cap-volume-slider { left: -123px; width: 120px; }