/* version 07.16.25.19:12 */

html, body {
  overscroll-behavior: none;
  touch-action: none;
}

body{
  font-family:
  "Baskerville",
  "Baskerville Old Face",
  "Hoefler Text",
  "Georgia",
  "Times New Roman",
  serif;
    font-size: 20px;
    line-height: 1.6;
    color: #333333;
    background-color: #F0EAD6;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}



a:link, a:visited{
    color: #319090;
    text-decoration: none;
}

a:hover, a:active{
    color: #5EB3D0;
    border-bottom: 1px dotted #5EB3D0;
}


.header-mockup {
    width: 100%;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.header-mockup img {
    width: auto;
    height: 341px; /* Half of 682px */
    max-width: 100%;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 36px;
    font-weight: bold;
    color: #333;
}

h2 {
    font-size: 24px;
    font-weight: normal;
    color: #666;
}

article p {
    margin: 15px 0;
}

figure {
    margin: 20px 0;
    text-align: center;
}

figcaption {
    font-size: 14px;
    font-style: italic;
    color: #555;
}

blockquote {
    font-style: italic;
    font-size: 20px;
    margin: 20px 40px;
    padding: 10px 20px;
    background-color: #f9f9f9;
    border-left: 5px solid #ccc;
}

footer {
    border-top: 1px solid #ccc;
    margin-top: 40px;
    padding-top: 10px;
}

footer p {
    font-size: 14px;
    color: #666;
}

.header {
    text-align: center;
    padding: 20px;
    background-color: #f4f4f4;
    border-bottom: 1px solid #ccc;
}

.nav {
    text-align: center;
    background-color: #333;
    color: white;
}

.nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
}

.nav ul li {
    margin: 0 10px;
}

.nav ul li a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    display: block;
}

.nav ul li a:hover {
    background-color: #555;
}

.content {
    position: relative;
    height: calc(100% - 100px);
}

.section {
    /* padding: 20px; */
    height: 100%;
    overflow-y: auto;
    width: 100%;
    transition: opacity 0.5s ease;
    opacity: 0;
    display: none;
}

.section h1, .section h2, .section h3, .section h4, .section p{
    max-width: 920px;
    margin: auto;
    padding: 10px 0px;
}  

.visible {
    opacity: 1;
    display: block;
}

.video-placeholder {
    width: 100%;
    height: 200px;
    background-image: url("../img/Odumosu_Welcome\ VideoScreenshot_Nov2024.png");
    background-repeat: no-repeat;
    background-size: contain;
    background-color: #ddd;
    text-align: center;
    line-height: 200px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

#toolSection {
    position: relative;
    height: 100vh;
    width: 100vw;
    background-color: #312b25;
}

#contentSection{

}

.custom-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(49, 43, 37, 0.7);
    backdrop-filter: blur(23px);
    display: flex;
    justify-content: center;
    padding: 10px 0;
    z-index: 10;
  }

  #zoom-in,
  #zoom-out,
  #home,
  #fullscreen,
  #unfilter,
  #citation,
  #toggle-overlay,
  #how-to-use {
    /* background: none; */
    width: 40px;
    height: 40px;
    margin: 0 10px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
  }

  #zoom-in {
    background-image: url('../img/btn/zoom_in.svg');
    background-size: cover;
  }
  #zoom-out {
    background-image: url('../img/btn/zoom_out.svg');
    background-size: cover;
  }
  #home {
    background-image: url('../img/btn/home.svg');
    background-size: cover;
  }
  #fullscreen {
    background-image: url('../img/btn/fullscreen.svg');
    background-size: cover;
  }
  #unfilter {
    background-image: url('../img/btn/filter.svg');
    background-size: cover;
  }
  #how-to-use {
    background-image: url('../img/btn/howto.svg');
    background-size: cover;
  }
  #citation{
    background-image: url('../img/btn/citation.svg');
    background-size: cover;
  }

  #toggle-overlay {
    background-image: url('../img/btn/toggle_overlay.svg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    width: 40px;
    height: 40px;
    border: none;
    outline: none;
    cursor: pointer;
  }
  
  #toggle-overlay:hover {
    filter: brightness(1.2);
  }
  
  #toggle-overlay.tool_in_use {
    filter: grayscale(100%);
  }

  .toolbar-button {
    position: relative;
    width: 40px;
    height: 40px;
    margin: 5px;
    background: none;
    border: 1px solid #aaaaaa26;
    cursor: pointer;
    outline: none;
  }

  .toolbar-button:hover {
    background-color: #fff4;
    color: #000;
  }

  
  .toolbar-tooltip {
    position: absolute;
    top: -55px;
    left: -40px;
    display: block;
    pointer-events: none;
    background: #efeeee;
    color: #222;
    border-radius: 8px;
    padding: 8px 12px;
    width: 94px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    max-width: 10vw;
    font-size: 0.8em;
    line-height: 1.1;
    white-space: normal;
    opacity: 0;
    transition: opacity 150ms ease;
    z-index: 20000;
}

  .toolbar-tooltip.visible {
    opacity: 1;
    visibility: visible;
  }
  
  .toolbar-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: white transparent transparent transparent;
  }
