/**
 * Framed Minds — Stillness  v3.0.0
 * Consolidated CSS for the Stillness plugin.
 *
 * Sections:
 *   A) Shared Foundation
 *   B) Landing Page (shortcode within BuddyBoss layout)
 *   C) Taxonomy Archive
 *   D) Session Cards (archive)
 *   E) Popup Player Modal
 *   F) Pagination
 *   G) BuddyBoss Layout Adjustments
 *   H) Responsive
 */


/* ==========================================================
   A) SHARED FOUNDATION
   ========================================================== */

.fm-stillness {
    position: relative;
    overflow: hidden;
}

.fm-stillness__bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #E9E2D0 0%, #F4F1E8 35%, #FFFFFF 100%);
    opacity: 0.75;
    pointer-events: none;
}

.fm-stillness__empty {
    text-align: center;
    padding: 48px 20px;
    color: #7a8793;
    font-size: 15px;
    line-height: 1.6;
}


/* ==========================================================
   B) LANDING PAGE (shortcode output)
   ========================================================== */

.fm-stillness--landing {
    /* Extend the background to the edges of the content area */
    margin: -1.5em -1px 0 -1px;
    padding: 0 1px;
}

.fm-stillness--landing .fm-stillness__container {
    position: relative;
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 36px 20px 60px;
}

.fm-stillness--landing .fm-stillness__hero {
    text-align: center;
    margin-bottom: 26px;
}

.fm-stillness--landing .fm-stillness__title {
    margin: 0;
    font-size: clamp(44px, 6vw, 86px);
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: #0b0b0b;
    font-weight: 800;
}

.fm-stillness--landing .fm-stillness__subtitle {
    margin: 12px auto 0;
    max-width: 720px;
    font-size: 15px;
    line-height: 1.65;
    color: #3f4a54;
}

.fm-stillness--landing .fm-stillness__description {
    margin: 6px auto 0;
    max-width: 720px;
    font-size: 15px;
    line-height: 1.65;
    color: #3f4a54;
}

/* Category list */
.fm-stillness--landing .fm-stillness__list {
    display: grid;
    gap: 14px;
    margin: 26px auto 0;
    max-width: 920px;
    width: 100%;
}

/* Category cards */
.fm-stillness--landing .fm-stillness__card {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    text-decoration: none;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid #e7eaed;
    background: rgba(255,255,255,0.72);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
    backdrop-filter: blur(6px);
}

.fm-stillness--landing .fm-stillness__card:hover {
    transform: translateY(-1px);
    border-color: rgba(150, 202, 66, 0.35);
    box-shadow: 0 14px 32px rgba(14, 26, 39, 0.08);
}

.fm-stillness--landing .fm-stillness__card:focus {
    outline: 2px solid rgba(150, 202, 66, 0.45);
    outline-offset: 2px;
}

.fm-stillness--landing .fm-stillness__card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.fm-stillness--landing .fm-stillness__icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    flex-shrink: 0;
}

.fm-stillness--landing .fm-stillness__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fm-stillness--landing .fm-stillness__label {
    font-weight: 700;
    color: #111;
    font-size: 14px;
}

.fm-stillness--landing .fm-stillness__hint {
    font-size: 12px;
    color: #7a8793;
}

.fm-stillness--landing .fm-stillness__chev {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #e7eaed;
    background: rgba(244,241,232,0.65);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(21,21,21,0.65);
    flex-shrink: 0;
}


/* ==========================================================
   C) TAXONOMY ARCHIVE LAYOUT
   ========================================================== */

.fm-stillness--archive .fm-stillness__container--wide {
    position: relative;
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 56px 20px 72px;
}

.fm-stillness--archive .fm-stillness__hero--archive {
    text-align: center;
    margin-bottom: 28px;
}

.fm-stillness--archive .fm-stillness__kicker {
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #A0A7B0;
    margin-bottom: 10px;
}

.fm-stillness--archive .fm-stillness__title {
    margin: 0;
    font-size: clamp(32px, 4vw, 46px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #151515;
}

.fm-stillness--archive .fm-stillness__subtitle {
    margin: 14px auto 0;
    max-width: 760px;
    font-size: 15px;
    line-height: 1.65;
    color: #4A5560;
}

/* Session grid */
.fm-stillness--archive .fm-stillness__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 26px;
}


/* ==========================================================
   D) SESSION CARDS (archive)
   ========================================================== */

.fm-stillness--archive .fm-stillness__card {
    border: 1px solid #E7EAED;
    background: rgba(255,255,255,0.75);
    border-radius: 18px;
    padding: 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 168px;
    transition: transform 160ms ease, box-shadow 160ms ease,
                border-color 160ms ease, background 160ms ease;
    backdrop-filter: blur(6px);
}

.fm-stillness--archive .fm-stillness__card:hover {
    transform: translateY(-1px);
    border-color: rgba(150, 202, 66, 0.28);
    box-shadow: 0 10px 24px rgba(14, 26, 39, 0.06);
    background: rgba(255,255,255,0.85);
}

