/* Non-Profit Hub Theme: site styles (header, highlights, news grid, menus, social icons, pinned posts).
   Loaded on the site and inside the editor. Colours come from the palette, so the dark mode and
   other palettes change them. */

/* stacked logo in the header. Its width is set from the screen width (not the image file or the layout),
   so it is as big as the space allows: 240px on computers, about 190px on a typical phone, never pushing Join off screen. */
.nfp-header .nfp-logo-stacked { flex: 0 0 auto; margin: 0 !important; width: auto !important; }
.nfp-header .nfp-logo-stacked img { width: min(260px, calc(100vw - 200px)) !important; height: auto !important; max-width: none !important; max-height: none !important; aspect-ratio: auto !important; object-fit: contain; }
@media (min-width: 600px) { .nfp-header .nfp-logo-stacked img { width: 300px !important; } }
@media (min-width: 1000px) { .nfp-header .nfp-logo-stacked img { width: clamp(240px, 24vw, 340px) !important; } }
.nfp-header .wp-block-group > .wp-block-group:last-child { flex-shrink: 0; }
@media (max-width: 599px) {
  .nfp-header.wp-block-group { padding-left: 14px !important; padding-right: 14px !important; }
  .nfp-header .wp-block-group > .wp-block-group:last-child { gap: 8px !important; }
  .nfp-header .wp-block-button__link { padding: 8px 14px !important; font-size: 16px !important; }
}
/* search icon in the header */
.nfp-search .wp-block-search__button { background: transparent; color: inherit; border: 0; padding: 6px; }
.nfp-search.wp-block-search__searchfield-hidden .wp-block-search__input { border: 0; }
/* cards in the highlights strip stretch to equal height */
.nfp-highlights .wp-block-column > .wp-block-group { height: 100%; }
/* fold submenus in the phone menu (one menu for every screen size) */
.nfp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.nfp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
  align-items: stretch !important;
  width: 100%;
  gap: 0 !important;
}
.nfp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
  border-bottom: 1px solid rgba(255, 255, 255, .2);
  padding: 14px 0;
  font-size: 22px;
}
.nfp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item.has-child {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}
.nfp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-icon {
  display: inline-flex !important;
  width: 44px;
  height: 44px;
  justify-content: center;
  align-items: center;
  margin: -10px 0;
}
.nfp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-icon svg {
  width: 16px;
  height: 16px;
  transition: transform .2s;
}
.nfp-header .wp-block-navigation__responsive-container.is-menu-open [aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.nfp-header .wp-block-navigation__responsive-container.is-menu-open .has-child > .wp-block-navigation__submenu-container {
  grid-column: 1 / -1;
  padding: 8px 0 0 16px !important;
  gap: 0 !important;
}
.nfp-header .wp-block-navigation__responsive-container.is-menu-open .has-child > [aria-expanded="false"] ~ .wp-block-navigation__submenu-container {
  display: none !important;
}
.nfp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item {
  border: 0;
  padding: 8px 0;
  font-size: 17px;
  font-weight: 500;
}
.nfp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item,
.nfp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
  justify-content: flex-start !important;
  align-items: flex-start !important;
  text-align: left !important;
}
.nfp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item.has-child {
  align-items: center !important;
}
/* keep wide photos from stretching the news grid */
.nfp-news .wp-block-post-template.is-layout-grid > li { min-width: 0; }
.nfp-news .wp-block-post-featured-image img { width: 100%; }

/* Events Calendar widget inside the "Coming up" card: compact dates and titles */
.tribe-events-widget .tribe-events-widget-events-list__header,
.tribe-events-widget .tribe-events-widget-events-list__view-more { display: none !important; }
.tribe-events-widget .tribe-events-widget-events-list__event-row { margin: 0 0 12px !important; gap: 12px; }
.tribe-events-widget .tribe-events-widget-events-list__event-date-tag { width: 44px !important; min-width: 44px; padding: 0 !important; }
.tribe-events-widget .tribe-events-widget-events-list__event-date-tag-month { font-size: 11px !important; line-height: 1.2 !important; color: var(--wp--preset--color--highlight-text) !important; font-weight: 700; }
.tribe-events-widget .tribe-events-widget-events-list__event-date-tag-daynum { font-size: 22px !important; line-height: 1.1 !important; }
.tribe-events-widget .tribe-events-widget-events-list__event-datetime-wrapper,
.tribe-events-widget .tribe-events-widget-events-list__event-datetime { font-size: 14px !important; line-height: 1.3 !important; }
.tribe-events-widget .tribe-events-widget-events-list__event-title,
.tribe-events-widget .tribe-events-widget-events-list__event-title-link { font-size: 16px !important; line-height: 1.3 !important; font-weight: 600 !important; margin: 2px 0 0 !important; }
.widget-title:empty, .wp-block-legacy-widget h2:empty { display: none; }

