/* =======================================
   🌐 GLOBAL STYLES
======================================= */
* {
  font-family: "Mukta";
  box-sizing: border-box;
}

body {
  overflow: auto !important;
  width: 100%;
  margin: 0;
  padding: 0;
  top: 0 !important;
}

th {
  padding: 0;
}

/* =======================================
   🔹 HEADER / FOOTER
======================================= */


nav.navbar {


  /* FIX: Forces the nav onto its own compositing layer.
     This prevents child z-indexes (like floating labels)
     from rendering incorrectly when other elements are transformed. */
  transform: translateZ(0);
  position: relative;
}

#navbarFilters {
  position: relative;
  z-index: 5;
}


.topHeaderDiv {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  border-bottom: 1px solid var(--primary-color);
}

#welcomeText {
  min-inline-size: max-content;
  color: var(--primary-color);
  font-size: 1.5em;
  font-weight: bold;
  text-decoration: none;
}

.svg-stroke {
  stroke: var(--primary-color);
  width: 35px;
  height: 26px;
  vertical-align: sub;
}

.footer-container {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-around;
  white-space: nowrap;
  flex-grow: 1;
  width: 100%;
}

/* =======================================
   🧩 SPLIT VIEW (Articles Page)
======================================= */
.split-view-container {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  min-height: calc(100vh - 80px);
  /* Full height minus header */
  overflow: visible !important;
  /* allow one global scroll */
}

/* 🖼️ IMAGE PANEL */
.split-view-image-pane {
  width: 50%;
  background: #f8f9fa;
  border-right: 1px solid #dee2e6;
  padding: 0 !important;
  margin: 0 !important;

  /* CRITICAL: Must be hidden to clip the zoomed content inside #mainPieces */
  overflow: hidden !important;

  transform-origin: top left;

  /* CRITICAL: Set position and a low z-index for correct stacking */
  position: relative;
  z-index: 5;

  touch-action: pan-y;
}

/* FIX 2: Prevent drag-select/text selection on the viewer pane and its children */
.split-view-image-pane,
.split-view-image-pane * {
  /* Standard property to prevent selection */
  user-select: none !important;
  -webkit-user-select: none !important;
  /* Safari/Chrome */
  -moz-user-select: none !important;
  /* Firefox */
  -ms-user-select: none !important;
  /* IE/Edge */

  /* Property to prevent the image from being dragged */
  user-drag: none !important;
  -webkit-user-drag: none !important;
  /* Safari/Chrome */
}

/* Ensure the image element also has dragging disabled */
.split-view-image-pane img,
#epaper-image,
#mainImage1 {
  -webkit-user-drag: none !important;
  user-drag: none !important;
}

/* 📜 ARTICLES PANEL */
.split-view-article-pane {
  width: 50%;
  height: auto;
  overflow: visible !important;

  /* CRITICAL: Set position and a HIGHER z-index to ensure it covers the image */
  position: relative;
  z-index: 10;
  background-color: #fff;
  /* CRITICAL: Needs a solid background to cover elements beneath it */
  touch-action: pan-y;
}

/* ===== Image Inside Split View ===== */
.split-view-image-pane img,
#epaper-image,
#mainImage1 {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block;
  object-fit: contain;
}

/* ===== Article List ===== */
.article-list {
  padding: 1.5rem 1rem;
}

/* === ARTICLE BOX WITH BORDER === */
.article-item {
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
  background: #fff;
}

.article-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.article-item h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 6px;
}

.article-item p {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.5;
  margin-bottom: 6px;
}

.article-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.article-meta-top span {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--primary-color);
}

/* === SVG Icons in Articles === */
.icon {
  width: 16px;
  height: 16px;
  stroke: var(--primary-color);
  flex-shrink: 0;
}



/* =======================================
   🖥️ DESKTOP VIEW & ZOOM AREA
======================================= */
.desktop-content {
  overflow: visible !important;
  /* prevent inner scroll */
  min-height: 80vh;
}

