/* ==========================================================================
   RECENTRE — Single Course Page Hide Elements
   Scoped to body.single-lp_course only.
   Hides specific UI elements; does not change functionality.
   ========================================================================== */

/* ==========================================================================
  1. HEADER BANNER
  No overrides here — use original Eduma/LearnPress header styles.
  ========================================================================== */

/* ==========================================================================
   2. HIDE COURSE META BLOCK
   Teacher, Categories, Review meta row below the course title.
   ========================================================================== */

body.single-lp_course .course-meta.course-meta-single {
  display: none;
}

/* ==========================================================================
   2b. HIDE COURSE HEADER EXCERPT ONLY
   Eduma outputs the course excerpt as the paragraph directly after the
   single-course title. Keep this adjacent selector narrow so overview content,
   lesson text, and other paragraphs stay visible.
   ========================================================================== */

body.single-lp_course .course-info-left.learn-press > h1.entry-title + p {
  display: none !important;
}

/* ==========================================================================
   2c. TIGHTEN COURSE INTRO BAND SPACING ONLY
   After the intro excerpt/media blocks are hidden, Eduma's default 70px vertical
   padding leaves a large empty band above the course tabs. Scope this to the
   single-course top heading wrapper so archive cards and lesson content stay as-is.
   ========================================================================== */

body.single-lp_course .top_heading_out > .course-info-top {
  padding: 28px 0 24px !important;
}

/* ==========================================================================
   3. HIDE CURRICULUM INFO SUMMARY ROW
   "3 Sections · 21 Lessons · Lifetime" row above the curriculum list.
   ========================================================================== */

body.single-lp_course .course-curriculum-info {
  display: none;
}

/* Also hide the <h3> "Curriculum" heading inside the tab content
   (the tab itself is renamed to "Program Agenda" via PHP filter) */
body.single-lp_course .lp-course-curriculum__title {
  display: none;
}

/* ==========================================================================
   4. HIDE COURSE FEATURES SIDEBAR SECTION
   The "Course Features" list rendered by thim_course_info().
   ========================================================================== */

body.single-lp_course .thim-course-info {
  display: none;
}

/* ==========================================================================
   4a. HIDE MEDIA INTRO SIDEBAR PLACEHOLDER ONLY
   Do not hide .course-thumbnail broadly; Eduma uses that class for real images.
   This only removes the direct media intro block in the single-course sidebar.
   ========================================================================== */

body.single-lp_course
  #sidebar
  .course_right
  > .course-thumbnail
  > .media-intro {
  display: none !important;
}

/* ==========================================================================
   4b. HIDE FEATURED REVIEW SIDEBAR BLOCK ONLY
   LearnPress/Eduma can output this as .course-featured-review.
   Keep the selector limited to single course pages so comments, ratings, and
   other review/testimonial elements elsewhere remain untouched.
   ========================================================================== */

body.single-lp_course .course-featured-review {
  display: none !important;
}

/* ==========================================================================
   4c. HIDE "YOU MAY LIKE" (RELATED COURSES) ONLY
   Targets the single block Eduma outputs as .thim-related-course — it is a
   sibling of .thim-course-menu-landing / tab content, not their parent.
   display:none removes that panel from layout only; no JS or PHP changes.
   ========================================================================== */

body.single-lp_course #main-content .thim-related-course {
  display: none !important;
}

/* ==========================================================================
   4d. LANDING MENU BAR — always on-screen (Eduma default is off-screen until scroll)
   Parent course-single.css sets .thim-course-menu-landing { position:fixed;
   bottom:-60px } and only moves to bottom:0 when body has .course-landing-active
   (toggled by scroll in thim-scripts.js — see course_menu_landing). That is not
   caused by hiding .thim-related-course. Pin the bar here if it should stay visible
   at the top of the page; remove this block to restore Eduma’s scroll-reveal behavior.
   ========================================================================== */

body.single-lp_course .thim-course-menu-landing {
  bottom: 0 !important;
}

/* ==========================================================================
   5. HIDE ENROLLMENT WARNING MESSAGE
   "NOTE: You have to pass these courses before you can enroll this course."
   Scoped to the course payment/sidebar area on the single course page.
   ========================================================================== */

/* body.single-lp_course .course-payment .learn-press-message.warning,
body.single-lp_course .course_right .learn-press-message.warning {
  display: none;
} */

/* ==========================================================================
   5b. RIGHT SIDEBAR — program banner links
   Replaces the hidden course-info panel with clickable course banners.
   ========================================================================== */
