MediaWiki:Common.css.bak: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
/* ----->START------ FONTS  */
$(document).ready(function () {
@font-face {
  // Global variables
    font-family: 'HALColant-TextRegular';
  var cards = $(".card");
    src: url('/fonts/HALColant-TextRegular.woff2') format('woff2'),
  var showArticleWrapper = $("#show-article-wrapper");
        url('/fonts/HALColant-TextRegular.woff') format('woff');
  var areFiltersActive = false;
    font-weight: normal;
    font-style: normal;
}
* {
    color: #292828; /* Specific black color */
}


/* Change text color of links on hover */
  // Make header-box in Home clickable
a:hover {
  $(".head-box").click(function () {
     cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="white" stroke="black" stroke-width="1" /></svg>') 14 14, auto;
     window.location.href = "/Main_Page"; // Redirects to the home page
}
  });


/* Change text color of links on focus */
  // Loop through each card to format related articles
a:focus {
  cards.each(function () {
     cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="white" stroke="black" stroke-width="1" /></svg>') 14 14, auto;
     // Check if the card has related articles
}
    var relatedArticles = $(this).find(".related-articles");
    if (relatedArticles.length > 0) {
      // Get all the related article elements
      var relatedArticleElements = relatedArticles.find(".related-article");


html, body {
      // Create an array to store unique related articles
    font-family: HALColant-TextRegular!important;
      var uniqueArticles = [];
    background: #FAFAFA 0%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-smoothing: antialiased;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="black" /></svg>') 14 14, auto;
}
html {
    scrollbar-width: none; /* Firefox */
}
body {
    background: #FAFAFA 0%;
    transition: background-color 1s ease;
}
::-webkit-scrollbar {
    display: none;
}
pre.mw-code.mw-css {
    font-family: sans-serif!important;
}
/* -----END<------ FONTS */


/* ----->START------ GENERAL RULES FOR MEDIAWIKI SKIN  */
      // Loop through each related article element
/* Page Margins */
      relatedArticleElements.each(function () {
.mw-body {
        // Remove <p> tags from the article
    padding: 0 !important;
        $(this).find("p").remove();
    margin-left: 0 !important;
    border: none;
    background: #FAFAFA 0%;
}
.mw-search-profile-tabs {
    display: none;
}
.mw-parser-output {
    background: #FAFAFA 0%;
    transition: background-color 1s ease;
    /*padding: 25px;*/
    padding: 1.3%;
}
#mw-searchoptions {
    display: none;
}
/* Hide Mediawiki logo */
#p-logo a {
    display: none;
}
/* Hide left vertical toolbar */
#mw-panel {
    display: none;
}
.mw-parser-output a.external {
    background-image: none;
}
.mw-search-result-data {
    display: none;
}
.mw-search-result-heading {
  font-size: 16pt;
  line-height: 27px;
  letter-spacing: 0.4px;
}
.mw-search-results li a {
  font-size: 16pt!important;
  line-height: 27px;
  letter-spacing: 0.4px;
  color: black;
  text-decoration: underline;
}
#mw-indicator-mw-helplink {
  display: none;
}
.mw-search-results-container h2 {
  display: none;
}
#mw-content-text .mw-search-results {
  margin-top: 0 !important;
 
}
.mw-search-results li {
  list-style: none;
  margin-bottom: 0 !important;
}
.results-info {
  display: none;
}
.vector-body p
{
  margin-top: 0px!important;
  margin-bottom: 0px!important;
}
#firstHeading {
    display: none;
}
.mw-footer {
    display: none;
}
a.mw-selflink {
    font-weight: normal;
    text-decoration: underline;
}
a.mw-selflink:hover {
    font-weight: normal;
    text-decoration: underline;
}
#mw-head {
    background-color: #FAFAFA;
    transition: background-color 1s ease;
    display: none;
}
.mw-body, #left-navigation, #mw-data-after-content, .mw-footer {
    margin-left: 0!important;
}
#mw-page-base {
    background-color: #FAFAFA;
    transition: background-color 1s ease;
    background-image: none;
    display: none;
}
#catlinks {
    display: none;
}
/* Don't display 3 vertical lines. This is loading of Mediawiki*/
.mw-indicators {
    display: none;
}
/* Don't display loading load spinner. This is loading of Semantic Mediawiki*/
.smw-overlay-spinner {
    display: none;
}
.mw-content-subtitle, #contentSub, #contentSub2 {
    display: none;
}
/* -----END<------ GENERAL RULES FOR MEDIAWIKI SKIN */


/* ------> STYLING HEADER */
        // Convert the article HTML to a string
.custom-navbar {
        var articleHTML = $(this)[0].outerHTML;
    display:none;
}
.logo p {
  font-size: 17px;
  line-height: 22px;
  letter-spacing: 0.37px;
  text-align: right;
  text-decoration: underline;
  margin-top: -0.33rem !important;
}
div.hf-header {
    position: fixed;
    top: 0;
    left: 0;
    width: -moz-available; /* For Firefox */
    width: -webkit-fill-available; /* For Chrome and Safari */
    background: transparent linear-gradient(180deg, #FAFAFA 0%, #FFFFFF00 100%) 0% 0% no-repeat padding-box;
    z-index: 9999;
    /*padding: 25px 25px 0 25px;*/
    padding: 1.3%;
}
div#hf-nsheader- {
    position: fixed;
    top: 0;
    left: 0;
    width: -moz-available; /* For Firefox */
    width: -webkit-fill-available; /* For Chrome and Safari */
    background: transparent linear-gradient(180deg, #FAFAFA 0%, #FFFFFF00 100%) 0% 0% no-repeat padding-box;
    z-index: 9999;
    /*padding: 25px 25px 0 25px;*/
    padding: 1.3%;
}
div#hf-nsheader-Special {
    position: fixed;
    top: 0;
    left: 0;
    width: -moz-available; /* For Firefox */
    width: -webkit-fill-available; /* For Chrome and Safari */
    background: transparent linear-gradient(180deg, #FAFAFA 0%, #FFFFFF00 100%) 0% 0% no-repeat padding-box;
    z-index: 9999;
    /*padding: 25px 25px 0 25px;*/
    padding: 1.3%;
}
#header-container {
    display: flex;
    flex-wrap: wrap;
    margin: 0 auto;
    /*padding-bottom: 100px;*/
}
.head-col {
    width: calc(20% - 0px);
    box-sizing: border-box;
    height: fit-content;
    padding: 10px;
.head-links.head-col {
  width: calc(20% - 3px);
}
.head-col-extend {
    box-sizing: border-box;
    height: fit-content;
}
.head-box {
    border: 1px solid black;
    background: #FAFAFA;
    z-index: 2;
    position: relative;
}
.head-box:hover {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="white" stroke="black" stroke-width="1" /></svg>') 14 14, auto;
}
.head-nav {
    padding-left: 15px;
    padding-top: 5px;
    line-height: 23px;
}
.head-links {
    padding-top: 5px;
}


/* FILTERS HEADER */
        // Check if the article HTML already exists in the uniqueArticles array
.head-filter.head-col-extend {
        if ($.inArray(articleHTML, uniqueArticles) === -1) {
    width: calc(40% + 3px);
          // If it doesn't exist, add it to the uniqueArticles array
    overflow: hidden;
          uniqueArticles.push(articleHTML);
}
        }
.container-filter-label-button {
      });


}
      // Clear the content of the related articles container
      relatedArticles.empty();


.buttons-filters {
      // Append the unique related articles back to the container
    font-size: 16px;
      relatedArticles.append(uniqueArticles.join(""));
    line-height: 20px;
     }
    letter-spacing: 0.35px;
  });
    padding-bottom: 5px;
    display: grid;
    grid-template-columns: 1fr 1fr; /* two equal columns */
    align-items: center;
     gap: 10px;
}


