/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Will Baker
 Author URI:   https://zookri.com
 Template:     generatepress
 Version:      0.1
*/

/* Utility classes */

html {
    scroll-behavior: smooth;
}

/* Prevent horizontal scrolling */
.grid-container {
  width: 100% !important;
}


/* Prevent horizontal scrolling */
.hide-me {
  display: none;
}


/* Hide empty p tags */
p:empty {
    height: 0;
    margin: 0;
    padding: 0;
    display: none; 
}


/* Hide empty custom-loop query containers (JS) */
.hide-query-no-results .check-loop {
    display: none;
}

/* Place Headline icon on the right */
.reverse-icon.gb-headline {
    display: flex;
    flex-direction: row-reverse;
	justify-content: flex-end;
}


#further-reading {
    scroll-margin-top: 56px; /* tweak to match your header height */
}


.hidden-until-scroll {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease; /* Smooth transition effect */
}

/* Force shrink - expertise/strong-cities/expertise */

.gb-grid-wrapper > .gb-grid-column-57a7fefb {
  flex-shrink: 0 !important;
}


/* Fallback team biog photo */

.gb-query-loop-item .gb-block-image:has(.team-photo) + .gb-block-image, .single-team-member .gb-block-image:has(.team-photo) + .gb-block-image {
    display: none;
}


/* Show hide the searh filter "no results" container message ( Headline handled with js) */

/* Hide the headline by default */
.no-post-headline {
    display: none;
}

/* Hide headline until JavaScript is fully loaded */
.no-js .no-post-headline {
    display: none;
}



/* No results message for filters */
.has-no-post-message .gb-query-loop-wrapper:not(:empty) + .no-post-message {
    display: none;
}

/* Show the no-post-message when there are no posts */
.has-no-post-message .gb-query-loop-wrapper:empty + .no-post-message {
    display: block;
}


/* Navigation adjustments */

 .main-nav {
  padding: 32px 0;
 } 


.main-nav .gp-icon svg {
  height: 0.75em;
  width: 0.75em;
  top: 0.1em;

}

.main-navigation ul ul a {
  display: flex !important;
  padding: 6px;
}

.menu-item-has-children > a {
    align-items: center;
    justify-content: space-between;
}

ul .sub-menu {
  padding: 16px 4px 8px 8px;
}  

.main-navigation .main-nav ul ul li a {
  padding: 6px;
}

.footer-nav li {
  margin-bottom: 16px;

}


figcaption .wp-caption, figcaption .wp-caption-text { /* Zero WP caption styles */
  margin-bottom: 0;
  margin-top: 0;  
  padding-top: 0;
  opacity: 1 !important;
}

p:has(img) { /* Zero p tags that contain images */
  margin-bottom: 0;
}

div[id^="attachment_"] {
  display: inline-block;
  white-space: normal; /* Ensure text wraps */
}

figcaption, p.wp-caption-text, p[id^="caption-attachment-"] {  
  font-size: 14px !important;
  line-height: 1.25rem;
  color: #2e2e2e !important;
  background-color: #f6f6f6;
  padding: 16px 8px !important;
  margin-bottom: 16px;
  opacity: 1 !important;
  max-width: 100%;
  word-wrap: break-word; /* Ensure long words wrap */
  white-space: normal; /* Ensure text wraps */
  display: block;
  box-sizing: border-box; /* Include padding in width calculation */
}

.hidden {
  display: none !important;
}

/* Normalise breadcrumb styles */
.standard-breadcrumb, .standard-breadcrumb a {
	background-color: var(--base-3) !important;
	color: var(--contrast-2) !important;
	margin-bottom: 24px;
}

/* Normalise team filter layout */
/* .gb-grid-wrapper > .gb-grid-column-f6f84176 {
  width: 25% !important;
}
.gb-grid-wrapper > .gb-grid-column-d18d4a6a {
  width: 75% !important;
} */


/* Spotlight tab colours */

.spotlight-ukraine, .spotlight-ukraine:hover, .spotlight-ukraine:active   {
	background-color: var(--contrast-2) !important;	
}
.spotlight-elections2024, .spotlight-elections2024:hover, .spotlight-elections2024:active {
	background-color: var(--isd-coral) !important;
	
}


/* Custom filter form styles */
  
  .custom-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
  }
  
  .custom-filter label {
    display: none;
  }
  
  .custom-filter select {
    padding: 12px;
    margin-right: 10px;
    flex: 1;
    background-color: #D9D9D9;
  }

  .custom-filter select option {
    background-color: #f7f8f9;

  }
  
  .custom-filter input[type="submit"] {
    margin-left: 10px;
    padding: 8px 20px;
  }

  .custom-filter .ps-radio, .custom-filter .cpt-radio {
    display: flex;
    flex-basis: 100%;
	  flex-direction:row;
	  align-items: center;  
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 1rem;
  }

  .custom-filter .ps-radio input{
    margin-left: 16px;
    margin-right: 12px;
  }

  .custom-filter .ps-radio input:first-of-type, .custom-filter .cpt-radio input:first-of-type {
    margin-left: 0px;
  }

  .custom-filter .cpt-radio label {
    display: inline-block;
    font-weight: normal;
    font-size: .85rem;
    padding: 0 16px 0 8px;
    text-transform: uppercase;
  }

