/* ======= Moodle Courses Home Page ======= */

/* Exposed filters container */
.ui-datepicker {
  font-size: 0.85rem;
}

.ui-datepicker-header {
  background: #1f3c88;
  color: #fff;
  border-radius: 4px;
}

.ui-datepicker-calendar td a {
  padding: 0.35rem;
}

.view-ohsa-courses .views-exposed-form {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  background: #f4f6f8;
  border-radius: 8px;
}

/* Filter items */
.view-ohsa-courses .views-exposed-form .form-item {
  display: flex;
  flex-direction: column;
  min-width: 180px;
}

/* Labels */
.view-ohsa-courses .views-exposed-form label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* Select fields */
.view-ohsa-courses .views-exposed-form select {
  padding: 0.5rem 0.6rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
}

/* Actions wrapper (button stays close) */
.view-ohsa-courses .views-exposed-form .form-actions {
  display: flex;
  align-items: flex-end;
}

/* Apply button */
.view-ohsa-courses .views-exposed-form .form-submit {
  background: #005aa7 !important;
  color: #fff;
  border: none;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  height: 38px; 
}

.view-ohsa-courses .views-exposed-form .form-submit:hover {
  background: #004b8d !important;
}

.page-banner {
  padding: 40px 0;
  background: #f5f5f5;
}

.page-content {
  padding: 60px 0;
}

.page-bottom-space {
  height: 90px; /* gives space before footer */
}

/* Fix sticky button overlap */
.ohsa-course-teaser__footer {
  position: static !important;
}

.ohsa-course-teaser__footer {
  position: sticky;
  bottom: 120px; 
}

/* ======= GRID LAYOUT ======= */

.view-ohsa-courses .view-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 0 1.5rem; 
}

/* CARD */
.view-ohsa-courses .ohsa-course-teaser,
.ohsa-course-card-context .ohsa-course-teaser {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
  background: #fff;
  overflow: hidden;
}

.view-ohsa-courses .ohsa-course-teaser .card__body,
.ohsa-course-card-context .ohsa-course-teaser .card__body {
  flex: 1;
  font-size: 0.92rem;
  padding: 1rem 0.5rem 0.5rem 1rem !important;
}

/* Limit the form container */
.ohsa-course-card-context {
  max-width: 720px;
  margin: 10rem auto;
  padding: 0 1rem; 
}

/* ----- CAPTCHA FORM STYLING ----- */
.ohsa-course-registration-form .col-12 {
  padding-left: 0 !important; 
  padding-right: 0 !important;
}


/* Submit button styling */
.ohsa-course-registration-form input.form-submit {
  width: 100%;
  padding: 0.65rem;
  border-radius: 4px;
  font-size: 1rem;
  margin-top: 1rem;
}

/* FOOTER BUTTON */
/* ===== Social Share Buttons ===== */
.ohsa-course-share {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-top: 1px solid rgba(0,0,0,0.08);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;  
  align-items: center;    
}

.ohsa-course-share .a2a_button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid #005aa7;
  color: #005aa7;
  background: #fff;
  transition: all 0.2s ease;
}

.ohsa-course-share .a2a_button:hover {
  background: #005aa7;
  color: #fff;
}

.block-addtoany {
  margin-top: 1rem;
}