.count-filters-container {
  // Utility Functions
   border-bottom: 1px solid black;
   function sortChronologically() {
  padding-bottom: 5px;
    var cards = $(".list-container .card").get();
}


.count-filtered-cards {
    cards.sort(function (a, b) {
  font-size: 17px;
      var numberA = parseInt(
  line-height: 22px;
        $(a).find(".entry-number").text().replace(/\[|\]/g, ""),
  font-style: italic;
        10
  margin-top: 0;
      );
  width: fit-content;
      var numberB = parseInt(
}
        $(b).find(".entry-number").text().replace(/\[|\]/g, ""),
        10
      );
      return numberB - numberA; // Descending order
    });


.count-filtered-cards span {
    $.each(cards, function (index, item) {
  margin-right: 2px;
      $(".list-container").append(item);
  background-color: #EDEDED;
    });
   padding: 1px 3px;
   }
}


  function randomizeCards(selector) {
    var cards = $(selector).get();


.reset-button {
     var i = cards.length,
   
      j,
}
      temp;
.reset-button {
     while (--i > 0) {
     justify-self: end;
      j = Math.floor(Math.random() * (i + 1));
}
      temp = cards[i];
.open-close-button {
      cards[i] = cards[j];
    justify-self: start;
      cards[j] = temp;
}
.reset-symbol {
  font-size: 20px;
}
.reset-filter {
    font-family: HALColant-TextRegular !important;
    background: none;
    border: none;
    font-size: 17px;
    line-height: 20px;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="white" stroke="black" stroke-width="1" /></svg>') 14 14, auto;
    text-transform: uppercase;
}
.toggle-filters.general-toggle {
    font-family: HALColant-TextRegular !important;
     background: none;
    border: none;
    font-size: 17px;
    line-height: 20px;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="white" stroke="black" stroke-width="1" /></svg>') 14 14, auto;
    text-transform: uppercase;
    padding-left: 0!important;
}
.toggle-filters.open-filter {
    font-family: HALColant-TextRegular !important;
    position: absolute;
    background: none;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0px;
    border: none;
    padding: 5px 0;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="white" stroke="black" stroke-width="1" /></svg>') 14 14, auto;
    text-decoration: underline;
    font-size: 17px;
    line-height: 22px;
    letter-spacing: 0.95px;
}
.toggle-filters.open-filter:hover {
    font-style: italic;
}
.filter-button {
    font-family: HALColant-TextRegular !important;
    padding: 0 !important;
    white-space: nowrap;
    background: rgb(237,237,237);
    margin-bottom: 5px;
    border: none;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="white" stroke="black" stroke-width="1" /></svg>') 14 14, auto;
    font-size: 19px;
    line-height: 26px;
    letter-spacing: 0.95px;
}
.filter-button:hover {
    font-style: italic;
}
.values {
    display: none; /* Keep the filter values hidden initially */
    padding-top: 30px;
}
button.active {
    text-decoration: underline;
}
#filters {
    display: none; /* Hidden initially, will be shown on button click */
    width: 100%; /* Full width of the parent container */
    grid-template-columns: repeat(4, 1fr); /* Creates four columns with equal width */
    gap: 5px; /* Space between grid items */
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.5s ease, height 0.5s ease;
    height: 0;
    overflow: hidden;
    background: transparent linear-gradient(180deg,#FAFAFA 0%,#FFFFFF00 100%) 0% 0% no-repeat padding-box;
}
@media screen and (max-width: 1366px) {
    .toggle-filters.open-filter {
        font-size: 15px;
        line-height: 24px;
        letter-spacing: 0.95px;
     }
     }


     .filter-button {
     $.each(cards, function (index, item) {
         font-size: 16px;
      $(selector).parent().append(item);
         line-height: 24px;
    });
         letter-spacing: 0.95px;
  }
 
  function sortAlphabetically(selector) {
    var cards = $(selector).get();
 
    cards.sort(function (a, b) {
      var titleA = $(a).find(".title").text().toUpperCase();
      var titleB = $(b).find(".title").text().toUpperCase();
      return titleA < titleB ? -1 : titleA > titleB ? 1 : 0;
    });
 
    $.each(cards, function (index, item) {
      $(selector).parent().append(item);
    });
  }
 
  function updateViews() {
    // Handle cards in the list view
    $(".home-chronicle-list div.list-container div.card:not(.event)").each(
      function () {
        if (!$(this).closest(".home-chronicle-block").length) {
          var title = $(this).find(".title").detach();
          var images = $(this).find(".images").detach();
 
          // Remove existing .title-images if it exists
          $(this).find(".title-images").remove();
 
          var titleImagesContainer = $(
            '<div class="title-images"></div>'
          ).append(images, title);
          $(this).find(".people").after(titleImagesContainer);
        }
      }
    );
 
    // Handle cards in the block view
    $(".home-chronicle-block div.list-container div.card:not(.event)").each(
      function () {
        // Remove .title-images container if it exists, re-attach .title and .images to their original places
        var titleImagesContainer = $(this).find(".title-images");
        if (titleImagesContainer.length) {
          var title = titleImagesContainer.find(".title").detach();
          var images = titleImagesContainer.find(".images").detach();
          titleImagesContainer.remove();
 
          $(this).find(".people").after(title);
          $(this).find(".type").after(images);
        } else {
          // If .title-images doesn't exist, ensure .images is placed correctly
          var images = $(this).find(".images").detach();
          $(this).find(".type").after(images);
        }
      }
    );
  }
 
  function processEventCards() {
    $(".card.event").each(function () {
      var $card = $(this);
      var existingContainer = $card.find(".container-people-date");
 
      // Create container if missing
      if (existingContainer.length === 0) {
        existingContainer = $('<div class="container-people-date"></div>');
        $card.append(existingContainer); // temp placement
      }
 
      // Detach people and date
      var people = $card.find(".people").detach();
      var date = $card.find(".date").detach();
 
      // BLOCK VIEW (gallery)
      if ($card.closest(".home-chronicle-block").length) {
        existingContainer.append(people).append(date);
 
        // Place container after title
        if (!existingContainer.is($card.find(".title").next())) {
          $card.find(".title").after(existingContainer);
        }
 
        // LIST VIEW
      } else if ($card.closest(".home-chronicle-list").length) {
        // Only append .people into container
        existingContainer.empty().append(people);
 
        // Place container before title
        $card.find(".title").before(existingContainer);
 
        // Place date after title
        $card.find(".title").after(date);
      }
    });
  }
 
  if ($("#home").length > 0) {
    // This code will only run only on the homepage.
    $(".home-block-view").show();
    $(".home-chronicle-block-button, .home-block-view-button").addClass(
      "active-view-button"
    );
 
    // Initially hide list view sorting buttons and set the default sorted view for block
    $(
      ".home-chronicle-list-button, .home-random-list-button, .home-alphabetical-list-button"
    ).hide();
    sortChronologically(); // Sort the block view chronologically by default
 
    updateLastVisibleCard();
    updateWidthBlockView();
    processEventCards();
    updateViews();
 
    $(".home-list-view-button").click(function () {
      $(".home-list-sorting-buttons").css("display", "flex");
      // Switching view classes
      $(".home-block-view")
        .removeClass("home-block-view")
        .addClass("home-list-view");
      // Additional class switch
      $(".home-chronicle-block")
        .removeClass("home-chronicle-block")
        .addClass("home-chronicle-list");
      // Toggling visibility of buttons
      $(
        ".home-chronicle-block-button, .home-random-block-button, .home-alphabetical-block-button"
      ).hide();
      $(
        ".home-chronicle-list-button, .home-random-list-button, .home-alphabetical-list-button"
      ).show();
      updateLastVisibleCard();
      updateWidthBlockView();
      processEventCards();
      updateViews();
 
      // Remove active class from block view button and add to list view button
      $(".home-block-view-button").removeClass("active-view-button");
      $(".home-list-view-button").addClass("active-view-button");
 
      // Conditional checks for transferring the active class from block to list buttons
      if ($(".home-chronicle-block-button").hasClass("active-view-button")) {
        $(".home-chronicle-block-button").removeClass("active-view-button");
        $(".home-chronicle-list-button").addClass("active-view-button");
      } else if (
        $(".home-random-block-button").hasClass("active-view-button")
      ) {
        $(".home-random-block-button").removeClass("active-view-button");
        $(".home-random-list-button").addClass("active-view-button");
      } else if (
        $(".home-alphabetical-block-button").hasClass("active-view-button")
      ) {
        $(".home-alphabetical-block-button").removeClass("active-view-button");
        $(".home-alphabetical-list-button").addClass("active-view-button");
      }
    });
 
    $(".home-block-view-button").click(function () {
      console.log("Block view button clicked.");
      $(".home-list-sorting-buttons").hide(); // Hide list sorting buttons
      $(".home-list-view")
         .removeClass("home-list-view")
        .addClass("home-block-view");
      $(".home-chronicle-list")
        .removeClass("home-chronicle-list")
        .addClass("home-chronicle-block");
      $(
        ".home-chronicle-block-button, .home-random-block-button, .home-alphabetical-block-button"
      ).show();
      $(
        ".home-chronicle-list-button, .home-random-list-button, .home-alphabetical-list-button"
      ).hide();
      updateLastVisibleCard();
      updateWidthBlockView();
      processEventCards();
      updateViews();
      $(".home-list-view-button").removeClass("active-view-button");
      $(".home-block-view-button").addClass("active-view-button");
 
      // Conditional checks for transferring the active class from block to list buttons
      if ($(".home-chronicle-list-button").hasClass("active-view-button")) {
        $(".home-chronicle-list-button").removeClass("active-view-button");
        $(".home-chronicle-block-button").addClass("active-view-button");
      } else if ($(".home-random-list-button").hasClass("active-view-button")) {
        $(".home-random-list-button").removeClass("active-view-button");
        $(".home-random-block-button").addClass("active-view-button");
      } else if (
        $(".home-alphabetical-list-button").hasClass("active-view-button")
      ) {
        $(".home-alphabetical-list-button").removeClass("active-view-button");
        $(".home-alphabetical-block-button").addClass("active-view-button");
      }
    });
 
    // BLOCK VIEW SORTING BUTTONS
    $(".home-chronicle-block-button").click(function () {
      sortChronologically();
 
      updateLastVisibleCard();
      updateWidthBlockView();
      processEventCards();
      updateViews();
      $(".home-chronicle-block-button").addClass("active-view-button");
      $(".home-random-block-button").removeClass("active-view-button");
      $(".home-alphabetical-block-button").removeClass("active-view-button");
    });
 
    $(".home-random-block-button").click(function () {
      randomizeCards(".list-container .card");
 
      updateLastVisibleCard();
      updateWidthBlockView();
      processEventCards();
      updateViews();
      $(".home-random-block-button").addClass("active-view-button");
      $(".home-chronicle-block-button").removeClass("active-view-button");
      $(".home-alphabetical-block-button").removeClass("active-view-button");
    });
 
    $(".home-alphabetical-block-button").click(function () {
      sortAlphabetically(".list-container .card");
 
      updateLastVisibleCard();
      updateWidthBlockView();
      processEventCards();
      updateViews();
      $(".home-alphabetical-block-button").addClass("active-view-button");
      $(".home-chronicle-block-button").removeClass("active-view-button");
      $(".home-random-block-button").removeClass("active-view-button");
    });
 
    // LIST VIEW SORTING BUTTONS
    $(".home-chronicle-list-button").click(function () {
      sortChronologically();
 
      updateLastVisibleCard();
      updateWidthBlockView();
      processEventCards();
      updateViews();
      $(".home-chronicle-list-button").addClass("active-view-button");
      $(".home-random-list-button").removeClass("active-view-button");
      $(".home-alphabetical-list-button").removeClass("active-view-button");
    });
 
    $(".home-random-list-button").click(function () {
      randomizeCards(".list-container .card");
 
      updateLastVisibleCard();
      updateWidthBlockView();
      processEventCards();
      updateViews();
      $(".home-random-list-button").addClass("active-view-button");
      $(".home-chronicle-list-button").removeClass("active-view-button");
      $(".home-alphabetical-list-button").removeClass("active-view-button");
    });
 
    $(".home-alphabetical-list-button").click(function () {
      sortAlphabetically(".list-container .card");
 
      updateLastVisibleCard();
      updateWidthBlockView();
      processEventCards();
      updateViews();
      $(".home-alphabetical-list-button").addClass("active-view-button");
      $(".home-chronicle-list-button").removeClass("active-view-button");
      $(".home-random-list-button").removeClass("active-view-button");
    });
  } else {
    console.log("NOT HOMEPAGE");
    $(".home-list-view").show();
    $(".chronicle-list-button, .list-view-button").addClass(
      "active-view-button"
    );
 
    // Initialization and Default Settings
    // Initially hide block view sorting buttons and set the default sorted view for list
    $(
      ".chronicle-block-button, .random-block-button, .alphabetical-block-button"
    ).hide();
    sortChronologically(); // Sort the block view chronologically by default
    updateLastVisibleCard();
    updateWidthBlockView();
    processEventCards();
    updateViews();
 
    $(".list-view-button").click(function () {
      console.log("List view button clicked.");
      $(".list-sorting-buttons").css("display", "flex");
      $(".block-sorting-buttons").hide();
      // Switching view classes
      $(".home-block-view")
        .removeClass("home-block-view")
        .addClass("home-list-view");
      // Additional class switch
      $(".home-chronicle-block")
        .removeClass("home-chronicle-block")
        .addClass("home-chronicle-list");
      // Toggling visibility of buttons
      $(
        ".chronicle-block-button, .random-block-button, .alphabetical-block-button"
      ).hide();
      $(
        ".chronicle-list-button, .random-list-button, .alphabetical-list-button"
      ).show();
      updateLastVisibleCard();
      updateWidthBlockView();
      processEventCards();
      updateViews();
 
      // Remove active class from block view button and add to list view button
      $(".block-view-button").removeClass("active-view-button");
      $(".list-view-button").addClass("active-view-button");
 
      // Conditional checks for transferring the active class from block to list buttons
      if ($(".chronicle-block-button").hasClass("active-view-button")) {
        $(".chronicle-block-button").removeClass("active-view-button");
        $(".chronicle-list-button").addClass("active-view-button");
      } else if ($(".random-block-button").hasClass("active-view-button")) {
        $(".random-block-button").removeClass("active-view-button");
        $(".random-list-button").addClass("active-view-button");
      } else if (
        $(".alphabetical-block-button").hasClass("active-view-button")
      ) {
        $(".alphabetical-block-button").removeClass("active-view-button");
        $(".alphabetical-list-button").addClass("active-view-button");
      }
    });
 
    $(".block-view-button").click(function () {
      console.log("Block view button clicked.");
      $(".list-sorting-buttons").hide(); // Hide list sorting buttons
      $(".block-sorting-buttons").css("display", "flex");
      $(".home-list-view")
        .removeClass("home-list-view")
        .addClass("home-block-view");
      $(".home-chronicle-list")
        .removeClass("home-chronicle-list")
        .addClass("home-chronicle-block");
      $(
        ".chronicle-block-button, .random-block-button, .alphabetical-block-button"
      ).show();
      $(
        ".chronicle-list-button, .random-list-button, .alphabetical-list-button"
      ).hide();
      updateLastVisibleCard();
      updateWidthBlockView();
      processEventCards();
      updateViews();
      $(".list-view-button").removeClass("active-view-button");
      $(".block-view-button").addClass("active-view-button");
 
      // Conditional checks for transferring the active class from block to list buttons
      if ($(".chronicle-list-button").hasClass("active-view-button")) {
        $(".chronicle-list-button").removeClass("active-view-button");
        $(".chronicle-block-button").addClass("active-view-button");
      } else if ($(".random-list-button").hasClass("active-view-button")) {
        $(".random-list-button").removeClass("active-view-button");
        $(".random-block-button").addClass("active-view-button");
      } else if (
        $(".alphabetical-list-button").hasClass("active-view-button")
      ) {
        $(".alphabetical-list-button").removeClass("active-view-button");
         $(".alphabetical-block-button").addClass("active-view-button");
      }
    });
 
    // BLOCK VIEW SORTING BUTTONS
    $(".chronicle-block-button").click(function () {
      sortChronologically();
 
      updateLastVisibleCard();
      updateWidthBlockView();
      processEventCards();
      updateViews();
      $(".chronicle-block-button").addClass("active-view-button");
      $(".random-block-button").removeClass("active-view-button");
      $(".alphabetical-block-button").removeClass("active-view-button");
    });
 
    $(".random-block-button").click(function () {
      randomizeCards(".list-container .card");
 
      updateLastVisibleCard();
      updateWidthBlockView();
      processEventCards();
      updateViews();
      $(".random-block-button").addClass("active-view-button");
      $(".chronicle-block-button").removeClass("active-view-button");
      $(".alphabetical-block-button").removeClass("active-view-button");
    });
 
    $(".alphabetical-block-button").click(function () {
      sortAlphabetically(".list-container .card");
 
      updateLastVisibleCard();
      updateWidthBlockView();
      processEventCards();
      updateViews();
      $(".alphabetical-block-button").addClass("active-view-button");
      $(".chronicle-block-button").removeClass("active-view-button");
      $(".random-block-button").removeClass("active-view-button");
    });
 
    // LIST VIEW SORTING BUTTONS
    $(".chronicle-list-button").click(function () {
      sortChronologically();
 
      updateLastVisibleCard();
      updateWidthBlockView();
      processEventCards();
      updateViews();
      $(".chronicle-list-button").addClass("active-view-button");
      $(".random-list-button").removeClass("active-view-button");
      $(".alphabetical-list-button").removeClass("active-view-button");
    });
 
    $(".random-list-button").click(function () {
      randomizeCards(".list-container .card");
 
      updateLastVisibleCard();
      updateWidthBlockView();
      processEventCards();
      updateViews();
      $(".random-list-button").addClass("active-view-button");
      $(".chronicle-list-button").removeClass("active-view-button");
      $(".alphabetical-list-button").removeClass("active-view-button");
    });
 
    $(".alphabetical-list-button").click(function () {
      sortAlphabetically(".list-container .card");
 
      updateLastVisibleCard();
      updateWidthBlockView();
      processEventCards();
      updateViews();
      $(".alphabetical-list-button").addClass("active-view-button");
      $(".chronicle-list-button").removeClass("active-view-button");
      $(".random-list-button").removeClass("active-view-button");
    });
  }
 
  // FILTERS  ---------------------  SECTION //
  // General Filters Toggle Button
  $(".general-toggle").click(function () {
    var filtersDiv = $("#filters");
    var resetButton = $(".reset-button");
 
    filtersDiv.toggleClass("is-visible");
 
    if (filtersDiv.hasClass("is-visible")) {
      filtersDiv.css("display", "grid").hide().slideDown(100);
      $(this).text("[FILTER]");
      // Attach click handler to document
      $(document).on("mousedown.hideFilters", function (event) {
        var isOutsideFilters =
          !filtersDiv.is(event.target) &&
          filtersDiv.has(event.target).length === 0;
         var isOnToggle = $(event.target).closest(".general-toggle").length > 0;
 
        if (isOutsideFilters && !isOnToggle) {
          filtersDiv.removeClass("is-visible").slideUp(100, function () {
            $(this).css("display", "none");
          });
          $(".general-toggle").text("[FILTER]");
          // Remove the document click handler
          $(document).off("mousedown.hideFilters");
        }
      });
    } else {
      filtersDiv.slideUp(100, function () {
        $(this).css("display", "none");
      });
      $(this).text("[FILTER]");
      // Remove the document click handler
      $(document).off("mousedown.hideFilters");
     }
     }


     #filters {
     updateLastVisibleCard();
        grid-template-columns: 0.65fr 0.8fr 1fr 1fr;  
    updateWidthBlockView();
    processEventCards();
    updateViews();
  });
 
  // Specific Toggle for Filter Sections like TYPE, ENTITY, etc.
  $(".open-filter").click(function (event) {
    event.stopPropagation();
 
    var filterType = $(this).closest(".filter").data("filter");
    var cardSelector = $(".card").length > 0 ? ".card" : ".community-card"; // Determine which card type is present
 
    console.log("Filter type:", filterType, "Card Selector:", cardSelector);
 
    $("#values-" + filterType).toggle();
 
    if ($("#values-" + filterType).is(":visible")) {
      $(this).addClass("active-filter");
    } else {
      $(this).removeClass("active-filter");
     }
     }
}


#filters.is-visible {
     // Pass the determined card selector to the function
     display:grid;
     updateLastVisibleCard(cardSelector);
    opacity: 1;
     updateWidthBlockView(cardSelector);
    height: auto; /* Adjust to the natural height of the content */
     processEventCards(cardSelector);
}
     updateViews(cardSelector);
.filter {
    white-space: normal;
     overflow-wrap: break-word;
}
.filter-label {
     font-size: 17px;
     line-height: 22px;
     letter-spacing: 0.37px;
}


