/* =========================================================
   Tides of Terragos Podcast Homepage
========================================================= */

/* Hide the legacy card-site banner on the podcast homepage only. */
#HeadBanner {
    display: none !important;
}


/* =========================================================
   PAGE
========================================================= */

.podcast-page {
    width: min(1280px, 94%);
    margin: 0 auto;
    padding: 26px 0 60px;
    color: #ececec;
}

.podcast-page h1,
.podcast-page h2,
.podcast-page h3,
.podcast-page p {
    margin-top: 0;
}

.podcast-feed-error {
    margin-bottom: 18px;
    padding: 12px 16px;

    border: 1px solid #815454;
    border-radius: 10px;

    background: rgba(120, 35, 35, 0.3);
}


/* =========================================================
   PODCAST HERO
========================================================= */

.podcast-hero {
    display: grid;
    grid-template-columns: minmax(260px, 390px) 1fr;
    gap: 44px;
    align-items: center;

    padding: 38px;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;

    background:
        radial-gradient(
            circle at 15% 15%,
            rgba(84, 118, 162, 0.24),
            transparent 38%
        ),
        linear-gradient(
            135deg,
            rgba(20, 25, 34, 0.98),
            rgba(8, 10, 15, 0.98)
        );

    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}

.podcast-hero-art img,
.latest-episode-art img,
.episode-card-art img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.podcast-hero-art img {
    border-radius: 20px;
    box-shadow: 0 20px 38px rgba(0, 0, 0, 0.42);
}

.podcast-art-placeholder {
    display: grid;
    place-items: center;

    aspect-ratio: 1;
    padding: 30px;

    border-radius: 20px;
    background: #171b23;

    text-align: center;
    font-size: 28px;
    font-weight: 800;
}

.podcast-eyebrow {
    margin-bottom: 8px;

    color: #91abc8;

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.podcast-hero-copy h1 {
    margin-bottom: 6px;
    font-size: clamp(38px, 6vw, 74px);
    line-height: 0.98;
}

.podcast-author {
    margin-bottom: 18px;

    color: #b9c2cc;

    font-size: 15px;
    font-weight: 700;
}

.podcast-description {
    max-width: 760px;

    color: #c9ced5;

    font-size: 17px;
    line-height: 1.65;
}


/* =========================================================
   HERO ACTIONS / PLATFORM BUTTONS
========================================================= */

.podcast-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    margin-top: 24px;
}

.podcast-primary-button,
.podcast-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 10px 16px;

    border-radius: 999px;

    font-weight: 800;
    text-decoration: none;

    cursor: pointer;
}

.podcast-primary-button {
    border: 0;

    color: #111;
    background: #f2f4f7;
}

.podcast-secondary-button {
    border: 1px solid rgba(255, 255, 255, 0.22);

    color: #ecf1f7;
    background: rgba(255, 255, 255, 0.06);
}

.podcast-primary-button:hover,
.podcast-secondary-button:hover {
    transform: translateY(-1px);
}

.podcast-youtube {
    border-color: #ff0033;
    background: #ff0033;
    color: white;
}

.podcast-spotify {
    border-color: #1ed760;
    background: #1ed760;
    color: #111;
}

.podcast-apple {
    border-color: #872ec4;
    background: #872ec4;
    color: white;
}


/* =========================================================
   LATEST EPISODE / ARCHIVE SECTIONS
========================================================= */

.latest-episode-section,
.episode-library-section {
    margin-top: 34px;
    padding: 28px;

    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;

    background: rgba(12, 15, 20, 0.88);
}

.section-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;

    margin-bottom: 20px;
}

.section-heading-row h2 {
    margin-bottom: 0;
    font-size: clamp(26px, 4vw, 40px);
}

.latest-episode-card {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 24px;
    align-items: start;
}

.latest-episode-art img {
    border-radius: 14px;
}

.latest-episode-body p {
    color: #c4cad2;
    line-height: 1.6;
}


/* =========================================================
   EPISODE META
========================================================= */

.episode-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    color: #9fa8b3;

    font-size: 13px;
    font-weight: 700;
}

.episode-meta span:not(:last-child)::after {
    content: "•";
    margin-left: 8px;
    opacity: 0.5;
}

/* Archive cards: center the metadata row. */
.episode-card .episode-meta {
    justify-content: center;
    align-items: center;
    text-align: center;
}