/* tick list in the membership card */
.nfp-highlights .nfp-ticks { list-style: none; }
.nfp-highlights .nfp-ticks li { position: relative; padding-left: 26px; margin: 0 0 6px; }
.nfp-highlights .nfp-ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--wp--preset--color--highlight-pale); font-weight: 700; }

/* header menu on computers: wider dropdowns, no wrapping, and the ☰ menu below 1000px so the row never breaks onto two lines */
.nfp-header .wp-block-navigation .wp-block-navigation__submenu-container { min-width: 270px !important; padding: 8px 0 !important; }
.nfp-header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 7px 18px !important; }
.nfp-header .wp-block-navigation-item, .nfp-header .wp-block-button__link { white-space: nowrap; }
.nfp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { white-space: normal; }
@media (min-width: 600px) and (max-width: 999px) {
  .nfp-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
  .nfp-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
@media (min-width: 1000px) { .nfp-header .wp-block-navigation__container { flex-wrap: nowrap; } }


/* "Follow us" submenu shows social icons instead of names (names stay for screen readers).
   Give the submenu the class nfp-social-menu. Icons are picked from each link's address. */
.nfp-social-menu > .wp-block-navigation__submenu-container { flex-direction: row !important; flex-wrap: wrap; gap: 4px; min-width: 0 !important; width: max-content !important; max-width: 320px; padding: 8px !important; }
.nfp-header .nfp-social-menu > .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 8px !important; display: flex; }
.nfp-social-menu .wp-block-navigation__submenu-container .wp-block-navigation-item__label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nfp-social-menu .wp-block-navigation__submenu-container a::before { content: ""; display: block; width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--nfp-icon) center / contain no-repeat; mask: var(--nfp-icon) center / contain no-repeat; }
.nfp-social-menu .wp-block-navigation__submenu-container a:hover::before, .nfp-social-menu .wp-block-navigation__submenu-container a:focus::before { opacity: .75; }
.wp-block-navigation__responsive-container.is-menu-open .nfp-social-menu > .wp-block-navigation__submenu-container { max-width: none; width: auto !important; padding: 0 0 8px 8px !important; }
.nfp-social-menu a[href*="facebook.com"] { --nfp-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" version="1.1" aria-hidden="true"%3E%3Cpath d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"%3E%3C/path%3E%3C/svg%3E'); }
.nfp-social-menu a[href*="instagram.com"] { --nfp-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" version="1.1" aria-hidden="true"%3E%3Cpath d="M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z"%3E%3C/path%3E%3C/svg%3E'); }
.nfp-social-menu a[href*="bsky.app"] { --nfp-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" version="1.1" aria-hidden="true"%3E%3Cpath d="M6.3,4.2c2.3,1.7,4.8,5.3,5.7,7.2.9-1.9,3.4-5.4,5.7-7.2,1.7-1.3,4.3-2.2,4.3.9s-.4,5.2-.6,5.9c-.7,2.6-3.3,3.2-5.6,2.8,4,.7,5.1,3,2.9,5.3-5,5.2-6.7-2.8-6.7-2.8,0,0-1.7,8-6.7,2.8-2.2-2.3-1.2-4.6,2.9-5.3-2.3.4-4.9-.3-5.6-2.8-.2-.7-.6-5.3-.6-5.9,0-3.1,2.7-2.1,4.3-.9h0Z"%3E%3C/path%3E%3C/svg%3E'); }
.nfp-social-menu a[href*="mastodon"] { --nfp-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" version="1.1" aria-hidden="true"%3E%3Cpath d="M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z"%3E%3C/path%3E%3C/svg%3E'); }
.nfp-social-menu a[href*="/discord"] { --nfp-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" version="1.1" aria-hidden="true"%3E%3Cpath d="M20.317 4.369A19.88 19.88 0 0 0 15.894 3a14.145 14.145 0 0 0-.719 1.518 19.205 19.205 0 0 0-5.351 0A14.183 14.183 0 0 0 9.104 3 19.896 19.896 0 0 0 4.682 4.369a18.921 18.921 0 0 0-3.012 12.52 19.929 19.929 0 0 0 6.081 3.097c.487-.65.922-1.339 1.3-2.061a12.445 12.445 0 0 1-1.958-.896c.165-.12.326-.246.483-.374a12.445 12.445 0 0 0 8.946 0c.157.128.318.253.483.374-.627.371-1.281.683-1.958.896.379.722.813 1.41 1.3 2.061a19.94 19.94 0 0 0 6.081-3.097 18.921 18.921 0 0 0-3.012-12.52ZM8.12 15.233c-1.202 0-2.184-1.09-2.184-2.431 0-1.34.97-2.431 2.184-2.431 1.213 0 2.202 1.09 2.184 2.431 0 1.341-.97 2.431-2.184 2.431Zm7.757 0c-1.202 0-2.184-1.09-2.184-2.431 0-1.34.97-2.431 2.184-2.431 1.213 0 2.202 1.09 2.184 2.431 0 1.341-.97 2.431-2.184 2.431Z"%3E%3C/path%3E%3C/svg%3E'); }
.nfp-social-menu a[href*="mailto:"] { --nfp-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" version="1.1" aria-hidden="true"%3E%3Cpath d="M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm.5 12c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l7.5 5.6 7.5-5.6V17zm0-9.1L12 13.6 4.5 7.9V7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v.9z"%3E%3C/path%3E%3C/svg%3E'); }

/* archive cards: events show their event date, so hide the publish date on them */
.nfp-archive .type-tribe_events .nfp-post-date { display: none; }

/* Sticky (pinned) posts in post lists */
.wp-block-post-template > .sticky { position: relative; background: color-mix(in srgb, var(--wp--preset--color--brand) 8%, var(--wp--preset--color--surface)); border: 2px solid var(--wp--preset--color--custom-primary); border-top-width: 8px; border-radius: 14px; padding: 14px 14px 18px; }
.wp-block-post-template > .sticky::before { content: "Pinned"; position: absolute; top: 26px; right: 26px; z-index: 2; background: var(--wp--preset--color--custom-primary); color: var(--wp--preset--color--on-brand); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
html[lang^="fr"] .wp-block-post-template > .sticky::before { content: "Épinglé"; }
/* Sticky header: logo and menu stay at the top; the message bar scrolls away */
.wp-site-blocks > .wp-block-template-part:has(> .nfp-header) { display: contents; }
.nfp-header { position: sticky; top: 0; z-index: 100; }
body.admin-bar .nfp-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .nfp-header { top: 46px; } }
@media (max-width: 600px) { body.admin-bar .nfp-header { top: 0; } }
html { scroll-padding-top: 96px; }
/* No gap between the header and what comes next */
.wp-site-blocks > .wp-block-template-part:has(> .nfp-header) + *, .nfp-message-bar { margin-block-start: 0 !important; }
/* Menus: dropdowns use the surface colours, the phone menu the dark brand colour */
.nfp-header .wp-block-navigation .wp-block-navigation__submenu-container { background-color: var(--wp--preset--color--surface) !important; color: var(--wp--preset--color--ink) !important; border: 1px solid var(--wp--preset--color--line) !important; }
.nfp-header .wp-block-navigation__responsive-container.is-menu-open { background-color: var(--wp--preset--color--brand-dark) !important; color: var(--wp--preset--color--on-brand) !important; }
.nfp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container { background-color: transparent !important; color: inherit !important; border: 0 !important; }
.nfp-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content,
.nfp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content,
.nfp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close { color: inherit !important; }

/* ---- From the site's old Additional CSS (the general rules) ---- */
.hide { display: none !important; }
.tribe_events p { margin-bottom: 1em; }
.tribe-events-single .wp-block-button { margin-top: 1.5em; }
.tribe-events-single a.wp-block-button__link { color: var(--wp--preset--color--on-brand); }
.single-tribe_events .tribe-events-single-event-title { font-size: 2em !important; line-height: initial !important; }
.tribe-embed a, .tribe-events-event-meta a, .tribe-events-single a { color: inherit !important; text-decoration: underline !important; }
.wp-block-social-links [class^="wp-block"] { margin-bottom: initial !important; }
a:hover { text-decoration: underline !important; text-decoration-thickness: 3px !important; }
.wp-block-file * + .wp-block-file__button { color: var(--wp--preset--color--on-brand) !important; text-decoration: none !important; }
