/* Custom styles for Astro migration */

/* Smooth in-page scrolling for anchor links */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Spacing below navigation */
.fusion-secondary-main-menu {
  margin-bottom: 40px;
}

/* Sticky menu styles */
.fusion-sticky-menu {
  margin-bottom: 0 !important;
  height: 60px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e0e0e0;
  overflow: visible;
}

/* Desktop dropdown behaviour for About Us and other items */
.fusion-secondary-main-menu .fusion-main-menu .fusion-menu > li.menu-item-has-children {
  position: relative;
}

.fusion-secondary-main-menu .fusion-main-menu .fusion-menu > li.menu-item-has-children > .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  visibility: hidden;
  opacity: 0;
  z-index: 10001;
  transition: opacity 0.2s ease-in;
}

.fusion-secondary-main-menu .fusion-main-menu .fusion-menu > li.menu-item-has-children:hover > .sub-menu,
.fusion-secondary-main-menu .fusion-main-menu .fusion-menu > li.menu-item-has-children:focus-within > .sub-menu {
  visibility: visible;
  opacity: 1;
}

/* Green bar should be flush with top in sticky menu */
.fusion-sticky-menu .fusion-menu > li.current-menu-item > a::before,
.fusion-sticky-menu .fusion-menu > li.current_page_item > a::before {
  top: -8px;
}

/* Active menu item green bar highlight */
.fusion-main-menu .fusion-menu > li.current-menu-item > a,
.fusion-main-menu .fusion-menu > li.current_page_item > a {
  position: relative;
  color: #65bc7b !important; /* Green text color for active menu item */
}

.fusion-main-menu .fusion-menu > li.current-menu-item > a .menu-text,
.fusion-main-menu .fusion-menu > li.current_page_item > a .menu-text {
  color: #65bc7b !important; /* Green text color for active menu item */
}

.fusion-main-menu .fusion-menu > li.current-menu-item > a::before,
.fusion-main-menu .fusion-menu > li.current_page_item > a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: #65bc7b; /* Green color for active menu item */
}

/* Hover effect - green line at top */
.fusion-main-menu .fusion-menu > li > a,
.fusion-sticky-menu .fusion-menu > li > a {
  position: relative;
}

.fusion-main-menu .fusion-menu > li > a:hover::before,
.fusion-sticky-menu .fusion-menu > li > a:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: #65bc7b;
}

/* Hover effect in sticky menu - flush with top */
.fusion-sticky-menu .fusion-menu > li > a:hover::before {
  top: -8px;
}

/* Accordion/Toggle functionality */
.panel-collapse.collapse {
  display: none;
}

.panel-collapse.in {
  display: block;
}

.panel-collapse {
  overflow: hidden;
}

/* Smooth transitions for accordion */
.panel-collapse.collapsing {
  position: relative;
  height: 0;
  overflow: hidden;
  transition: height 0.3s ease-in-out;
}

/* Toggle icons: show minus when expanded, plus when collapsed */
.panel-title.toggle a .fusion-toggle-icon-wrapper { display: inline-flex; align-items: center; }
.panel-title.toggle a[aria-expanded="true"] .fusion-toggle-icon-wrapper { display: inline-flex !important; }

.panel-title.toggle a .active-icon { display: none; }
.panel-title.toggle a[aria-expanded="true"] .active-icon { display: inline-block !important; }
.panel-title.toggle a[aria-expanded="false"] .active-icon { display: none !important; }
.panel-title.toggle a[aria-expanded="true"] .inactive-icon { display: none !important; }
.panel-title.toggle a[aria-expanded="false"] .inactive-icon { display: inline-block !important; }

/* Scroll to top button */
.to-top-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
}

.no-mobile-totop .to-top-container {
  display: block;
}

.fusion-top-top-link {
  display: none;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background-color: #4a4a4a;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

.fusion-top-top-link::before {
  content: '';
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 9px solid currentColor;
  transform: translateY(1px);
}

.fusion-top-top-link:hover,
.fusion-top-top-link:focus {
  background-color: #65bc7b;
}

.fusion-top-top-link:focus-visible {
  outline: 3px solid rgba(101, 188, 123, 0.5);
  outline-offset: 2px;
}

.fusion-top-top-link.fusion-to-top-active {
  display: flex;
}

@media (max-width: 767px) {
  .to-top-container {
    right: 16px;
    bottom: 16px;
  }

  .fusion-top-top-link {
    width: 44px;
    height: 44px;
  }
}

#toTop::before {
  content: "" !important;
  /* display: none !important; */
}