/* =========================================================
   EPISODE TOOLS / SEARCH
========================================================= */

.episode-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.episode-search,
.episode-season-filter {
    min-height: 42px;
    padding: 8px 12px;

    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;

    color: #eef2f7;
    background: #171c24;
}

.episode-search {
    min-width: 240px;
}

.episode-results-count {
    min-height: 22px;
    margin-bottom: 12px;

    color: #9fa8b3;

    font-size: 13px;
}


/* =========================================================
   EPISODE GRID / CARDS
========================================================= */

.episode-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.episode-card {
    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;

    background: #121720;
}

.episode-card[hidden] {
    display: none !important;
}

.episode-card-art {
    position: relative;
    overflow: hidden;

    background: #0b0e13;
}

.episode-card-art img {
    transition: transform 180ms ease;
}

.episode-card:hover .episode-card-art img {
    transform: scale(1.025);
}

.episode-play-overlay {
    position: absolute;
    right: 14px;
    bottom: 14px;

    display: grid;
    place-items: center;

    width: 48px;
    height: 48px;

    padding-left: 4px;

    border: 0;
    border-radius: 50%;

    color: #111;
    background: rgba(244, 246, 249, 0.94);

    font-size: 18px;

    cursor: pointer;

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.episode-card-body {
    padding: 18px;
}

.episode-card-body h3 {
    margin: 8px 0 10px;

    font-size: 20px;
    line-height: 1.25;

    text-align: center;
}

.episode-title-link {
    display: block;

    color: inherit;

    text-align: center;
    text-decoration: none;
}

.episode-title-link:hover {
    text-decoration: underline;
}

.episode-card-body p {
    display: -webkit-box;
    overflow: hidden;

    color: #adb6c1;

    line-height: 1.5;

    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.episode-page-link {
    display: inline-block;

    margin: 4px 0 16px;

    color: inherit;

    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-decoration: none;
    text-transform: uppercase;

    opacity: 0.75;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}

.episode-page-link:hover {
    opacity: 1;
    transform: translateX(3px);
}


/* =========================================================
   CUSTOM AUDIO PLAYER
========================================================= */

.podcast-player {
    display: grid;

    /*
     * Desktop:
     * Play | Current | Progress | Duration | Volume icon | Volume slider
     */
    grid-template-columns:
        40px
        auto
        minmax(120px, 1fr)
        auto
        40px
        100px;

    align-items: center;

    width: 100%;
    gap: 10px;
    padding: 12px 14px;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.06),
            rgba(255, 255, 255, 0.025)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04);

    color: white;
}

.podcast-player-play,
.podcast-player-volume-button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.08);

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

.podcast-player-play:hover,
.podcast-player-volume-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.podcast-player-play:active,
.podcast-player-volume-button:active {
    transform: scale(0.96);
}

.podcast-player-icon {
    display: block;

    width: 20px;
    height: 20px;

    object-fit: contain;
    pointer-events: none;

    /* SVG files are black by default; display them white. */
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.podcast-player-time,
.podcast-player-duration {
    color: #cfd6df;

    font-size: 0.82rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;

    white-space: nowrap;
}

.podcast-player-progress,
.podcast-player-volume {
    margin: 0;

    cursor: pointer;

    accent-color: #5da9ff;
}

.podcast-player-progress {
    width: 100%;
    min-width: 0;
}

.podcast-player-volume {
    width: 100px;
    min-width: 100px;
    height: 4px;
}

.podcast-player .episode-audio {
    display: none;
}


/* =========================================================
   COMPACT ARCHIVE PLAYER
========================================================= */

.episode-card .podcast-player {
    grid-template-columns:
        36px
        auto
        minmax(60px, 1fr)
        auto
        36px
        64px;

    gap: 7px;
    padding: 9px 10px;
}

.episode-card .podcast-player-play,
.episode-card .podcast-player-volume-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
}

.episode-card .podcast-player-icon {
    width: 18px;
    height: 18px;
}

.episode-card .podcast-player-time,
.episode-card .podcast-player-duration {
    font-size: 0.72rem;
}