.desktop-content .card {
  transform-origin: center center;
  will-change: transform;
  touch-action: none;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;

  /* FIX: iOS SWIPE FIX
    Tells Safari to handle vertical scrolling (pan-y)
    but let our JavaScript handle horizontal gestures.
  */
  touch-action: pan-y;
}

#mainPieces {
  position: relative;
  display: block;
  max-width: none !important;
  width: auto !important;
  height: auto !important;
}

.pieces {
  width: -webkit-fill-available !important;
}

/* =======================================
   🔍 ZONES
======================================= */
.zone {
  position: absolute;
  border: 2px solid rgba(255, 0, 0, 0.4);
  background: rgba(255, 0, 0, 0.15);
  cursor: pointer;
  transition: 0.2s;
  z-index: 5;
}

.zone:hover {
  background: rgba(255, 0, 0, 0.25);
  border-color: rgba(255, 0, 0, 0.6);
}

/* =======================================
   🔼 PAGE NAVIGATION BUTTONS
======================================= */
.page-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
  background-color: var(--primary-color);
  border: none;
  cursor: pointer;
  padding: 20px 0px;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.page-nav-btn.left {
  left: 15px;
}

.page-nav-btn.right {
  right: 15px;
}

.page-nav-btn svg {
  width: 30px;
  height: 30px;
  stroke: white;
  display: block;
}

.config-bg {
  background-color: var(--primary-color);
  color: white;
}

.config-outline {
  color: var(--primary-color);
  background-color: white;
}

.config-bg:hover {
  background-color: var(--secondary-color);
  color: white;
}

/* =======================================
   ⚙️ CONTROLS OVERLAY (ZOOM)
======================================= */
.controls-overlay {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px;
  display: flex;
  align-items: center;
  z-index: 1000;
  justify-content: center;

  /* FIX: CLUTTERED BUTTONS */
  gap: 8px;
  /* Increased from 5px for better spacing */
}

/* FIX: CLUTTERED BUTTONS
  Standardize spacing, override Bootstrap 'm-1' 
*/
.controls-overlay>.btn {
  margin: 0 !important;
  padding: 10px;
  /* Ensure padding is consistent */
}


.control-btn {
  background: transparent;
  border: none;
  padding: 10px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.2s;
}

.control-btn svg {
  width: 24px;
  height: 24px;
  stroke: white;
  display: block;
}

.navbar-hidden {
  display: none !important;
}

/* =======================================
   👤 SSO / USER CARD
======================================= */
.sso_wrapper {
  position: relative;
  z-index: 9999;
  /* Higher z-index for the parent wrapper */

  /* Add 'will-change' to optimize rendering and ensure a new stacking context */
  will-change: transform, z-index;
}

.sso_person-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  text-decoration: none;
  color: #333;
  cursor: pointer;
  width: 2.75em;
  z-index: 99;
}

.sso_person-icon img {
  width: 80%;
  height: auto;
  border-radius: 50%;
}

.sso_LoginCard {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5em;
  background-color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  text-align: center;
  z-index: 1000000;
  min-width: 14rem;
  border-radius: var(--border-radius-global-button);
  transform: none;
}

.sso_LoginCard {
  position: absolute;
  /* Already set, but crucial */
  top: 100%;
  /* Already set */
  right: 0;
  /* Already set */

  /* 2. Maximize the child's z-index within the parent's new context.
     A number like 1,000,000 is generally safer than 99999 for full-top.
  */
  z-index: 1000000;
  /* Ensure it is the absolute highest */

  /* Remove any conflicting properties if they were added elsewhere */
  transform: none;
}

.sso_circle {
  display: flex;
  justify-content: center;
  align-items: center;
}

#sso_signOutButton {
  color: var(--primary-color) !important;
  border: 1px solid var(--primary-color);
  margin-top: 1rem;
  border-radius: 100px;
  color: #fff;
  font-size: 1rem;
  padding: 10px 27px;
  background: none;
}

