/* Hans Institute Support Centre – department dropdown */
select[name="department"] {
    height: auto !important;
    min-height: 52px !important;
    padding: 12px 40px 12px 14px !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
    font-size: 16px !important;
    vertical-align: middle !important;
}

/* ==========================================
   HANS INSTITUTE HOMEPAGE FIX
   Does not affect trainee dashboard
   ========================================== */

/* Hide unwanted Home page heading */
body.home .entry-title,
body.home .wp-block-post-title,
body.home h1.page-title {
    display: none !important;
}

/* Remove homepage content width restrictions */
body.home .entry-content,
body.home .wp-block-post-content {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Align homepage HTML with the slider */
body.home .hans-home {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

/* Remove unnecessary gap above the slider */
body.home .entry-content > :first-child,
body.home .wp-block-post-content > :first-child {
    margin-top: 0 !important;
}

/* Hans Institute — space below homepage slider */

body.home .hans-home {
    margin-top: 40px !important;
}

/* Hans Institute — trainee service title fix */

body.page-slug-my-credentials .entry-title,
body.page-slug-digital-transcript .entry-title,
body.page-slug-my-institute-letters .entry-title,
body.page-slug-my-placement-tracker .entry-title,
body.page-slug-my-support-centre .entry-title,
body.page-slug-my-visa-application .entry-title {
    display: none !important;
}

/* HANS INSTITUTE
   Mobile Course Bundle Card Improvements
   Tutor LMS / Astra
*/

@media (max-width: 767px) {

  /* Target cards linking to Tutor LMS bundles */
  .tutor-course-card:has(
    a[href*="/course-bundle/"]
  ) {
    height: auto !important;
    min-height: 0 !important;
  }

  /* Compact card content */
  .tutor-course-card:has(
    a[href*="/course-bundle/"]
  ) .tutor-card-body,
  .tutor-course-card:has(
    a[href*="/course-bundle/"]
  ) .tutor-course-card-body {
    height: auto !important;
    min-height: 0 !important;
    padding: 16px !important;
  }

  /* Display complete titles */
  .tutor-course-card:has(
    a[href*="/course-bundle/"]
  ) .tutor-course-name,
  .tutor-course-card:has(
    a[href*="/course-bundle/"]
  ) .tutor-course-card-title {
    height: auto !important;
    min-height: 0 !important;
    margin-bottom: 12px !important;
    display: block !important;
    overflow: visible !important;
    white-space: normal !important;
    -webkit-line-clamp: unset !important;
  }

  /* Reduce unnecessary metadata spacing */
  .tutor-course-card:has(
    a[href*="/course-bundle/"]
  ) .tutor-course-card-meta,
  .tutor-course-card:has(
    a[href*="/course-bundle/"]
  ) .tutor-course-card-instructors {
    margin-top: 8px !important;
    margin-bottom: 8px !important;
    height: auto !important;
    min-height: 0 !important;
  }

  /* Improve metadata readability */
  .tutor-course-card:has(
    a[href*="/course-bundle/"]
  ) .tutor-course-card-meta {
    font-size: 13px !important;
    line-height: 1.5 !important;
    overflow-wrap: anywhere;
  }

  /* Preserve the pricing and enrolment area */
  .tutor-course-card:has(
    a[href*="/course-bundle/"]
  ) .tutor-card-footer {
    height: auto !important;
    padding: 14px 16px !important;
  }
}


/* ==========================================
   HANS INSTITUTE
   Mobile Manage Cookies Button
   Compact, Accessible and HANS AI Friendly
   ========================================== */

@media only screen and (max-width: 767px) {

  #cmplz-manage-consent button.cmplz-manage-consent {

    /* Position */
    position: fixed !important;
    top: auto !important;
    bottom: 8px !important;
    left: 8px !important;
    right: auto !important;

    /* Compact dimensions */
    width: auto !important;
    max-width: calc(100vw - 100px) !important;
    height: auto !important;
    min-height: 44px !important;

    /* Spacing */
    padding: 8px 10px !important;
    margin: 0 !important;

    /* Appearance */
    background: #07559B !important;
    color: #FFFFFF !important;
    border: 1px solid #07559B !important;
    border-radius: 10px !important;

    /* Text */
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    text-align: center !important;
    white-space: nowrap !important;

    /* Prevent unwanted rotation */
    transform: none !important;

    /* Keep button clickable */
    z-index: 9998 !important;
    cursor: pointer !important;

    /* Subtle shadow */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15) !important;

  }

  /* Focus indicator for accessibility */
  #cmplz-manage-consent button.cmplz-manage-consent:focus-visible {
    outline: 3px solid #F4B400 !important;
    outline-offset: 2px !important;
  }

}