.header-entry-number {
     console.log("Updated views and borders after filter toggle");
    font-size: 17px;
  });
    line-height: 24px;
     letter-spacing: 0.37px;
    padding-bottom: 5px;
    float: left;
}
.header-authors {
    font-size: 19px;
    line-height: 26px;
    letter-spacing: 0.95px;
    padding-left: 5em;


}
  function filterCards() {
.header-title {
     var displayCountsHtml = "";
    border-top: 1px solid black;
     var cardSelector = $(".card").length > 0 ? ".card" : ".community-card"; // Determine which card type is present
    font-size: 19px;
    line-height: 26px;
    letter-spacing: 0.95px;
    padding: 4px 0;
}
.header-authors a {
    color: black;
    text-decoration: none;
}
.header-authors a:hover {
    font-style: italic;
}
.header-title a {
    color: black;
    text-decoration: none;
}
.header-title a:hover {
    font-style: italic;
}
.header-type {
    border-top: 1px solid black;
    font-size: 19px;
    line-height: 23px;
    letter-spacing: 0.95px;
    padding-top: 4px;
}
.header-index {
    font-size: 17px;
    line-height: 22px;
    letter-spacing: 0.37px;
}
.header-index a {
    color: black;
}
.header-index a:hover {
    color: black;
}
.header-people {
    font-size: 17px;
    line-height: 22px;
    letter-spacing: 0.37px;
}
.header-people a{
    color: black!important;
}
.header-people a:hover{
    color: black;
}
.header-community {
    font-size: 17px;
    line-height: 22px;
    letter-spacing: 0.37px;
}
.header-community a {
    color: black!important;
}
.header-community a:hover{
    color: black;
}
.header-date {
    color: #4D4D4D;
    font-size: 17px;
    line-height: 22px;
    letter-spacing: 0.37px;
}
.header-about {
    font-size: 17px;
    line-height: 22px;
    letter-spacing: 0.37px;
}
.header-about a {
    color: black!important;
}
.header-about a:hover{
    color: black;
}
.about-hide {
     opacity: 0; /* Make it invisible initially */
    visibility: hidden; /* Ensure it's not interactable */
    display: none;
    color: black;
     font-size: 28px;
    line-height: 34px;
    letter-spacing: 1.4px;
    width: 200%;
    border-bottom: 1px solid black;
    padding-bottom: 5px;
    padding-top: 5px;
    transition: opacity 0.8s ease, visibility 0.8s;
}
.header-about:hover + .about-hide {
    display: block;
    opacity: 1; /* Make it fully visible on hover */
    visibility: visible; /* Make it interactable */
}
#about-container {
    display: flex;
    flex-wrap: wrap;
    margin: 0 auto;
    padding-bottom: 12%;
    top: 420px;
    position: relative;
    width: 100%;
}
.about-col {
    width: calc(40% - 0px);
    box-sizing: border-box;
    height: fit-content;
    padding: 0 0 0 0;
    margin-bottom: 30px;
    margin-right: 15px;
}
.about-details-col {
    width: calc(18% - 0px);
    box-sizing: border-box;
    height: fit-content;
    margin-bottom: 30px;
    font-size: 10pt;
    line-height: 16px;
    letter-spacing: 0.4px;
    border-bottom: 1px solid black;
}
.about-details-label {
    border-top: 1px solid black;
    padding-top: 5px;
    margin-bottom: 0 !important;
    text-indent: 35px;
}
.about-details-text {
    margin: 3px 0 !important;
}
.about-main-text {
    text-indent: 35px;
    font-size: 23px;
    line-height: 31px;
    letter-spacing: 1.29px;
    margin-top: 0 !important;
}
.about-bullets {
    text-indent: 35px;
    padding-left: 35px;
}
.about-more-text {
    text-indent: 35px;
    font-size: 23px;
    line-height: 31px;
    letter-spacing: 1.29px;
    margin-top: 0 !important;
}
.about-label {
    font-size: 15px;
    line-height: 19px;
    letter-spacing: 0.48px;
    border-top: none!important;
    text-indent: 35px;
    margin-bottom: 0 !important;
}
.about-details-contact-label {
    font-size: 15px;
    line-height: 19px;
    letter-spacing: 0.48px;
    border-top: none!important;
    text-indent: 35px;
    margin-bottom: 0 !important;
}
.about-details-contact {
    font-size: 15px;
    line-height: 18px;
    text-indent: 35px;
    letter-spacing: 0.84px;
    margin-top: 0 !important;
}
/* -----END<------ STYLING HEADER */


    $(".filter .values a[title]").each(function () {
      var anchor = $(this);
      var filterValue = anchor.attr("title").toLowerCase();
      var count = 0;


img {
      if (anchor.find("button").hasClass("active")) {
    border: 0;
        $(cardSelector).each(function () {
    width: 50px;
          var card = $(this);
    height: auto;
          $(".filter").each(function () {
}
            var filterType = $(this).data("filter");
            var cardValue = card
              .find("." + filterType)
              .text()
              .toLowerCase();
            if (cardValue.indexOf(filterValue) !== -1) {
              count++;
            }
          });
        });


.home-block-view {
        displayCountsHtml +=
    display: none;
          "<span>[" + count + "] " + filterValue + "</span> ";
    position: relative;
      }
    top: 440px;
     });
    width: -moz-available!important;
     width: -webkit-fill-available!important;
}
.home-list-view {
    display: none;
    position: relative;
    top: 440px;
}


/* ----->START------ BUTTONS IN HOME LIST BLOCK CHRONICLE RANDOM ALPHABETICAL */
    if (displayCountsHtml) {
      $(".count-filtered-cards").html(displayCountsHtml).show();
    } else {
      $(".count-filtered-cards").hide();
    }


.active-view-button button {
    // Apply filtering and pass the determined card selector to the function
     text-decoration: underline;
     applyFiltering(cardSelector);
}


/* Block and List View Buttons */
     updateLastVisibleCard(cardSelector);
.view-container-buttons {
     updateWidthBlockView(cardSelector);
     display: flex;
     processEventCards(cardSelector);
     justify-content: space-between; /* This puts one group on the left, and the other on the right */
     updateViews(cardSelector);
     position: relative;
 
     top: 420px;
     console.log("Filtering process complete, updated views and borders");
}
   }
.view-buttons, .order-buttons {
    display: flex;
    justify-content: left;
}
.home-view-buttons, .home-order-buttons {
    display: flex;
    justify-content: left;
    position: relative;
    z-index: 1000;
}
.view-buttons, .order-buttons {
    display: flex;
    justify-content: left;
    position: relative;
    z-index: 1000;
}
.home-list-sorting-buttons, .home-block-sorting-buttons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: flex-end;
}
.list-sorting-buttons, .block-sorting-buttons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: flex-end;
}
.home-list-sorting-buttons {
    display: none; /* Initially hide the sorting buttons */
}
.block-sorting-buttons {
    display: none; /* Initially hide the sorting buttons */
}
.list-view-button, .block-view-button, .chronicle-button, .random-button, .alphabetical-button, .chronicle-list-button, .random-list-button, .alphabetical-list-button, .chronicle-block-button, .random-block-button, .alphabetical-block-button, .home-list-view-button, .home-block-view-button, .home-chronicle-list-button, .home-random-list-button, .home-alphabetical-list-button, .home-chronicle-block-button, .home-random-block-button, .home-alphabetical-block-button {
    font-size: 19px;
    line-height: 26px;
     letter-spacing: 0.95px;
    padding-inline: 2px;
    display: inline-block;
}
.home-list-view-button button:hover, .home-block-view-button button:hover, .home-chronicle-block-button button:hover, .home-chronicle-list-button button:hover, .home-random-block-button button:hover, .home-random-list-button button:hover, .home-alphabetical-block-button button:hover, .home-alphabetical-list-button button:hover{
  text-decoration: underline;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="white" stroke="black" stroke-width="1" /></svg>') 14 14, auto;
}
.home-list-view-button button:focus, .home-block-view-button button:focus, .home-chronicle-block-button button:focus, .home-chronicle-list-button button:focus, .home-random-block-button button:focus, .home-random-list-button button:focus, .home-alphabetical-block-button button:focus, .home-alphabetical-list-button button:focus{
  text-decoration: underline;
   cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="white" stroke="black" stroke-width="1" /></svg>') 14 14, auto;
}
.list-view-button button, .block-view-button button, .chronicle-button button, .random-button button, .alphabetical-button button, .chronicle-list-button button, .random-list-button button, .alphabetical-list-button button, .chronicle-block-button button, .random-block-button button, .alphabetical-block-button button, .home-list-view-button button, .home-block-view-button button, .home-chronicle-list-button button, .home-random-list-button button, .home-alphabetical-list-button button, .home-chronicle-block-button button, .home-random-block-button button, .home-alphabetical-block-button button{
    background: transparent;
    border: none;
    font-family: HALColant-TextRegular!important;
    font-size: 19px;
    line-height: 26px;
    letter-spacing: 0.4px;
    padding-inline: 5px;
}


/* -----END<------ BUTTONS IN HOME LIST BLOCK CHRONICLE RANDOM ALPHABETICAL */
  function applyFiltering() {
    // Determine which card selector to use based on the elements present in the DOM
    var cardSelector = $(".card").length > 0 ? ".card" : ".community-card";


/* ----->START------ LIST AND BLOCK VIEW */
    // Apply the logic to the determined card type
    $(cardSelector)
      .show()
      .each(function () {
        var card = $(this);
        var hideCard = false;


/* BLOCK VIEW */
        $(".filter").each(function () {
.home-chronicle-block div.list-container {
          if (hideCard) return;
    display: flex;
    flex-wrap: wrap;
    margin: 0 auto;
    padding-left: 1px;
}
/* Card for BLOCK view */
.home-chronicle-block div.list-container div.card {
  position: relative;
  width: calc(20% - 0px);
  box-sizing: border-box;
  border: 1px solid black;
  height: fit-content;
  padding: 5px 10px;
  margin-bottom: 30px;
  font-size: 17px;
  line-height: 24px;
  letter-spacing: 0.9px;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-size="24" font-family="Arial" fill="black">⤢</text></svg>') 16 16, auto;
}
.home-chronicle-block div.list-container div.card:hover {
    background: #f3f3f3;
}
.home-chronicle-list div.list-container div.card:hover {
    background: #f3f3f3;
}
.home-chronicle-block div.list-container div.event:hover {
  background: black;
  color: white !important;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="white" stroke="black" stroke-width="1" /></svg>') 14 14, auto;
}


.home-chronicle-block div.list-container div.event:hover .entry-number,
          var filterType = $(this).data("filter");
.home-chronicle-block div.list-container div.event:hover .event-link,
          var activeFilters = $(this)
.home-chronicle-block div.list-container div.event:hover .title,
            .find(".values a[title] button.active")
.home-chronicle-block div.list-container div.event:hover .container-people-date .people a,
            .map(function () {
.home-chronicle-block div.list-container div.event:hover .container-people-date .date,
              return $(this).parent("a").attr("title").toLowerCase();
.home-chronicle-block div.list-container div.event:hover .type a {
            })
  color: white !important;
            .get();
}


.home-chronicle-list div.list-container div.event:hover {
          if (activeFilters.length > 0) {
  background: black;
            var cardValue = card
  color: white !important;
              .find("." + filterType)
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="white" stroke="black" stroke-width="1" /></svg>') 14 14, auto;
              .text()
}
              .toLowerCase();
            var matchesFilter = activeFilters.some(function (filterValue) {
              return cardValue.indexOf(filterValue) !== -1;
            });
            if (!matchesFilter) hideCard = true;
          }
        });


.home-chronicle-list div.list-container div.event:hover .entry-number,
        if (hideCard) card.hide();
.home-chronicle-list div.list-container div.event:hover .event-link,
      });
.home-chronicle-list div.list-container div.event:hover .title,
   }
.home-chronicle-list div.list-container div.event:hover .container-people-date .people a,
.home-chronicle-list div.list-container div.event:hover .container-people-date .date,
.home-chronicle-list div.list-container div.event:hover .type a {
   color: white !important;
}


.home-chronicle-block div.list-container div.event div.entry-number {
  function updateLastVisibleCard() {
     z-index: 100000;
     // Target only the list view container for updating the last visible card
}
     $(".home-chronicle-list div.list-container div.card").removeClass(
.home-chronicle-block div.list-container div.event div.entry-number:hover {
      "last-visible"
     color: white;
     );
}
.home-chronicle-block div.list-container div.card:not(:first-child) {
    margin-left: -1px;
    border-left: 1px solid black;
}
.home-chronicle-block div.list-container div.card:nth-child(5n + 1) {
    transform: none;
    width: calc(20% - 0px);
}
.home-chronicle-block div.list-container div.card:last-child {
     margin-right: 0;
    border-right: 1px solid black;
}


/* Contents of Card for BLOCK view */
    // Find the last visible card within the list view and add the class
.home-chronicle-block div.list-container div.card div.images {
     var lastVisibleCard = $(
    border-top: 1px solid black;
      ".home-chronicle-list div.list-container div.card:visible:last"
    padding-top: 5px;
     );
    padding-bottom: 5px;
     lastVisibleCard.addClass("last-visible");
    display: flex;
  }
     flex-wrap: nowrap;
}
.home-chronicle-block div.list-container div.card div.image1,  .home-chronicle-block div.list-container div.card div.image2 {
     margin-right: 10px;  
     transition: transform 0.3s ease;
    transform-origin: top left;
}
.home-chronicle-block div.list-container div.card div.image1 img,  .home-chronicle-block div.list-container div.card div.image2 img{
    display: block;
    width: auto;
    height: 75px;


}
  function updateWidthBlockView() {
    // Target only the block view container for updating the with of card
    $(".home-chronicle-block div.list-container").css("width", "100%");
    $(".home-chronicle-block div.list-container div.card").css(
      "width",
      "calc(20% - 0px)"
    );
    $(
      ".home-chronicle-block div.list-container div.card:nth-child(5n + 1)"
    ).css("width", "calc(20% + 4px)");
  }


.home-chronicle-block div.list-container div.card div.image1:hover,
  // Reset function to remove active filters
.home-chronicle-block div.list-container div.card div.image2:hover {
  $(".reset-filter").click(function (event) {
     transform: scale(2);  
     event.stopPropagation(); // Prevent event bubbling
    position: relative;
    z-index: 900000;
}


.home-chronicle-block div.list-container div.card div.image3, .home-chronicle-block div.list-container div.card div.image4, .home-chronicle-block div.list-container div.card div.image5 {
    // Remove 'active' class from all filter buttons
     display: none;
    $("#filters .values button").removeClass("active");
}
     $(".open-filter").removeClass("active-filter");
.home-chronicle-block div.list-container div.card div.image3 img, .home-chronicle-block div.list-container div.card div.image4 img, .home-chronicle-block div.list-container div.card div.image5 img {
    display: none;
}


.home-chronicle-block div.list-container div.card div.entry-number {
    // Reset and hide the filter counts
  padding-bottom: 3px;
    $(".count-filtered-cards").text("").hide();
  float: left;
}
.title a {
  color: black !important;
  pointer-events: none;
  cursor: default;
}


.home-chronicle-block div.list-container div.card div.event-link {
     filterCards(); // Reapply filtering based on the updated active buttons
     text-decoration: underline;
    font-size: 16px;
    line-height: 26px;
    float: right;
    margin-top: -2px;
    font-family: Arial, sans-serif;
    text-underline-offset: 3px;
}


.home-chronicle-block div.list-container div.card.event .title {
    // Update other UI elements as needed, excluding the general toggle button
  font-size: 23px;
    updateLastVisibleCard();
  line-height: 26px;
    updateWidthBlockView();
  font-style: italic;
     processEventCards();
  text-align: left;
     updateViews();
  letter-spacing: 0.9px;
   });
  padding: 6px 6px 6px 0;
  border-top: 1px solid black
}
.home-chronicle-list div.list-container div.card.event div.title {
  font-size: 17px;
  line-height: 24px;
  letter-spacing: 0.9px;
  text-align: left;
  width: calc(60% - 0px);
  max-width: 40%;
}
.home-chronicle-list div.list-container div.card.event .container-people-date {
  display: flex;
  width: calc(20% - 0px);
  padding-right: 50px;
}
.home-chronicle-list div.list-container div.card.event div.people {
  width: auto;
  flex: 1;
}
.home-chronicle-list div.list-container div.card.event div.date {
     width: auto;
     flex: 1;
    text-align: center;
    width: calc(10% - 0px);
    white-space: nowrap;
    position: absolute;
    left: 80%;
}
.home-chronicle-list div.list-container div.card.event div.date:hover {
    color: #fff !important;
}
.home-chronicle-block div.list-container div.event:hover .date,
.home-chronicle-list div.list-container div.event:hover .date {
   color: #fff !important;
}
.home-chronicle-block div.list-container div.card.event div.container-people-date {
    display: flex; /* Enables flexbox layout mode */
    justify-content: space-between;
    border-top: 1px solid black;
}
.home-chronicle-block div.list-container div.card.event div.people {
    padding-left: 0!important;
}


