/* =====================================================================
   Custom Membership — meditation theme
   Palette:  cream #f2eee1 · sage #5a7247 · deep green #2f4423
   ===================================================================== */
:root {
    --cm-cream:      #f2eee1;
    --cm-cream-soft: #f7f4ea;
    --cm-green:      #5a7247;
    --cm-green-dark: #445734;
    --cm-green-deep: #2f4423;
    --cm-ink:        #1f2419;
    --cm-muted:      #6b7263;
    --cm-line:       #e4dfd0;
    --cm-white:      #ffffff;
    --cm-radius:     16px;
    --cm-shadow:     0 10px 30px rgba(47, 68, 35, 0.10);
    --cm-shadow-sm:  0 2px 8px rgba(47, 68, 35, 0.08);
}

/* =========================  MEDITATION LIBRARY  ====================== */
.cm-med {
    background: var(--cm-cream);
    border-radius: 24px;
    padding: 28px 22px 40px;
    margin-top: 28px;
    margin-bottom: 28px;
    /* Force a true, centered 1220px band even when the theme's content
       column is narrower. left:50% + translateX(-50%) with vw units
       centers the section on the viewport, not the (narrow) parent. */
    position: relative;
    left: 50%;
    right: 50%;
    width: min(1220px, 100vw - 32px) !important;
    max-width: min(1220px, 100vw - 32px) !important;
    margin-left: calc(-1 * min(1220px, 100vw - 32px) / 2) !important;
    margin-right: calc(-1 * min(1220px, 100vw - 32px) / 2) !important;
    box-sizing: border-box;
    font-family: inherit;
}
/* Neutralise theme styling that leaks into buttons/links inside the widget
   (some themes add coloured borders, gradients or hover tints). */
.cm-med *:focus { outline: none; }
.cm-med button { font-family: inherit; }
.cm-med-intro {
    text-align: center;
    max-width: 720px;
    margin: 4px auto 26px;
    color: var(--cm-ink);
    font-size: 20px;
    line-height: 1.5;
    font-weight: 500;
}
.cm-med-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    justify-content: center;
    align-items: stretch;
    margin-bottom: 32px;
    width: 100%;
}
/* Hard reset so the active WordPress theme cannot inject its own button
   colours, borders, outlines or focus rings (that was the pink/blue edge). */
