/* Qualification detail pages: Archivo, cream, ink, gold. Scoped to course detail/social bodies. */
@layer tbs-interior-presentation {
  body:is(.tbs-course-detail,.tbs-course-social).tbs-course-page.tbs-interior .tbs-interior-content {
    --q-ink:#0f2c5e; --q-gold:#f7941d; --q-brass:#2961a4; --q-muted:#4a586e; --q-line:#dbe3ee; --q-sand:#edf1f7; --q-paper:#f6f8fb;
  }
  /* Accreditation logo: compact, no blank space */
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .elementor .elementor-section.tbs-course-media.tbs-course-section {
    padding-block: 20px !important; min-height: 0 !important; background-color: var(--q-paper) !important;
  }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-media :is(.elementor-container,.elementor-column,.elementor-widget-wrap,.elementor-widget,.elementor-widget-container) {
    min-height: 0 !important; height: auto !important; padding-block: 0 !important; margin-bottom: 0 !important;
  }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-media .elementor-widget-wrap { justify-content: flex-start; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-media .elementor-widget-image { text-align: left !important; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-media img { width: auto !important; max-width: min(180px, 100%) !important; max-height: 96px !important; height: auto !important; object-fit: contain; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-media .elementor-spacer { display: none; }

  /* Overview: strip mustard panels from nested containers */
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-overview :is(.elementor-inner-section,.elementor-column,.elementor-widget-wrap,.elementor-widget-text-editor,.elementor-widget-container,.elementor-background-overlay) {
    background: transparent !important; background-image: none !important; box-shadow: none !important; border: 0 !important;
  }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-overview :is(.elementor-widget-text-editor,.elementor-widget-text-editor p,.elementor-widget-text-editor li,.elementor-widget-text-editor span) {
    color: var(--q-muted) !important; font-size: 17px !important; line-height: 1.7 !important; text-shadow: none !important;
  }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-overview .elementor-widget-text-editor :is(strong,b) { color: var(--q-ink) !important; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-overview .elementor-widget-text-editor ul { padding-left: 1.2em; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-overview :is(.elementor-widget-image-box,.elementor-widget-icon-box) > .elementor-widget-container {
    padding: 22px 24px !important; height: 100%; background: #fff !important; border: 1px solid var(--q-line) !important; border-radius: 18px !important; box-shadow: none !important;
  }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-overview :is(.elementor-image-box-title,.elementor-icon-box-title) { color: var(--q-ink) !important; font-size: 18px !important; line-height: 1.3 !important; }

  /* Fact tiles: one surface, dark 44px icons */
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-facts .elementor-widget-image-box > .elementor-widget-container {
    padding: 20px 22px !important; background: #fff !important; border: 1px solid var(--q-line) !important; border-radius: 16px !important; box-shadow: none !important;
  }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-facts :is(.elementor-column,.elementor-widget-wrap):not(.elementor-widget-wrap:has(.elementor-widget-image-box)) { background: transparent !important; box-shadow: none !important; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-facts .elementor-image-box-wrapper { align-items: center; gap: 16px; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-facts .elementor-image-box-img img,
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-facts .elementor-widget-image img {
    width: 44px !important; max-width: 44px !important; height: 44px !important; object-fit: contain; filter: brightness(0) opacity(.88) !important; background: none !important; border: 0 !important; border-radius: 0 !important; padding: 0 !important;
  }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-facts .elementor-image-box-title { color: var(--q-ink) !important; font-size: 17px !important; font-weight: 700 !important; margin: 0 0 2px !important; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-facts .elementor-image-box-description { color: var(--q-muted) !important; font-size: 15px !important; line-height: 1.5; }

  /* Tile columns: surface on the immediate widget-wrap only */
  body:is(.tbs-course-detail,.tbs-course-social).tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-section .elementor-column.tbs-course-tile > .elementor-widget-wrap {
    height: 100%; padding: 20px !important; background: #fff !important; border: 1px solid var(--q-line) !important; border-radius: 18px !important; box-shadow: none !important; align-content: flex-start;
  }
  body:is(.tbs-course-detail,.tbs-course-social).tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-section .elementor-column.tbs-course-tile .elementor-widget > .elementor-widget-container {
    background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; border-radius: 0 !important;
  }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-section .elementor-column.tbs-course-tile .elementor-heading-title { font-size: 20px !important; line-height: 1.25 !important; }

  /* Downloads: compact document link cards */
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .elementor .elementor-section.tbs-course-section.tbs-course-resources > .elementor-container {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 24px !important;
  }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-resources .elementor-widget.tbs-course-download {
    width: 100% !important; min-width: 0 !important; height: auto !important; margin: 0 0 16px !important;
  }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-resources .elementor-widget.tbs-course-download > .elementor-widget-container {
    margin: 0 !important; height: auto !important; min-height: 72px !important;
    padding: 0 !important; background: #fff !important; border: 1px solid var(--q-line) !important; border-radius: 14px !important; box-shadow: none !important; transition: border-color .2s, transform .2s;
  }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-resources .tbs-course-download > .elementor-widget-container:hover { border-color: var(--q-gold) !important; transform: translateY(-2px); }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-resources .tbs-course-download .elementor-image-box-wrapper { display: flex !important; align-items: center !important; gap: 14px; margin: 0 !important; padding: 14px 18px !important; text-align: left !important; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-resources .tbs-course-download .elementor-image-box-img { flex: 0 0 auto; width: auto !important; margin: 0 !important; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-resources .tbs-course-download .elementor-image-box-img img { width: 40px !important; max-width: 40px !important; height: 40px !important; object-fit: contain; filter: brightness(0) opacity(.75) !important; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-resources .tbs-course-download .elementor-image-box-content { flex: 1; min-width: 0; width: auto !important; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-resources .tbs-course-download :is(.elementor-image-box-title,.elementor-image-box-title a) {
    margin: 0 !important; color: var(--q-ink) !important; font-size: 16px !important; line-height: 1.4 !important; overflow-wrap: anywhere;
  }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-resources .tbs-course-download a:hover { color: var(--q-brass) !important; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-resources .tbs-course-download .elementor-image-box-title a { display: flex; align-items: center; min-height: 44px; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-resources .tbs-course-download .elementor-image-box-description { margin: 2px 0 0; font-size: 14px !important; color: var(--q-muted) !important; }

  /* Related courses: neat photo-link cards */
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-related .elementor-column:has(> .elementor-widget-wrap > .elementor-widget-image) > .elementor-widget-wrap {
    padding: 0 !important; background: #fff !important; border: 1px solid var(--q-line) !important; border-radius: 18px !important; overflow: hidden; height: 100%; box-shadow: none !important;
  }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-related .elementor-widget-image img { display: block; width: 100% !important; height: 180px !important; object-fit: cover; border-radius: 0 !important; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-related .elementor-widget-icon-list { padding: 16px 20px 20px; margin: 0 !important; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-related .elementor-icon-list-text { color: var(--q-ink) !important; font-weight: 700; font-size: 17px; line-height: 1.35; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-related .elementor-icon-list-item a:hover .elementor-icon-list-text { color: var(--q-brass) !important; }

  /* Enquiry: keep dark contrast; outer only */
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-enquiry { background-color: var(--q-ink) !important; }

  /* Social course: share coherent surfaces, keep its accordions */
  body.tbs-course-social.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-facts .elementor-widget-image-box > .elementor-widget-container { background: #fff !important; border: 1px solid var(--q-line) !important; border-radius: 16px !important; box-shadow: none !important; }

  /* Facts heading, social facts icon-list, and nested spacing limits */
  body:is(.tbs-course-detail,.tbs-course-social).tbs-course-page.tbs-interior .tbs-interior-content .elementor .elementor-section.tbs-course-section.tbs-course-facts .elementor-widget.tbs-course-heading .elementor-heading-title {
    font-size: clamp(28px, 3vw, 38px) !important; line-height: 1.12 !important;
  }
  body.tbs-course-social.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-facts .elementor-icon-list-text { color: var(--q-ink) !important; font-size: 16px !important; line-height: 1.45 !important; }
  body.tbs-course-social.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-facts .elementor-widget-image img { width: 44px !important; max-width: 44px !important; height: 44px !important; object-fit: contain; filter: brightness(0) opacity(.88) !important; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content :is(.tbs-course-overview,.tbs-course-facts,.tbs-course-resources,.tbs-course-related) :is(.elementor-inner-section,.elementor-section):not(.tbs-course-section) { padding: 0 !important; margin: 0 !important; }
  body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content :is(.tbs-course-overview,.tbs-course-facts,.tbs-course-resources,.tbs-course-related) :is(.elementor-column,.elementor-element-populated):not(.tbs-course-tile):not(.metform-form-content *) > .elementor-widget-wrap { padding: 0 !important; margin: 0 !important; }

  @media (max-width: 1024px) {
    body:is(.tbs-course-detail,.tbs-course-social).tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-section .elementor-column.tbs-course-tile > .elementor-widget-wrap { padding: 16px !important; }
  }
  @media (max-width: 767px) {
    body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-media img { max-width: min(150px, 100%) !important; }
    body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-overview :is(.elementor-widget-text-editor,.elementor-widget-text-editor p) { font-size: 16px !important; }
    body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-related .elementor-widget-image img { height: 160px !important; }
  }
  @media (prefers-reduced-motion: reduce) {
    body.tbs-course-detail.tbs-course-page.tbs-interior .tbs-interior-content .tbs-course-resources .tbs-course-download > .elementor-widget-container { transition: none; transform: none !important; }
  }
}
