/* =====================================================================
   Infologicsoft responsive layer
   ---------------------------------------------------------------------
   Loaded after main.css on every page. Holds the mobile / tablet layout
   fixes and polish layered on top of the EduAll template, so main.css
   stays untouched.

   Hook classes added in the page markup and used here:
     .course-hero        breadcrumb hero on course pages
     .course-details     tabs + content + sidebar section on course pages
     .related-courses    related courses section on course pages
     .course-highlights  course shortcut tiles under the home hero
     .contact-section    contact details + form on contact-us.html
     .contact-map        map block on contact-us.html
     .mobile-action-bar  sticky Call / Enquire bar (phones + tablets)

   Breakpoints follow Bootstrap 5: 576 / 768 / 992 / 1200.
   ===================================================================== */

:root {
  --ils-blue: var(--main-600);        /* brand blue  hsl(207 43% 45%) */
  --ils-blue-mist: var(--main-50);    /* tinted surface */
  --ils-navy: var(--main-two-600);    /* footer, action bar */
  --ils-ink: #1f2a37;                 /* headings on light surfaces */
  --ils-slate: #566273;               /* body copy: 6.3:1 on white (template grey is 2.7:1) */
  --ils-line: hsl(207 32% 88%);
  --ils-bar-h: 66px;
}

/* ---------------------------------------------------------------------
   1. Quality floor: keyboard focus, reduced motion, phone gutters
   --------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--ils-blue);
  outline-offset: 2px;
}

/* "Skip to main content": hidden until focused with the keyboard (Bootstrap's
   .visually-hidden-focusable), then shown above the preloader */
.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100000;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--ils-navy);
  background-color: #fff;
  box-shadow: 0 4px 16px rgb(16 23 31 / 0.2);
}

/* width/height attributes are added to images (tools/apply_seo.py) so the browser can
   reserve space; this keeps the aspect ratio wherever CSS sets only the width.
   :where() has zero specificity, so any existing class that sets a height still wins. */
:where(img[width][height]) {
  height: auto;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 575.98px) {
  .container,
  .container-fluid {
    padding-inline: 1rem;
  }
}

/* ---------------------------------------------------------------------
   2. Header + mobile menu
   --------------------------------------------------------------------- */
.mobile-menu .close-button {
  width: 40px;
  height: 40px;
  font-size: 1.25rem;
  color: var(--ils-navy);
  background-color: var(--ils-blue-mist);
}

.mobile-menu .close-button:hover {
  color: #fff;
  background-color: var(--ils-navy);
}

/* ---------------------------------------------------------------------
   3. Course pages
   --------------------------------------------------------------------- */

/* 3a. Hero */
.course-hero p.text-neutral-300 {
  color: var(--ils-slate);
  line-height: 1.65;
}

/* trainer / rating / mode row was a pale grey on a light wash */
.course-hero .text-neutral-100 {
  color: var(--ils-slate);
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  /* keep the intro clear of the overlapping course card */
  .course-hero .max-w-650-px {
    max-width: 60%;
  }
}

@media (max-width: 575.98px) {
  .course-hero {
    padding-block: 32px 28px;
  }

  .course-hero h1 {
    font-size: 1.625rem;
    line-height: 1.25;
  }

  .course-hero p.text-neutral-300 {
    font-size: 1rem;
  }

  .course-hero .tw-h-px {
    margin-block: 20px 16px;
  }

  /* the dot separators strand at line ends once the row wraps */
  .course-hero .tw-w-1.rounded-circle {
    display: none;
  }

  .course-hero .tw-gap-4.flex-wrap {
    gap: 8px 18px;
  }
}

/* 3b. Tabs */
.course-details #nav-tab {
  gap: 8px;
}

.course-details #nav-tab .nav-link {
  padding: 8px 20px;
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  /* one segmented control instead of three wrapping ovals */
  .course-details #nav-tab {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background-color: var(--ils-blue-mist);
  }

  .course-details #nav-tab .nav-link {
    padding: 10px 4px;
    font-size: 0.875rem;
    line-height: 1.2;
    white-space: normal;
    background-color: transparent;
    border-color: transparent !important;
  }

  .course-details #nav-tab .nav-link.active {
    background-color: var(--ils-blue) !important;
  }

  .course-details nav > span {
    margin-top: 16px;
  }
}

/* 3c. Readable body copy (template grey fails contrast) */
.course-details .text-neutral-300 {
  color: var(--ils-slate);
}

.course-details #nav-tabContent p {
  line-height: 1.7;
}