.episode-card .podcast-player-volume {
    width: 64px;
    min-width: 64px;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1000px) {

    .podcast-hero {
        grid-template-columns: 260px 1fr;
        gap: 26px;
        padding: 26px;
    }

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


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 720px) {

    .podcast-page {
        width: calc(100% - 20px);
        padding-top: 12px;
    }


    /* -----------------------------------------------------
       Mobile hero
    ----------------------------------------------------- */

    .podcast-hero {
        display: flex;
        flex-direction: column;

        gap: 0;
        padding: 0;

        overflow: hidden;

        border-radius: 22px;
    }

    .podcast-hero-art {
        width: 100%;
        margin: 0;
        padding: 0;

        background: #0b1018;
    }

    .podcast-hero-art img {
        width: 100%;
        max-width: none;

        aspect-ratio: 16 / 10;

        object-fit: cover;
        object-position: center;

        border-radius: 0;
        box-shadow: none;
    }

    .podcast-art-placeholder {
        width: 100%;
        aspect-ratio: 16 / 10;
        border-radius: 0;
    }

    .podcast-hero-copy {
        padding: 24px 20px 22px;

        text-align: left;

        background:
            linear-gradient(
                180deg,
                rgba(18, 24, 34, 0.98),
                rgba(9, 12, 18, 0.99)
            );
    }

    .podcast-hero-copy h1 {
        margin-bottom: 6px;

        font-size: clamp(36px, 10vw, 48px);
        line-height: 1.02;
    }

    .podcast-author {
        margin-bottom: 18px;
        font-size: 15px;
    }

    .podcast-description {
        margin-bottom: 0;

        font-size: 18px;
        line-height: 1.7;

        text-align: left;
    }

    .podcast-hero-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;

        gap: 10px;
        margin-top: 22px;
    }

    .podcast-primary-button,
    .podcast-secondary-button {
        width: 100%;
        min-height: 52px;
        padding: 12px 14px;

        border-radius: 12px;

        font-size: 16px;
        line-height: 1.2;

        text-align: center;
    }


    /* -----------------------------------------------------
       Latest episode / archive
    ----------------------------------------------------- */

    .latest-episode-section,
    .episode-library-section {
        margin-top: 20px;
        padding: 18px;
    }

    .section-heading-row {
        flex-direction: column;
        align-items: stretch;
    }

    .latest-episode-card {
        display: block;
    }

    .latest-episode-art {
        width: 100%;
        margin: 0 0 18px;
    }

    .latest-episode-art img {
        width: 100%;
        border-radius: 14px;
    }

    .latest-episode-body p {
        font-size: 17px;
        line-height: 1.65;
    }

    .episode-tools {
        display: grid;
        grid-template-columns: 1fr;

        width: 100%;
    }

    .episode-search,
    .episode-season-filter {
        width: 100%;
        min-height: 50px;

        font-size: 16px;
    }

    .episode-grid {
        grid-template-columns: 1fr;
    }

    .episode-card-body {
        padding: 20px;
    }

    .episode-card-body h3 {
        font-size: 23px;
    }

    .episode-card-body p {
        font-size: 16px;
        line-height: 1.6;

        -webkit-line-clamp: 5;
    }


    /* -----------------------------------------------------
       Mobile audio player
       Volume stays available, but moves to row two.
    ----------------------------------------------------- */

    .podcast-player,
    .episode-card .podcast-player {
        grid-template-columns:
            40px
            auto
            minmax(0, 1fr)
            auto;

        grid-template-areas:
            "play current progress duration"
            "volume volumeSlider volumeSlider volumeSlider";

        gap: 8px 10px;
        padding: 10px;
    }

    .podcast-player-play {
        grid-area: play;
    }

    .podcast-player-time {
        grid-area: current;
    }

    .podcast-player-progress {
        grid-area: progress;
    }

    .podcast-player-duration {
        grid-area: duration;
    }

    .podcast-player-volume-button {
        grid-area: volume;
    }

    .podcast-player-volume {
        grid-area: volumeSlider;

        width: 100%;
        min-width: 0;
    }

    .episode-card .podcast-player-play,
    .episode-card .podcast-player-volume-button {
        width: 40px;
        min-width: 40px;
        height: 40px;
    }

    .episode-card .podcast-player-icon {
        width: 18px;
        height: 18px;
    }

    .episode-card .podcast-player-time,
    .episode-card .podcast-player-duration {
        font-size: 0.72rem;
    }
}