/* Offset About Us sections so headings are visible below sticky header */
#presentationen,
#missionen,
#teamen,
#partnersen,
#presentationfr,
#missionfr,
#equipefr,
#partenairesfr {
  scroll-margin-top: 52px;
}

@media screen and (min-width: 896px) {
  #presentationen,
  #missionen,
  #teamen,
  #partnersen,
  #presentationfr,
  #missionfr,
  #equipefr,
  #partenairesfr {
    scroll-margin-top: 90px;
  }
}

/* Login page */
.login-page {
  position: relative;
  min-height: 100vh;
  width: 100vw;
  max-width: 100vw;
  padding: 40px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background-color: #f4f6fb;
  box-sizing: border-box;
}

.login-page__background {
  display: none;
}

.login-page__inner {
  width: 100%;
  max-width: 540px;
}

.login-card {
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24);
  padding: 28px 32px 24px;
}

.login-card__logo {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.login-card__logo img {
  max-width: 190px;
  height: auto;
}

.login-card__title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  color: #1f2430;
  text-align: center;
}

.login-card__subtitle {
  margin: 0 0 24px;
  font-size: 15px;
  color: #4a4a4a;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form__field {
  display: flex;
  flex-direction: column;
}

.login-form__label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.login-form label {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}

.login-form input[type='text'],
.login-form input[type='email'],
.login-form input[type='password'] {
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  padding: 10px 12px !important;
  font-size: 15px;
  line-height: 1.4;
  background-color: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  box-sizing: border-box;
}

.login-form input:focus {
  outline: none;
  border-color: #27368b;
  box-shadow: 0 0 0 3px rgba(39, 54, 139, 0.16);
}

.login-form__forgot-link {
  font-size: 13px;
  color: #27368b;
  text-decoration: none;
}

.login-form__forgot-link:hover,
.login-form__forgot-link:focus {
  text-decoration: underline;
}

.login-form__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.login-form__remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #111827;
}

.login-form__remember input[type='checkbox'] {
  width: 16px;
  height: 16px;
}

.login-form__submit {
  margin-top: 8px;
  width: 100%;
  border: none;
  border-radius: 999px;
  background-color: #0085ba;
  background-image: none;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 11px 20px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.28);
}

.login-form__submit:hover,
.login-form__submit:focus {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.32);
}

.login-card__help {
  margin-top: 16px;
  margin-bottom: 0;
  font-size: 13px;
  color: #4b5563;
}

.login-card__meta {
  margin-top: 16px;
}

/* Minimal login shell body */
html.login-shell-html,
html.login-shell-html body.login-shell {
  background-color: #f4f6fb !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  overflow-x: hidden !important;
}

html.login-shell-html body.login-shell {
  min-height: 100vh;
}

html.login-shell-html body.login-shell .login-shell-main {
  width: 100vw !important;
  max-width: 100vw !important;
  min-height: 100vh;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f4f6fb;
}

html.login-shell-html body.login-shell .login-shell-main > .login-page {
  width: 100vw !important;
  max-width: 100vw !important;
}

.login-card__back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: #27368b;
  text-decoration: none;
}

.login-card__back-link:hover,
.login-card__back-link:focus {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .login-page {
    padding: 24px 12px 32px;
  }

  .login-card {
    padding: 24px 20px 24px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
  }

  .login-card__title {
    font-size: 24px;
  }
}

/* Minimal Font Awesome support for checklist icons on Material pages */
@font-face {
  font-family: 'Font Awesome 5 Free';
  font-style: normal;
  font-weight: 900;
  font-display: block;
  src: url('/fonts/fa-solid-900.woff2') format('woff2'),
       url('/fonts/fa-solid-900.woff') format('woff'),
       url('/fonts/fa-solid-900.ttf') format('truetype');
}

.fas,
.fusion-li-icon {
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
}