#sso_userImage {
  display: block;
  max-width: 30%;
  width: 30%;
  border-radius: 50%;
  justify-self: center;
}

/* =======================================
   📱 MOBILE RESPONSIVE
======================================= */
@media (max-width: 992px) {

  /* [MODIFIED] Stack content vertically */
  .split-view-container {
    flex-direction: column !important;
    width: 100%;
    overflow-x: hidden;
  }

  /* [MODIFIED] Hide the image pane on mobile */
  .split-view-image-pane {
    display: none !important;
  }

  /* [MODIFIED] Make article pane full width */
  .split-view-article-pane {
    width: 100% !important;
    min-width: 100%;
    border-top: none !important;
    border-left: none !important;
    /* Remove divider */
  }

  /* Scale image correctly on smaller width */
  #mainImage1,
  #epaper-image {
    width: 100%;
    height: auto;
  }

  /* [MODIFIED] Prevent horizontal scroll */
  body {
    overflow-x: hidden !important;
  }
}

/* === Modal article content spacing === */
.article-modal-content {
  padding: 1rem 1.5rem;
  /* margin-bottom: 100px; */
  /* Prevent content from touching bottom */
  text-align: justify;
}

/* =======================================
   MODAL NAVIGATION BUTTONS (FIXED)
======================================= */
.modal-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);

  /* Style to match footer buttons (no overlay) */
  background: transparent !important;
  border: 1px solid transparent;
  color: var(--primary-color);
  /* Bootstrap primary blue */

  /* Size and Shape */
  font-size: 1.5rem;
  /* Smaller icon */
  font-weight: bold;
  /* width: 40px; */
  /* height: 40px; */
  /* border-radius: 50%; */
  /* Circle shape */

  /* Other properties */
  cursor: pointer;
  z-index: 1055;
  opacity: 1;
  /* No transparency */
  /* transition: all 0.2s ease-in-out; */
  /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); */

  /* Centering the chevron icon */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  /* padding-bottom: 2px; */
  /* Visual centering for chevron */
}

.modal-nav-btn:hover {
  /* background: #f8f9fa !important; */
  /* Light hover */
  color: var(--secondary-color, var(--primary-color));
}

.modal-nav-btn.left {
  left: 15px;
}

.modal-nav-btn.right {
  right: 15px;
}

@media (max-width: 768px) {
  .modal-nav-btn {
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    border-radius: 50%;
    /* Revert to circle on small screens */
  }

  .modal-nav-btn.left {
    left: -5px;
  }

  .modal-nav-btn.right {
    right: -5px;
  }

  .article-modal-content {
    padding: 1.5rem;
  }
}

.article-modal-content {
  /* padding: 2rem; */
  margin-bottom: 100px;
}

.no-article-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #666;
}

.no-article-placeholder img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

#show-nav-btn {
  position: fixed;
  right: 50px;
  top: 25px;
  z-index: 1000;
  width: 60px;
  height: 60px;
  line-height: 60px;
  background-color: var(--primary-color);
  color: var(--background-color);
  border-radius: 50%;
  padding: 0;
  background-image: none;
  opacity: 1;
  text-align: center;
  font-size: 22px;
}

/* === Article Modal Toolbar === */
.modal-header {
  position: sticky;
  top: 0;
  z-index: 1050;
  background-color: var(--primary-color);
  /* Color is applied via Bootstrap 'bg-primary' class in HTML */
}

#articleCarousel img:hover {
  transform: scale(1.05);
  transition: 0.2s ease-in-out;
  border: 2px solid var(--primary-color);
}

#articleViewContainer {
  min-height: 70vh;
}

/* ===== Modal Scroll & Layout (MODIFIED) ===== */
#articleModal .modal-body {
  overflow-y: auto !important;
  /* Allow vertical scroll */
  overflow-x: hidden !important;
  /* Prevent horizontal scroll */
}