.toolbar-switch .toolbar-tooltip {
    position: absolute;
    top: -35px; /* Position above the switch */
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    color: black;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
    z-index: 10;
}

.toolbar-switch .toolbar-tooltip.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.toolbar-switch .toolbar-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: white transparent transparent transparent;
}

/* ONLY when hovering or focusing #toggle-overlay: */
#toggle-overlay:hover  .toolbar-tooltip,
#toggle-overlay:focus  .toolbar-tooltip {
  top: -132px !important;   /* raise it above your popover */
  left: -40px !important;   /* center it over the popover */
}
/* Lift the tooltip up when it’s on the toggle‐overlay button */
.toggle-overlay-btn > .toolbar-tooltip {
  /* push it up 12px higher than its normal JS‐calculated top */
  /* transform: translateY(-19px) translateX(-5px) !important; */
}


  .tool_in_use{
    background-color: #fff4;
    color: #000;
  }
.howToUse-overlay {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    /* height: 80%; */
    z-index: 10; /* Ensure it's above other elements */
    color: #BBB;
    background-color: rgba(0, 0, 0, 0.5); /* White background with slight transparency */
    padding: 20px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: auto; /* Allows scrolling if content exceeds the container */
    display: flex; /* Initially hidden, then flex when visible */
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.howToUse-close {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #00000073;
  border-radius: 9px;
  font-size: 20px;
  color: #fff;
  cursor: pointer;
  z-index: 1000;
  }
  
  .howToUse-close:hover {
    color: #336e6e;
  }

  /* hidden by default */
.howToUse-overlay.offscreen {
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

/* when we toggle it on */
.howToUse-overlay.show {
  display: flex;    /* or block, whatever you need */
  opacity: 1;
  pointer-events: auto;
}

#instructions-modal{
  z-index: 10001;
}

.instructions-container {
    width: 100%; /* Take full width of the overlay */
    /* height: 100%;  Take full height of the overlay */
    overflow-y: auto; /* Enable vertical scrolling */
    overflow-x: hidden; /* Prevent horizontal scrolling */
    padding: 20px; /* Optional padding inside the scrollable area */
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 79vw;
    justify-items: stretch;
    align-items: start;
}

.instructions-grid.single-column {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Two equal columns */
  gap: 20px;
  justify-items: stretch;
}
#touch-instructions{
  width: fit-content;
}


  .instruction-cell {
    border: 1px solid #ccc3;
    width: 100%;              /* fill the whole column */
    /* min-height: -webkit-fill-available; */
    box-sizing: border-box;   /* include padding in that 100% */  
    padding: 15px;
    text-align: center;
    background-color: #000A;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-size: smaller;
  }
  
  .instruction-cell h3{
    padding: 10px 0px 0px 0px;
  }

  .instruction-cell p{
    text-align: left;
  }

/* span both columns and center its contents: */
#instruction6 {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 80%;
}

  .mouse-icon {
    position: relative;
    float: left;
    width: 40px;
    height: 60px;
    margin: 0px 15px 0px 0px;
    border: 2px solid black;
    border-radius: 20px;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .instruction_image{
    position: relative;
    float: left;
    min-width: 40px;
    height: 60px;
    margin: 0px 15px 0px 0px;
    display: flex;
  }
  .instruction_image #home, 
  .instruction_image #zoom-in, 
  .instruction_image #zoom-out,
  .instruction_image #fullscreen,
  .instruction_image #unfilter,
  .instruction_image #how-to-use{
    margin: auto;
  }
  .instruction-cell .toolbar-switch-container{
    float: left;
    margin: 12px 10px 0px 0px;
  }



  .wheel {
    width: 10px;
    height: 10px;
    background-color: black;
    border-radius: 50%;
    animation: scrollWheel 1s infinite ease-in-out;
  }
  
  @keyframes scrollWheel {
    0% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(10px);
    }
    100% {
      transform: translateY(0);
    }
  }
  

    /* reduces saturation of a layer */