.fusion-checklist .fusion-li-icon {
  font-size: 1.2em;
  color: #27368b;
  margin-right: 12px;
}

.fusion-li-icon.fa-file-pdf::before {
  content: "\f1c1";
}

.fusion-li-icon.fa-file-alt::before {
  content: "\f15c";
}

.fusion-li-icon.fa-address-card::before {
  content: "\f2bb";
}

.fusion-li-icon.fa-bookmark::before {
  content: "\f02e";
}

.fusion-li-icon.fa-book-open::before {
  content: "\f518";
}

.fusion-li-icon.fa-video::before {
  content: "\f03d";
}

/* Shared styling for resources tables (portal admin + Materials database) */
.resources-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.resources-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.resources-table th,
.resources-table td {
  padding: 0.75rem 1.25rem;
  border: 1px solid #ccc;
  text-align: left;
  vertical-align: middle;
}

.resources-table th {
  background: #f0f0f0;
  font-weight: 600;
  white-space: nowrap;
}

/* Ensure header shading on Materials tables matches the portal admin tables */
.resources-table thead th {
  background-color: #f0f0f0 !important;
}

/* Center-align compact / meta columns */
.resources-table th:nth-child(1),
.resources-table td:nth-child(1),
.resources-table th:nth-child(2),
.resources-table td:nth-child(2),
.resources-table th:nth-child(5),
.resources-table td:nth-child(5),
.resources-table th:nth-child(6),
.resources-table td:nth-child(6),
.resources-table th:nth-child(7),
.resources-table td:nth-child(7),
.resources-table th:nth-child(8),
.resources-table td:nth-child(8),
.resources-table th:nth-child(9),
.resources-table td:nth-child(9) {
  text-align: center;
}

/* Subtle row striping for readability */
.resources-table tbody tr:nth-child(odd) {
  background: #fafafa;
}

.resources-table-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.resources-table-controls,
.resources-table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.resources-table-footer {
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 1rem 0;
  border-top: 1px solid #e2e8f0;
  margin-top: 0.5rem;
}

.resources-table-controls label select {
  margin: 0 0.5rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  background: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.resources-table-controls label select:hover {
  border-color: #cbd5e0;
}

.resources-table-controls label select:focus {
  outline: none;
  border-color: #27368b;
  box-shadow: 0 0 0 3px rgba(39, 54, 139, 0.1);
}

.resources-table-info {
  font-size: 0.875rem;
  color: #616161;
  font-weight: 400;
}

/* Modern pagination styling - clean minimal design */
.resources-table-pagination {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
  padding: 0.5rem 0;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

.resources-table-pagination button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-right: 1px solid #e0e0e0;
  background: transparent;
  color: #757575;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 400;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.resources-table-pagination button:last-child {
  border-right: none;
}

/* Arrow navigation buttons */
.resources-table-pagination button.pagination-nav {
  color: #9e9e9e;
  font-size: 1.125rem;
}

.resources-table-pagination button.pagination-nav:hover:not([disabled]) {
  background: #f5f5f5;
  color: #616161;
}

/* Number buttons hover state */
.resources-table-pagination button:hover:not([disabled]):not(.is-current) {
  background: #f5f5f5;
  color: #424242;
}

/* Current page styling */
.resources-table-pagination button.is-current {
  background: #e0e0e0;
  color: #424242;
  font-weight: 500;
}

/* Disabled state */
.resources-table-pagination button[disabled] {
  color: #bdbdbd;
  cursor: not-allowed;
}

.resources-table-pagination button[disabled]:hover {
  background: transparent;
}

/* Focus states for accessibility */
.resources-table-pagination button:focus-visible {
  outline: 2px solid #27368b;
  outline-offset: -2px;
  z-index: 1;
}

/* Ellipsis styling */
.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  border-right: 1px solid #e0e0e0;
  color: #9e9e9e;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
}

/* Materials page: enforce stable column widths and wrapping */
#resources-results-en .resources-table,
#resources-results-fr .resources-table {
  table-layout: fixed;
}

#resources-results-en .resources-table th:nth-child(1),
#resources-results-fr .resources-table th:nth-child(1) {
  width: 6%;
}

#resources-results-en .resources-table__description,
#resources-results-fr .resources-table__description {
  width: 54%;
  white-space: normal;
}