/* =======================================
   MODAL FOOTER (CONSOLIDATED FIX)
======================================= */
.modal-footer {
  /* Flex properties to force the "good" layout */
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  /* This is the key fix to prevent stacking */

  /* Positioning from your original CSS */
  position: sticky !important;
  /* Changed from fixed */
  bottom: 0;
  width: 100%;
  z-index: 1050;

  /* UPDATED COLORS */
  /* background: #eeeeee !important; */
  border-top: 1px solid var(--primary-color) !important;

  padding: 0.5rem;
  /* Matches the 'p-2' class from your HTML */
}

.border-top {
  border-top: 1px solid var(--primary-color) !important;
}

/* Style footer buttons for new primary-color background */
.modal-footer .btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.modal-footer .btn-outline-primary:hover {
  color: var(--primary-color);
  background-color: white;
  border-color: white;
}


#articleCarousel img:hover {
  transform: scale(1.08);
  transition: 0.2s;
}

/* Hide scrollbar */
::-webkit-scrollbar {
  display: none;
}

/* Footer carousel cards */
.footer-article-card {
  text-align: center;
  transition: 0.2s ease-in-out;
}

.footer-article-card.active {
  border: 2px solid var(--primary-color);
  border-radius: 8px;
}

.footer-article-card:hover {
  transform: translateY(-3px);
}



#articleCarousel {
  overflow-x: hidden !important;
  scroll-behavior: smooth;
}

/* Hide scrollbar globally */
::-webkit-scrollbar {
  display: none !important;
}

/* Footer compact layout */
.footer-article-card {
  padding: 4px 6px;
  border-radius: 6px;
  transition: 0.2s ease-in-out;
  white-space: nowrap;
  background: white;
  border: 1px solid black;
}

.footer-article-card.active {
  border: 2px solid var(--primary-color);
  background: #eef6ff;
}

.footer-article-card:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
}


#articleCarousel {
  overflow-x: hidden !important;
  scroll-behavior: smooth;
}

::-webkit-scrollbar {
  display: none !important;
}

/* Fix for modal header buttons wrapping text */
#btnImageView,
#btnTextView {
  white-space: nowrap;
}

/* =======================================
   MODAL FONT STYLES (Mukta + Resizing)
======================================= */

#articleTextBody {
  /* Apply the Mukta font loaded by home.aspx */
  font-family: 'Mukta';
}

#articleTextBody h2 {
  /* Use 'em' to scale relative to the parent (#articleTextBody).
     This makes the headline scale up and down with the rest of the text.
     1.7em is a good relative size to keep it looking like a headline.
  */
  font-size: 1.7em;
  font-weight: 700;
  /* Re-apply bold */
  line-height: 1.3;
}

#articleTextBody p {
  /* Use 'em' to scale relative to the parent. 
     1em means it will be exactly the size of modalFontSize (e.g., 1rem, 1.5rem, etc.)
  */
  font-size: 1em;
  line-height: 1.6;

  /* NEW RULES: Fix text wrapping on zoom */
  overflow-wrap: break-word;
  word-wrap: break-word;
  /* Legacy fallback */
}

/* =======================================
   GOOGLE TRANSLATE STYLES
======================================= */

/* This hides the actual Google Translate widget */
#google_translate_element {
  display: none;
}

/* Styles for the translation disclaimer */
.disclaimer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: #d3d3d3;
  /* Light red background */
  /* color: #721c24; */
  /* Dark red text */
  border: 1px solid #d3d3d3;
  border-radius: 4px;
  /* margin: 1rem 2rem 0 2rem; */
  /* Position it below the content */
  font-family: 'Mukta', sans-serif;
  font-size: 0.9rem;
}

.disclaimer .close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  font-weight: bold;
  /* color: #721c24; */
  cursor: pointer;
  opacity: 0.7;
}

.disclaimer .close-btn:hover {
  opacity: 1;
}

/* =======================================
   GOOGLE TRANSLATE UI HIDING (Consolidated)
======================================= */

/* This hides the main Google widget dropdown */
#google_translate_element {
  display: none !important;
}