.desaturate{
    MIX-BLEND-MODE: darken;
    opacity: .9;
    height: 100vh;
    width: 100vw;
    transition: opacity 0.7s ease, background-color 0.7s ease; /* Smooth transition for opacity and background-color */
    background-color: transparent; /* Default transparent background */
}


.hide_desaturate{
    background: #000;
    opacity: .3;
}

.overlay{
    /* z-index: 20; */
    cursor: pointer;
}

.overlay-highlight {
  background-color: #FFF             !important;
  mix-blend-mode:    luminosity      !important;
  border-radius:     15%             !important;
  box-shadow:        0 0 15px 15px rgba(255,255,255,0.6), inset 0 0 20px 10px rgba(153,153,153,0.5) !important;
  z-index:           9999            !important;
}

/* a half-strength, persistent highlight */
.overlay-isolate {
  box-shadow: 0 0 10px 5px rgb(255 255 255 / 52%) !important;
  z-index:     9999 !important;
  background-color: #fffffb73;
  border-radius: 15px;
}

/* when both isolate and highlight are present */
.overlay-isolate.overlay-highlight {
 position: relative;           /* create a new stacking context */
  z-index: 10001 !important;    /* above everything else */
  outline: 3px solid #fff !important;
  outline-offset: 4px !important;
  /* you can still keep your glow if you like: */
  box-shadow: 0 0 20px 12px rgba(255,255,255,0.8) !important;
}

.overlay-hover-highlight{
    border-radius: 15%;
    opacity: .5;
    background-color: #7ba3b9;
    mix-blend-mode: multiply;
    /* backdrop-filter: brightness(1.3); */
    border: 3px solid rgb(94, 179, 208);

}

.desaturate .overlay-hover-highlight{
    opacity: 1;
    mix-blend-mode: luminosity;
    border: 2 px cyan;
    box-shadow: 0 0 15px 15px rgba(255, 255, 255, 0.6), inset 0 0 20px 10px rgba(153, 153, 153, 0.5);
}

.overlay-hover-highlight-revealed {
    border-radius: 15%;
    background-color: #5EB3D0;
    background-blend-mode: color-dodge;
    border: 3px solid rgb(94, 179, 208);
}

.openseadragon-overlay-indicator:hover{
    opacity: 0.9;
    background-color: #b11414;
    outline: 2px solid whitesmoke;
}

.openseadragon-canvas {
  touch-action: manipulation;
  -ms-touch-action: none !important;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.overlay-touch-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.7);
  border: 2px solid #5EB3D0;
  pointer-events: none; /* allows clicks to pass through to the overlay */
  z-index: 1;
}

.overlay-touch-marker[data-layer-category="cat01"] {
  border: 2px solid #54c7e0; /* Portraits */
}

.overlay-touch-marker[data-layer-category="cat02"] {
  border: 2px solid #e2d25e; /* References */
}

.overlay-touch-marker[data-layer-category="cat03"] {
  border: 2px solid #d186a8; /* Symbols */
}

/* Ensure the canvas will transition the filter effect */
canvas {
    transition: filter 0.5s ease-in-out; /* Adjust timing as needed */
}

canvas.osd-image-grayscale {
    filter: grayscale(100%) !important;
}

.osd-image-grayscale .overlay-hover-highlight {
    filter: none !important; /* Ensure overlay highlight remains unaffected */
}

.filtered-canvas {
  background-size: contain;
  background-repeat: no-repeat;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0; /* Ensure it's below the OSD canvas */
  transition: filter 0.5s ease-in-out, opacity 0.2s ease-in-out; /* ✨ Add this line */
  opacity: 1;                            /* ✨ Ensure default state is visible */
  pointer-events: none !important;
}

  .filtered-canvas.hover{
    filter: brightness(0.5);
  }