.home-chronicle-block div.list-container div.card div.container-people-date .people {
  $("#filters .values button").click(function () {
  flex: 1;
    console.log("Filter is clicked!!!");
  text-align: left;
    $(this).toggleClass("active");
  border: none!important;
    filterCards(); // Re-apply the filters based on the updated active buttons
  line-height: 23px !important;
  padding-top: 6px;
}
.home-chronicle-block div.list-container div.card div.container-people-date .date {
  flex: 1;
  text-align: right;
  line-height: 23px !important;
  padding-top: 6px;
}


.home-chronicle-block div.list-container div.card div.people {
     updateLastVisibleCard();
  line-height: 23px!important;
     updateWidthBlockView();
  padding-top: 2px;
     processEventCards();
  padding-left: 5em;
     updateViews();
}
  });
.home-chronicle-block div.list-container div.card div.people a {
     color: black;
     text-decoration: underline;
}
.home-chronicle-block div.list-container div.card div.people a:hover {
     font-style: italic;
     color: black;
}


.home-chronicle-block div.list-container div.card div.title {
   // Hide filters when window is scrolled
   font-size: 23px;
   $(window).on("scroll", function () {
   padding: 6px 0;
    var filtersDiv = $("#filters");
  border-top: 1px solid black;
}


.home-chronicle-block div.list-container div.card div.type {
     if (filtersDiv.hasClass("is-visible")) {
     border-top: 1px solid black;
      filtersDiv.removeClass("is-visible").slideUp(100, function () {
    padding-top: 5px;
        $(this).css("display", "none");
}
        // The filter reset code has been removed to keep the filters active
.home-chronicle-block div.list-container div.card div.type a {
      });
    color: black;
      $(".general-toggle").text("[FILTER]"); // Update the toggle button text
    text-decoration: none;
     }
}
  });
.home-chronicle-block div.list-container div.card div.type a:hover {
    font-style: italic;
    color: black;
}
.home-chronicle-block div.list-container div.card.event div.type a:hover {
   
}
/* Card for LIST view */
.home-chronicle-list div.list-container {
    width: 100%; /* For Chrome and other browsers */
    padding-bottom: 80px;
}
.home-chronicle-list div.list-container div.card {
  width: -moz-available!important;
  width: -webkit-fill-available!important;
  width: 100%;
  margin-bottom: 0;
  border-left: 1px solid black;
  border-right: 1px solid black;
  border-bottom: none;
  border-top: 1px solid black;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-size="24" font-family="Arial" fill="black">⤢</text></svg>') 16 16, auto;
  display: flex;
  align-items: flex-start;
  justify-content: start;
  font-size: 17px;
  line-height: 24px;
  letter-spacing: 0.9px;
  transition-delay: .001s;
  padding: 5px 10px;
}
.home-chronicle-list div.list-container div.card:not(:first-child) {
    margin-left: 0;
    border-left: 1px solid black;
}
.home-chronicle-list div.list-container div.card:nth-child(5n + 1) {
    margin-left: 0;
     transform: none;
}
/*
.home-chronicle-list div.list-container div.card:last-child {
    margin-right: 0;
    border-bottom: 1px solid black;
} */
.home-chronicle-list div.list-container div.card.last-visible {
    margin-right: 0;
    border-bottom: 1px solid black;
}


/* Contents of Card for LIST view */
  // MODAL ARTICLE  ---------------------   SECTION //
.home-chronicle-list div.list-container div.card div.entry-number {
  // Format paragraphs
    width: calc(10% - 0px);
  function formatParagraphs(text) {
}
     var paragraphs = text.split("\n").filter(function (p) {
.home-chronicle-list div.list-container div.event div.entry-number {
      return p.trim() !== "";
    width: calc(3.5% + 5px);
     });
}
     return paragraphs
.home-chronicle-list div.list-container div.event div.event-link {
      .map(function (p) {
    width: calc(6.2% - 0px);
        return "<p>" + p.trim() + "</p>";
    text-decoration: underline;
      })
    font-size: 16px;
      .join("");
    line-height: 24px;
  }
    float: right;
    margin-top: -3.4px;
    font-family: Arial, sans-serif;
     text-underline-offset: 3px;
}
.home-chronicle-list div.list-container div.card div.people {
    width: calc(20% - 0px);
     border: none;
    padding-right: 50px;
}
.home-chronicle-list div.list-container div.card div.people a {
    text-decoration: underline;
     color: black;
}
.home-chronicle-list div.list-container div.card.event div.people a {
 
}
.home-chronicle-list div.list-container div.card div.people a:hover {
    font-style: italic;
}
.home-chronicle-list div.list-container div.card div.title-images {
    display: flex;
    width: calc(60% - 0px);
    max-width: 50%;
}
.home-chronicle-list div.list-container div.card div.images {
    display: flex;
    border: none;
    padding-top: 0;
    padding-bottom: 0;
}


.home-chronicle-list div.list-container div.card div.image1 img,  .home-chronicle-list div.list-container div.card div.image2 img{
  var images = []; // Initialize an empty array to store the images
    display: block;
  // Find all image containers within the article content and extract the necessary information
    max-width: 100%;
  $(".article-images .image-container").each(function () {
    width: auto;
     var img = $(this).find("img");
    height: 25px;
     var captionDiv = $(this).find('div[class^="caption-image"]');
}
     var image = {
.home-chronicle-list div.list-container div.card div.image1, .home-chronicle-list div.list-container div.card div.image2  {
      src: img.attr("src"),
     margin-right: 10px;
      alt: img.attr("alt"),
    transition: transform 0.3s ease;
      caption: captionDiv.text(),
     transform-origin: top left;
      captionClass: captionDiv.attr("class"),
}
     };
.home-chronicle-list div.list-container div.card div.image3, .home-chronicle-list div.list-container div.card div.image4, .home-chronicle-list div.list-container div.card div.image5 {
     images.push(image); // Add the image object to the images array
     display: none;
  });
}
.home-chronicle-list div.list-container div.card div.type {
    width: calc(10% - 0px);
    border: none;
    white-space: nowrap;
    position: absolute;
    left: 90%;
}
.home-chronicle-list div.list-container div.card.event div.type a {
      
}
.home-chronicle-list div.list-container div.card div.type a {
    color: black;
     text-decoration: none;
}
.home-chronicle-list div.list-container div.card div.type a:hover {
    font-style: italic;
}
.home-chronicle-list div.list-container div.card div.title {
    max-width: 50%;
}
.home-chronicle-list div.list-container div.card div.image1:hover,
.home-chronicle-list div.list-container div.card div.image2:hover {
    transform: scale(6);  
}


.card.event + .card.event {
  if (images.length > 0) {
     border-left: none;
     setupImageToggle(images); // Call the setupImageToggle function with the images array
}
    updateImageLabel(1, images.length); // Set the label for the first image immediately
/* -----END<------ LIST AND BLOCK VIEW */
  }


/* ----->START------ POP UP ARTICLE */
  function setupImageToggle(images) {
#list {
     var currentIndex = 0;
     width: 100%!important;
     var enableNavigation = images.length > 1; // Enable navigation only if there is more than one image
}
#show-article-wrapper-entry {
    display: block;
    position: fixed; /* Change to fixed */
    top: 0;
     /*right: 24px;*/
    right: 1.3%;
    width: 41%;
    height: 100vh; /* Set to full viewport height */
    overflow: auto; /* Enables scrolling if content overflows */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
    z-index: 9999; /* Ensure it's above #list */
    /*padding-left: 100px;*/
    margin-top: 50px;
}
#show-article-wrapper-entry #show-article {
    padding-bottom: 50px;
}
/* Hides scrollbar for Webkit browsers */
#show-article-wrapper-entry::-webkit-scrollbar {
    display: none;
}
#show-article-wrapper {
    display: none;
    position: fixed; /* Change to fixed */
    top: 5%;
    /*right: 24px;*/
    right: 1.3%;
    width: 41%;
    height: 100vh; /* Set to full viewport height */
    overflow: auto; /* Enables scrolling if content overflows */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
    z-index: 9999; /* Ensure it's above #list */
    /*padding-left: 100px;*/
}
/* Hides scrollbar for Webkit browsers */
#show-article-wrapper::-webkit-scrollbar {
    display: none;
}
#show-article {
    background-color: #FAFAFA;
    border: 1px solid;
    padding: 0px 10px 0 10px;
    position: relative;
    top: 40px;
    /*margin-left: 36px;*/
    margin-left: 4.6%;
}
#show-article-before {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #FAFAFA;
    border: 1px solid #080808;
    transition: all 0.3s ease;
    opacity: 0; /* Initially hidden */
    z-index: -1; /* Ensures it's under the main content */
}
#show-article:hover #show-article-before {
    opacity: 1;
        scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
}
/* Hides scrollbar for Webkit browsers */
#show-article::-webkit-scrollbar {
    display: none;
}


.article-metadata {
    function showImage(index) {
    display: flex;
      currentIndex = index;
    border-bottom: 1px solid black;
      var image = images[currentIndex];
    padding: 5px 0 5px 0;
      updateImageLabel(currentIndex + 1, images.length);
}
      $("#article-content")
.article-metadata-label {
        .find(".article-images")
    text-transform: uppercase;
        .html(
    margin-bottom: 0 !important;
          getImageHtml(image, currentIndex, images.length, enableNavigation)
    margin-top: 5px!important;
        );
    font-size: 15px;
     }
    line-height: 23px;
    letter-spacing: 0.48px;
}
.article-metadata-value {
    text-transform: capitalize;
    font-size: 19px;
    line-height: 23px;
    letter-spacing: 0.6px;
    margin-top: 0 !important;
     margin-bottom: 7px !important;
}
.article-metadata-value a {
  color: black !important;
}


.article-metadata-column:not(:first-child) {
    // Attach click handlers only if navigation is enabled
    margin-left: 20px;
    if (enableNavigation) {
}
      $("#article-content").on("click", ".next-arrow", function () {
        showImage((currentIndex + 1) % images.length);
      });


.article-metadata-column:nth-child(n+2) {
      $("#article-content").on("click", ".prev-arrow", function () {
    margin-left: 10%;
        showImage((currentIndex - 1 + images.length) % images.length);
}
      });
.article-label-description {
     }
    text-transform: uppercase;
    text-indent: 35px;
    padding-top: 5px;
    font-size: 15px;
    line-height: 23px;
    letter-spacing: 0.48px;
}
.article-label-image {
    text-transform: uppercase;
    text-indent: 35px;
    font-size: 15px;
    line-height: 23px;
    letter-spacing: 0.48px;
    padding-top: 5px;
}
.article-label-reflection {
    text-transform: uppercase;
    text-indent: 35px;
    padding-top: 5px;
    font-size: 15px;
    line-height: 23px;
    letter-spacing: 0.48px;
}
.article-label-quote {
    text-transform: uppercase;
    text-indent: 35px;
    font-size: 15px;
    line-height: 23px;
    letter-spacing: 0.48px;
    padding-top: 5px;
}
.article-label-modification-date {
    text-transform: uppercase;
    padding-top: 5px;
    text-indent: 35px;
    color: grey;
    display: inline-block;
    font-size: 15px;
    line-height: 23px;
    letter-spacing: 0.48px;
}
.article-entry-number {
    border-bottom: 1px solid black;
    font-size: 19px;
    line-height: 23px;
    letter-spacing: 0px;
    padding-bottom: 5px;
    padding-top: 7px;
}
.article-people {
    font-size: 25px;
    line-height: 30px;
    letter-spacing: 1.4px;
    text-decoration: underline;
    text-align: center;
    padding-top: 25px;
    margin-bottom: 5px!important;
}
.article-people a {
    color: black;
    text-decoration: underline;
}
.article-people a:hover {
    font-style: italic;
    color: black;
}
.article-title-link {
    border-bottom: 1px solid black;
    padding-bottom: 10px;
    display: flex; /* Use flexbox */
    flex-direction: column; /* Stack items vertically */
    align-items: center; /* Align items horizontally in the center */
    justify-content: center; /* Align items vertically in the center */
    text-align: center; /* Center the text */
}
.article-title {
    font-size: 25px;
    line-height: 30px;
    letter-spacing: 1.4px;
    text-align: center;
    margin-bottom: 0!important;
    margin-top: 0 !important;
    max-width: 70%;
}
.article-title a{
    color: black!important;
    font-size: 25px;
    line-height: 30px;
    letter-spacing: 1.4px;
    text-align: center;
    margin-bottom: 0!important;
    margin-top: 0 !important;
    max-width: 70%;
}
.article-type {
    font-size: 19px;
    line-height: 23px;
    letter-spacing: 0.4px;
    border-bottom: 1px solid black;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 5px 0 5px 0;
}
.article-type a {
    color: black;
    text-decoration: none;
}
.article-type a:hover {
    font-style: italic;
    color: black;
}
.article-entity {
    font-size: 12pt;
    line-height: 25px;
    letter-spacing: 0.4px;
    margin-top: 0 !important;
}
.article-discipline {
    font-size: 12pt;
    line-height: 25px;
    letter-spacing: 0.4px;
    margin-top: 0 !important;
}
.article-subject {
    font-size: 12pt;
    line-height: 25px;
    letter-spacing: 0.4px;
    margin-top: 0 !important;
}
.article-images {
    border-bottom: 1px solid black;
    padding-bottom: 7px;
}
.article-image {
    position: relative;
}
.external-link-icon {
    display: flex; /* Use flexbox */
    align-items: center; /* Align items vertically in the center */
    justify-content: center; /* Center the content horizontally */
    width: 20px; /* Adjust the width as needed */
    height: 20px; /* Adjust the height as needed */
    font-size: 17px;
    line-height: 22px;
    letter-spacing: 0.48px;
    color: black !important;
    text-decoration: none;
}
.external-link-icon a {
    font-size: 17px;
    line-height: 22px;
    letter-spacing: 0.48px;
    color: black !important;
     text-decoration: none;
}
.external-link-icon a:hover {
    text-decoration: underline;
}
p.pdf-link-icon {
  margin-right: 10px;
}
.text-symbol {
    color: black; /* Ensure the symbol is black */
    font-size: 15px;
}


.pdf-link-icon {
     // Display the first image
  font-size: 17px;
     showImage(currentIndex);
  line-height: 22px;
  }
  letter-spacing: 0.48px;
  color: black !important;
  margin-right: 25px;
  margin-left: -20px;
}
.pdf-link-icon a {
  font-size: 17px;
  line-height: 22px;
  letter-spacing: 0.48px;
  color: black !important;
}
.link-pdf {
     display: flex;
     margin-top: 5px;
    align-items: center;
}