.fm-stillness--archive .fm-stillness__card:focus {
    outline: 2px solid rgba(150, 202, 66, 0.35);
    outline-offset: 3px;
}

.fm-stillness--archive .fm-stillness__card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.fm-stillness--archive .fm-stillness__tag {
    font-size: 12px;
    color: #4A5560;
    background: rgba(244,241,232,0.7);
    border: 1px solid #E7EAED;
    padding: 6px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.fm-stillness--archive .fm-stillness__meta-pill {
    font-size: 12px;
    color: #A0A7B0;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #E7EAED;
    background: rgba(255,255,255,0.55);
}

.fm-stillness--archive .fm-stillness__card-body {
    flex: 1;
}

.fm-stillness--archive .fm-stillness__card-title {
    margin: 0 0 6px 0;
    font-size: 16px;
    line-height: 1.25;
    color: #151515;
    letter-spacing: -0.01em;
}

.fm-stillness--archive .fm-stillness__card-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #4A5560;
}

.fm-stillness--archive .fm-stillness__card-action {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.fm-stillness--archive .fm-stillness__play {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(244,241,232,0.65);
    border: 1px solid #E7EAED;
    color: #151515;
    transition: background 160ms ease, border-color 160ms ease;
}

.fm-stillness--archive .fm-stillness__card:hover .fm-stillness__play {
    background: rgba(150, 202, 66, 0.12);
    border-color: rgba(150, 202, 66, 0.3);
}


/* ==========================================================
   E) POPUP PLAYER MODAL
   ========================================================== */

/* Overlay container */
#fmStillnessPopup.fm-player {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
}

#fmStillnessPopup.fm-player.is-open {
    display: flex !important;
}

/* Backdrop */
#fmStillnessPopup .fm-player__overlay {
    position: absolute !important;
    inset: 0 !important;
    background: rgba(14, 26, 39, 0.42) !important;
    backdrop-filter: blur(10px) !important;
}

/* Panel */
#fmStillnessPopup .fm-player__panel {
    position: relative !important;
    width: min(920px, calc(100% - 24px)) !important;
    max-height: calc(100dvh - 24px) !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;

    border-radius: 26px !important;
    border: 1px solid rgba(231,234,237,0.95) !important;
    background: rgba(255,255,255,0.94) !important;
    box-shadow: 0 34px 90px rgba(14,26,39,0.22) !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 18px !important;
}

@supports not (height: 100dvh) {
    #fmStillnessPopup .fm-player__panel {
        max-height: calc(100vh - 24px) !important;
    }
}

/* Close button */
#fmStillnessPopup .fm-player__close {
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    width: 46px !important;
    height: 46px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(231,234,237,1) !important;
    background: rgba(244,241,232,0.92) !important;
    color: #151515 !important;
    font-size: 26px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 6px 18px rgba(14,26,39,0.10) !important;
    z-index: 2;
}

#fmStillnessPopup .fm-player__close:focus {
    outline: 2px solid rgba(150, 202, 66, 0.45) !important;
    outline-offset: 3px !important;
}

/* Top / header area */
#fmStillnessPopup .fm-player__top {
    text-align: center !important;
    padding: 10px 10px 12px !important;
    flex: 0 0 auto !important;
}

#fmStillnessPopup .fm-player__taxonomy {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    color: #4A5560 !important;
    border: 1px solid #E7EAED !important;
    background: rgba(244,241,232,0.65) !important;
    border-radius: 999px !important;
    padding: 6px 12px !important;
    margin-bottom: 10px !important;
}

#fmStillnessPopup .fm-player__title {
    margin: 0 !important;
    color: #151515 !important;
    font-size: clamp(18px, 2.2vw, 28px) !important;
    letter-spacing: -0.02em !important;
    line-height: 1.15 !important;
}

#fmStillnessPopup .fm-player__excerpt {
    margin: 12px auto 0 !important;
    max-width: 680px !important;
    color: #4A5560 !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

/* Metadata block */
#fmStillnessPopup .fm-player__meta {
    margin-top: 10px;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

#fmStillnessPopup .fm-player__meta-row {
    margin: 6px 0 0;
    color: #4A5560;
    font-size: 13px;
    line-height: 1.6;
}

#fmStillnessPopup .fm-player__meta-row strong {
    color: #151515;
    font-weight: 600;
}

/* ── Media frame (base) ── */
#fmStillnessPopup .fm-player__media {
    position: relative !important;
    width: 100% !important;
    border-radius: 22px !important;
    border: 1px solid #E7EAED !important;
    overflow: hidden !important;
    margin: 12px 0 !important;
    flex: 0 0 auto !important;
}

/* ── VIDEO MODE ── */
#fmStillnessPopup.is-video .fm-player__media {
    background: #000 !important;
    padding: 0 !important;
    aspect-ratio: 16 / 9;
    max-height: 60dvh !important;
}