#tooltip {
    pointer-events: none;
    position: absolute;
    display: none;
    padding: 10px;
    /*background-color: rgba(50, 50, 50, 0.85); /* Dark charcoal with transparency */
    color: #15130d;
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Subtle drop shadow */
    max-width: 250px; /* Optional: control the tooltip width */
    font-size: 14px; /* Optional: adjust text size */
    z-index: 1000; /* Ensure it appears on top */
  }
  
  #tooltip-header {
    font-weight: bold;
    margin-bottom: 5px;
  }
  
  #tooltip-description {
    font-size: 14px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: bolder;
    font-variant: all-small-caps;
    color: rgba(78, 78, 78, 1);
    opacity: .8;
  }
  
  #tooltip hr{
    border: .1px solid white;
    opacity: .3;
  } 

/* Overlay Switch Tooltip */
.overlay-switch-tooltip {
    position: absolute;
    bottom: 50px; /* Adjust to hover above the switch */
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none; /* Prevents interaction */
    z-index: 1000;
}

.overlay-switch-tooltip.visible {
    opacity: 1;
}
  
/* Tooltip and modal background colors based on layer_category */
/* people */ 
.layer-cat01, #chip-description-modal.cat01 {
    background-color: #bdc9d2;
}


.layer-cat02, #chip-description-modal.cat02 {
    background-color: #f4ee95;
}

.layer-cat03, #chip-description-modal.cat03 {
    background-color: #f7cadd;
}


.toolbar{
    width: 90vw;
    margin: 10px auto;
}

/* Common switch styles */
.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
  }
  
  .switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 20px;
  }
  
  .slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
  }
  
  input:checked + .slider {
    background-color: #f4e0879e;
    /* background-color: #70809030; */
  }
  
  input:checked + .slider:before {
    transform: translateX(14px);
  }
  
  #disclaimer-filter-toggle:checked + .slider {
    background-color: #1E90FF; /* Bright blue color */
}

  

  /* Specific styles for toolbar filter switch */
  .toolbar-switch-container {
    display: flex;
    align-items: center;
    padding: 0 10px; 
    gap: 0.5rem;
    position: relative; /* Establish positioning context for tooltip */
    width: 40px;
    height: 40px;
  }
  
  .toolbar-switch-label {
    font-size: 0.85rem;
    color: #000; /* Custom color for toolbar label */
  }
/* Toolbar Switch */
/* Parent container ensures the child elements are clipped */
.toolbar-switch {
    position: relative;
    width: 40px;
    height: 40px;
    overflow: hidden;  /* Ensures content outside is clipped */
    background-color: #cccccc42; /* Add a background color to differentiate states */
    display: flex;
    align-items: center;
  }
  
  /* Square switch styles */
  .toolbar-switch .switch {
    position: relative;
    display: inline-block;
    width: 40px; /* Square size */
    height: 40px; /* Square size */
  }
  
  .toolbar-switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
/* Slider styles */
.toolbar-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0; /* Remove rounded corners */
    background-color: #70809030;
    /* background-color: #f4e0879e; */
    transition: 0.4s;
  }
  .instruction-cell .slider
  {
    background-color: #cccccc12;
  }
/* make a “full-width” instruction cell span across the two-column grid */
.instructions-grid .instruction-full {
  grid-column: 1 / -1;
}

#instruction-print-inscriptions{
    max-width: 50%;
    font-size: .8em;
    margin: auto;
    bottom: 0px;
    position: relative;
}

#instruction-print-inscriptions p{
  text-align: justify;
}
  /* Slider knob styles */
  .toolbar-switch .slider:before {
    position: absolute;
    content: "";
    height: 30px; /* Slightly smaller than parent for spacing */
    width: 30px;
    background-color: white;
    transition: 0.4s;
    border-radius: 0; /* Square knob */
  }
  
  /* Unfiltered state: position halfway outside left */
  .toolbar-switch input[type="checkbox"]:not(:checked) + .slider:before {
    transform: translateX(20px); /* Move knob entirely to the right */
  }
  
  /* Filtered state: position halfway outside right */
  .toolbar-switch input[type="checkbox"]:checked + .slider:before {
    transform: translateX(-20px); /* Half of knob width */
  }
  
  /* Disabled Overlay: visually dim and disable pointer events */