.image-container {
  function getImageHtml(image, currentIndex, totalImages, enableNavigation) {
     position: relative;
     var imageLabel = currentIndex + 1 + "/" + totalImages + " IMAGES";
    display: inline-block;
}


.image-container img {
    // Render navigation arrows based on the enableNavigation flag
     display: block;
     var navigationHtml = enableNavigation
    max-width: 100%;
      ? '<div class="prev-arrow"><</div><div class="next-arrow">></div>'
    width: auto;
      : "";
    height: 400px;
    padding-bottom: 3px;
}


.arrows-and-image {
    return (
    position: relative;
      '<div class="image-navigation">' +
     width: fit-content;
      '<p class="article-label-image">' +
}
      imageLabel +
      "</p>" +
      '<div class="image-container">' +
      '<div class="arrows-and-image">' +
      navigationHtml +
      '<img src="' +
      image.src +
      '" alt="' +
      image.alt +
      '">' +
      "</div>" +
      '<div class="' +
      image.captionClass +
      '">' +
      image.caption +
      "</div>" +
      "</div>" +
      "</div>"
     );
  }


.image-navigation {
  function updateImageLabel(currentIndex, totalImages) {
     position: relative;
     var imageLabel = currentIndex + "/" + totalImages + " IMAGES";
     display: inline-block;
     $("#article-content .article-label-image").text(imageLabel);
}
  }
.image-navigation:hover .prev-arrow,
.image-navigation:hover .next-arrow {
    display: block;
}


  $(".caption-image1").each(function () {
    // Split the caption at each <br> tag and wrap each line in a span
    var htmlContent = $(this).html();
    var lines = htmlContent.split("<br>");
    var wrappedLines = lines.map(function (line) {
      return '<span class="caption-line">' + line + "</span>";
    });
    var newHtml = wrappedLines.join("<br>");
    $(this).html(newHtml);
  });


.image-navigation:hover .caption-image1,
  function setShowArticleRotationEffect() {
.image-navigation:hover .caption-image2,
    const offset = 20;
.image-navigation:hover .caption-image3,
    const showArticle = document.querySelector("#show-article");
.image-navigation:hover .caption-image4,
    const h = showArticle.clientHeight;
.image-navigation:hover .caption-image5,
    const theta = -Math.atan(offset / h);
.image-navigation:hover .related-article-caption-image1,
    const a = Math.cos(theta);
.image-navigation:hover .related-article-caption-image2,
    const b = Math.sin(theta);
.image-navigation:hover .related-article-caption-image3,
    const c = -Math.sin(theta);
.image-navigation:hover .related-article-caption-image4,
    const d = Math.cos(theta);
.image-navigation:hover .related-article-caption-image5 {
    const showArticleBefore = document.querySelector("#show-article-before");
    display: block;
    const transformValue =
}
      "matrix(" + a + "," + b + "," + c + "," + d + ",0,0)";
    showArticleBefore.style.transform = transformValue;
  }


.prev-arrow, .next-arrow {
  function openEvent(element, event) {
     position: absolute;
     event.stopPropagation();
    top: 53%;
     event.preventDefault();
    transform: translateY(-53%);
     cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="white" stroke="black" stroke-width="1" /></svg>') 14 14, auto;
    user-select: none;
    font-size: 40px;
    color: white; /* Adjust color as needed */
    display: none; /* Hide arrows initially */
    z-index: 10;
}


.prev-arrow {
    var url = $(element).find(".link a").attr("href");
     left: 10px;
    if (url) {
}
      window.open(url, "_blank").focus();
     }
  }


.next-arrow {
   function openModal(cardElement, event) {
    right: 10px;
    event.stopPropagation();
}
     $("#print-chooser").hide();
.caption-line {
     $("#show-article").removeClass("print-opts-open");
    display: contents;
     var pageTitle = $(cardElement).data("page") || null; // e.g. "090"
   position: absolute;
     window.currentEntryTitle = pageTitle;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  color: white;
  padding: 0px;
  text-align: center;
  font-size: 25px;
  line-height: 28px;
  letter-spacing: 0.4px;
  font-style: italic;
  font-weight: bold;
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  text-overflow: ellipsis;
  text-shadow: 2px 2px 40px rgba(0,0,0,.8);
}
.caption-image1, .caption-image2, .caption-image3, .caption-image4, .caption-image5, .related-article-caption-image1, .related-article-caption-image2, .related-article-caption-image3, .related-article-caption-image4, .related-article-caption-image5 {
     display: none;
    caption-side: bottom;
    font-size: 15px;
    line-height: 18px;
    letter-spacing: 0.48px;
      
}
.article-book {
    text-transform: capitalize;
    font-size: 19px;
    line-height: 23px;
    letter-spacing: 0.6px;
    margin-top: 0 !important;
    margin-bottom: 7px !important;
}
.article-web {
    text-transform: capitalize;
    font-size: 19px;
    line-height: 23px;
    letter-spacing: 0.6px;
    margin-top: 0 !important;
    margin-bottom: 7px !important;
     border-bottom: 1px solid black;
}
.article-year {
    text-transform: capitalize;
    font-size: 19px;
    line-height: 23px;
    letter-spacing: 0.6px;
    margin-top: 0 !important;
    margin-bottom: 7px !important;
    border-bottom: 1px solid black;
}
.article-has-url {
    text-transform: capitalize;
    font-size: 19px;
    line-height: 23px;
    letter-spacing: 0.6px;
     margin-top: 0 !important;
    margin-bottom: 7px !important;
    border-bottom: 1px solid black;
}
.article-has-pdf {
    text-transform: capitalize;
    font-size: 19px;
    line-height: 23px;
    letter-spacing: 0.6px;
    margin-top: 0 !important;
    margin-bottom: 7px !important;
    border-bottom: 1px solid black;
}
.article-internal-ref {
    text-transform: capitalize;
    font-size: 19px;
    line-height: 23px;
    letter-spacing: 0.6px;
    margin-top: 0 !important;
    margin-bottom: 7px !important;
    border-bottom: 1px solid black;
}
.article-external-ref {
    font-size: 19px;
    line-height: 23px;
    letter-spacing: 0.6px;
    margin-top: 0 !important;
    margin-bottom: 7px !important;
    border-bottom: 1px solid black;
}
.article-external-reference {
    font-size: 19px;
    line-height: 23px;
    letter-spacing: 0.6px;
    margin-top: 0 !important;
    margin-bottom: 7px !important;
    border-bottom: 1px solid black;
    text-indent: 35px;
    padding-bottom: 5px;
}
.article-label-external-reference {
  text-transform: uppercase;
  text-indent: 35px;
  padding-top: 5px;
  font-size: 15px;
  line-height: 23px;
  letter-spacing: 0.48px;
}
.article-external-ref a {
  padding-right: 0px !important;
  color: black !important;
}
.article-external-reference a {
    padding-right: 0px !important;
    color: black !important;
}
.article-format-participation {
    text-transform: capitalize;
    font-size: 19px;
    line-height: 23px;
    letter-spacing: 0.6px;
    margin-top: 0 !important;
    margin-bottom: 7px !important;
    border-bottom: 1px solid black;
}
.article-setting {
    text-transform: capitalize;
    font-size: 19px;
    line-height: 23px;
    letter-spacing: 0.6px;
    margin-top: 0 !important;
    margin-bottom: 7px !important;
    border-bottom: 1px solid black;
}
.article-notes {
    font-size: 23px;
    line-height: 31px;
    letter-spacing: 1.29px;
    text-align: left;
    text-indent: 35px;
    border-bottom: 1px solid black;
}
.image-container:hover .caption-image1,
.image-container:hover .caption-image2,
.image-container:hover .caption-image3,
.image-container:hover .caption-image4,
.image-container:hover .caption-image5 {
    display: block;
}


.image-container:hover .related-article-caption-image1,
    var isRelatedArticle = $(cardElement).hasClass("related-article");
.image-container:hover .related-article-caption-image2,
    showArticleWrapper.css("display", "block");
.image-container:hover .related-article-caption-image3,
.image-container:hover .related-article-caption-image4,
.image-container:hover .related-article-caption-image5 {
    display: block;
}


.article-description {
     // Clear existing content in modal
    font-size: 23px;
     $("#article-title").empty();
    line-height: 31px;
     $("#article-content").empty();
    letter-spacing: 1.29px;
    text-align: left;
     text-indent: 35px;
     border-bottom: 1px solid black;
}
.article-reflection {
    font-size: 23px;
    line-height: 31px;
    letter-spacing: 1.29px;
    text-align: left;
    text-indent: 35px;
    margin-top: 0 !important;
    border-bottom: 1px solid black;
     padding-bottom: 5px;
}
.article-quote {
    font-size: 30px;
    line-height: 31px;
    letter-spacing: 1.5px;
    font-style: italic;
    text-align: left;
    text-indent: 35px;
    margin-top: 0 !important;
    border-bottom: 1px solid black;
    padding-bottom: 5px;
}


.article-modification-date {
    if (isRelatedArticle) {
    color: grey;
      // Handle card elements (existing logic)
    text-align: left;
      var cardImages = [];
    text-indent: 10px;
      for (var i = 1; i <= 5; i++) {
    margin-top: 0 !important;
        var imageClass = ".related-article-image" + i;
    display: inline-block;
        var captionClass = ".related-article-caption-image" + i;
    padding-bottom: 5px;
        var imageElem = $(cardElement).find(imageClass + " img");
    font-size: 15px;
    line-height: 23px;
    letter-spacing: 0.48px;
}


#related-articles {
        if (imageElem.length) {
    margin-top: 0px;
          var captionText = $(cardElement)
    /*margin-left: 36px;*/
            .find(imageClass + " " + captionClass)
    margin-left: 4.6%;
            .text();
    padding-bottom: 80px;
          cardImages.push({
    padding-top: 100px;
            link: $(cardElement)
}
              .find(imageClass + " a")
.related-articles-label {
              .attr("href"),
    text-transform: uppercase;
            src: imageElem.attr("src"),
    margin-bottom: 0 !important;
            alt: imageElem.attr("alt"),
    text-indent: 35px;
            caption: captionText,
}
            captionClass: "related-article-caption-image" + i,
.related-articles-container {
          });
    display: flex;
        }
    flex-wrap: wrap;
      }
    gap: 0; /* No gap between articles */
}
.related-article {
    width: calc(50% - 0px); /* Adjusted width */
    box-sizing: border-box;
    border: 1px solid black;
    height: fit-content;
    padding: 3px 10px 6px 10px;
    margin-bottom: 30px;
    font-size: 19px;
    line-height: 26px;
    letter-spacing: 0.95px;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="white" stroke="black" stroke-width="1" /></svg>') 14 14, auto;
    background-color: #FAFAFA;
}


.related-article:not(:first-child) {
      if (cardImages.length > 1) {
    margin-left: -1px;
        setupImageToggle(cardImages);
}
      }
      // Handle related-article elements
      var entryNumber = $(cardElement)
        .find(".related-article-entry-number")
        .text();
      var peopleHtml = $(cardElement).find(".related-article-people").html();
      var title = $(cardElement).find(".related-article-title").text();
      var typeHtml = $(cardElement).find(".related-article-type").html();
      var externalPdfURL = $(cardElement)
        .find(".related-article-pdf a")
        .attr("href");
      var externalLinkURL = $(cardElement)
        .find(".related-article-link a")
        .attr("href");
      var entity = $(cardElement).find(".related-article-entity").text();
      var discipline = $(cardElement)
        .find(".related-article-discipline")
        .text();
      var subjectHtml = $(cardElement).find(".related-article-subject").html();
      var description = $(cardElement)
        .find(".related-article-description")
        .html();
      var reflection = $(cardElement)
        .find(".related-article-reflection")
        .html();
      var quote = $(cardElement).find(".related-article-quote").text();
      var modificationDate = $(cardElement)
        .find(".related-article-modification-date")
        .text();


.related-article:nth-child(2n + 1) {
      // Update modal content for related-article
    margin-left: 0;
      $("#article-title").html(
}
        '<p class="article-entry-number">' +
          entryNumber +
          '</p><p class="article-people">' +
          peopleHtml +
          "</p>"
      );
      var articleContentHtml = '<div class="article-title-link">';
      articleContentHtml += '<p class="article-title">' + title + "</p>";
      // Create a div that will wrap the links
      articleContentHtml += '<div class="link-pdf">';


.related-article:last-child {
      if (externalPdfURL) {
    margin-right: 0;
        articleContentHtml +=
}
          '<a href="' +
.related-article-entry-number {
          externalPdfURL +
    padding-bottom: 3px;
          '" target="_blank" class="pdf-link-icon">[PDF<span class="text-symbol">⤴</span>]</a>';
}
      }
.related-article-people {
      if (externalLinkURL) {
    text-decoration: underline;
        articleContentHtml +=
    border-top: 1px solid black;
          '<a href="' +
    line-height: 23px!important;
          externalLinkURL +
    padding-top: 6px;
          '" target="_blank" class="external-link-icon">[WEB<span class="text-symbol">⤴</span>]</a>';
}
      }
.related-article-people a {
    color: black;
    text-decoration: underline;
}
.related-article a:hover {
    font-style: italic;
    color: black;
}
.related-article-title {
   
}
.related-article-type {
    border-top: 1px solid black;
}


.related-article-type a {
      // Close the .link-pdf div
    color: black;
      articleContentHtml += "</div>";
    text-decoration: none;
      articleContentHtml += "</div>"; // Close the container div
}
.related-article-type a:hover {
    font-style: italic;
    color: black;
}


#close-button {
      // Append type, entity, discipline, and subject details
    float: right;
      articleContentHtml +=
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="white" stroke="black" stroke-width="1" /></svg>') 14 14, auto;
        '<p class="article-type">' +
    font-size: 20px;
        typeHtml +
    line-height: 24px;
        "</p>" +
    letter-spacing: 0px;
        '<div class="article-metadata">' +
        '<div class="article-metadata-column">' +
        '<p class="article-metadata-label">Entity</p>' +
        '<p class="article-metadata-value">' +
        entity +
        "</p>" +
        "</div>" +
        '<div class="article-metadata-column">' +
        '<p class="article-metadata-label">Discipline</p>' +
        '<p class="article-metadata-value">' +
        discipline +
        "</p>" +
        "</div>" +
        '<div class="article-metadata-column">' +
        '<p class="article-metadata-label">Subject(s)</p>' +
        '<p class="article-metadata-value">' +
        subjectHtml +
        "</p>" +
        "</div>" +
        "</div>";


    position: absolute;   /* override float for precise placement */
      // Add images if any
    top: 8px;
      if (cardImages.length > 0) {
    right: 8px;
        var initialImage = cardImages[0]; // Use the first image initially
}
        var enableNavigation = cardImages.length > 1; // Enable navigation only if more than one image
        articleContentHtml +=
          '<div class="article-images">' +
          getImageHtml(initialImage, 0, cardImages.length, enableNavigation) +
          "</div>";
      }
      // Add non-image content (description, reflection, etc.)
      articleContentHtml +=
        (description
          ? '<p class="article-label-description">Description</p>' +
            '<div class="article-description">' +
            formatParagraphs(description) +
            "</div>"
          : "") +
        (reflection
          ? '<p class="article-label-reflection">Reflection</p>' +
            '<div class="article-reflection">' +
            formatParagraphs(reflection) +
            "</div>"
          : "") +
        (quote
          ? '<p class="article-label-quote">Quote</p>' +
            '<p class="article-quote">' +
            quote +
            "</p>"
          : "") +
        '<p class="article-label-modification-date">Added on</p>' +
        '<div class="article-modification-date">' +
        modificationDate +
        "</div>";