/* ==========================================
   HANS INSTITUTE
   TUTOR LMS MOBILE COOKIE BUTTON FIX
   Keep lesson navigation accessible
   ========================================== */

@media only screen and (max-width: 767px) {

  /* Tutor LMS learning and lesson pages */
  body.single-lesson
  #cmplz-manage-consent button.cmplz-manage-consent,

  body:has(.tutor-course-single-content-wrapper)
  #cmplz-manage-consent button.cmplz-manage-consent {

    /* Move above the bottom lesson toolbar */
    position: fixed !important;
    top: auto !important;
    bottom: 115px !important;
    left: 8px !important;
    right: auto !important;

    /* Compact but touch-friendly */
    width: auto !important;
    max-width: 180px !important;
    min-height: 44px !important;
    padding: 8px 10px !important;

    /* Match Hans Institute styling */
    background: #07559B !important;
    color: #FFFFFF !important;
    border-radius: 10px !important;

    font-size: 11px !important;
    font-weight: 600 !important;

    transform: none !important;
    z-index: 9998 !important;
  }
}

/* ==========================================
   HANS INSTITUTE
   QUIZ RESULTS COOKIE BUTTON FIX
   Mobile Tutor LMS
   ========================================== */

@media only screen and (max-width: 767px) {

  /* Quiz result pages with Continue Lesson footer */
  body:has(.tutor-learning-area-footer)
  #cmplz-manage-consent button.cmplz-manage-consent {

    position: fixed !important;
    top: auto !important;
    bottom: 115px !important;
    left: 8px !important;
    right: auto !important;

    width: auto !important;
    max-width: 160px !important;
    min-height: 44px !important;

    padding: 8px 10px !important;

    background: #07559B !important;
    color: #FFFFFF !important;

    font-size: 11px !important;
    font-weight: 600 !important;
    border-radius: 10px !important;

    transform: none !important;
    z-index: 9998 !important;
  }
}


/* ==========================================
   HANS INSTITUTE
   COMPACT COOKIE CONTROL FOR TUTOR LMS
   Mobile lessons and quizzes
   ========================================== */

@media only screen and (max-width: 767px) {

  body:has(.tutor-course-single-content-wrapper)
  #cmplz-manage-consent button.cmplz-manage-consent,

  body:has(.tutor-learning-area-footer)
  #cmplz-manage-consent button.cmplz-manage-consent {

    position: fixed !important;
    top: auto !important;
    bottom: 115px !important;
    left: 8px !important;
    right: auto !important;

    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;

    padding: 0 !important;
    overflow: hidden !important;

    font-size: 0 !important;
    line-height: 0 !important;

    background: #07559B !important;
    border-radius: 50% !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    z-index: 9998 !important;
  }

  body:has(.tutor-course-single-content-wrapper)
  #cmplz-manage-consent button.cmplz-manage-consent::after,

  body:has(.tutor-learning-area-footer)
  #cmplz-manage-consent button.cmplz-manage-consent::after {

    content: "⚙" !important;
    font-size: 24px !important;
    line-height: 1 !important;
    color: #FFFFFF !important;
  }
}


/* ==========================================
   HANS INSTITUTE
   COMPACT COOKIE CONTROL
   Checkout and Order Confirmation
   Mobile only
   ========================================== */

@media only screen and (max-width: 767px) {

  /* Tutor LMS checkout and order confirmation */
  body.page:has(.tutor-checkout)
  #cmplz-manage-consent button.cmplz-manage-consent,

  body.page:has(.tutor-order-details)
  #cmplz-manage-consent button.cmplz-manage-consent,

  body:has(.tutor-order-confirmation)
  #cmplz-manage-consent button.cmplz-manage-consent,

  /* Actual confirmed checkout content */
  body:has(.tutor-checkout-billing)
  #cmplz-manage-consent button.cmplz-manage-consent {

    position: fixed !important;
    top: auto !important;
    bottom: 85px !important;
    left: 8px !important;
    right: auto !important;

    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;

    padding: 0 !important;
    border-radius: 50% !important;

    font-size: 0 !important;
    line-height: 0 !important;

    background: #07559B !important;
    color: #FFFFFF !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    overflow: hidden !important;
    transform: none !important;
    z-index: 9998 !important;
  }

  body:has(.tutor-checkout)
  #cmplz-manage-consent button.cmplz-manage-consent::after,

  body:has(.tutor-order-details)
  #cmplz-manage-consent button.cmplz-manage-consent::after,

  body:has(.tutor-order-confirmation)
  #cmplz-manage-consent button.cmplz-manage-consent::after,

  body:has(.tutor-checkout-billing)
  #cmplz-manage-consent button.cmplz-manage-consent::after {

    content: "⚙" !important;
    font-size: 24px !important;
    line-height: 1 !important;
    color: #FFFFFF !important;
  }
}