/* Team styles */

.leadership-team-loop .hide-inactive, .director-team-loop .hide-inactive, .team-members-loop .hide-inactive{
    display: none;
}

/* Inactive employee panel */
.not-active {
  font-size: .85rem;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 12px;
  font-weight: 600;
  background-color: #C7074D;
  color: #fff;
  margin: 40px 0 16px 0;
}


.profile-img{
    border-radius: 50%;
    object-fit: cover;
}

.media-links span{
  display: block;
}

.horiz-scroll {
  display: flex;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  padding-bottom: 16px;
} 

.horiz-scroll::-webkit-scrollbar {
  width: 5px;
  height: 8px;
  background-color: #fff;
}

.horiz-scroll::-webkit-scrollbar-thumb {
  background-color: #333;
  border-radius: 5px;
  

}

.horiz-scroll::-moz-scrollbar {
  width: 10px;
  background-color: #fff;
}

.horiz-scroll::-moz-scrollbar-thumb {
  background-color: #333;
  border-radius: 5px;
  
}

.horiz-scroll .gb-grid-column {
  overflow: hidden;
}


.related-card {
  height: 100%;
  width: 25%;
  display: flex;
  flex-direction: column;
  flex-grow: 0;
  flex-shrink: 0;  
  margin-left: 4px;
  margin-right: 4px;
  position: relative;
  background-color: var(--base-2);
}

.related-image {
  height: 120px;
  background-repeat: no-repeat;
  background-size: cover;
  flex-shrink: 0;
}

.media-links {
  padding: 8px;
  font-size: 1rem;

}


.hide-heading { /*JS function Show/Hide headers*/
  display: none;
}


.past-event .register-btn {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;  
  display: none;
}

.event-end-time::before {
  content: "to ";
}

#isd-speaker a{
  border-bottom: 1px solid #ffffff;
}

/*Publication staff profile cards shortcode*/

h3.staff-profile-title {
  margin-top: 48px;
  text-transform: uppercase;
  font-size: 1rem;
  font-weight: 600;
}

.staff-profile-cards {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.staff-profile-card {
  display: flex;
  align-items: center;
  flex-basis: 30%;
  margin-right: 8px;
  margin-bottom: 8px;
  background-color: #f0f0f1;
  padding: 8px;
}

.staff-profile-image {
  display: flex;
  width: 33%;
  min-width:70px;
}

.staff-profile-image img {
  max-width: 80px;
  border-radius: 80%;
  object-fit: cover;
}

.staff-profile-detail {
  width: 77%;
  padding-left: 16px;
}

.staff-profile-detail p {
  font-size: 1rem;
  padding: 0 !important;
  margin-bottom: 0;
}

span.staff-author-role {
  font-size: .85rem;
  line-height: 16px;
  display: block;
}


/*Our Expertise areas*/

.subcategory-list {
  font-size: .85rem;
  list-style: none;
  line-height: 1rem;
  padding-top: 8px;
  margin: 0 24px;
}
.subcategory-list li {
  padding-bottom: 8px;
}


.topic-areas .gb-container:has(.gb-query-loop-wrapper:empty) {
  display: none;
}

/* Our Impact YouTube video */

.our-impact-video {
    position: relative;
    padding-bottom: 56.25%;
    max-width: 100%;
    height: auto;
}

.our-impact-video iframe{
    position: absolute;
    width: 100%;
    height: 100%;
}


.related-impacts a {
  display: flex;
  flex: 0 0 20%;
  flex-direction: column;
  margin-right: 8px;

}

.related-impacts a .related-card {
  width:100%
}

  /* Contact form */

#form_contact-form .frm_fields_container {
    grid-gap: 16px 2%;    
  }

#form_contact-form .frm_submit {
  display: flex;
  justify-content: flex-end;
}

/*Glossary tooltip*/

.glossary-alpha-links {
  font-size: 1.8rem;
  font-weight: 600;
  color: #babac4;
  letter-spacing: 0.25rem;
  transition: opacity 0.3s ease-in-out
}

.glossary-alpha-links .active-letter {  
  font-size: 2.5rem;
}

.glossary-term {
  position: relative;
  border-bottom: 1px dotted #000;
  cursor: help;
}

