/* ==============================
   GLOBAL.CSS — HEADER + MENUS (CLEAN)
   Matches markup:
   - .site-header__stack contains desktop menus
   - #mobile-menu.site-header__mobile contains mobile menus
============================== */

/* ==============================
   HEADER
============================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: #fff;
  border-bottom: 1px solid #ececec;
}

.site-header__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
}

/* Desktop: centered */
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px 0;
  position: relative;
}

/* Branding (logo + slogan) */
.site-header__branding {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}

.site-header__top {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}
/* Admin menu top */
nav#block-profacto-adminmenutop {
    display: flex;
}

/* Drupal branding block safety (your markup uses #block-profacto-site-branding) */
#block-profacto-site-branding {
  float: none;          /* don’t let legacy floats break flex */
  max-width: 100%;
  width: auto;
}

#block-profacto-site-branding #logo img,
.site-header__branding img {
  max-height: 56px;
  width: auto;
  display: block;
}

/* Slogan */
#block-profacto-site-branding .slogan,
.site-header__branding .site-slogan {
  margin: 0;
  font-size: 13px;
  color: #6f6f6f;
  line-height: 1.2;
  max-width: 720px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* Desktop menu container */
.site-header__stack {
  width: 100%;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

/* ==============================
   MENUS — BASE
============================== */

.site-header nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-header nav li {
  margin: 0;
  padding: 0;
}

.site-header nav a {
  text-decoration: none;
  font-size: 14px;
  color: #222;
  padding: 8px 12px;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  font-weight: 600;
  color: #6b1f6b;
  outline: none;
}

.site-header nav a.is-active {
  color: #6b1f6b;
  font-weight: 600;
}

/* Hard override legacy menu styles that cause grey backgrounds / floats */
.site-header #block-profacto-main-menu,
.site-header #block-profacto-main-menu ul,
.site-header #block-profacto-main-menu li {
  float: none ;
}

.site-header #block-profacto-main-menu a,
.site-header #block-profacto-main-menu a:visited {
  background: transparent ;
  box-shadow: none ;
  border: 0 ;
}

.site-header__nav--secondary nav ul
{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  max-width: 1200px;
  width: 100%;
  float: right;
  justify-content: end;
}

.site-header__nav--secondary nav ul li > ul
{
  display: none;
  position: absolute;
  gap: 12px;

  flex-direction: column;
  align-items: flex-start;
  background: #fff;            /* adjust */
  padding: 8px 0;
  z-index: 1000;
}
/* Ensure parent is positioning context */
.site-header__nav--secondary nav ul li {
  position: relative;
}

/* 2️⃣ Show sub-menu on hover or focus */
.site-header__nav--secondary nav ul li:hover > ul,
.site-header__nav--secondary nav ul li:focus-within > ul {
  display: flex;
}

.site-header__nav--secondary nav ul li:has(> ul) > a::after {
  content: "▾";                 /* down arrow */
  margin-left: 6px;
  font-size: 0.75em;
  transition: transform 0.2s ease;
}

.site-header__nav--secondary nav ul li:has(> ul):hover > a::after,
.site-header__nav--secondary nav ul li:has(> ul):focus-within > a::after {
  transform: rotate(180deg);
}

.site-header__nav--secondary .menu-item--expanded > a::after {
  content: "▾";
  display: inline-block;
  margin-left: 6px;
  font-size: 0.75em;
  transition: transform 0.2s ease;
}

.site-header__nav--secondary .menu-item--expanded:hover > a::after,
.site-header__nav--secondary .menu-item--expanded:focus-within > a::after {
  transform: rotate(180deg);
}

.site-header__nav--secondary nav ul li > ul {
  width: max-content;      /* shrink-to-fit content */
  min-width: max-content;
  white-space: nowrap;     /* prevent wrapping */
}

.site-header__nav_secondary.site-header__nav--secondary {
    margin-top: 10px;
}



/* ==============================
   DESKTOP MENU LAYOUT
============================== */

.site-header__nav--desktop ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  row-gap: 10px;
}

.site-header nav li > ul {
    border-radius: 12px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}
/* ==============================
   DESKTOP DROPDOWNS
============================== */