@supports not (aspect-ratio: 16 / 9) {
    #fmStillnessPopup.is-video .fm-player__media {
        height: min(65vh, 520px) !important;
        min-height: 320px !important;
    }
}

#fmStillnessPopup.is-video .fm-player__media video {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: contain !important;
    background: #000 !important;
    max-height: none !important;
}

/* ── AUDIO MODE ── */
#fmStillnessPopup.is-audio .fm-player__media {
    aspect-ratio: auto !important;
    height: auto !important;
    max-height: none !important;
    background: rgba(244,241,232,0.35) !important;
    padding: 12px !important;
    overflow: visible !important;
}

#fmStillnessPopup .fm-player__media img.player-bg {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    max-height: 45vh !important;
    object-fit: cover !important;
    border-radius: 18px !important;
    border: 1px solid rgba(231,234,237,0.95) !important;
    margin-bottom: 12px !important;
}

#fmStillnessPopup.is-audio .fm-player__media audio {
    display: block !important;
    width: 100% !important;
    height: 54px !important;
    min-height: 54px !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Ensure native controls render */
#fmStillnessPopup video::-webkit-media-controls,
#fmStillnessPopup audio::-webkit-media-controls {
    display: flex !important;
    opacity: 1 !important;
}


/* ==========================================================
   F) PAGINATION
   ========================================================== */

.fm-stillness__pagination {
    margin: 40px 0 20px;
    text-align: center;
}

.fm-stillness__pagination .page-numbers {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 6px;
}

.fm-stillness__pagination .page-numbers li {
    list-style: none;
}

.fm-stillness__pagination .page-numbers a,
.fm-stillness__pagination .page-numbers span {
    display: inline-block;
    padding: 8px 14px;
    text-decoration: none;
    border: 1px solid #E7EAED;
    border-radius: 999px;
    color: #4A5560;
    background: rgba(255,255,255,0.75);
    font-size: 13px;
    transition: all 160ms ease;
}

.fm-stillness__pagination .page-numbers a:hover {
    background: rgba(255,255,255,0.92);
    border-color: rgba(150, 202, 66, 0.3);
}

.fm-stillness__pagination .page-numbers .current {
    background: #151515;
    color: #fff;
    border-color: #151515;
}

.fm-stillness__pagination .page-numbers .prev,
.fm-stillness__pagination .page-numbers .next {
    font-weight: 600;
}

.fm-stillness__pagination .page-numbers .dots {
    border: none;
    background: none;
    color: #A0A7B0;
}


/* ==========================================================
   G) BUDDYBOSS LAYOUT ADJUSTMENTS
   On taxonomy archives, allow content to use full grid width.
   The landing page is handled by BuddyBoss "Full Width Content"
   template — no overrides needed there.
   ========================================================== */

body.tax-meditation_type .bb-grid.site-content-grid,
body.tax-meditation_type .site-content .bb-grid.site-content-grid,
body.tax-meditation_type .site-content .container,
body.tax-meditation_type .site-content .container-fluid,
body.tax-meditation_type .site-content .wrap,
body.tax-meditation_type #page .site-content,
body.tax-meditation_type #content.site-content {
    max-width: none !important;
    width: 100% !important;
}

body.tax-meditation_type .bb-grid.site-content-grid > .bb-grid-cell,
body.tax-meditation_type .bb-grid.site-content-grid > .bb-grid-cell-primary,
body.tax-meditation_type .bb-grid.site-content-grid .bb-grid-cell {
    max-width: none !important;
    width: 100% !important;
}

body.tax-meditation_type .site-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Hide BuddyBoss sidebar on taxonomy archives */
body.tax-meditation_type .site-content .bb-grid-cell-secondary {
    display: none !important;
}


/* ==========================================================
   H) RESPONSIVE
   ========================================================== */

/* Archive grid breakpoints */
@media (max-width: 1100px) {
    .fm-stillness--archive .fm-stillness__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .fm-stillness--archive .fm-stillness__grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile popup */
@media (max-width: 640px) {
    #fmStillnessPopup .fm-player__panel {
        width: calc(100% - 18px) !important;
        padding: 16px !important;
        border-radius: 28px !important;
    }

    #fmStillnessPopup .fm-player__media {
        border-radius: 18px !important;
    }

    #fmStillnessPopup.is-video .fm-player__media {
        max-height: 52vh !important;
    }

    #fmStillnessPopup .fm-player__close {
        width: 40px !important;
        height: 40px !important;
        top: 12px !important;
        right: 12px !important;
        font-size: 22px !important;
    }

    .fm-stillness__pagination .page-numbers a,
    .fm-stillness__pagination .page-numbers span {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Landing page mobile */
@media (max-width: 480px) {
    .fm-stillness--landing .fm-stillness__container {
        padding: 24px 14px 40px;
    }

    .fm-stillness--landing .fm-stillness__title {
        font-size: clamp(36px, 10vw, 56px);
    }

    .fm-stillness--landing .fm-stillness__card {
        padding: 12px;
        border-radius: 14px;
    }
}