.ohsa-course-card .block-addtoany {
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.ohsa-course-share-label {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.1rem;
    color: #333;
}


.ohsa-course-share .a2a_svg svg path {
  fill: #fff !important;
}

.ohsa-course-share .a2a_kit a {
  display: inline-block !important;
}

.ohsa-course-share--light .a2a_svg svg path {
  fill: #000 !important;
}

.ohsa-course-share--dark .a2a_svg svg path {
  fill: #fff !important;
}

/* Black icons */
.ohsa-course-share .a2a_svg svg path {
  fill: #000 !important;
}

/* Optional: make share text black too */
.ohsa-course-share .a2a_label {
  color: #000 !important;
}

/* ===== Course Card Footer ===== */
.view-ohsa-courses .ohsa-course-teaser__footer .button,
.ohsa-course-card-context .ohsa-course-teaser__footer .button {
  display: block;
  width: 100%;
  background: #005aa7;
  color: #fff !important;
  padding: 0.6rem 1rem;
  font-weight: 600;
  text-align: center;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s ease;
  margin-top: 0.75rem;
}

.view-ohsa-courses .ohsa-course-teaser__footer .button:hover,
.ohsa-course-card-context .ohsa-course-teaser__footer .button:hover {
  background: #004b8d;
}


.view-ohsa-courses .ohsa-course-teaser__footer,
.ohsa-course-card-context .ohsa-course-teaser__footer {
  padding: 1.5rem 1.5rem 1.25rem; 
}


/* ===== Course Meta Info ===== */  
.view-ohsa-courses .ohsa-course-meta{
  margin-top: 0.75rem;
}

.view-ohsa-courses .ohsa-course-meta > div,
.ohsa-course-card-context .ohsa-course-meta > div {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: baseline;
}

.view-ohsa-courses .ohsa-course-meta > div > div:first-child {
  font-weight: 600;
  min-width: 120px;
}

.view-ohsa-courses .ohsa-course-description > div > div:first-child {
  margin-bottom: 1rem;
}

.view-ohsa-courses .ohsa-course-meta > div > div:last-child,
.view-ohsa-courses .ohsa-course-meta > div > div:last-child * {
  font-weight: 400;
  display: inline;
}

/* ============================= */
/* COURSE REGISTRATION FORM CARD */
/* ============================= */

.ohsa-course-registration-form { 
  padding: 2rem 2.25rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
  max-width: 520px;
  margin: 10rem auto 4rem; 
  padding: 2rem 2.25rem;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Success confirmation block */
.ohsa-registration-success {
  background: #e6f4ea;
  border: 1px solid #b7e1c1;
  color: #1e4620;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
}

.ohsa-registration-success h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* ============================= */
/* FORM LAYOUT */
/* ============================= */

/* First + Last name side by side */
.ohsa-course-registration-form .form-item-first-name,
.ohsa-course-registration-form .form-item-last-name {
  grid-column: span 1;
}

.ohsa-course-registration-form .form-item-last-name {
  padding-top: 0.6rem;
}


.ohsa-course-registration-form .form-item-email {
  clear: both;
   grid-column: 1 / -1;
   padding-top: 0.6rem;
}

/* Submit button */
.ohsa-course-registration-form .form-submit {
  width: 100%;
  margin-top: 1.25rem;
  background: #005aa7;
  color: #fff;
  font-weight: 600;
}

/* ============================= */
/* LABELS & INPUTS */
/* ============================= */

.ohsa-course-registration-form label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  display: block;
}

.ohsa-course-registration-form input.form-text,
.ohsa-course-registration-form input.form-email {
  width: 100%;
  padding: 0.55rem 0.65rem;
  font-size: 0.95rem;
  border-radius: 4px;
  border: 1px solid #ccc;
}

/* ============================= */
/* SUBMIT BUTTON */
/* ============================= */

.ohsa-course-registration-form .form-submit {
  grid-column: 1 / -1;
  margin-top: 1.25rem;
  background: #005aa7; 
  color: #fff;
  border: none;
  padding: 0.7rem 1.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ohsa-course-registration-form .form-submit:hover {
  background: #004b8d;
}

/* Messages inside registration card */
.ohsa-course-registration-form .ohsa-form-messages {
  margin-bottom: 1.5rem;
}

.ohsa-course-registration-form .messages {
  padding: 1rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.ohsa-course-registration-form .messages--status {
  background: #e6f4ea;
  border: 1px solid #b7dfc2;
  color: #1e6f3d;
}

.ohsa-course-registration-form .messages--error {
  background: #fdecea;
  border: 1px solid #f5c2c0;
  color: #842029;
}

/* ===============================
   COURSE REGISTRATION MESSAGES
   =============================== */

.ohsa-course-registration-form [data-drupal-messages] {
  margin-bottom: 1.25rem;
}

/* Base message card */
.ohsa-course-registration-form [role="contentinfo"],
.ohsa-course-registration-form [role="alert"] {
  border-radius: 6px;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: 0.95rem;
}

/* Remove default list styling */
.ohsa-course-registration-form [role] ul {
  margin: 0;
  padding-left: 1.25rem;
}

/* SUCCESS */
.ohsa-course-registration-form [role="contentinfo"] {
  background: #e6f4ea;
  border: 1px solid #b7e1c1;
  color: #1e4620;
}

/* ERROR */
.ohsa-course-registration-form [role="alert"] {
  background: #fdecea;
  border: 1px solid #f5c6cb;
  color: #842029;
}

/* Optional: spacing between multiple messages */
.ohsa-course-registration-form [role] li + li {
  margin-top: 0.35rem;
}


/* ===============================
   PAGER
   =============================== */
   
/* Pager wrapper */
nav[aria-labelledby="pagination-heading"] {
  margin: 2rem 0 1.5rem;
}

/* Pager list */
.js-pager__items {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

/* Pager items */
.js-pager__items li {
  font-size: 0.9rem;
  color: #555;
}

/* Pager links */
.js-pager__items a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.75rem;
  border-radius: 4px;
  background-color: #005aa7;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Hover + focus */
.js-pager__items a:hover,
.js-pager__items a:focus {
  background-color: #004b8d;
  color: #fff;
}

/* Current page text (non-link) */
.js-pager__items li:not(:has(a)) {
  padding: 0 0.5rem;
  font-weight: 600;
  color: #111;
}

/* Arrows spacing */
.js-pager__items a span[aria-hidden="true"] {
  font-size: 1.2rem;
  line-height: 1;
}


/* ===== Mobile Responsive Adjustments ===== */

@media (max-width: 1200px) {
  .view-ohsa-courses .view-content {
    grid-template-columns: repeat(3, 1fr);
  }
   .view-ohsa-courses .views-exposed-form {
    flex-wrap: wrap;
  }
  .view-ohsa-courses .views-exposed-form .form-item,
  .view-ohsa-courses .views-exposed-form .form-actions {
    width: 100%;
  }
  .view-ohsa-courses .views-exposed-form .form-submit {
    width: 100%;
  }
}

@media (max-width: 1000px) {
  .view-ohsa-courses .view-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 800px) {
  .view-ohsa-courses .view-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .ohsa-course-registration-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .ohsa-course-card-context {
    margin: 5rem auto; 
  }

  .form-item-captcha-response label {
    font-size: 0.8rem; 
  }

  .form-item-captcha-response input.form-text {
    font-size: 0.9rem;
    padding: 0.5rem 0.55rem;
  }

  .form-item-captcha-response .description {
    font-size: 0.7rem;
  }

  .ohsa-course-registration-form input.form-submit {
    font-size: 0.95rem;
    padding: 0.55rem;
  }
}