@media (max-width: 575.98px) {
  .course-details #nav-tabContent p {
    font-size: 1rem;
  }

  .course-details #nav-tabContent h2 {
    font-size: 1.25rem;
    line-height: 1.3;
  }
}

/* 3d. "What you'll learn" checklist: icon pinned to the first line */
.course-details #nav-course .tw-gap-2.d-flex {
  align-items: flex-start !important;
}

.course-details #nav-course .tw-gap-2.d-flex > .tw-text-6 {
  font-size: 1.25rem;
  line-height: 1.6;
}

.course-details #nav-course .tw-gap-2.d-flex > span:last-child {
  line-height: 1.6;
}

@media (max-width: 575.98px) {
  .course-details #nav-course .tw-gap-2.d-flex > span:last-child {
    font-size: 1rem;
  }

  .course-details #nav-course .justify-content-between.flex-wrap {
    gap: 16px !important;
  }
}

/* 3e. Who can join / career / support cards */
.course-details .bg-neutral-05.tw-rounded-xl {
  background-color: var(--ils-blue-mist) !important;
  border: 1px solid var(--ils-line);
}

.course-details .bg-neutral-05.tw-rounded-xl h3 {
  font-size: 1.125rem;
  color: var(--ils-ink);
}

.course-details .bg-neutral-05.tw-rounded-xl li {
  position: relative;
  padding-inline-start: 18px;
  font-size: 1rem;
  line-height: 1.5;
}

.course-details .bg-neutral-05.tw-rounded-xl li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--ils-blue);
}

@media (max-width: 575.98px) {
  .course-details .bg-neutral-05.tw-rounded-xl {
    padding: 20px;
  }
}

/* 3f. Curriculum: topic rows with a pill for the session type */
.course-details .accordion-button-three {
  line-height: 1.4;
}

.course-details .accordion-body {
  padding: 12px 20px 8px;
}

.course-details .accordion-body > div > div {
  gap: 8px 16px;
  margin: 0;
  padding-block: 12px;
  flex-wrap: nowrap !important;
  align-items: flex-start !important;
  border-bottom: 1px solid rgb(255 255 255 / 0.16);
}

.course-details .accordion-body > div > div:last-child {
  border-bottom: 0;
}

.course-details .accordion-body > div > div > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
  align-items: flex-start !important;
  line-height: 1.5;
}

.course-details .accordion-body > div > div > div:first-child > span:first-child {
  line-height: 1.5;
  flex-shrink: 0;
}

.course-details .accordion-body > div > div > div:last-child span {
  display: inline-block;
  padding: 5px 11px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 999px;
  color: #fff !important;
  background-color: rgb(255 255 255 / 0.16);
}

@media (max-width: 575.98px) {
  .course-details .accordion-button-three {
    padding-inline-start: 44px;
    font-size: 1rem;
  }

  .course-details .accordion-body {
    padding: 8px 16px 4px;
  }

  .course-details .accordion-body > div > div {
    flex-direction: column;
    gap: 8px;
  }

  .course-details .accordion-body > div > div > div:first-child span {
    font-size: 1rem;
  }

  /* line the pill up with the topic text, not the icon */
  .course-details .accordion-body > div > div > div:last-child {
    margin-inline-start: 26px;
  }
}

/* 3f-2. Optional course sections (rendered only when a course has the data):
   curriculum phases, tools, projects, FAQ */
.course-phase {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 32px 0 14px;
  font-family: var(--heading-font);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ils-ink);
}

.course-phase:first-child {
  margin-top: 0;
}

.course-phase span {
  font-family: var(--body-font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ils-slate);
}

.course-tools li {
  padding: 7px 14px;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ils-ink);
  background-color: #fff;
  border: 1px solid var(--ils-line);
  border-radius: 999px;
}

.course-details #nav-tabContent .course-projects__stack {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ils-blue);
}

/* question buttons sit in an h3; the template's large h3 line box left a
   blue sliver of the panel showing above each question */
.course-faq h3 {
  display: flex;
}

.course-faq .accordion-body {
  padding: 16px 20px 18px;
}

.course-faq .accordion-body p {
  line-height: 1.7;
  color: #fff;
}

@media (max-width: 575.98px) {
  .course-faq {
    margin-top: 40px;
  }

  .course-tools li {
    padding: 6px 12px;
    font-size: 0.875rem;
  }

  .course-faq .accordion-body {
    padding: 14px 16px 16px;
  }
}