@media (min-width: 1025px) {
  .site-header nav li.menu-item--expanded {
    position: relative;
  }

  .site-header nav li.menu-item--expanded > ul {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    z-index: 9999;
  }

  .site-header nav li.menu-item--expanded:hover > ul,
  .site-header nav li.menu-item--expanded:focus-within > ul {
    display: block;
  }

  .site-header nav li.menu-item--expanded > ul a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    white-space: nowrap;
  }

  /* Arrow for items that have a submenu */
  .site-header nav li.menu-item--expanded > a {
    position: relative;
    padding-right: 22px;
  }

  .site-header nav li.menu-item--expanded > a::after {
    content: "▾";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #6b1f6b;
    opacity: 0.9;
    pointer-events: none;
  }

  .site-header nav li.menu-item--expanded:hover > a::after,
  .site-header nav li.menu-item--expanded:focus-within > a::after {
    transform: translateY(-50%) rotate(180deg);
  }

  /* ✅ Separators ONLY for submenu items (desktop) */
  .site-header nav ul ul > li {
    border-bottom: 1px solid #ececec;
    width: 100%;
  }
  .site-header nav ul ul > li:last-child {
    border-bottom: 0;
  }
}

/* ==============================
   HAMBURGER BUTTON
============================== */

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.hamburger {
  position: relative;
  width: 24px;
  height: 18px;
  display: block;
}

.hamburger span,
.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #222;
  border-radius: 3px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.hamburger::before { top: 0; }
.hamburger span { top: 50%; transform: translateY(-50%); }
.hamburger::after { bottom: 0; }

.menu-toggle[aria-expanded="true"] .hamburger::before {
  transform: translateY(7.5px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .hamburger::after {
  transform: translateY(-7.5px) rotate(-45deg);
}
.menu-toggle[aria-expanded="true"] .hamburger span {
  opacity: 0;
}

/* ==============================
   TABLET + MOBILE
============================== */

@media (max-width: 1024px) {

  /* Hide desktop menus */
  .site-header__stack {
    display: none;
  }

  /* Branding LEFT, hamburger RIGHT */
  .site-header__inner {
    justify-content: space-between ;
    align-items: center ;
    text-align: left ;
  }

  .site-header__branding {
    width: auto;
    flex: 1 1 auto;
    align-items: flex-start;
    justify-content: flex-start;
    margin: 0;
  }

  #block-profacto-site-branding {
    float: none;
    width: auto;
  }

  #block-profacto-site-branding #logo,
  #block-profacto-site-branding .slogan {
    text-align: left ;
  }

  .site-header__branding .site-slogan,
  #block-profacto-site-branding .slogan {
    text-align: left ;
    margin: 0;
  }

  .menu-toggle {
    display: inline-flex ;
    margin-left: auto ;
    flex: 0 0 auto ;
  }

  /* Mobile dropdown container */
  .site-header__mobile {
    position: absolute;
    top: 100%;
    right: 20px;
    width: min(92vw, 320px);
    max-height: 70vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 10px 30px rgba(0,0,0,0.10);
    background: #fff ;
    z-index: 9999;
    border-radius: 12px;
  }

  /* ✅ FORCE stacking (works through Drupal wrappers) */
  #mobile-menu nav ul {
    display: flex ;
    flex-direction: column ;
    gap: 0 ;
  }

  #mobile-menu nav li {
    display: block ;
    width: 100% ;
    float: none ;
  }

  #mobile-menu nav > * ul > li {
    border-bottom: 1px solid #f0f0f0;
  }

  #mobile-menu nav a,
  #mobile-menu nav a:visited {
    display: block ;
    width: 100% ;
    padding: 14px 0 ;
    background: transparent ;
    box-shadow: none ;
    border: 0 ;
    color: #222 ;
  }

   #mobile-menu li.menu-item--expanded > ul {
    display: block ;
    padding: 6px 0 10px 14px ;
    margin: 0 ;
    border-left: 2px solid rgba(107, 31, 107, 0.18) ;
  }

  /* Optional: remove the dropdown arrow since it’s no longer collapsible */
  #mobile-menu li.menu-item--expanded > a::after {
    display: none ;
  }

  /* ✅ Separators ONLY for submenu items (mobile/tablet) */
  #mobile-menu ul ul > li {
    border-bottom: 1px solid #f0f0f0;
  }
  #mobile-menu ul ul > li:last-child {
    border-bottom: 0;
  }

  #mobile-menu ul ul > li > a {
    padding: 12px 0 ;
  }
}

/* Never show mobile menu on desktop */
@media (min-width: 1025px) {
  .site-header__mobile {
    display: none ;
  }
}

/* Small mobile: hide slogan */
@media (max-width: 640px) {
  .site-header__branding .site-slogan,
  #block-profacto-site-branding .slogan {
    display: none;
  }
}

/* ==============================
   MISC existing globals
============================== */

.contextual { display: none ; }

.error-card {
  text-align: center;
  margin: 50px auto;
}

.chosen-container-multi .chosen-choices {
  padding: 5px 8px;
}