.overlay-disabled {
    pointer-events: none;
    opacity: 0.5; /* Dim the overlay */
    transition: opacity 0.3s ease-in-out;
}

  .temporary-tooltip {
    position: absolute;
    top: -55px; /* Positioned above the switch */
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 5px;
    white-space: nowrap;
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
    display: block; /* Hidden initially */
    z-index: 100000;
  }
  
  .temporary-tooltip.show {
    opacity: 1;
    visibility: visible;
  }
  

  /* Specific styles for disclaimer filter switch */
  .disclaimer-switch-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .disclaimer-switch-label {
    font-size: 0.85rem;
    color: #666; /* Custom color for disclaimer label */
  }
  

.filter-container {
    display: flex;
    align-items: center; /* Aligns items vertically centered */
    gap: 8px; /* Adds space between the toggle and text */
    justify-content: center;
}

#filter-state {
    font-size: 0.85em; /* Adjust font size */
    color: #333; /* Optional: Adjust text color */
}

#OSD-image-viewer{
    width: 90vw;
    margin: 0px auto;
    /* padding-top: 30px; */
    /* height: 95vh; */
    height: calc(100vh - 64px) !important;
    box-sizing: border-box;
    z-index: 1;
    transition: filter 0.5s ease-in-out;
}
.blurred {
    filter: blur(20px);
}

.disclaimer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.disclaimer-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    max-width: 430px;
    margin: 0 20px;
}

.disclaimer-button {
    background-color: #0066cc;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 10px;
    cursor: pointer;
    border-radius: 5px;
}

.disclaimer-button:hover {
    background-color: #004a99;
}

#contentSection{
    position: relative;
    width: 100vw;
    height: 100vh;
}
/****************** Modal box styles ******************/

.modal{
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    bottom: 0;
    /* transform: translateY(-50%); */
    border-radius: 0px 20px 20px 0px;
    width: 50vw;
    /* width: 600px; */
    /* height: 80%; */
    /* background-color: rgba(0, 0, 0, 0.8); */
    /* color: #F0EAD6; */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    display: none; /* Initially hidden */
    opacity: 0; /* Initially transparent */
    transition: transform 0.5s ease-in-out, width 0.5s, max-width 0.5s; 
    z-index: 1000; /* Ensure modal is above other elements */
    overflow-y: scroll;
}

.modal.expanded {
    width: 90vw;
}


.modal_container{
    display: flex;
    flex-direction: column;
    width: 60%;
    max-width: 800px;
    max-height: 80%;    
    padding: 20px 70px 20px;
    overflow-y: auto;
    font-size: 40px;
    background-color: rgba(133, 168, 199, 0.865);
    border-radius: 8px;
    transition: width 0.5s, max-width 0.5s;
    /* z-index: 101; */
}
#modal_container{
    display: flex;
    width: auto;
    direction: ltr;
}

#modal_container.expanded .modal-content {
    grid-template-columns: repeat(3, 1fr);
}

   /* Hidden positions for sliding in and out */

.modal.show {
    opacity: 1; /* Fully visible when 'show' is added */
}

.modal-left {
    left: -320px; /* Hidden to the left */
    direction: rtl;
}

.modal-right {
    right: -320px; /* Hidden to the right */

}

/* Visible positions */
.modal-left.show {
    transform: translateX(320px); /* Slide in from the left */
    border-radius: 0px 20px 20px 0px;
    padding: 20px 0px 20px 20px;
}

.modal-right.show {
    transform: translateX(-320px); /* Slide in from the right */
    border-radius: 20px 0px 0px 20px;
    padding: 20px 20px 20px 0px;
}

/* Offscreen positions */
.modal-left.offscreen {
    transform: translateX(-320px); /* Slide out to the left */
}

.modal-right.offscreen {
    transform: translateX(320px); /* Slide out to the right */
}

.modal.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999; /* Ensure it appears above OpenSeaDragon content */
}
/* 2) If you ever do fullscreen, apply the same logic */
.modal.fullscreen #OSD-image-viewer,
#OSD-image-viewer.fullscreen {
  height: calc(100vh - 64px) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   Citation Modal (mirrors your existing modal styles)
   ───────────────────────────────────────────────────────────────────────── */
#citation-modal {
  /* Use the same positioning as #modal_wrapper */
  position: fixed;
  width: fit-content;
  height: fit-content;
  margin: auto;
  top: 0; right: 0; bottom: 0; left: 0;
  display: none;           /* initially hidden */
  justify-content: center; /* center horizontally */
  align-items: center;     /* center vertically */
  z-index: 2000;           /* above most content but below lightbox if any */
}