/* 3g. Course card (sidebar) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .course-details-card .tw-py-7.tw-px-7 {
    padding: 22px 20px;
  }

  .course-details-card .justify-content-between.flex-wrap {
    flex-wrap: nowrap !important;
  }

  .course-details-card .justify-content-between span.tw-text-405,
  .course-details-card .justify-content-between h2.tw-text-405 {
    font-size: 0.9375rem;
    white-space: nowrap;
  }

  .course-details-card ul .tw-w-14 {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 991.98px) {
  .course-details-card .img-box-overlay img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  /* thumbnail beside the facts instead of a full-width banner */
  .course-details-card > .bg-white {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
  }

  .course-details-card .img-box-overlay {
    margin: 24px 0 24px 24px;
    border-radius: 12px;
    overflow: hidden;
  }
}

@media (max-width: 575.98px) {
  .course-details-card .tw-py-7.tw-px-7 {
    padding: 20px;
  }

  .course-details-card .tw-h-px.bg-gray-40 {
    margin-block: 14px;
  }
}

/* 3h. Related courses: swipeable row below desktop */
@media (max-width: 991.98px) {
  .related-courses {
    padding-block: 56px;
  }

  .related-courses .tw-mb-15 {
    margin-bottom: 24px;
  }

  .related-courses .row {
    --bs-gutter-y: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-block: 8px 28px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .related-courses .row::-webkit-scrollbar {
    display: none;
  }

  .related-courses .row > [class*="col-"] {
    flex: 0 0 82%;
    max-width: 82%;
    scroll-snap-align: start;
  }

  .related-courses .course-img-box {
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  .related-courses .row > [class*="col-"] {
    flex-basis: 46%;
    max-width: 46%;
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  /* three across instead of two plus an orphan */
  .related-courses .row > .col-lg-6 {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
  }
}

/* ---------------------------------------------------------------------
   4. Sticky Call / Enquire bar (below 992px)
   --------------------------------------------------------------------- */
.mobile-action-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background-color: var(--ils-navy);
  box-shadow: 0 -8px 24px rgb(16 23 31 / 0.18);
}

@media (min-width: 576px) {
  /* tablets: keep the two buttons a comfortable width, centred */
  .mobile-action-bar {
    padding-inline: max(16px, calc((100% - 560px) / 2));
  }
}

.mobile-action-bar__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mobile-action-bar__btn i {
  font-size: 1.25rem;
}

.mobile-action-bar__btn--call {
  border: 1px solid rgb(255 255 255 / 0.35);
}

.mobile-action-bar__btn--call:hover {
  color: #fff;
  border-color: #fff;
}

.mobile-action-bar__btn--enquire {
  background-color: var(--ils-blue);
}

.mobile-action-bar__btn--enquire:hover {
  color: #fff;
  background-color: hsl(207 43% 38%);
}

.mobile-action-bar__btn:focus-visible {
  outline-color: #fff;
}

@media (max-width: 991.98px) {
  /* keep the footer's last line above the bar; padding the copyright strip
     (not body) keeps the colour running to the bottom edge */
  body:has(.mobile-action-bar) footer > .bg-main-600:last-child {
    padding-bottom: calc(12px + var(--ils-bar-h) + env(safe-area-inset-bottom));
  }
}

/* ---------------------------------------------------------------------
   5. Home page
   --------------------------------------------------------------------- */
@media (max-width: 575.98px) {
  /* 5a. Course shortcut tiles: 2 x 3 grid instead of six full-width rows */
  .course-highlights {
    padding-inline: 1rem;
  }

  .course-highlights > .row {
    --bs-gutter-x: 12px;
    --bs-gutter-y: 12px;
  }

  .course-highlights > .row > [class*="col-"] {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .course-highlights .animation-item {
    height: 100%;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 18px 10px;
    text-align: center;
  }

  .course-highlights .animation-item img {
    width: 44px;
    height: 44px;
    object-fit: contain;
  }

  .course-highlights .animation-item span {
    font-size: 1rem;
  }

  /* 5b. Course list: compact horizontal cards (16 cards ~9,000px -> ~3,500px) */
  .infologic-course-card.my-courses {
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    gap: 14px;
    padding: 12px;
  }

  .infologic-course-card .infologic-course-img {
    width: 96px;
    min-width: 96px;
    height: 96px;
    border-radius: 12px;
  }

  .infologic-course-card .infologic-course-img::before {
    background: rgb(0 0 0 / 0.12);
  }

  .infologic-course-card.my-courses > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .infologic-course-card.my-courses h2 {
    order: -1;
    margin-bottom: 6px;
    font-size: 1.0625rem;
    line-height: 1.3;
  }

  .infologic-course-card.my-courses h2 a {
    margin-bottom: 0;
  }

  .infologic-course-card.my-courses > div > div:first-child {
    margin-bottom: 6px;
  }

  .infologic-course-card.my-courses > div > div:first-child li {
    font-size: 0.875rem;
  }

  .infologic-course-card.my-courses > div > div:first-child > span {
    font-size: 0.875rem;
  }

  .infologic-course-card.my-courses p {
    margin-bottom: 10px;
    font-size: 0.9375rem;
  }

  /* "Practical Training / Career Guidance" repeats on every card */
  .infologic-course-card.my-courses > div > div.tw-mb-4:not(:first-child) {
    display: none !important;
  }

  .infologic-course-card.my-courses .btn {
    padding: 8px 18px;
  }

  /* 5c. Feature boxes: 2 x 2 */
  .row > [class*="col-"]:has(> .feature-item) {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .feature-item.tw-py-15 {
    height: 100%;
    padding: 28px 12px;
  }

  .feature-item img {
    width: 52px;
    margin-bottom: 14px;
  }

  .feature-item h2 {
    margin-bottom: 8px;
    font-size: 1.0625rem;
  }

  .feature-item p {
    margin-bottom: 12px;
    font-size: 0.875rem;
  }

  .feature-item a {
    font-size: 0.875rem;
  }
}

/* ---------------------------------------------------------------------
   6. Contact page
   --------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .contact-section .tw-ms-15 {
    margin-inline-start: 0;
  }
}

@media (max-width: 575.98px) {
  .contact-section {
    padding-block: 48px;
  }

  .contact-section h2.h4 {
    margin-bottom: 32px;
  }

  .contact-section .tw-mb-10 {
    margin-bottom: 24px;
  }

  .contact-map {
    height: 320px;
  }
}

/* ---------------------------------------------------------------------
   7. Footer
   --------------------------------------------------------------------- */
@media (max-width: 575.98px) {
  footer .py-100 {
    padding-block: 48px 32px;
  }

  /* Courses + Useful links side by side */
  footer .py-100 > .row > :nth-child(2),
  footer .py-100 > .row > :nth-child(3) {
    flex: 0 0 50%;
    max-width: 50%;
  }

  footer .py-100 h2.h5 + span {
    margin-bottom: 20px;
  }

  footer .py-100 ul.tw-gap-6 {
    gap: 14px;
  }
}

/* ---------------------------------------------------------------------
   8. Logo clarity
   main.css sizes the logo to 54px tall (img[src$="infologic-logo.png"]).
   High-density screens get sharper 2x/3x files through srcset (see
   tools/brand_assets.mjs "logo"). In the dark footer the blue logo and grey
   tagline had too little contrast, so it sits on a white rounded panel.
   --------------------------------------------------------------------- */
footer img[src*="infologic-logo"] {
  box-sizing: content-box;
  padding: 10px 14px;
  border-radius: 12px;
  background-color: #fff;
}

/* footer decorative shapes are absolutely positioned, so they painted over the
   logo and links; keep them behind the footer content */
footer > .container {
  position: relative;
  z-index: 1;
}

/* ---------------------------------------------------------------------
   9. In-page links and enquiry forms
   --------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;   /* reduced-motion users get instant jumps (section 1) */
}

/* sections reached from menu/buttons: stop below the sticky header */
#courses,
#about,
#why-us,
#enquiry {
  scroll-margin-top: 110px;
}

/* course dropdown styled like the text fields next to it */
.enquiry-select {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  padding-inline-end: 46px !important;
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%23566273' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* home "Online Registration" form: its text fields are white boxes, so match them */
.enquiry-select--light {
  background-color: #fff;
}

/* typed text readable in every enquiry field; the unselected course prompt
   looks like the other fields' placeholders */
[data-enquiry-form] input,
[data-enquiry-form] select,
[data-enquiry-form] textarea {
  color: var(--ils-ink);
}

[data-enquiry-form] .enquiry-select:has(option[value=""]:checked) {
  color: #757b85;
}

.enquiry-select option {
  color: var(--ils-ink);
  background-color: #fff;
}

.form-status {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.form-status[data-state="sending"] {
  color: var(--ils-ink);
  background-color: var(--ils-blue-mist);
}

.form-status[data-state="sent"] {
  color: #135a2c;
  background-color: #e5f5ea;
}

.form-status[data-state="error"] {
  color: #8a1c12;
  background-color: #fdecea;
}

.form-note {
  margin: 12px 0 0;
  font-size: 0.875rem;
  color: var(--ils-slate);
}

.form-note--on-dark {
  color: rgb(255 255 255 / 0.8);
}

button[aria-busy="true"] {
  cursor: progress;
  opacity: 0.85;
}