input.form-text {
  border-radius: 5px;
}

/* =========================================================
   HARD RESET: remove any legacy grey backgrounds in header menu
   (Desktop + Mobile)
========================================================= */
.site-header #block-profacto-main-menu,
.site-header #block-profacto-main-menu ul {
    background:  #fff ;
    box-shadow: none ;
    border: 0 ;   
}
.site-header #block-profacto-main-menu li,
.site-header #block-profacto-main-menu li::before,
.site-header #block-profacto-main-menu li::after {
  background: #fff ;
}

/* Also ensure links stay clean */
.site-header #block-profacto-main-menu a,
.site-header #block-profacto-main-menu a:visited,
.site-header #block-profacto-main-menu a:hover,
.site-header #block-profacto-main-menu a:focus-visible {
  background: transparent ;
  box-shadow: none ;
}

/* Keep only your hover styling (optional) */
@media (min-width: 1025px) {
  .site-header #block-profacto-main-menu a:hover,
  .site-header #block-profacto-main-menu a:focus-visible {
    font-weight: 600;
  }
}

@media (max-width: 1024px) {
  .site-header__inner {
    position: relative; /* anchor the absolute dropdown */
  }

  .site-header__mobile {
    position: absolute;     /* ✅ clickable again */
    top: 100%;
    right: 20px;
    width: min(92vw, 320px);

    /* ✅ scroll instead of overflowing page */
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    padding: 12px 16px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 10px 30px rgba(0,0,0,0.10);
    background: #fff ;
    z-index: 9999;
    border-radius: 12px;
  }
}

@media (max-width: 1024px) {

  /* Make the dropdown panel scrollable */
  #mobile-menu.site-header__mobile {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ✅ CRITICAL: kill legacy "dropdown" positioning for ALL nested uls */
  #mobile-menu #block-profacto-main-menu li,
  #mobile-menu #block-profacto-main-menu ul {
    position: static ;
    float: none ;
  }

  /* Submenus must participate in normal flow (no absolute, no left/top) */
  #mobile-menu #block-profacto-main-menu ul ul {
    display: block ;
    position: static ;
    left: auto ;
    top: auto ;
    background: transparent ;
    border: 0 ;
    box-shadow: none ;
    margin: 6px 0 10px 0 ;
    padding: 6px 0 10px 14px ;
    width: 100% ;
    overflow: visible ;
  }

  /* Optional: stronger visual grouping */
  #mobile-menu #block-profacto-main-menu li.menu-item--expanded > ul {
    border-left: 2px solid rgba(107, 31, 107, 0.18) ;
  }

  /* Remove arrow since everything is always open */
  #mobile-menu li.menu-item--expanded > a::after {
    display: none ;
  }
}

/* Desktop-only arrows for items that HAVE submenus */
@media (min-width: 1025px) {

  /* Only in the desktop menu stack */
  .site-header__stack .site-header__nav--desktop li:has(> ul) > a {
    position: relative;
    padding-right: 22px;
  }

  .site-header__stack .site-header__nav--desktop li:has(> ul) > a::after {
    content: "▾";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #6b1f6b;
    opacity: 0.9;
    pointer-events: none;
  }

  /* Optional: rotate arrow when dropdown is open (hover/focus) */
  .site-header__stack .site-header__nav--desktop li:has(> ul):hover > a::after,
  .site-header__stack .site-header__nav--desktop li:has(> ul):focus-within > a::after {
    transform: translateY(-50%) rotate(180deg);
  }
}

/* ==============================
   PAGINATION STYLES for node/
============================== */

.pager {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 30px 0;
  padding: 0;
}

.pager__item {
  list-style: none;
}

.pager__item a,
.pager__item span {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #e5e5e5;
  text-decoration: none;
  font-size: 13px;
  color: #6b1f6b;
}

.pager__item.is-active span {
  background: rgba(107, 31, 107, 0.12);
  font-weight: 600;
}

li.pager__item.pager__item--next a, li.pager__item.pager__item--last a {
    border: none;
    padding: 0px;
}

li.pager__item.pager__item--first a, li.pager__item.pager__item--previous a {
    border: none;
    padding: 0px;           
 }

ul.pager__items.js-pager__items {
    display: flex;
    flex-direction: row;
    gap: 13px;
    flex-wrap: wrap;
}

ul.links.inline {
    list-style: none;
    display: flex;
    flex-direction: row;
    gap: 20px;
}

input[type="date"], select.form-select {
     font-family: 'Open Sans', sans-serif;
    color: #666;
    border: 1px solid #ddd;
}