/* This hides the Google Translate banner at the top of the page */
.goog-te-banner-frame {
  display: none !important;
}



/* These are the classes from your old code to hide specific UI elements */
.VIpgJd-ZVi9od-aZ2wEe-OiiCO,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-ORHb {
  display: none !important;
  visibility: hidden !important;
}

/* =======================================
    MODAL STYLES (NEW)
======================================= */

.thumbnail-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  padding: 10px;
}

.thumbnail-item {
  touch-action: pan-y;
  /* This is the new width calculation for 6 items per row.
    It takes 100% width, subtracts the space for 5 gaps (15px * 5), 
    then divides the remaining space by 6.
  */
  width: calc((100% - (15px * 5)) / 6);

  /* Add flex-grow and flex-shrink to prevent unwanted resizing */
  flex-grow: 0;
  flex-shrink: 0;

  border: 1px solid black;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  background: #f9f9f9;
}

.thumbnail-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.thumbnail-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  /* Maintain a consistent shape */
  display: block;
  border-bottom: 1px solid #eee;
}

.thumbnail-caption {
  display: block;
  text-align: center;
  /* This rule already centers the text */
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px;
  color: #333;
}

.img-broder {
  border: 1px solid black;
}

.thumbnail-caption {
  border: 1px solid black;

}

/* =======================================
   TOAST NOTIFICATION STYLES
======================================= */
.toast-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1060;
  /* Above most elements */
  font-family: 'Mukta', sans-serif;
  max-width: 300px;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.toast-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.toast-message {
  font-size: 0.95rem;
  line-height: 1.4;
}

.toast-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  opacity: 0.8;
  cursor: pointer;
  padding: 0 0 0 10px;
}

.toast-close-btn:hover {
  opacity: 1;
}


/* =======================================
   FIX #3: RESPONSIVE THUMBNAIL MODAL
======================================= */

/* On screens 992px wide or less (tablets, mobiles) */
@media (max-width: 992px) {
  .thumbnail-item {
    /* 3 items per row: (100% - 2 gaps) / 3 */
    width: calc((100% - (15px * 2)) / 3);
  }
}


/* =======================================
   NEW: MOBILE ARTICLE MODAL STYLES
======================================= */

/* === Mobile Header === */
.mobile-modal-header {
  padding: 0.25rem 0.5rem;
  gap: 0.5rem;
}

.mobile-modal-header .btn-link {
  padding: 0.25rem;
  color: white;
}

.mobile-modal-header .btn-link svg {
  width: 24px;
  height: 24px;
  fill: white;
}

.mobile-modal-header .form-select {
  max-width: 120px;
  font-size: 0.9rem;
  padding: 0.25rem 1.5rem 0.25rem 0.5rem;
  height: auto;
  /* background-color: var(--primary-color); */
  color: rgb(0, 0, 0);
  border-color: rgba(255, 255, 255, 0.5);
}

/* === Mobile Article Counter (above footer) === */
#mobile-article-counter-bottom {
  background-color: #f8f9fa;
  color: #333;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem;
}

/* === Mobile Footer === */
.mobile-modal-footer {
  /* background-color: var(--primary-color) !important; */
  color: white;
  padding: 0.5rem 0;
}

.mobile-modal-footer .btn-link {
  color: white;
  padding: 0.5rem;
  border-radius: 8px;
  opacity: 0.8;
}

.mobile-modal-footer .btn-link.active {
  background-color: rgba(0, 0, 0, 0.2);
  opacity: 1;
}

.mobile-modal-footer .btn-link svg {
  width: 24px;
  height: 24px;
  fill: rgb(0, 0, 0);
}