body.single-lp_course .course_right .recentre-sidebar-program-banners {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

body.single-lp_course .course_right .recentre-sidebar-program-banner {
  display: block;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--rc-green-100, #dceede) 45%, #fff);
  text-decoration: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

body.single-lp_course .course_right .recentre-sidebar-program-banner img {
  display: block;
  width: 100%;
  height: auto;
}

body.single-lp_course .course_right .recentre-sidebar-program-banner:hover {
  transform: translateY(-1px);
  border-color: var(--rc-green-300, #9dc4a8);
  box-shadow: 0 4px 14px rgba(26, 64, 38, 0.14);
}

body.single-lp_course
  .course_right
  .recentre-sidebar-program-banner.is-current-course {
  border-color: var(--rc-green-600, #4a8c5c);
  box-shadow: 0 0 0 1px
    color-mix(in srgb, var(--rc-green-600, #4a8c5c) 55%, white);
}

/* Overview-tab layout (full-width course template): place banners beside .thim-course-content */
body.single-lp_course .course-description {
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

body.single-lp_course .course-description .thim-course-content {
  flex: 1 1 auto;
  min-width: 0;
}

body.single-lp_course .course-description > .recentre-sidebar-program-banners {
  display: grid;
  gap: 20px;
  flex: 0 0 240px;
  width: 240px;
  max-width: 240px;
  margin-top: 2px;
}

/* Elementor shape dividers inside overview content:
   visually extend to include the right banner column width + gap so
   wave/shape edges don't look cut off in the two-column course layout. */
@media (min-width: 992px) {
  body.single-lp_course .course-description {
    --recentre-overview-sidebar-w: 240px;
    --recentre-overview-gap: 28px;
  }

  body.single-lp_course
    .course-description
    .thim-course-content
    .elementor-shape
    svg {
    width: calc(
      100% + var(--recentre-overview-sidebar-w) + var(--recentre-overview-gap)
    ) !important;
    max-width: none !important;
  }
}

body.single-lp_course
  .course-description
  > .recentre-sidebar-program-banners
  .recentre-sidebar-program-banner
  img {
  width: 100%;
  height: auto;
}

@media (max-width: 991px) {
  body.single-lp_course .course-description {
    display: block;
  }

  body.single-lp_course
    .course-description
    > .recentre-sidebar-program-banners {
    width: 100%;
    max-width: 100%;
    margin-top: 16px;
  }
}

/* ==========================================================================
   6. LAYOUT FIX — expand content after sidebar elements are hidden
   When "Course Features" is hidden, the sidebar may look sparse.
   On layouts using the new-1/layout_style_3 grid, the content column
   should expand if the sidebar is effectively empty.
   ========================================================================== */

/* If the sidebar only has hidden content + payment button,
   give the main content more room on desktop */
@media (min-width: 992px) {
  body.single-lp_course .content_course_2 .content-single {
    flex: 0 0 75%;
    max-width: 75%;
  }

  body.single-lp_course .content_course_2 #sidebar {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

/* On the classic layout, the .course-info is full-width already,
   so no adjustment needed. */


/* ==========================================================================
   7. HUB-STYLE TILE TREATMENT — standalone course pages + archive
   Make /courses/ and /courses/<slug>/ feel like the Hub: each major
   content block sits in a white card with the same radius, border, and
   shadow as the Hub dashboard tiles. Shared design tokens keep things
   consistent with recentre-hub.css. Scoped so the popup player
   (body.course-item-popup) is untouched — it already has its own card
   treatment.
   ========================================================================== */

:root {
  --rc-hub-tile-bg:     #fff;
  --rc-hub-tile-border: #dde6db;
  --rc-hub-tile-radius: 12px;
  --rc-hub-tile-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --rc-hub-tile-accent: #53947c;
  --rc-hub-tile-pad:    24px;
}

/* --- Standalone single course page (NOT the popup player) ----------------- */
body.single-lp_course:not(.course-item-popup) .thim-course-content {
  background: var(--rc-hub-tile-bg);
  border: 1px solid var(--rc-hub-tile-border);
  border-radius: var(--rc-hub-tile-radius);
  box-shadow: var(--rc-hub-tile-shadow);
  padding: var(--rc-hub-tile-pad);
  margin-bottom: 18px;
}

body.single-lp_course:not(.course-item-popup) .course-summary {
  background: transparent;
}

/* Accent line at the top of the main content card — mirrors the Hub */
body.single-lp_course:not(.course-item-popup) .thim-course-content::before {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  background: var(--rc-hub-tile-accent);
  border-radius: 2px;
  margin: -4px 0 16px;
}

/* Course sidebar widgets — also as Hub tiles */
body.single-lp_course:not(.course-item-popup) #sidebar > .widget {
  background: var(--rc-hub-tile-bg);
  border: 1px solid var(--rc-hub-tile-border);
  border-radius: var(--rc-hub-tile-radius);
  box-shadow: var(--rc-hub-tile-shadow);
  padding: 18px;
  margin-bottom: 16px;
}

/* --- Courses archive (/courses/) ------------------------------------------ */
body.post-type-archive-lp_course #lp-archive-courses {
  background: transparent;
}

body.post-type-archive-lp_course ul.learn-press-courses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  list-style: none;
  padding: 0;
  margin: 0;
}

body.post-type-archive-lp_course ul.learn-press-courses > li {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--rc-hub-tile-bg);
  border: 1px solid var(--rc-hub-tile-border);
  border-radius: var(--rc-hub-tile-radius);
  box-shadow: var(--rc-hub-tile-shadow);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

body.post-type-archive-lp_course ul.learn-press-courses > li:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  border-color: #c5dccc;
}

body.post-type-archive-lp_course ul.learn-press-courses .course-item {
  display: flex;
  flex-direction: column;
  height: 100%;
}

body.post-type-archive-lp_course ul.learn-press-courses .course-item .course-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  border-top-left-radius: var(--rc-hub-tile-radius);
  border-top-right-radius: var(--rc-hub-tile-radius);
}

body.post-type-archive-lp_course ul.learn-press-courses .course-item .course-info {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

body.post-type-archive-lp_course ul.learn-press-courses .course-item h2,
body.post-type-archive-lp_course ul.learn-press-courses .course-item h3,
body.post-type-archive-lp_course ul.learn-press-courses .course-item .course-title {
  font-size: 1.1rem;
  line-height: 1.35;
  margin: 0 0 8px;
  color: #2d5a27;
}

body.post-type-archive-lp_course ul.learn-press-courses .course-item .course-meta {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f0f3f0;
  font-size: 0.85rem;
  color: #666;
}

/* Mobile: single column */
@media (max-width: 600px) {
  body.post-type-archive-lp_course ul.learn-press-courses {
    grid-template-columns: 1fr;
  }
  body.single-lp_course:not(.course-item-popup) .thim-course-content {
    padding: 16px;
  }
}


/* ==========================================================================
   8. HUB LEFT RAIL ON STANDALONE SINGLE COURSE PAGES
   The PHP hook in functions.php (recentre_render_hub_sidebar_on_standalone_course)
   injects the Hub sidebar markup right after <body>. This block positions it as
   a fixed 260px left rail, hides Eduma's masthead/footer chrome, and pushes the
   course content to the right — matching the Hub dashboard layout.

   Scoped to body.single-lp_course:not(.course-item-popup) so the popup player
   (which has its own Hub rail) is unaffected.
   ========================================================================== */

body.single-lp_course:not(.course-item-popup) {
  --recentre-standalone-hub-w: 260px;
}

/* Fixed left rail */
body.single-lp_course:not(.course-item-popup) .recentre-hub--standalone-course {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--recentre-standalone-hub-w);
  height: 100vh;
  overflow-y: auto;
  z-index: 100001;
  background: #fff;
  border-right: 1px solid var(--rh-sidebar-border, #c5e6c9);
}

body.single-lp_course:not(.course-item-popup) .recentre-hub--standalone-course .recentre-hub__sidebar {
  position: static;
  border: none;
  padding: 0;
  width: 100%;
  max-width: 100%;
}

/* Hide Eduma's top header — Hub left rail replaces all navigation */
body.single-lp_course:not(.course-item-popup) #masthead,
body.single-lp_course:not(.course-item-popup) #thim-header-wrap,
body.single-lp_course:not(.course-item-popup) #colophon,
body.single-lp_course:not(.course-item-popup) #thim-footer {
  display: none !important;
}

/* Push main content right by the rail width */
body.single-lp_course:not(.course-item-popup) #wrapper-container,
body.single-lp_course:not(.course-item-popup) #main-content {
  margin-left: var(--recentre-standalone-hub-w);
  padding-top: 24px;
}

/* Restore background colour the masthead used to provide */
body.single-lp_course:not(.course-item-popup) #wrapper-container {
  background: #f5f7f5;
  min-height: 100vh;
}

/* Mobile: hide rail, restore full-width content. Eduma header stays hidden;
   we could re-show it on mobile but for now keep the Hub layout consistent. */
@media (max-width: 1024px) {
  body.single-lp_course:not(.course-item-popup) .recentre-hub--standalone-course {
    display: none;
  }
  body.single-lp_course:not(.course-item-popup) #wrapper-container,
  body.single-lp_course:not(.course-item-popup) #main-content {
    margin-left: 0;
  }
}