/* print button next to [close] */
      $("#article-content").html(articleContentHtml);
#print-button {
    } else {
  position: absolute;
      // Handle card elements (existing logic)
  top: 8px;
      var cardImages = [];
  right: 60px;         
      for (var i = 1; i <= 5; i++) {
  line-height: 24px;
        var imageClass = ".image" + i;
  font-size: 20px;
        var captionClass = ".caption-image" + i;
  letter-spacing: 0;
        var imageElem = $(cardElement).find(imageClass + " img");
  cursor: pointer;
  z-index: 10;
  padding-right: 8px;
}


#print-button a {
        if (imageElem.length) {
  color: black;
          var captionText = $(cardElement)
  text-decoration: none;
            .find(imageClass + " " + captionClass)
}
            .text();
          cardImages.push({
            link: $(cardElement)
              .find(imageClass + " a")
              .attr("href"),
            src: imageElem.attr("src"),
            alt: imageElem.attr("alt"),
            caption: captionText,
            captionClass: "caption-image" + i,
          });
        }
      }


#print-button a:hover {
      if (cardImages.length > 1) {
  text-decoration: underline;
        setupImageToggle(cardImages);
}
      }
      var entryNumber = $(cardElement).find(".entry-number").text();
      var title = $(cardElement).find(".title").text();
      var peopleHtml = $(cardElement).find(".people").html();
      var typeHtml = $(cardElement).find(".type").html();
      var externalPdfURL = $(cardElement).find(".pdf a").attr("href");
      var externalLinkURL = $(cardElement).find(".link a").attr("href");
      var entity = $(cardElement).find(".entity").text();
      var discipline = $(cardElement).find(".discipline").text();
      var subjectHtml = $(cardElement).find(".subject").html();
      var description = $(cardElement).find(".description").html();
      var reflection = $(cardElement).find(".reflection").html();
      var quote = $(cardElement).find(".quote").text();
      var externalReferenceHtml = $(cardElement)
        .find(".external-reference")
        .html();
      var modificationDate = $(cardElement).find(".modification-date").text();
      var relatedArticlesHtml = $(cardElement).find(".related-articles").html();


.entryPage-printBtn {
      $("#article-title").html(
  right: 0 !important;
        '<p class="article-entry-number">' +
}
          entryNumber +
          '</p><p class="article-people">' +
          peopleHtml +
          "</p>"
      );


#print-chooser {
      var articleContentHtml = '<div class="article-title-link">';
  position: absolute;
      articleContentHtml += '<p class="article-title">' + title + "</p>";
  top: 36px;             
  right: 8px;           
  display: none;         
  white-space: nowrap;   
  font-size: 14px;
  line-height: 20px;
}


/* Links styled like pills (MW-safe) */
      // Create a div that will wrap the links
#print-chooser .print-choice {
      articleContentHtml += '<div class="link-pdf">';
  display: inline-block;
      if (externalPdfURL) {
  padding: 2px 4px;
        articleContentHtml +=
  text-decoration: none;
          '<a href="' +
  background: #ececec;
          externalPdfURL +
  color: #767676;
          '" target="_blank" class="pdf-link-icon">[PDF<span class="text-symbol">⤴</span>]</a>';
  margin-top: 2px;
      }
}
      if (externalLinkURL) {
        articleContentHtml +=
          '<a href="' +
          externalLinkURL +
          '" target="_blank" class="external-link-icon">[WEB<span class="text-symbol">⤴</span>]</a>';
      }
      // Close the .link-pdf div
      articleContentHtml += "</div>";
      articleContentHtml += "</div>"; // Close the new div


#print-chooser .print-choice + .print-choice { margin-left: 6px; }
      // Append type, entity, discipline, and subject details
      articleContentHtml +=
        '<p class="article-type">' +
        typeHtml +
        "</p>" +
        '<div class="article-metadata">' +
        '<div class="article-metadata-column">' +
        '<p class="article-metadata-label">Entity</p>' +
        '<p class="article-metadata-value">' +
        entity +
        "</p>" +
        "</div>" +
        '<div class="article-metadata-column">' +
        '<p class="article-metadata-label">Discipline</p>' +
        '<p class="article-metadata-value">' +
        discipline +
        "</p>" +
        "</div>" +
        '<div class="article-metadata-column">' +
        '<p class="article-metadata-label">Subject(s)</p>' +
        '<p class="article-metadata-value">' +
        subjectHtml +
        "</p>" +
        "</div>" +
        "</div>";
      // Add images if any
      if (cardImages.length > 0) {
        var initialImage = cardImages[0]; // Use the first image initially
        var enableNavigation = cardImages.length > 1; // Enable navigation only if more than one image
        articleContentHtml +=
          '<div class="article-images">' +
          getImageHtml(initialImage, 0, cardImages.length, enableNavigation) +
          "</div>";
      }
      // Add non-image content (description, reflection, etc.)
      articleContentHtml +=
        (description
          ? '<p class="article-label-description">Description</p>' +
            '<div class="article-description">' +
            formatParagraphs(description) +
            "</div>"
          : "") +
        (reflection
          ? '<p class="article-label-reflection">Reflection</p>' +
            '<div class="article-reflection">' +
            formatParagraphs(reflection) +
            "</div>"
          : "") +
        (externalReferenceHtml
          ? '<p class="article-label-external-reference">References</p>' +
            '<p class="article-external-reference">' +
            externalReferenceHtml +
            "</p>"
          : "") +
        (quote
          ? '<p class="article-label-quote">Quote</p>' +
            '<p class="article-quote">' +
            quote +
            "</p>"
          : "") +
        '<p class="article-label-modification-date">Added on</p>' +
        '<div class="article-modification-date">' +
        modificationDate +
        "</div>";


#print-chooser .print-choice:hover,
      $("#article-content").html(articleContentHtml);
#print-chooser .print-choice:focus {
      $("#related-articles").html(relatedArticlesHtml);
  text-decoration: none;
  color: black;
}


.fade-out {
      if (relatedArticlesHtml && relatedArticlesHtml.trim().length > 0) {
    position: absolute;
        $("#related-articles")
    width: 100%;
          .html(
    height: 100%;
            '<div class="related-articles-label">Related Articles</div><div class="related-articles-container">' +
    background: #FAFAFA;
              relatedArticlesHtml +
    opacity: 0.4;
              "</div>"
     z-index: 999;
          )
}
          .show();
      }
     }


/* -----END<------ POP UP ARTICLE */
    // Check which view is active and set the width accordingly
    if ($(".home-chronicle-list").is(":visible")) {
      $(".home-list-view").each(function () {
        var currentWidth = $(this).width(); // Get the current width
        $(this).data("originalWidth", currentWidth); // Store the original width
        $(this).css("width", "calc(60% - 2px)");
      });


      // Modify the .type elements within .home-chronicle-list
      $(".home-chronicle-list .type").each(function () {
        var currentLeft = $(this).css("left"); // Get the current left value
        $(this).data("originalLeft", currentLeft); // Store the original left value
        $(this).css("left", "85%");
      });
    } else if ($(".home-chronicle-block").is(":visible")) {
      $(".home-chronicle-block div.list-container").each(function () {
        var currentWidth = $(this).width(); // Get the current width
        $(this).css("width", "calc(60% - 0px)"); // Set the new width as 30% of the current width
      });
      $(".home-chronicle-block div.list-container div.card").each(function () {
        var currentWidth = $(this).width(); // Get the current width
        $(this).css("width", "calc(33.333% - 0px)"); // Set the new width as 30% of the current width
      });
    }


/* ----->START------ EVENT HOMEPAGE  */
    // Apply the fade-out effect to both #list and #list-list elements
#show-event-wrapper {
     $(".list-container").addClass("fade-out");
    display: block;
  }
    position: fixed; /* Change to fixed */
    top: 0;
    /*right: 24px;*/
    right: 1.3%;
    width: 41%;
    height: 100vh; /* Set to full viewport height */
    overflow: auto; /* Enables scrolling if content overflows */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
    z-index: 9999; /* Ensure it's above #list */
    /*padding-left: 100px;*/
    margin-top: 50px;
}
#show-event {
    background-color: #FAFAFA;
    border: 3px solid;
    padding: 0px 10px 0 10px;
    position: relative;
    top: 40px;
    /*margin-left: 36px;*/
     margin-left: 4.6%;
}
.event-entry-number {
    border-bottom: 1px solid black;
    font-size: 19px;
    line-height: 23px;
    letter-spacing: 0px;
    padding-bottom: 5px;
    padding-top: 7px;
}
.event-people {
    font-size: 25px;
    line-height: 30px;
    letter-spacing: 1.4px;
    text-decoration: underline;
    text-align: center;
    padding-top: 25px;
    margin-bottom: 5px !important;
}
.event-people a {
    color: black;
    text-decoration: underline;
}
.event-title-link {
    border-bottom: 1px solid black;
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.event-title {
    font-size: 25px;
    line-height: 30px;
    letter-spacing: 1.4px;
    text-align: center;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    max-width: 70%;
}
.event-link {
    display: flex;
    margin-top: 5px;
    align-items: center;
}


/* -----END<------ EVENT HOMEPAGE */
  // closeModal function
  function closeModal() {
    $("#print-chooser").hide();
    $("#show-article").removeClass("print-opts-open");
    if ($(".home-chronicle-list").is(":visible")) {
      $(".home-list-view").css("width", "100%");
      $(".home-chronicle-list div.list-container div.card div.type").css(
        "left",
        "90%"
      );
    } else if ($(".home-chronicle-block").is(":visible")) {
      updateWidthBlockView();
    }
    showArticleWrapper.hide();
  }


/* ----->START------ FOOTER and SEARCH  */
  $(".card").on("click", function (event) {
#view-more-footer {
     // Check if the click event is originating from a link within .people or .type, or any other specific area
     display: none;
    if ($(event.target).closest(".people a, .type a").length) {
}
      // The click is inside a link; let the default behavior proceed without opening the modal
.footer {
      return;
  position: fixed;
    }
  left: 0;
  bottom: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 11;
  background: transparent linear-gradient(180deg, #FFF0 0%, rgba(250, 250, 250, 0.97) 80%) 0% 0% no-repeat padding-box;
  padding-bottom: 1%;
  padding-top: 100px;
  padding-left: 1.3%;
  padding-right: 1.3%;
 
  display: flex;
  justify-content: flex-start; /* Aligns the buttons to the right */
  align-items: center; /* Vertically center the items */
}


.submit-container {
     // Prevent further event handling if the card has the 'event' class
     position: relative; /* Positioning context for absolute children */
     if ($(this).hasClass("event")) {
    display: inline-block; /* Constrain hover area to the container */
      event.stopImmediatePropagation();
     width: calc(20% - 0px);
      openEvent(this, event);
}
      $(".list-container").removeClass("fade-out");
#submit {
      closeModal();
    font-size: 17px;
     } else {
    line-height: 22px;
      // Handle cards without the 'event' class
    letter-spacing: 0.37px;
      openModal(this, event);
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="white" stroke="black" stroke-width="1" /></svg>') 14 14, auto;
      setShowArticleRotationEffect();
    color: black !important;
     }
}
  });
#submit:hover {
     color: black;
    text-decoration: underline;
}
.submit-hide {
    opacity: 0; /* Make it invisible initially */
    visibility: hidden; /* Ensure it's not interactable */
    display: none;
    background: black;
    width: 20%;
    position: absolute; /* Position relative to the parent */
    bottom: 100%; /* Position above the parent */
    left: 0; /* Align left with the parent */
    z-index: 1; /* Ensure it's above other content */
    transform: translateY(-10px); /* Slightly offset to prevent overlap */
}
.submit-hide p {
    color: white!important;
     font-size: 17px;
    line-height: 22px;
    letter-spacing: 0.37px;
    padding: 10px;
}
.submit-hide p .italics {
    color: white;
    font-style: italic;
}
.submit-hide p .underline {
    text-decoration: underline;
}
.submit-container:hover .submit-hide {
    display: block;
    opacity: 1;
    visibility: visible;
    width: auto;
}


  $("#show-article-wrapper").on("click", ".related-article", function (event) {
    openModal(this, event); // Call openModal when a related-article is clicked
    setShowArticleRotationEffect();
  });


  // HERE SHOULD BE THE NEW CODE!!!!
  /* ---------- Softwear PRINT (scoped, ES5-safe) ---------- */


.suggestions {
  /* helpers */
     display: none!important;
  function swPrintPreloadFont() {
}
    var link = document.createElement("link");
    link.rel = "preload";
    link.as = "font";
    link.type = "font/woff2";
    link.href = "/fonts/HALColant-TextRegular.woff2?v=20250820";
    link.crossOrigin = "anonymous";
     document.head.appendChild(link);
  }


.simpleSearch {
   function swPrintCacheBust(url) {
   position: relative;
     return url + (url.indexOf("?") > -1 ? "&" : "?") + "_=" + Date.now();
  display: inline-block;
  }
  width: calc(20% - 0px);
}
#simpleSearch, #simpleSearchSpecial {
     text-align: left;
    letter-spacing: normal;
    font-family: 'HALColant-TextRegular';
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><circle cx="14" cy="14" r="4.5" fill="white" stroke="black" stroke-width="1" /></svg>') 14 14, auto;
    text-transform: uppercase;
    background: none;
    border: none;
    font-size: 17px;
    line-height: 20px;
}


/* Style footer background and gradient */
  function swEnsurePrintChooser() {
#simpleSearch:before, #simpleSearchSpecial:before {
     var $chooser = jQuery("#print-chooser");
     content: "";
     if ($chooser.length) return $chooser;
     position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
}


#searchInput,
    $chooser = jQuery(
.closing-bracket {
      '<div id="print-chooser" class="print-chooser" style="display:none;">' +
    display: none;
        '<a href="#" id="print-with-border" class="print-choice">show border</a> ' +
    border: none;
        '<a href="#" id="print-no-border" class="print-choice">hide border</a>' +
}
        "</div>"
.searchresult {
    );
    display: none;
    jQuery("#print-button").after($chooser);
}
#simpleSearch:hover #searchInput {
  display: inline-block;
  border-bottom: 1px solid black;
  margin-left: -9.5px;
  background: #FAFAFA;
  width: calc(75% - 20px); /* Default width */
}


/* Small screens */
    // Bind once on the chooser to catch nested elements
@media (max-width: 600px) {
    if (!$chooser.data("swBound")) {
  #simpleSearch:hover #searchInput {
      function chooserFire(ev, where) {
    width: calc(50% - 20px);
        ev = ev || window.event;
        var t = ev && (ev.target || ev.srcElement);
        var a = t && t.closest ? t.closest("a[id]") : null;
        if (!a) return;
        var id = a.getAttribute("id");
        if (id !== "print-with-border" && id !== "print-no-border") return;
        if (ev.preventDefault) ev.preventDefault();
        if (ev.stopImmediatePropagation) ev.stopImmediatePropagation();
        if (ev.stopPropagation) ev.stopPropagation();
        swHandlePrintChoice(id, (window.jQuery && jQuery(a)) || null);
        return false;
      }
      $chooser.on("pointerdown", chooserFire);
      $chooser.on("touchstart", chooserFire);
      $chooser.on("mousedown", chooserFire);
      $chooser.on("click", chooserFire);
      $chooser.data("swBound", true);
    }
    return $chooser;
   }
   }
}