.glossary-term::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 150%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 24px;
  border-radius: 5px;
  z-index: 10;
  width: 300px;
  font-size: 1rem;  
  opacity: 0; /* Initially set opacity to 0 */
  transition: opacity 0.3s ease-in-out; /* Add a transition for opacity */
  pointer-events: none; /* Disable pointer events on the tooltip itself */
}

.glossary-term:hover::before {
  opacity: 1; /* Change opacity to 1 on hover */
}

/* What we do table */

.wwd-table table {
	background-color: #f7f8f9;

}
  
.wwd-table thead {
  background-color: #E76863;
  color: #fff;
  border: none;
  border-bottom: none;
}

.wwd-table thead th {
	border: none;
		
}

.wwd-table td {
	border: 1px solid #ccc;
	padding: 1em;
}




/*Donations page*/

#currencySelector {
  width: 100%;
}

/*Easy Footnote styling*/

.easy-footnote-title h4, .easy-footnote a {
  font-weight: 600;
}

/* Slick slider next / forward buttons */

.slick-arrow {
  z-index: 1;
  opacity: .8;
}
.slick-prev:before, .slick-next:before {
  font-size: 40px;
} 

.slick-next {
  right: 35px;
}

.slick-prev {
  left: 15px;
}


/*Search results*/

.searchwp-custom .swp-flex--col, .searchwp-form .swp-flex--col{
  flex-direction: row-reverse;
}

.searchwp-custom .swp-input, .searchwp-form .swp-select {
  background-color: #D9D9D9;
  border:none !important;
  padding: 12px;
  min-height: 48px !important;;

}

.searchwp-custom .swp-select option{
  background-color: #fff;
}

.searchwp-custom .swp-toggle {
  justify-content: flex-end !important;
  padding: 12px 0;
}
.searchwp-custom .swp-toggle-checkbox:checked + .swp-toggle-switch {
  background:#c7074d !important;
}

.search-results .read-more { /*Hide standard page 'read more' link*/
  display: none;
}

.file-type-icon {
  width: 54px;
  height: 22px;
  margin-bottom: 0px;
}

/* Media outlet - logo and info (hidden) */
.media-outlet-info {
    display: flex;
    align-items: center;
}

.media-outlet-logo {
    margin-right: 20px;
	height: 40px;          /* this is the key control */
    width: 150px;          /* optional, but helps alignment */
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.media-outlet-logo img {
    max-height: 60%;
    max-width: 60%;
    object-fit: contain;
}

.media-outlet-title {
	display:none;
}

.media-outlet-title h3 {
    margin: 0;
}

/* Adjust logos on Media Archive */

/* 
.post-type-archive-media-mention .horiz-scroll .media-outlet-logo img {
	min-width: 70px;
    max-width: 70px;
}

.post-type-archive-media-mention .other-media-mentions .media-outlet-logo img {
	min-width: 60px;
    max-width: 130px;
}
*/

/* Digital Policy Digest */

.dpl-prefix {
  display: block;
  font-size: 1rem;
  font-weight: normal;
}

/***************************
*   Media Queries
****************************/

 @media (max-width: 768px) {  /* Mobile */

  .col-to-horiz-scroll {
    flex-wrap: nowrap !important;
    overflow-x: auto;
   padding-bottom: 16px;
  } 
  
  .col-to-horiz-scroll::-webkit-scrollbar {
    width: 5px;
    height: 8px;    
  }
  
  .col-to-horiz-scroll::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 5px;     
  }
  
  .col-to-horiz-scroll::-moz-scrollbar {
    width: 10px;    
  }
  
  .col-to-horiz-scroll::-moz-scrollbar-thumb {
    background-color: #333;
    border-radius: 5px;    
  }

  .spotlight-moreposts {
    background-color:#6c7580 ;
  }

  .related-card {
    width:80%
  }

/*Publications filter*/
  .custom-filter {
    display: flex;
    align-items: stretch;
    flex-direction: column;
  }

  .custom-filter select {
    width: 100%;
    margin-bottom: 4px;
  }

  .custom-filter input[type="submit"] {
    margin-left: 0px;
  }

  .related-col .gb-container{
    /* background-color: #f7f8f9; */
  }

  /* Slick Slider Buttons */

  .slick-prev, .slick-next {
    top:30%;
  }



  .staff-profile-card {
    flex-basis: 100%;
  }

  .staff-profile-image {
    width: 20%;
  }


/* Footer */
  .frm_form_field {
    margin-bottom: 8px;
  }

  .footer-nav li{
    margin-bottom: 0px;    
  }

  .footer-nav {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

}

@media (min-width: 769px) and (max-width: 1024px) {  /* Tablet */

  .related-card {
    width:40%
  }

}

@media (min-width: 1025px) {  /* Desktop */ 

  .sticky-column  {
    position: sticky;
    top: 40px;
  }

}



