﻿/* =========================================================
   ENTRACK Platform - Course Pages Mobile Fixes
   Applies only to single course pages (Tutor LMS)
========================================================= */

/* Prevent horizontal scrolling globally for courses */
body.single-courses {
  overflow-x: hidden;
}

/* Ensure containers behave correctly on all screen sizes */
body.single-courses .tutor-wrap,
body.single-courses .tutor-container,
body.single-courses .tutor-course-details-page {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* Prevent images, quotes, or tabs from overflowing */
body.single-courses .tutor-course-thumbnail img,
body.single-courses .tutor-tab img,
body.single-courses .tutor-tab blockquote,
body.single-courses .tutor-course-details-content img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Optional: prevent tab sections from causing overflow */
body.single-courses .tutor-tab {
  max-width: 100%;
  overflow-x: hidden;
}

.kumu-map-container {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.kumu-map-container h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #0073e6;
}

.kumu-map-container p {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: #444;
  line-height: 1.6;
}

.kumu-map-frame iframe {
  width: 100%;
  height: 600px;
  border: none;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}

/* =========================================================
   All Courses Archive - Language bar and ordering
========================================================= */

/* Hide Tutor sort/filter UI to avoid clashing with manual ordering */
.course-archive-page .tutor-course-filter,
.course-archive-page [tutor-course-filter],
.course-archive-page .tutor-course-filter-bar,
.course-archive-page .tutor-course-archive-order,
.course-archive-page .tutor-form-select,
.course-archive-page select[name="course_order"] {
  display: none !important;
}

.course-archive-page .tutor-course-filter .tutor-js-form-select,
.course-archive-page .tutor-course-filter select[name="course_order"],
.course-archive-page .tutor-form-select[name="course_order"] {
  display: none !important;
}

/* Language switcher layout */
.entrack-lang-switcher.ent-lang-bar {
  margin: 18px auto 10px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.entrack-lang-switcher .ent-lang-inner {
  display: inline-flex;
  gap: 6px;
  padding: 8px 14px;
  background: #f5f8ff;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.ent-lang-pill {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0b1a33;
  transition: background 0.15s ease, color 0.15s ease, transform 0.04s ease;
  --flag-w: 1.25em;
  --flag-h: 0.9em;
}

.ent-lang-pill .ent-flag,
.ent-lang-pill .ent-flag--svg {
  width: var(--flag-w);
  height: var(--flag-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.22em;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  vertical-align: -1px;
  flex: 0 0 auto;
}

.ent-lang-pill .ent-flag > img,
.ent-lang-pill .ent-flag--svg > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.ent-lang-pill .ent-code {
  letter-spacing: 0.3px;
}

.ent-lang-pill .ent-name {
  opacity: 0.7;
  font-weight: 500;
}

.ent-lang-pill:hover,
.ent-lang-pill:focus-visible {
  background: rgba(0, 115, 230, 0.1);
  outline: none;
}

.ent-lang-pill.is-active {
  background: #0073e6;
  color: #fff;
}

.ent-lang-pill.is-active .ent-name {
  opacity: 1;
}

@media (max-width: 540px) {
  .entrack-lang-switcher .ent-lang-inner {
    padding: 6px;
    gap: 4px;
  }
  .ent-lang-pill {
    padding: 6px 10px;
    gap: 6px;
    --flag-w: 1.1em;
    --flag-h: 0.82em;
  }
  .ent-lang-pill .ent-name {
    display: none;
  }
}

/* Remove dark Elementor container around the TOP language bar only */
.course-archive-page .elementor-widget-container:has(.ent-lang-bar),
.course-archive-page .elementor-section:has(.ent-lang-bar),
.course-archive-page .elementor-container:has(.ent-lang-bar) {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding-top: 0;
  padding-bottom: 0;
}