#citation-modal .modal-container {
  background: #eeece3;
  color:#262626;
  border-radius: 4px;
  padding: 20px; 
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

#citation-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  
}

#citation-modal .modal-content {
  padding: 1rem;
  font-size: 1rem;
}

#citation-modal .close-button{
  color: #262626;
  background: none;
  border: 1px solid #26262640;
  border-radius: 4px;
}

#citation-modal.show {
  display: flex; /* when “show” is added, it becomes visible */
}

#citation_footer{
    width: 100%;
    margin-top: 60px;
    padding-bottom: 60px;
    position: relative;
}
#citation_footer p{
  max-width: 95%;
  font-size: smaller;
}

#footnote-modal {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 10002;
  background-color: white;
}

#chip-description-modal {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 1001;
}

#chip-description-modal.offscreen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#chip-description-modal.show {
    display: flex;
    position: fixed;
    width: 80vw;
    height: 75vh;
    margin: auto;
    overflow-y: scroll;
    /* background: white; */
    padding: 27px;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0.85;
    visibility: visible;
    pointer-events: auto;
  }

  #chip-description-header
  {
    position: relative;
    z-index: 2;
    padding: 0.75em 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
  }
  
  #chip-description-close {
    font-size: 2rem;
    background: none;
    border: 1px solid rgb(41, 41, 41);
    border-radius: 5px;
    cursor: pointer;
    color: grey;
    z-index: 3;
  }

  #chip-description-content {
    flex: 1;
    max-height: 75vh;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
    touch-action: pan-y;
    z-index: 1;
  }
/****************** Modal content styles ******************/

.modal-header {
    text-align: center;
    margin-bottom: 20px;
    grid-column: span 3; /* Span all columns when expanded */
}

.modal-header{
    margin: 0px auto 45px;
    position: relative;
    text-align: left;
    font-size: 2em;
}
.modal-header::after {
  content: "";
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 100%;
  background: url("../img/filigree.svg") no-repeat center/contain;
  opacity: 0.3;             /* make it subtle */
  pointer-events: none;
}
.modal-header h2 {
    margin: 0;
    position: relative;
    padding-bottom: 1.5em;  /* room for the filigree */
    font-size: 1.5em;
    color: gray;
}

.modal-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    line-height: 1.6;
}

.modal-content h2{
  margin:0%;
}
.modal-column {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: center;
}

.content-column {
    width: 100%;
    padding: 20px;
}