/* HANS INSTITUTE — CHECKOUT COOKIE POSITION */

@media only screen and (max-width: 767px) {

  body:has(.tutor-checkout)
  #cmplz-manage-consent button.cmplz-manage-consent,

  body:has(.tutor-checkout-billing)
  #cmplz-manage-consent button.cmplz-manage-consent,

  body:has(.tutor-order-confirmation)
  #cmplz-manage-consent button.cmplz-manage-consent {

    bottom: 12px !important;
    left: 8px !important;
  }
}


/* ==========================================
   HANS INSTITUTE
   COMPACT HANS AI ON MOBILE CHECKOUT
   ========================================== */

@media only screen and (max-width: 767px) {

  /* Checkout and order confirmation pages */
  body:has(.tutor-checkout) #hans-ai-toggle,
  body:has(.tutor-checkout-billing) #hans-ai-toggle,
  body:has(.tutor-order-confirmation) #hans-ai-toggle,
  body:has(.tutor-order-details) #hans-ai-toggle {

    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;

    height: 48px !important;
    min-height: 48px !important;

    padding: 0 !important;
    border-radius: 50% !important;

    font-size: 0 !important;
    overflow: hidden !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    z-index: 9997 !important;
  }

  /* Display a compact AI label */
  body:has(.tutor-checkout) #hans-ai-toggle::after,
  body:has(.tutor-checkout-billing) #hans-ai-toggle::after,
  body:has(.tutor-order-confirmation) #hans-ai-toggle::after,
  body:has(.tutor-order-details) #hans-ai-toggle::after {

    content: "AI" !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #FFFFFF !important;
  }
}



/* HANS INSTITUTE — STABLE STICKY HEADER */

#masthead {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #0666c5;
}

#masthead .ast-primary-header-bar {
  background: #0666c5;
}

/* Compact mobile branding */
@media (max-width: 921px) {
  #masthead .site-branding img {
    max-height: 72px;
    width: auto;
    object-fit: contain;
  }

  #masthead .site-title {
    font-size: 20px;
    line-height: 1.2;
  }
}

/* Adjust for WordPress toolbar */
body.admin-bar #masthead {
  top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar #masthead {
    top: 46px;
  }
}


/* HANS INSTITUTE — WHITE HEADER TITLE */
#masthead .site-title,
#masthead .site-title a {
    color: #FFFFFF !important;
}


/* HANS INSTITUTE — CIRCULAR COOKIE SETTINGS BUTTON */

@media (max-width: 767px) {

  #cmplz-manage-consent .cmplz-manage-consent,
  .cmplz-manage-consent {
    position: fixed !important;
    left: 12px !important;
    right: auto !important;
    bottom: 16px !important;

    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;

    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;

    font-size: 0 !important;
    line-height: 0 !important;
    text-indent: -9999px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    overflow: hidden !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
  }

  #cmplz-manage-consent .cmplz-manage-consent::before,
  .cmplz-manage-consent::before {
    content: "⚙" !important;
    display: block !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;

    font-size: 28px !important;
    line-height: 1 !important;
    text-indent: 0 !important;
    color: #ffffff !important;
  }
}



/* =========================================
   HANS INSTITUTE
   ROUND HANS AI FLOATING BUTTON
   ALL MOBILE PAGES
   ========================================= */

@media only screen and (max-width: 767px) {

  #hans-ai-toggle {
   width: 48px !important;
min-width: 48px !important;
max-width: 48px !important;


   height: 48px !important;
min-height: 48px !important;
max-height: 48px !important;

    padding: 0 !important;
    border-radius: 50% !important;

    font-size: 0 !important;
    line-height: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    overflow: hidden !important;
    box-sizing: border-box !important;

    /* Keep launcher away from enrol buttons */
    right: 12px !important;
    bottom: 115px !important;

    z-index: 9997 !important;
  }

  #hans-ai-toggle::after {
    content: "✦" !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    color: #ffffff !important;
  }
}