/* Medium screens */
  function swHidePrintUI() {
@media (min-width: 601px) and (max-width: 760px) {
    jQuery("#print-chooser").hide();
  #simpleSearch:hover #searchInput {
    jQuery("#show-article").removeClass("print-opts-open");
    width: calc(50% - 20px);
   }
   }
}


/* Medium large screens */
  /* small boot probe */
@media (min-width: 761px) and (max-width: 900px) {
  (function () {
  #simpleSearch:hover #searchInput {
    try {
     width: calc(50% - 20px);
      console.log("[swprint] probe on load", {
        printButton: !!document.getElementById("print-button"),
        chooserExists: !!document.getElementById("print-chooser"),
        localPrintOnlyCount: jQuery(".print-only").length,
        showArticleExists: !!document.getElementById("show-article"),
      });
    } catch (e) {}
  })();
 
  /* core: build iframe and print */
  function swBuildIframeAndPrint(printHtml, borderPref, $btn) {
    // iframe
    var iframe = document.createElement("iframe");
    iframe.style.position = "fixed";
    iframe.style.right = "0";
    iframe.style.bottom = "0";
    iframe.style.width = "0";
    iframe.style.height = "0";
    iframe.style.border = "0";
    document.body.appendChild(iframe);
 
    var doc = iframe.contentDocument || iframe.contentWindow.document;
    doc.open();
    doc.write(
      '<!doctype html><html><head><meta charset="utf-8"><title>Print</title></head><body></body></html>'
    );
    doc.close();
 
    // make relative URLs resolve
    var base = doc.createElement("base");
    base.href = location.origin + "/";
    doc.head.appendChild(base);
 
    // print.css
    var linkCss = doc.createElement("link");
    linkCss.rel = "stylesheet";
    linkCss.href = swPrintCacheBust(
      "/index.php?title=MediaWiki:Print.css&action=raw&ctype=text/css"
    );
    linkCss.media = "print";
 
    var cssLoaded = new Promise(function (resolve) {
      linkCss.onload = resolve;
      linkCss.onerror = resolve;
    });
 
    // font preload (inside iframe)
    var linkFont = doc.createElement("link");
    linkFont.rel = "preload";
    linkFont.as = "font";
    linkFont.type = "font/woff2";
    linkFont.href = "/fonts/HALColant-TextRegular.woff2?v=20250820";
    linkFont.crossOrigin = "anonymous";
 
    doc.head.appendChild(linkFont);
    doc.head.appendChild(linkCss);
 
    // inject HTML
    doc.body.innerHTML = printHtml;
 
    // sanitize: remove inner .print-no-border if user chose WITH border
    (function () {
      var stray = doc.querySelectorAll(".print-no-border");
      if (borderPref === "with" && stray.length) {
        Array.prototype.forEach.call(stray, function (el) {
          el.className = (el.className || "")
            .replace(/\bprint-no-border\b/g, "")
            .trim();
        });
      }
    })();
 
    // apply border preference to <html>
    (function () {
      var htmlEl = doc.documentElement;
      if (borderPref === "without") {
        if (htmlEl.classList) htmlEl.classList.add("print-no-border");
        else if (
          (" " + htmlEl.className + " ").indexOf(" print-no-border ") === -1
        ) {
          htmlEl.className += " print-no-border";
        }
      } else {
        if (htmlEl.classList) htmlEl.classList.remove("print-no-border");
        else
          htmlEl.className = (htmlEl.className || "").replace(
            /\bprint-no-border\b/g,
            ""
          );
      }
    })();
 
    // OPTIONAL: glue label + body together (extra safety vs. page breaks)
    (function () {
      var style = doc.createElement("style");
      style.textContent =
        "@media print{.sw-keep{break-inside:avoid;page-break-inside:avoid;}}";
      doc.head.appendChild(style);
 
      var pairs = [
        [".article-label-description", ".article-description"],
        [".article-label-reflection", ".article-reflection"],
        [".article-label-external-reference", ".article-external-reference"],
        [".article-label-quote", ".article-quote"],
        [".article-label-modification-date", ".article-modification-date"],
      ];
 
      for (var i = 0; i < pairs.length; i++) {
        var labelSel = pairs[i][0];
        var bodySel = pairs[i][1];
        var labels = doc.querySelectorAll(labelSel);
        for (var j = 0; j < labels.length; j++) {
          var label = labels[j];
          var body = label.nextElementSibling;
          if (!body || !body.matches(bodySel)) continue;
          var wrap = doc.createElement("div");
          wrap.className = "sw-keep";
          label.parentNode.insertBefore(wrap, label);
          wrap.appendChild(label);
          wrap.appendChild(body);
        }
      }
    })();
 
    // clean empty paragraphs
    (function () {
      var ps = doc.querySelectorAll("#article-content p");
      Array.prototype.forEach.call(ps, function (p) {
        var txt = (p.textContent || "").replace(/\u00a0/g, " ").trim();
        var onlyBr =
          p.children &&
          p.children.length === 1 &&
          p.firstElementChild &&
          p.firstElementChild.tagName === "BR";
        if (
          (!txt && !p.querySelector("img, a, strong, em, span:not(:empty)")) ||
          onlyBr
        ) {
          if (p.parentNode) p.parentNode.removeChild(p);
        }
      });
      var root = doc.getElementById("article-content");
      if (root) {
        var kids = Array.prototype.slice.call(root.childNodes);
        for (var k = 0; k < kids.length; k++) {
          var n = kids[k];
          if (n.nodeType === 3 && !n.textContent.replace(/\s+/g, "")) {
            root.removeChild(n);
          }
        }
      }
    })();
 
    // inline micro-tweaks for print spacing
    (function () {
      var css =
        "@media print{" +
        "  .article-description p,.article-reflection p,.article-external-reference p,.article-quote p{margin:0 0 1.2mm!important;}" +
        "  .article-description p:last-child,.article-reflection p:last-child,.article-external-reference p:last-child,.article-quote p:last-child{margin-bottom:0!important;}" +
        "  .article-entry-number,.link-pdf,.article-type,.article-metadata,.article-images,.article-description,.article-reflection,.article-external-reference,.article-quote,.article-mod-line{padding-bottom:1mm!important;}" +
        "  .article-label-description + .article-description," +
        "  .article-label-reflection + .article-reflection," +
        "  .article-label-external-reference + .article-external-reference," +
        "  .article-label-quote + .article-quote," +
        "  .article-label-modification-date + .article-modification-date{margin-top:0!important;}" +
        "  .article-title-link{margin:0!important;padding:0!important;}" +
        "  .article-title-link > *{margin:0!important;}" +
        "  .link-pdf{margin-top:0!important;}" +
        "  #article-content > :last-child{padding-bottom:0!important;}" +
        "  #article-content > :last-child::after{content:none!important;}" +
        "}";
      var style = doc.createElement("style");
      style.type = "text/css";
      style.appendChild(doc.createTextNode(css));
      doc.head.appendChild(style);
    })();
 
    // link tweaks (wrapping / underline)
     (function () {
      var styleFix = doc.createElement("style");
      styleFix.textContent =
        "@media print {.article-external-reference a,.link-pdf a{white-space:nowrap!important;word-break:normal!important;overflow-wrap:normal!important;text-decoration:underline}.article-external-reference{overflow-wrap:anywhere;word-break:break-word}a[href]{position:relative}}";
      doc.head.appendChild(styleFix);
 
      var refs = doc.querySelectorAll(".article-external-reference a[href]");
      Array.prototype.forEach.call(refs, function (a) {
        var txt = (a.textContent || "").trim();
        var href = a.getAttribute("href") || "";
        var looksLongUrl = /^https?:\/\//i.test(txt) && txt.length > 60;
        if (looksLongUrl) {
          try {
            var u = new URL(href, doc.baseURI);
            var label =
              u.hostname + (u.pathname.replace(/\/$/, "") ? u.pathname : "");
            if (label.length > 40) label = label.slice(0, 37) + "…";
            a.textContent = label;
          } catch (e) {
            a.textContent = "Link";
          }
        }
        a.style.whiteSpace = "nowrap";
        a.style.wordBreak = "normal";
        a.style.overflowWrap = "normal";
      });
    })();
 
    // waits
    function waitImages() {
      var imgs = [].slice.call(doc.images || []);
      if (!imgs.length) return Promise.resolve();
      return Promise.all(
        imgs.map(function (img) {
          if (img.decode) {
            try {
              return img.decode().catch(function () {});
            } catch (e) {}
          }
          return new Promise(function (res) {
            if (img.complete) return res();
            img.onload = img.onerror = function () {
              res();
            };
          });
        })
      );
    }
    function waitFonts(timeoutMs) {
      if (!doc.fonts || !doc.fonts.ready) return Promise.resolve();
      var ready = doc.fonts.ready;
      var t = new Promise(function (res) {
        setTimeout(res, timeoutMs || 1200);
      });
      return Promise.race([ready, t]);
    }
    function waitSpecificFont(timeoutMs) {
      if (!doc.fonts || !doc.fonts.load) return Promise.resolve();
      var p = Promise.all([
        doc.fonts.load('400 16px "HALColant-TextRegular"'),
        doc.fonts.load('normal 16px "HALColant-TextRegular"'),
      ]);
      var t = new Promise(function (res) {
        setTimeout(res, timeoutMs || 1200);
      });
      return Promise.race([p, t]);
    }
    function nextFrame() {
      return new Promise(function (res) {
        (iframe.contentWindow.requestAnimationFrame || setTimeout)(res, 0);
      });
    }
 
    Promise.all([
      cssLoaded,
      waitImages(),
      waitFonts(1200),
      waitSpecificFont(1200),
      nextFrame(),
    ])
      .then(function () {
        // filename via document.title
        var entryNum = "";
        var numEl = doc.querySelector(".article-entry-number");
        if (numEl) {
          var m = (numEl.textContent || "").match(/\d+/);
          entryNum = m ? m[0] : "";
        }
        var desiredTitle =
          (entryNum ? entryNum + "." : "") + "softwear.directory";
        var oldIframeTitle = doc.title;
        var oldParentTitle = document.title;
 
        iframe.contentWindow.onafterprint = function () {
          try {
            doc.title = oldIframeTitle;
            document.title = oldParentTitle;
          } catch (e) {}
          setTimeout(function () {
            if (iframe.parentNode) iframe.parentNode.removeChild(iframe);
          }, 100);
          if ($btn && $btn.length) $btn.data("busy", false);
        };
 
        doc.title = desiredTitle;
        document.title = desiredTitle;
 
        iframe.contentWindow.focus();
        iframe.contentWindow.print();
 
        // safety cleanup
        setTimeout(function () {
          try {
            doc.title = oldIframeTitle;
            document.title = oldParentTitle;
          } catch (e) {}
          if (iframe.parentNode) iframe.parentNode.removeChild(iframe);
          if ($btn && $btn.length) $btn.data("busy", false);
        }, 1000);
      })
      .catch(function () {
        if ($btn && $btn.length) $btn.data("busy", false);
      });
   }
   }
}


/* Large screens */
  /* decide source & kick print */
@media (min-width: 901px) and (max-width: 1000px) {
  function swHandlePrintChoice(id, $btn) {
  #simpleSearch:hover #searchInput {
    if ($btn && $btn.data("busy")) return;
     width: calc(60% - 20px);
    if ($btn && $btn.length) $btn.data("busy", true);
 
    var borderPref = id === "print-no-border" ? "without" : "with";
    swPrintPreloadFont();
 
    // prefer local .print-only (Entry page)
    var localPrintOnly = jQuery(".print-only").first();
    if (localPrintOnly.length) {
      swHidePrintUI();
      swBuildIframeAndPrint(localPrintOnly.prop("outerHTML"), borderPref, $btn);
      return;
    }
 
    // otherwise fetch by title (modal/home)
    var title =
      window.currentEntryTitle ||
      (window.mw && mw.config && mw.config.get && mw.config.get("wgPageName"));
    if (!title) {
      window.print();
      if ($btn && $btn.length) $btn.data("busy", false);
      return;
    }
 
     var pageUrl =
      window.mw && mw.util && mw.util.getUrl
        ? mw.util.getUrl(title)
        : "/wiki/" + String(title);
 
    jQuery
      .get(swPrintCacheBust(pageUrl))
      .done(function (html) {
        var $tmp = jQuery("<div>").html(html);
        var $print = $tmp.find(".print-only").first();
        if (!$print.length) {
          window.print();
          if ($btn && $btn.length) $btn.data("busy", false);
          return;
        }
        swHidePrintUI();
        swBuildIframeAndPrint($print.prop("outerHTML"), borderPref, $btn);
      })
      .fail(function () {
        window.print();
        jQuery("#print-button").data("busy", false);
      });
   }
   }
}


/* Large screens */
  /* bind current choice anchors (defensive, for Entry pages) */
@media (min-width: 1001px) and (max-width: 1100px) {
  function swBindChoiceAnchors() {
  #simpleSearch:hover #searchInput {
    var sel = "#print-with-border, #print-no-border";
    width: calc(65% - 20px);
    var els = document.querySelectorAll(sel);
    for (var i = 0; i < els.length; i++) {
      (function (el) {
        if (el.__swChoiceBound) return;
        el.__swChoiceBound = true;
 
        // ensure clickable/accessible
        try {
          el.style.pointerEvents = el.style.pointerEvents || "auto";
          if (!el.getAttribute("role")) el.setAttribute("role", "button");
          if (!el.getAttribute("tabindex")) el.setAttribute("tabindex", "0");
        } catch (e) {}
 
        function fire(ev) {
          if (ev && ev.preventDefault) ev.preventDefault();
          if (ev && ev.stopImmediatePropagation) ev.stopImmediatePropagation();
          if (ev && ev.stopPropagation) ev.stopPropagation();
          var $a = (window.jQuery && jQuery(el)) || null;
          swHandlePrintChoice(el.id, $a);
          return false;
        }
 
        // early + normal phases
        el.addEventListener("pointerdown", fire, true);
        el.addEventListener("touchstart", fire, true);
        el.addEventListener("mousedown", fire, true);
        el.addEventListener("click", fire, true);
        el.addEventListener("click", fire, false);
        if (!el.onclick) el.onclick = fire;
 
        // keyboard
        el.addEventListener(
          "keydown",
          function (e) {
            var k = e.key || e.keyCode;
            if (k === "Enter" || k === 13 || k === " " || k === 32) fire(e);
          },
          true
        );
      })(els[i]);
    }
   }
   }
}


/* Large screens */
  /* early global catcher (minimal) */