.control-strip {
    /* width: 50px; */
    
    height: 95vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.modal-left .control-strip {
    border-left: 3px solid #333;
    border-left-style: double;
    border-right: none;
    border-right-style: none;
}

.modal-right .control-strip {
    border-right: 3px solid #333;
    border-right-style: double;
    border-left: none;
    border-left-style: none;
}

.control-button {
    background: none;
    border: none;
    font-size: 26px;
    font-weight: bold;
    color: #313131;
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
    margin: 5px 0;
}

.control-button:hover {
    background-color: #9c9c9c;
}

.expanded .content-column {
    width: calc(100vw - 50px);
}


/* === Base typography === */
/* let direct children size themselves rather than forcing 100% */
.modal-content > * {
  width: auto;
  margin: auto;
  /* max-width: 80%; */
  overflow: visible;
  /* font-size: 22px; */
}

/* paragraphs should fill their container by default */
.modal-content p {
  width: 100%;
  margin-bottom: 1em;
  line-height: 1.5;
}

/* === Figure & image styling === */

/* wrap image + caption in <figure class="modal-img"> */
.modal-content figure.modal-img {
  width: 45%;
  margin-bottom: 1em;
}

/* images only get forced to 100% *inside* a figure */
.modal-content figure.modal-img img {
  display: block;
  width: 95%;
  height: auto;
}

/* caption styling */
.modal-content figure.modal-img figcaption,
.modal-content .modal-img-caption {
  /* font-size: 1.0rem; */
  color: #403c3c;
  text-align: left;
  margin-top: 0.5em;
  padding-bottom: 0.75em;
  opacity: 1.0;
  
}

/* Float left/right based on modal side */
.modal.modal-left   figure.modal-img { float: left;  margin: 1em 1.5em 1em 0; }
.modal.modal-right  figure.modal-img { float: right; margin: 1em 0 1em 1.5em; }

/* clearfix so content after the floats wraps below */
.modal-content::after {
  content: "";
  display: table;
  clear: both;
}

.modal-content h2{
  font-size: 32px;
}

.modal-content .modal-sub-header{
    text-align: left;
    font-size: 27px;
    color: #5d5858;
}
/* .modal-content .modal-img-caption{
    font-size: 16px;
    text-align: left;
    padding-bottom: 30px;
} */

.modal-content .tombstone_title{
    font-style: oblique;
    font-weight: bold;
}

.expanded .gallery {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start; /* Align thumbnails at the start */
    max-height: 100vh; /* Prevent the gallery from exceeding the viewport height */
    overflow-y: auto; /* Add vertical scrolling if needed */
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    max-height: 500px; /* Set a default maximum height */
    overflow-y: auto; /* Add vertical scrolling if needed */
}

.gallery-item {
    width: calc(20% - 10px);
    cursor: pointer;
}

audio,
video {
    width: 100%;
    margin-bottom: 20px;
}

.footnote-sup {
  display: inline-block;  /* Needed for padding to take effect */
  padding: 10px;           /* Expand hit area around the character */
  margin: -10px;           /* Prevent layout shift */
  color: #183c76;
  cursor: pointer;
  font-size: small;
  text-decoration: underline dotted;
  position: relative;
}

.footnote-sup.footnote-touch {
  background-color: #ffffffc4;
  border-radius: 50%;
  padding: 0.1em 0.1em;
  margin: 0.5em -.1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  min-height: 1.2em;
  font-weight: bold;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  touch-action: manipulation;
}

.footnote-tooltip-box {
  position: absolute;
  z-index: 10000;
  background: #fff;
  color: #000;
  padding: 10px;
  padding-bottom: 1.8em; /* Add extra space at the bottom */
  border: 1px solid #ccc;
  border-radius: 4px;
  max-width: 400px;
  min-width: 375px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  font-size: 0.9em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 150ms ease/*, transform 150ms ease*/;
  pointer-events: none;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footnote-tooltip-box.visible {
  opacity: 1;
  /* transform: translate(-50%, -50%) scale(1); */
  pointer-events: auto;
}

/* Add loading spinner styles */
.loading-spinner {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    padding: 0.5em 1em;
    border-radius: 4px;
    z-index: 5;    
    display: block;
    width: 100%;
    text-align: center;
    font-size: 14px;
    color: #555;
}

.loading-spinner::after {
  content: "";
  display: block;
  width: 32px;
  height: 32px;
  margin: auto;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


.close-button {
    position: absolute;
    top: 10px;
    right: 25px;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #999;
    text-decoration: none;
    cursor: pointer;
}

/* 1) Lightbox container: pad 10% on every side */
#lightbox {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10vh 10vw;     /* leaves 10% margin top/bottom, 10% left/right */
  box-sizing: border-box; /* ensures padding is inside the 100vw/100vh */
  z-index: 20000;
}

/* 2) Image itself: never exceed container’s inner box */
#lightbox-image {
  max-width: 100%;   /* 100% of the available (80vw) width */
  max-height: 100%;  /* 100% of the available (80vh) height */
  width: auto;
  height: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  cursor: zoom-out;
}

.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  background: rgba(0, 0, 0, 0.7);
  padding: 1em 1.5em;
  font-size: 1rem;
  border-radius: 5px;
  z-index: 10001;
  pointer-events: none;
}

/* Gallery styles */
.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery-item {
    width: calc(20% - 10px);
    cursor: pointer;
}


/******************* buttons *******************/
.return-button {
    position: fixed;
    top: -125px;
    /* right: 20px; */
    background-color: lightblue;
    color: #2f4f4f;
    padding: 10px 20px;
    opacity: .7;
    border-radius: 5px;
    cursor: pointer;
    transition: top 0.5s;
}

.return-button.show {
    top: 20px;
}
.return-button.right{
    right: 20px;
}

.expand-button {
    align-self: flex-end;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    margin-bottom: 10px;
}


/****************** onboarding slideshow styles *****************/
/* Slideshow container */
.slideshow-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    backdrop-filter: brightness(0.5);
    width: 100%;
    height: 100%;
    /* background-color: rgba(0, 0, 0, 0.8); */
    z-index: 10;
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    color: white;
    border-radius: 10px;
    padding: 20px;
}