.cm-med-tab,
.cm-med-tab:link,
.cm-med-tab:visited {
    -webkit-appearance: none !important;
    appearance: none !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: var(--cm-shadow-sm) !important;
    text-shadow: none !important;
    cursor: pointer;
    background: var(--cm-white) !important;
    background-image: none !important;
    color: var(--cm-green) !important;
    font-size: clamp(13px, 1.15vw, 17px) !important;
    font-weight: 600 !important;
    padding: 18px 20px !important;
    border-radius: 12px !important;
    -webkit-border-radius: 12px !important;
    transition: background .18s ease, color .18s ease, transform .18s ease;
    line-height: 1.25;
    letter-spacing: 0;
    text-transform: none;
    width: auto;
    margin: 0;
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cm-med-tab:hover,
.cm-med-tab:focus {
    transform: translateY(-1px);
    outline: 0 !important;
    box-shadow: var(--cm-shadow-sm) !important;
    color: var(--cm-green) !important;
    background: var(--cm-white) !important;
}
.cm-med-tab.is-active,
.cm-med-tab.is-active:hover,
.cm-med-tab.is-active:focus {
    background: var(--cm-green) !important;
    color: var(--cm-white) !important;
    box-shadow: 0 6px 16px rgba(90, 114, 71, 0.35) !important;
    border-radius: 12px !important;
}
/* kill any active-state focus ring the theme adds on click */
.cm-med-tab:focus-visible { outline: 0 !important; }

/* On phones, let the row scroll sideways instead of squashing text. */
@media (max-width: 680px) {
    .cm-med-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        scrollbar-width: thin;
    }
    .cm-med-tab {
        flex: 0 0 auto !important;
        font-size: 14px !important;
        padding: 14px 18px !important;
    }
}
.cm-med-panel { display: none; }
.cm-med-panel.is-active { display: block; animation: cmFade .3s ease; }
@keyframes cmFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cm-med-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    max-width: 1160px;
    margin: 0 auto;
}
@media (max-width: 900px) { .cm-med-grid { grid-template-columns: 1fr; max-width: 420px; } }
.cm-med-card {
    background: var(--cm-white) !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: var(--cm-radius);
    padding: 26px 24px 28px;
    box-shadow: var(--cm-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.cm-med-card-title {
    font-size: 30px;
    font-weight: 500;
    color: var(--cm-ink);
    margin: 0 0 14px;
    font-family: Georgia, 'Times New Roman', serif;
    letter-spacing: .3px;
    background: none;
}
.cm-med-lotus-wrap { width: 230px; max-width: 82%; margin: 10px auto 24px; }
.cm-lotus { width: 100%; height: auto; display: block; }
.cm-med-img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 220px;
    object-fit: contain;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0;
    background: none;
}
.cm-med-player { width: 100%; margin-top: auto; }
.cm-med-player audio {
    width: 100%;
    height: 42px;
    outline: none;
    border-radius: 22px;
}
.cm-med-player audio::-webkit-media-controls-volume-control-container,
.cm-med-player audio::-webkit-media-controls-mute-button { display: none !important; }
.cm-med-player-locked {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #efefef;
    border-radius: 22px;
    padding: 9px 16px;
    cursor: pointer;
    position: relative;
    transition: background .15s ease;
    user-select: none;
}
.cm-med-player-locked:hover { background: #e7e7e7; }
.cm-med-fakebtn { color: #333; font-size: 12px; }
.cm-med-faketime { color: #6b6b6b; font-size: 13px; white-space: nowrap; }
.cm-med-fakebar { flex: 1; height: 4px; background: #cfcfcf; border-radius: 4px; position: relative; }
.cm-med-fakebar i { position: absolute; left: 0; top: 0; height: 100%; width: 14%; background: #9a9a9a; border-radius: 4px; }
.cm-med-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--cm-white);
    color: var(--cm-green);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
    flex: none;
}
.cm-med-card.is-locked .cm-med-card-title { color: #8a8f80; }

/* =============================  PLANS  ============================== */
.cm-plans-wrap {
    background: var(--cm-cream);
    border-radius: 24px;
    padding: 40px 28px 48px;
    margin-top: 28px;
    margin-bottom: 28px;
    /* Break out of a narrow theme content column and force a true,
       centered 1220px band (same technique as the meditation section). */
    position: relative;
    left: 50%;
    right: 50%;
    width: min(1220px, 100vw - 32px) !important;
    max-width: min(1220px, 100vw - 32px) !important;
    margin-left: calc(-1 * min(1220px, 100vw - 32px) / 2) !important;
    margin-right: calc(-1 * min(1220px, 100vw - 32px) / 2) !important;
    box-sizing: border-box;
}
.cm-plans-header { text-align: center; margin-bottom: 30px; }
.cm-plans-logo { width: 72px; height: auto; margin: 0 auto 10px; display: block; }
.cm-plans-header h2 { margin: 0 0 6px; color: var(--cm-green-deep); font-size: 32px; }
.cm-plans-header p { margin: 0; color: var(--cm-muted); font-size: 17px; }
.cm-plans {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 26px;
    max-width: 1120px;
    margin: 0 auto;
    align-items: stretch;
}
.cm-plan {
    background: var(--cm-white);
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius);
    padding: 34px 32px;
    box-shadow: var(--cm-shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    flex: 0 1 340px;
    max-width: 380px;
    min-width: 280px;
    box-sizing: border-box;
}
/* A single plan should fill the whole section width, not sit as a small
   floating card. Multiple plans keep the constrained card sizing above. */
.cm-plan:only-child {
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
    text-align: center;
    align-items: center;
    padding: 42px 40px;
}
.cm-plan:only-child .cm-plan-title { font-size: 26px; }
.cm-plan:only-child .cm-plan-price { font-size: 40px; }
.cm-plan:only-child .cm-plan-desc,
.cm-plan:only-child .cm-plan-features { max-width: 560px; width: 100%; }
.cm-plan:only-child .cm-plan-features li { text-align: left; }
.cm-plan:only-child .cm-plan-cta { width: 100%; max-width: 420px; margin-left: auto; margin-right: auto; }
.cm-plan:hover { transform: translateY(-4px); box-shadow: var(--cm-shadow); }
.cm-plan-featured {
    border: 2px solid var(--cm-green);
    box-shadow: 0 12px 30px rgba(90,114,71,.20);
}
.cm-plan-badge {
    position: absolute;
    top: -13px; left: 50%; transform: translateX(-50%);
    background: var(--cm-green);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 20px;
    white-space: nowrap;
}
.cm-plan-title { margin: 0 0 12px; font-size: 22px; color: var(--cm-green-deep); }
.cm-plan-price { margin: 8px 0 16px; font-size: 34px; font-weight: 700; color: var(--cm-ink); line-height: 1.1; }
.cm-plan-price .cm-currency { font-size: 15px; vertical-align: super; color: var(--cm-muted); margin-right: 2px; }
.cm-plan-price .cm-duration { font-size: 14px; font-weight: 400; color: var(--cm-muted); margin-left: 4px; }
.cm-plan-desc { color: #555; margin: 12px 0; }
.cm-plan-features { list-style: none; padding: 0; margin: 16px 0; flex-grow: 1; }
.cm-plan-features li { padding: 9px 0 9px 26px; position: relative; border-bottom: 1px solid #f1efe6; color: var(--cm-ink); }
.cm-plan-features li:before { content: '\2713'; color: var(--cm-green); font-weight: 700; position: absolute; left: 0; }
.cm-plan-cta { margin-top: 20px; }
.cm-already-member { padding: 12px; background: #edf3e6; color: var(--cm-green-dark); border-radius: 10px; text-align: center; font-weight: 600; }
.cm-config-warning { padding: 10px; background: #fef3c7; color: #92400e; border-radius: 8px; font-size: 14px; text-align: center; }
.cm-purchase-message { margin-top: 12px; font-size: 14px; text-align: center; }
.cm-login-hint { font-size: 13px; color: var(--cm-muted); text-align: center; margin: 8px 0 0; }

/* =============================  BUTTONS  ============================= */
.cm-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.4;
    text-align: center;
    transition: background .15s ease, transform .12s ease;
}
.cm-btn:hover { transform: translateY(-1px); }
.cm-btn-block { display: block; width: 100%; box-sizing: border-box; }
.cm-btn-primary { background: var(--cm-green); color: #fff; }
.cm-btn-primary:hover { background: var(--cm-green-dark); color: #fff; }
.cm-btn-secondary { background: #eef0e8; color: var(--cm-green-deep); }
.cm-btn-secondary:hover { background: #e4e7dc; color: var(--cm-green-deep); }
.cm-btn-ghost { background: transparent; color: var(--cm-green); border: 1px solid var(--cm-line); }
.cm-btn-ghost:hover { background: #f0f2ea; color: var(--cm-green-dark); }

/* =============================  NOTICES  ============================ */
.cm-notice { padding: 12px 16px; border-radius: 10px; margin: 0 0 20px; font-size: 15px; }
.cm-notice-info { background: #eef3e8; color: var(--cm-green-dark); border-left: 4px solid var(--cm-green); }

/* ==================  LOCKED MEDIA (legacy shortcode)  =============== */
.cm-locked-media { position: relative; display: block; }
.cm-locked-media > audio, .cm-locked-media > video,
.cm-locked-media audio, .cm-locked-media video { pointer-events: none; }
.cm-locked-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(242, 238, 225, 0.4);
    cursor: pointer; border-radius: 20px; z-index: 10;
    transition: background .15s ease;
}
.cm-locked-overlay:hover { background: rgba(90, 114, 71, 0.14); }
.cm-lock-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; background: #fff; border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15); font-size: 16px;
}

/* ========================  RESTRICTED CARD  ======================== */
.cm-restricted {
    text-align: center; padding: 44px 24px;
    background: var(--cm-cream-soft);
    border: 2px dashed #cdd3c1; border-radius: var(--cm-radius);
    margin: 24px 0;
}
.cm-restricted-icon { font-size: 48px; margin-bottom: 16px; }
.cm-restricted h3 { margin: 0 0 8px; color: var(--cm-green-deep); }
.cm-restricted p { color: #555; margin: 0 0 20px; }
.cm-restricted-actions .cm-btn { margin: 0 4px; }

/* ==============================  AUTH  ============================= */
.cm-auth {
    display: flex;
    justify-content: center;
    padding: 32px 16px;
    background: var(--cm-cream);
    border-radius: 24px;
}
.cm-auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--cm-white);
    border-radius: 20px;
    padding: 36px 34px 34px;
    box-shadow: var(--cm-shadow);
}
.cm-auth-brand { text-align: center; margin-bottom: 24px; }
.cm-auth-logo { width: 64px; height: auto; margin: 0 auto 10px; display: block; }
.cm-auth-title { margin: 0; font-size: 24px; color: var(--cm-green-deep); }
.cm-auth-sub { margin: 4px 0 0; color: var(--cm-muted); font-size: 15px; }
.cm-auth-switchline { text-align: center; margin: 16px 0 0; font-size: 14px; color: var(--cm-muted); }
.cm-auth-switchline a { color: var(--cm-green); font-weight: 600; text-decoration: none; }
.cm-auth-switchline a:hover { text-decoration: underline; }
.cm-auth-loggedin { text-align: center; }
.cm-auth-loggedin p { margin-bottom: 16px; }
.cm-tabs { display: flex; margin-bottom: 24px; }
.cm-tabs-pill {
    background: #f0f2ea; border-radius: 12px; padding: 5px; gap: 4px;
}
.cm-tabs-pill .cm-tab {
    flex: 1; padding: 11px; background: none; border: none; cursor: pointer;
    font-weight: 600; color: var(--cm-muted); font-size: 15px; border-radius: 9px;
    transition: all .15s ease;
}
.cm-tabs-pill .cm-tab-active { background: var(--cm-white); color: var(--cm-green-deep); box-shadow: var(--cm-shadow-sm); }
.cm-tabs:not(.cm-tabs-pill) { border-bottom: 1px solid var(--cm-line); }
.cm-tabs:not(.cm-tabs-pill) .cm-tab {
    flex: 1; padding: 12px; background: none; border: none; border-bottom: 2px solid transparent;
    cursor: pointer; font-weight: 600; color: var(--cm-muted); font-size: 15px;
}
.cm-tabs:not(.cm-tabs-pill) .cm-tab-active { color: var(--cm-green); border-bottom-color: var(--cm-green); }
.cm-form { display: block; }
.cm-form-hidden { display: none; }
.cm-field { margin-bottom: 16px; }
.cm-field label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--cm-ink); font-size: 14px; }
.cm-field input[type="text"],
.cm-field input[type="email"],
.cm-field input[type="password"] {
    width: 100%; padding: 12px 14px; border: 1px solid #d6d2c4; border-radius: 10px;
    font-size: 15px; box-sizing: border-box; background: var(--cm-cream-soft);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.cm-field input:focus {
    outline: none; border-color: var(--cm-green);
    box-shadow: 0 0 0 3px rgba(90,114,71,.15); background: #fff;
}
.cm-field-checkbox label { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--cm-muted); }
.cm-form-message { margin-top: 12px; font-size: 14px; text-align: center; }
.cm-form-wrap { max-width: 440px; margin: 0 auto; padding: 32px; background: #fff; border: 1px solid var(--cm-line); border-radius: var(--cm-radius); }

/* ============================  ACCOUNT  ============================ */
.cm-account {
    background: var(--cm-cream);
    border-radius: 24px;
    padding: 30px;
    margin: 24px 0;
}
.cm-account-header {
    display: flex; align-items: center; gap: 16px;
    background: var(--cm-white); border-radius: var(--cm-radius);
    padding: 20px 24px; box-shadow: var(--cm-shadow-sm); margin-bottom: 22px;
}
.cm-account-avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--cm-cream-soft); padding: 6px; object-fit: contain; }
.cm-account-header h3 { margin: 0; color: var(--cm-green-deep); font-size: 20px; }
.cm-account-email { margin: 2px 0 0; color: var(--cm-muted); font-size: 14px; }
.cm-account-logout { margin-left: auto; padding: 8px 16px; font-size: 14px; }
.cm-account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 720px) { .cm-account-grid { grid-template-columns: 1fr; } }
.cm-account-panel { background: var(--cm-white); border-radius: var(--cm-radius); padding: 24px; box-shadow: var(--cm-shadow-sm); }
.cm-account-panel h4 { margin: 0 0 16px; color: var(--cm-green-deep); font-size: 17px; }
.cm-muted { color: var(--cm-muted); }
.cm-membership-list { list-style: none; padding: 0; margin: 0 0 16px; }
.cm-membership-list li {
    padding: 14px 16px; margin-bottom: 10px; border-radius: 10px;
    background: var(--cm-cream-soft); border-left: 4px solid transparent;
    display: flex; flex-direction: column; gap: 2px;
}
.cm-membership-list li.cm-active { border-left-color: var(--cm-green); }
.cm-membership-list li.cm-expired { border-left-color: #c26b5c; color: var(--cm-muted); }
.cm-membership-meta { font-size: 13px; color: var(--cm-muted); }