.btn-outline-primary {
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

/* =======================================
   FIX: Header Buttons 2x2 Grid on Mobile
   (Corrected Gaps and Padding)
======================================= */

/* This targets screens 991.98px and smaller (tablets and mobile) */
@media (max-width: 991.98px) {

  .controls-overlay .btn {
    margin-right: 10px !important;

    /* Ensure no unexpected vertical margin is added */
    margin-top: 0 !important;
    margin-bottom: 10 !important;
  }

  /* Remove the right margin from the last button so it sits flush with the edge */
  .controls-overlay .btn:last-child {
    margin-right: 0 !important;
  }

  /* Remove the default p-3 padding from the container to make the placement cleaner */
  .controls-overlay {
    padding: 0.5rem !important;
  }
}

/* iPad + Tablet: 768px–1024px */
@media (min-width: 768px) and (max-width: 1024px) {

  /* Keep buttons in ONE ROW */
  #desktop_view_filters .d-flex.flex-wrap {
    flex-wrap: nowrap !important;
  }

  /* Add spacing between buttons */
  #desktop_view_filters .d-flex.flex-wrap button {
    margin-right: 0.5rem;
  }

  /* Last button shouldn't have extra space */
  #desktop_view_filters .d-flex.flex-wrap button:last-child {
    margin-right: 0;
  }

  /* Reduce the width of the DATE field */
  #pubSelectDate {
    max-width: 400px;
    /* You can adjust this */
  }

  /* Make the whole date container smaller */
  #pubSelectDate.form-control {
    width: 100%;
  }

  /* Also shrink the column that contains the date field */
  #pubSelectDate.form-control,
  #pubSelectDate.form-control:focus {
    font-size: 0.85rem;
  }

  .thumbnail-grid {
    /* *** CRITICAL FIX: Switch to CSS Grid for guaranteed gap support *** */
    display: grid !important;

    /* Enforce 3 columns of equal size */
    grid-template-columns: repeat(3, 1fr);

    /* Enforce the desired gap of 25px */
    gap: 25px !important;

    padding: 15px;

    /* Ensure no old flex properties interfere */
    flex-wrap: initial !important;
    justify-content: initial !important;
  }

  .thumbnail-item {
    /* Let the grid container handle the item width (no more manual calc()) */
    width: auto !important;

    /* Reset old flex properties */
    flex-grow: initial !important;
    flex-shrink: initial !important;
    max-width: 100%;
  }

  #translateSelect,
  #mobileTranslateSelect {
    /* Add a 15px margin to the right of the dropdowns to create the gap */
    margin-right: 15px !important;
  }
}

@media (max-width: 767px) {

  /* Make buttons container a grid with 2 columns */
  #desktop_view_filters .d-flex.flex-wrap {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    justify-items: stretch;
  }

  /* Make each button fill the grid cell */
  #desktop_view_filters .d-flex.flex-wrap button {
    width: 100%;
    padding: 0.4rem 0.6rem;
    /* optional smaller padding */
    font-size: 0.85rem;
    /* optional smaller font */
    white-space: nowrap;
  }
}

.article-item.active {
  background-color: #f0f5ff;
  border-left: 4px solid #0d6efd;
  padding-left: 10px;
}

/* Temporary highlight for hovering a zone */
.article-item.hover-highlight {
  background-color: #f8f9fa;
  /* A light grey */
  border-left: 4px solid #adb5bd;
  /* A grey border */
}

/* Permanent highlight for the clicked/active item */
.article-item.active {
  background-color: #f0f5ff;
  border-left: 4px solid var(--primary-color);
  padding-left: 10px;
}

#goog-gt-tt {
  display: none !important;
}

.watermark {
  position: absolute;
  z-index: 2;
  bottom: 50%;
  right: 50%;
  color: rgba(107, 107, 107, 0.3);
  pointer-events: none;
  transform: translate(50%, 50%) rotate(300deg);
  transform-origin: center center;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#lblWm{
  font-size: 12rem;
}

#wmname{
  font-size: 3rem;
}

/* added 05 Jan 2025 rearrange parameter menu */

.form-floating>label{
  width: 120% !important;
}

.form-select:not(#pageDropdown,#mobilePageDropdown,#translateSelect,#mobileTranslateSelect) {
  --bs-form-select-bg-img: none;
  padding-right: 0rem !important; 
}