#resources-results-en .resources-table__url,
#resources-results-fr .resources-table__url {
  width: 40%;
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* Resources filter form styling (Materials page) - matches portal add-resource section */
form.resources-filter {
  margin: 1.5rem 0 !important;
  padding: 1.5rem !important;
  background: #e8f5e9 !important;
  border-radius: 8px !important;
  border: none !important;
}

form.resources-filter .resources-filter__group {
  margin-bottom: 1rem !important;
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
}

form.resources-filter .resources-filter__group:last-of-type {
  margin-bottom: 1.25rem !important;
}

form.resources-filter .resources-filter__group > label:first-child {
  display: block !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: #1f2937 !important;
  margin-bottom: 0.5rem !important;
}

form.resources-filter .resources-filter__group legend {
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: #1f2937 !important;
  padding: 0 !important;
  margin-bottom: 0.5rem !important;
  float: none !important;
  width: auto !important;
}

form.resources-filter fieldset.resources-filter__group {
  border: none !important;
  padding: 0 !important;
  margin: 0 0 1rem 0 !important;
  min-width: 0 !important;
}

form.resources-filter .resources-filter__group input[type="search"],
form.resources-filter .resources-filter__group input[type="text"] {
  width: 100% !important;
  max-width: 400px !important;
  padding: 0.625rem 0.875rem !important;
  border: 1px solid #d1d5db !important;
  border-radius: 6px !important;
  font-size: 0.9375rem !important;
  background: #fff !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  box-sizing: border-box !important;
  height: auto !important;
  line-height: 1.4 !important;
}

form.resources-filter .resources-filter__group input[type="search"]:focus,
form.resources-filter .resources-filter__group input[type="text"]:focus {
  outline: none !important;
  border-color: #4caf50 !important;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15) !important;
}

form.resources-filter .resources-filter__options {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.75rem 1.5rem !important;
}

form.resources-filter .resources-filter__options label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  font-size: 0.875rem !important;
  color: #374151 !important;
  cursor: pointer !important;
  font-weight: 400 !important;
  margin: 0 !important;
  padding: 0 !important;
}

form.resources-filter .resources-filter__options input[type="checkbox"],
form.resources-filter .resources-filter__options input[type="radio"] {
  width: 16px !important;
  height: 16px !important;
  accent-color: #4caf50 !important;
  cursor: pointer !important;
  margin: 0 !important;
}

form.resources-filter button[type="submit"] {
  padding: 0.625rem 1.25rem !important;
  background: #4caf50 !important;
  color: white !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 0.9375rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease !important;
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2) !important;
}

form.resources-filter button[type="submit"]:hover {
  background: #43a047 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(76, 175, 80, 0.25) !important;
}

form.resources-filter button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(76, 175, 80, 0.2) !important;
}

form.resources-filter button[type="submit"]:focus-visible {
  outline: 2px solid #2e7d32 !important;
  outline-offset: 2px !important;
}

/* Selection status and email button styling */
.resources-selection {
  margin-top: 1.5rem !important;
  padding: 1rem 1.25rem !important;
  background: #f8fafc !important;
  border-radius: 6px !important;
  border: 1px solid #e2e8f0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 1rem !important;
  justify-content: space-between !important;
}

.resources-selection__status {
  margin: 0 !important;
  font-size: 0.9375rem !important;
  color: #475569 !important;
}

.resources-selection__button {
  padding: 0.625rem 1.25rem !important;
  background: #27368b !important;
  color: white !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 0.9375rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: background-color 0.15s ease, opacity 0.15s ease !important;
}

.resources-selection__button:hover:not(:disabled) {
  background: #1e2a6e !important;
}

.resources-selection__button:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

.resources-selection__button:focus-visible {
  outline: 2px solid #27368b !important;
  outline-offset: 2px !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  form.resources-filter {
    padding: 1rem !important;
  }

  form.resources-filter .resources-filter__options {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  form.resources-filter .resources-filter__group input[type="search"],
  form.resources-filter .resources-filter__group input[type="text"] {
    max-width: 100% !important;
  }

  .resources-selection {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .resources-selection__button {
    width: 100% !important;
    text-align: center !important;
  }
}

