/* CCM Sermons — Elementor sermon widgets + sermon page helpers
   Defaults follow the site's Elementor Global Colors; every value can be
   changed in the widget's Style tab. */

/* ── Hide elements when the sermon has no data for them ──────────────
   Add the class in Elementor → Advanced → CSS Classes:
   ccm-if-notes · ccm-if-series · ccm-if-part · ccm-if-prev · ccm-if-next · ccm-if-description */
.ccm-no-notes .ccm-if-notes,
.ccm-no-series .ccm-if-series,
.ccm-no-part .ccm-if-part,
.ccm-no-prev .ccm-if-prev,
.ccm-no-next .ccm-if-next,
.ccm-no-description .ccm-if-description { display: none !important; }

.ccm-el-note { padding: 14px 16px; border: 1px dashed #c3c4c7; border-radius: 8px; color: #50575e; font-size: 13px; background: #f6f7f7; }

[class*="ccm-el-"] svg { width: 1em; height: 1em; flex-shrink: 0; vertical-align: middle; }
[class*="ccm-el-"] img { display: block; max-width: 100%; }

/* Shared thumbnail */
.ccm-el-thumb { position: relative; display: block; flex-shrink: 0; width: 104px; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: var(--e-global-color-secondary, #0d2a5c); }
.ccm-el-thumb img { width: 100% !important; height: 100% !important; object-fit: cover; }
.ccm-el-thumb em, .ccm-el-card__thumb em { position: absolute; right: 4px; bottom: 4px; font-style: normal; font-size: 10px; font-weight: 700; line-height: 1.5; color: #fff; background: rgba(0,0,0,.7); padding: 1px 5px; border-radius: 4px; }

/* 1. Breadcrumb */
.ccm-el-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.ccm-el-crumbs a { color: inherit; opacity: .75; text-decoration: none; }
.ccm-el-crumbs a:hover { opacity: 1; }
.ccm-el-crumbs svg { opacity: .5; }

/* 2. In This Series */
.ccm-el-series { background: #fff; border: 1px solid #e3e9f2; border-radius: 18px; padding: 24px; box-shadow: 0 6px 18px -8px rgba(10,20,40,.18); }
.ccm-el-series__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.ccm-el-series__head h4 { margin: 0; font-size: 18px; color: var(--e-global-color-primary, #0f1b2d); }
.ccm-el-series__count, .ccm-el-series__sub { font-size: 13px; color: #7a8699; margin: 0; }
.ccm-el-series__sub { margin-bottom: 14px; }
.ccm-el-eps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 440px; overflow: auto; }
.ccm-el-ep { list-style: none; margin: 0; }
.ccm-el-ep a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; text-decoration: none; transition: background .2s; }
.ccm-el-ep a:hover { background: #f6f8fb; }
.ccm-el-ep__num { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #7a8699; }
.ccm-el-ep__title { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--e-global-color-text, #0f1b2d); }
.ccm-el-ep.is-current { --ccm-el-current: var(--e-global-color-primary, #1f6fc5); }
.ccm-el-ep.is-current a { background: color-mix(in srgb, var(--ccm-el-current) 9%, #fff); box-shadow: inset 3px 0 0 var(--ccm-el-current); }
.ccm-el-ep.is-current .ccm-el-ep__num { color: var(--ccm-el-current); }
.ccm-el-series__foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid #e3e9f2; }
.ccm-el-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; color: var(--e-global-color-accent, #1f6fc5); }
.ccm-el-link svg { transition: transform .2s; }
.ccm-el-link:hover svg { transform: translateX(4px); }

/* 3. Previous / Next */
.ccm-el-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ccm-el-pager a { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 18px; border: 1px solid #e3e9f2; background: #f6f8fb; text-decoration: none; transition: all .25s; }
.ccm-el-pager a:hover { background: #fff; box-shadow: 0 18px 45px -18px rgba(10,20,40,.3); transform: translateY(-2px); }
.ccm-el-pager a.next { flex-direction: row-reverse; text-align: right; }
.ccm-el-pager .ccm-el-thumb { width: 120px; border-radius: 10px; }
.ccm-el-pager small { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #7a8699; }
.ccm-el-pager strong { display: block; margin-top: 2px; font-size: 17px; line-height: 1.3; color: var(--e-global-color-primary, #0f1b2d); }
@media (max-width: 767px) {
  .ccm-el-pager { grid-template-columns: 1fr; }
  .ccm-el-pager__empty { display: none; }
  .ccm-el-pager .ccm-el-thumb { width: 96px; }
}

/* 4. Latest Messages */
.ccm-el-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.ccm-el-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #e3e9f2; border-radius: 18px; overflow: hidden; text-decoration: none; transition: transform .3s ease, box-shadow .3s ease; }
.ccm-el-cards--lift .ccm-el-card:hover { transform: translateY(-6px); box-shadow: 0 18px 45px -18px rgba(10,20,40,.3); }
.ccm-el-card__thumb { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--e-global-color-secondary, #0d2a5c); }
.ccm-el-card__thumb img { width: 100% !important; height: 100% !important; object-fit: cover; transition: transform .5s ease; }
.ccm-el-card:hover .ccm-el-card__thumb img { transform: scale(1.06); }
.ccm-el-card__thumb em { right: 12px; bottom: 12px; font-size: 12px; padding: 3px 8px; }
.ccm-el-card__body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.ccm-el-card__series { margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--e-global-color-accent, #1f6fc5); }
.ccm-el-card h3 { margin: 0; font-size: 20px; line-height: 1.25; color: var(--e-global-color-primary, #0f1b2d); transition: color .2s; }
.ccm-el-card__date { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 16px; font-size: 13px; color: #7a8699; }

/* 5. Share */
.ccm-el-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ccm-el-share__label { margin-right: 4px; font-size: 13px; font-weight: 600; color: #7a8699; }
.ccm-el-share .ccm-el-share__btn { --ccm-el-share-size: 42px; position: relative; display: grid; place-items: center; width: var(--ccm-el-share-size); height: var(--ccm-el-share-size); padding: 0; margin: 0;
  border: 1px solid #e3e9f2; border-radius: 12px; background: #fff; color: var(--e-global-color-secondary, #0d2a5c); cursor: pointer; text-decoration: none; box-shadow: none; transition: all .2s; font-size: 17px; line-height: 1; }
.ccm-el-share .ccm-el-share__btn:hover, .ccm-el-share .ccm-el-share__btn:focus-visible { background: var(--e-global-color-secondary, #0d2a5c); border-color: transparent; color: #fff; }
.ccm-el-toast { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 5px 10px; border-radius: 6px; background: #111; color: #fff; font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s; }
.ccm-el-toast.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  [class*="ccm-el-"], [class*="ccm-el-"] * { transition: none !important; }
}

/* ── Sermon page template helpers ─────────────────────────────────────
   Fonts follow the site's Elementor Global Fonts unless a widget sets its own. */
.ccm-sermon-el-page .elementor-heading-title { font-family: var(--e-global-typography-primary-font-family, inherit); }
.ccm-sermon-el-page .elementor-widget-text-editor,
.ccm-sermon-el-page .elementor-icon-list-text,
.ccm-sermon-el-page [class*="ccm-el-"] { font-family: var(--e-global-typography-text-font-family, inherit); }
.ccm-sermon-el-page .elementor-button { font-family: var(--e-global-typography-accent-font-family, inherit); }
.ccm-sermon-el-page .elementor-widget-text-editor a { color: var(--e-global-color-accent); text-decoration: underline; text-underline-offset: 3px; word-break: break-word; }

/* Rounded video with shadow (CSS class: ccm-el-video-round) — works with and without Elementor's widget-container wrapper */
.ccm-el-video-round { border-radius: 24px; overflow: hidden; box-shadow: 0 40px 80px -30px rgba(5,10,25,.55); }
.ccm-el-video-round .elementor-widget-container,
.ccm-el-video-round .elementor-wrapper,
.ccm-el-video-round .elementor-custom-embed-image-overlay { border-radius: inherit; overflow: hidden; }
@media (max-width: 767px) { .ccm-el-video-round { border-radius: 16px; } }

/* Series list stays in view while scrolling on desktop (CSS class: ccm-el-sticky) */
@media (min-width: 1025px) { .ccm-el-sticky { position: sticky; top: 24px; } .admin-bar .ccm-el-sticky { top: 56px; } }

/* Series pill (CSS class: ccm-el-pill): soft tint of the Accent color + small dot.
   Setting a Background Color in the widget's Style tab overrides the tint. */
.elementor .ccm-el-pill .elementor-button { background-color: color-mix(in srgb, var(--e-global-color-accent, #1f6fc5) 9%, #fff); }
.elementor .ccm-el-pill .elementor-button:hover { background-color: color-mix(in srgb, var(--e-global-color-accent, #1f6fc5) 16%, #fff); }
.ccm-el-pill .elementor-button-icon { font-size: 7px; opacity: .85; }
.ccm-el-pill .elementor-button-icon svg { width: 7px; height: 7px; }

/* Sermon not in a series → remove the empty "In This Series" column so the
   content uses the full width (works however deeply the widget is nested). */
.ccm-no-series .ccm-sermon-el-page .e-con:has(.ccm-if-series):not(:has(.elementor-widget:not(.ccm-if-series))) { display: none !important; }
.ccm-no-series .ccm-sermon-el-page .e-grid:has(> .ccm-if-series, > .e-con .ccm-if-series),
.ccm-no-series .ccm-sermon-el-page .e-grid > .e-con-inner:has(> .ccm-if-series, > .e-con .ccm-if-series) { grid-template-columns: minmax(0, 1fr) !important; --e-con-grid-template-columns: minmax(0, 1fr) !important; }