/* Slideshow images */
.slide {
    display: none;
    width: 100%;
    /* max-width: 600px; */
}

/* Navigation buttons */
.nav-button {
    background: none;
    color: #e0e26f;
    font-size: xxx-large;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    /* background-color: rgba(255, 255, 255, 0.6); */
    border: none;
    padding: 10px;
    cursor: pointer;
    /* border-radius: 50%; */
}

#prev-slide {
    left: 10px;
}

#next-slide {
    right: 10px;
}

#close-slideshow {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #BB5E6D;
    padding: 8px;
    cursor: pointer;
    color: white;
    border: none;
    border-radius: 5px;
}

@keyframes hop {
  0%, 100% { transform: translateY(0); }
  25%      { transform: translateY(-6px); }
  75%      { transform: translateY(-3px); }
}

.toolbar-tooltip.hop {
  /* shorthand covers name, duration, timing, iteration */
  animation: hop 0.8s ease 1;
  /* make sure it’s on top while animating */
  z-index: 9999;
}

@media (max-width: 960px) {
  #toggle-overlay:hover .toolbar-tooltip, #toggle-overlay:focus .toolbar-tooltip {
    top: -65px !important;
  }
  .modal-header {
    font-size: 1.8em;
    line-height: 1.3;
    margin: 0px auto 13px;
    padding-bottom: 6px;
    border-bottom: 1px solid #00000022;
  }
  .modal-header::after{
    background: none;
  }
  
  .modal-content {
    max-width: 95%;
    font-size: 0.95em;
    line-height: 1.5;

  }
  .modal-content h2 {
    font-size: 23px;
  }
  .modal-img-caption,
  figure.modal-img figcaption {
    font-size: 0.70em;
  }

  .footnote-tooltip-box {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: 75vw !important;
    max-height: 60vh !important; /* Make scrollable if tall */
    white-space: normal;
    word-wrap: break-word;
    z-index: 9999;
    background: white;
    padding: 1em;
    border-radius: 6px;
    font-size: 0.95rem;
    text-align: left;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto; /* Enable scrolling */
    pointer-events: auto; /* Make sure tap events work */
  }

  #tooltip {
    font-size: 0.9em;
  }
}

@media (min-width: 961px) {
  .modal-content > * {
    font-size: 22px;
    max-width: 80%;
  }
  .modal-content figure.modal-img figcaption,
.modal-content .modal-img-caption {
  font-size: 1.0rem;
  }

}

#rotate-device-warning {
  display: none;
  position: fixed;
  bottom: 12px;
  /* top: -157px; */
  width: 95vw;
  /* margin: auto; */
  left: 3vw;
  /* transform: translateX(-48vw); */
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 10px 10px;
  border-radius: 8px;
  font-size: 16px;
  z-index: 10000;
  text-align: center;
  max-width: 90%;
  pointer-events: none;
}

/* Only show on small portrait touch devices */
@media (max-aspect-ratio: 1/1) and (pointer: coarse) {
  #rotate-device-warning {
    display: block;
  }
}

@media (hover: none) and (pointer: coarse) {
  .howToUse-overlay {
    top: 3%;
    background-color: rgba(0, 0, 0, 0.9);
  }

#touch-instructions p{
  padding: 5px 0px;
  margin: 0px;
  font-size: .8em;
  border-bottom: 1px solid #6d6a6a4d;
}
  .instructions-container{
    padding: 0px;
  } 
  .footnote-tooltip-box {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: 75vw !important;
    max-height: 60vh !important;
    overflow-y: auto;
    opacity: 1;
    white-space: normal;
    z-index: 9999;
    background: white;
    padding: 1em 2em 1em 1em; /* More space on the right for the button goo */
    border-radius: 6px;
    font-size: 0.95rem;
    text-align: left;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
  }

  /* .footnote-tooltip-box .close-button {
    position: absolute;
    top: -6px;
    right: 0px;
    font-size: 2em;
    background: transparent;
    border: none;
    color: #555;
    cursor: pointer;
  } */

  .footnote-tooltip-box .close-button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  font-size: 18px;
  line-height: 24px;
  text-align: center;
  border: none;
  background: none;
  color: #333;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
}

.footnote-tooltip-box .close-button:focus,
.footnote-tooltip-box .close-button:hover {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
}

  .overlay-disabled {
    opacity: 0 !important;
  }
}