@media (min-width: 1101px) and (max-width: 1200px) {
  (function () {
   #simpleSearch:hover #searchInput {
    if (window.__swprintEarlyCatcher) return;
     width: calc(65% - 20px);
    window.__swprintEarlyCatcher = true;
 
    function routeEarly(ev) {
      var t = ev.target;
      if (!t || !t.closest) return;
      var a = t.closest("a#print-with-border, a#print-no-border");
      if (!a) return;
      if (ev.preventDefault) ev.preventDefault();
      if (ev.stopImmediatePropagation) ev.stopImmediatePropagation();
      if (ev.stopPropagation) ev.stopPropagation();
      swHandlePrintChoice(a.id, (window.jQuery && jQuery(a)) || null);
      return false;
    }
 
    window.addEventListener("pointerdown", routeEarly, true);
    window.addEventListener("touchstart", routeEarly, true);
    window.addEventListener("mousedown", routeEarly, true);
  })();
 
  /* wiring (namespaced) */
  jQuery(document).off("click.swprint");
  jQuery(document).on(
    "click.swprint",
    "#print-button, #print-chooser, #print-options",
    function (e) {
      // main [print] toggler
      if (jQuery(e.target).closest("#print-button").length) {
        e.preventDefault();
        var $chooser = swEnsurePrintChooser();
        $chooser.css({ position: "absolute", zIndex: 99999 });
        $chooser.toggle();
        var visible = $chooser.is(":visible");
        jQuery("#show-article").toggleClass("print-opts-open", visible);
 
        // ensure anchors are bound (important on Entry pages)
        swBindChoiceAnchors();
        return;
      }
 
      // click directly on a choice link (fallback path)
      var $choice = jQuery(e.target).closest(
        "a#print-with-border, a#print-no-border"
      );
      if (!$choice.length) return;
      e.preventDefault();
      swHandlePrintChoice($choice.attr("id"), $choice);
    }
  );
 
  // map any <button> inside chooser to its host anchor
  jQuery(document).on(
    "click.swprintChoiceBtn2",
    "#print-chooser button",
    function (e) {
      var host = this.closest(
        '[id="print-with-border"], [id="print-no-border"]'
      );
      if (!host) return;
      e.preventDefault();
      swHandlePrintChoice(host.id, (window.jQuery && jQuery(host)) || null);
    }
  );
 
  // hide choices on ESC
  jQuery(document).on("keydown.swprint", function (e) {
    if (e && e.keyCode === 27) swHidePrintUI();
  });
 
  /* ---------- /Softwear PRINT ---------- */
 
  // Close modal with Close button
  $("#close-button").on("click", function () {
    $("#print-chooser").hide();
    $("#show-article").removeClass("print-opts-open");
 
    $(".list-container").removeClass("fade-out");
    closeModal();
  });
 
  // Close modal and remove fade out also when clicking outside of card
  $(document).on("mousedown", function (event) {
    var isOutsideWrapper =
      !showArticleWrapper.is(event.target) &&
      showArticleWrapper.has(event.target).length === 0;
    var isOnCard = $(event.target).closest(".card, .list-card").length > 0;
 
    if (!areFiltersActive) {
      if (isOutsideWrapper && !isOnCard) {
        $(".list-container").removeClass("fade-out");
        showArticleWrapper.css("display", "none");
        closeModal(); // Use closeModal() for cleanup
      }
    }
  });
 
  // Hover effect for scrolling
   $("#show-article-wrapper").hover(
    function () {
      // On hover, enable scrolling on #show-article-wrapper
      $(this).css("overflow-y", "auto");
      $(this).css("overflow-x", "hidden");
    },
    function () {
      // On hover out, disable scrolling on #show-article-wrapper
      $(this).css("overflow-y", "hidden");
      $(this).css("overflow-x", "hidden");
     }
  );
 
  // Format community card, when in the Community Entries page
  if ($(".community-card").length) {
    formatCommunityCardDescriptions();
   }
   }
}


/* Large screens */
  function formatCommunityCardDescriptions() {
@media (min-width: 1201px) and (max-width: 1300px) {
    $(".community-card").each(function () {
  #simpleSearch:hover #searchInput {
      // Format paragraphs in community-description
     width: calc(70% - 20px);
      var descriptionContainer = $(this).find(".community-description");
      var rawDescription = descriptionContainer.text();
      var formattedDescription = formatParagraphs(rawDescription);
      descriptionContainer.html(formattedDescription);
 
      // Remove empty elements in the entire card
      $(this)
        .find("*")
        .each(function () {
          if ($(this).is(":empty") || $(this).html().trim() === "<br>") {
            $(this).remove();
          }
        });
     });
   }
   }
}


/* Large screens */
  if ($("#show-article-wrapper-entry").length) {
@media (min-width: 1301px) and (max-width: 1400px) {
    // Your existing formatParagraphs function
  #simpleSearch:hover #searchInput {
    function formatParagraphs(text) {
    width: calc(70% - 20px);
      var paragraphs = text.split("\n").filter(function (p) {
        return p.trim() !== "";
      });
      return paragraphs
        .map(function (p) {
          return "<p>" + p.trim() + "</p>";
        })
        .join("");
    }
 
    // Check if ".article-description" exists and format its text
    if ($(".article-description").length) {
      var descriptionText = $(".article-description").text();
      var formattedDescription = formatParagraphs(descriptionText);
      $(".article-description").html(formattedDescription); // Set the formatted text
    }
 
    // Check if ".article-reflection" exists and format its text
    if ($(".article-reflection").length) {
      var reflectionText = $(".article-reflection").text();
      var formattedReflection = formatParagraphs(reflectionText);
      $(".article-reflection").html(formattedReflection); // Set the formatted text
    }
   }
   }
}


  // SEARCH  ---------------------  SECTION //
  // Check if div with class "mw-search-results-info" exists
  if ($(".mw-search-results-info").length) {
    // Select the child <p> element and check its content
    var $paragraph = $(".mw-search-results-info > p");
    var currentText = $paragraph.text().trim();


/* Large screens */
    // Check if the current text is not "There were no results matching the query."
@media (min-width: 1401px) and (max-width: 1750px) {
    if (currentText !== "There were no results matching the query.") {
  #simpleSearch:hover #searchInput {
      // Overwrite the content with "Search results"
    width: calc(75% - 20px);
      $paragraph.text("Pages related to your Search");
    }
   }
   }
}


/* Large screens */
  // Object to store encountered titles
@media (min-width: 1751px) {
   var encounteredTitles = {};
   #simpleSearch:hover #searchInput {
    width: calc(80% - 20px);
  }
}


  // Iterate over each search result
  $(".mw-search-result-heading").each(function () {
    // Get the title of the current search result
    var title = $(this).find("a").attr("title");


    // Check if the title has already been encountered
    if (encounteredTitles[title]) {
      // Hide the duplicate search result
      $(this).hide();
    } else {
      // Mark the title as encountered
      encounteredTitles[title] = true;
    }
  });


  // Remove unwanted white spaces between lines
  $(".mw-search-results-container")
    .contents()
    .filter(function () {
      return this.nodeType === 3; // Filter text nodes
    })
    .remove();


  // Edits regarding Search Results
  // Define the new form HTML as a string
  var newFormHtml =
    '<form action="/index.php" id="searchform">' +
    '<div id="simpleSearchSpecial" class="right-inner-addon">' +
    "<span>[ Search ]</span>" +
    '<input class="form-control" name="search" placeholder="" title="Search [alt-shift-f]" accesskey="f" id="searchInput" tabindex="1" autocomplete="off" type="search">' +
    '<span class="closing-bracket">]</span>' +
    '<input value="Special:Search" name="title" type="hidden">' +
    "</div>" +
    "</form>";


#simpleSearchSpecial:hover #searchInput {
  // Replace the div with id="searchText" with the new form
    display: inline-block;
  $("#searchText").replaceWith(newFormHtml);
    border-bottom: 1px solid black;
    margin-left: -5px;
    background: #FAFAFA;
}


#simpleSearch:hover .closing-bracket, #simpleSearchSpecial:hover .closing-bracket {
  // Target the button based on its complex class structure
    display: inline-block;
  $(".oo-ui-actionFieldLayout-button .oo-ui-buttonInputWidget").remove();
}


  // Check if #submit button exists and add event listener if it does
  var submitButton = document.querySelector("#submit");


/* ----->END------ FOOTER and SEARCH  */
  if (submitButton) {
    // Add click event listener
    submitButton.addEventListener("click", function (event) {
      event.preventDefault(); // Prevent the default link behavior


/* ----->START------ AUTHORS CREATORS  */
      var email = "submit@softwear.directory";
/* Styling for Authors/Creators */
      var subject = "new entry to the softwear directory";
.smw-columnlist-container {
      var body =
  top: 420px;
        "☺ the following content could be interesting for the directory:\n\n" +
  position: relative;
        "[ author / creator ]\n\n" +
  margin: 0;
        "---\n\n" +
  width: 100%;
        "[ title ]\n\n" +
}
        "---\n\n" +
        "[ why should it be included? ]\n\n" +
        "---\n\n" +
        "[ link or pdf ]\n\n" +
        "---\n\n" +
        "[ your name / contact / social ]\n\n" +
        "---";


.smw-column {
      var mailtoLink =
    width: 20%!important;
        "mailto:" +
}
        encodeURIComponent(email) +
.smw-column ul li {
        "?subject=" +
    list-style: none;
        encodeURIComponent(subject) +
}
        "&body=" +
.smw-column-header {
        encodeURIComponent(body).replace(/%20/g, " ");
    font-weight:normal;
    border-bottom: 1px solid black;
    margin-right: 10px;
}
.smw-column ul {
    font-size: 16pt;
    line-height: 27px;
    letter-spacing: 0.4px;
    text-align: center;
    text-decoration: underline;
}
.smw-column a {
    color: black;
}
/* ----->END------ AUTHORS CREATORS */


/* ----->START------ COMMUNITY PAGE  */
      window.location.href = mailtoLink;
/* Styling for Community */
     });
.community-col {
  }
    width: calc(100% - 0px);
    box-sizing: border-box;
    height: fit-content;
    padding: 0 0 0 0;
}
.community-main-text {
    margin-top: 0 !important;
    position: relative;
    top: 400px;
    font-size: 22px;
     line-height: 25px;
    letter-spacing: 0px;
}
#community-list {
    -moz-column-count: 5;
    -webkit-column-count: 5;
    -ms-column-count: 5;
    column-count: 5;
    -moz-column-gap: 10px;
    -ms-column-gap: 10px;
    -webkit-column-gap: 10px;
    column-gap: 10px;
    position: relative;
    margin: 0;
    width: 100%;
    top: 430px;
}


.community-card {
  // Tooltip for "wander elsewhere..." on .card.event
    font-size: 12px;
  var tooltip = $(
     line-height: 25px;
     '<div class="tooltip-popup">wander elsewhere...</div>'
    letter-spacing: 0.4px;
  ).appendTo("body");
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    padding: 0 0 20px 0;
    margin-bottom: -1px; /* Negative margin, same as border thickness */
    border-top: 1px solid black;
    border-bottom: 1px solid black;
    break-inside: avoid-column;
    z-index: 1; /* Ensures the card is above the bottom border of the card above */
    background: #FAFAFA; /* Assuming cards have a white background */
}
/* Add margin-top to individual community pages */
.community-page {
    position: relative;
    top: 300px;
}
/* Removes top border from the first card in each column */
#community-list .community-card:first-of-type {
    border-top: none;
}


/* Adds top border to the very first card in the grid */
  $(".card.event").on("mouseenter", function () {
#community-list .community-card:first-child {
     tooltip.css("opacity", 1);
    border-top: 1px solid black;
   });
}
.community-name {
     font-size: 25px;
    line-height: 34px;
    letter-spacing: 1.4px;
    text-align: center;
    text-decoration: underline;
    padding-top: 45px;
    padding-bottom: 45px;
    border-bottom: 1px solid black;
}
.community-name a {
  color: black !important;
}
.community-name a:hover {
  font-style: italic;
}
.community-external-reference {
    text-align: center;
    font-size: 25px;
    line-height: 34px;
    letter-spacing: 1.4px;
    border-bottom: 1px solid black;
}
.community-external-reference a {
    color: white!important;
}
.community-external-reference a:hover {
    text-decoration: none;
    font-style: italic;
}
#community-list div.community-external-reference a {
  color: black !important;
   text-decoration:none;
}
.community-setting {
    font-size: 15px;
    line-height: 30px;
    letter-spacing: 0.48px;
    text-transform: uppercase;
    border-bottom: 1px solid black;
}
.community-location {
    font-size: 15px;
    line-height: 30px;
    letter-spacing: 0.48px;
    text-transform: uppercase;
    border-bottom: 1px solid black;
}
.community-type {
    font-size: 15px;
    line-height: 30px;
    letter-spacing: 0.48px;
    text-transform: uppercase;
    border-bottom: 1px solid black;
}
.community-domain {
    font-size: 15px;
    line-height: 30px;
    letter-spacing: 0.48px;
    text-transform: uppercase;
    border-bottom: 1px solid black;
}
.community-description p {
    text-indent: 35px;
    font-size: 19px;
    line-height: 26px;
    letter-spacing: 0.95px;
    margin: 0 !important;
}
.community-description-label {
    text-transform: uppercase;
    text-indent: 35px;
    font-size: 15px;
    margin: 0 !important;
    line-height: 30px;
}
/* ----->END------ COMMUNITY PAGE  */


/* ----->START------ SEARCH PAGE  */
  $(".card.event").on("mousemove", function (e) {
.hidden {
     var offsetX = 10; // right of cursor
    display: none;
     var offsetY = -30; // above cursor
}
     tooltip.css({
.oo-ui-layout.oo-ui-fieldLayout.oo-ui-fieldLayout-align-top.oo-ui-actionFieldLayout {
      left: e.clientX + offsetX + "px",
     margin-top: 420px;
      top: e.clientY + offsetY + "px",
}
     });
.mw-search-exists {
   });
     padding-bottom: 20px;
     font-size: 17px;
}
.mw-search-createlink {
    padding-bottom: 20px;
    font-size: 17px;
}
.mw-search-nonefound {
    padding-bottom: 20px;
    font-size: 17px!important;
}
#mw-content-text .searchresults {
     padding: 25px;
}
#mw-search-top-table div.oo-ui-actionFieldLayout {
  padding-left: 25px;
   padding-right: 25px;
}
/* ----->END------ SEARCH PAGE */


/* ----->START------ TOOLTIP EVENT CARDS  */
  $(".card.event").on("mouseleave", function () {
.tooltip-popup {
    tooltip.css("opacity", 0);
  position: fixed;
   });
  padding: 6px 12px;
  background-color: #f9f9f9;
  color: #111;
  font-size: 13px;
  font-family: Arial, sans-serif;
  border: 1px solid #ccc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);  
   pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 9999;
}
/* ----->END------ TOOLTIP EVENT CARDS */


/* ----->START------ PRINT STYLES  */  
  mw.loader.using("mediawiki.api", function () {
.print-only { display:none; }
    // Only run on form edit page
/* ----->END------ PRINT STYLES */
    if (mw.config.get("wgCanonicalSpecialPageName") === "FormEdit") {
      new mw.Api()
        .post({
          action: "purge",
          titles: "Main",
        })
        .fail(function (err) {
          // Optional: leave a minimal fallback error log
          console.warn("Main page purge failed", err);
        });
    }
  });
});

Navigation menu