:root {
  --border-rad: 20px;
  --border-rad-small: 20px;
}

/* Reduce image height on narrow screens so cards stay proportional */
@media (max-width: 420px) {
  .div-art-entry img {
    height: 140px;
  }
  .modal > button {
    display: none;
  }
}

body {
  max-width: 850px;
}

#a-art-link {
  font-weight: 900;
}

.div-grid-content {
  display: grid;
  /* Responsive grid: create as many columns as fit, each at least 200px */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 100px 0px 100px 0px;
}

.div-art-entry {
  cursor: pointer;
  background-color: white;
  /* background-image: linear-gradient(180deg, #ffffff 0%, #fdffe1 100%); */
  color: black;
  /* box-shadow: 5px 10px 0px rgba(0, 0, 0, 0.2); */
  text-align: center;
  display: flex;
  border-radius: 20px;
  overflow: hidden;
  flex-direction: column;
  width: 100%;
  transition:
    transform 300ms cubic-bezier(0.68, -0.55, 0.27, 3.5),
    background-color 300ms;
}

.div-art-entry:hover {
  transform: scale(1.025);
  background-color: #0095ff;
  color: white;
}

.div-art-entry > div {
  padding: 16px;
}

/* Ensure art thumbnails fit their grid cell */
.div-art-entry img {
  width: 100%;
  max-width: 100%;
  height: 200px;
  border-radius: 10px;
  box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.1);
  object-fit: cover;
  display: block;
}

.div-art-entry h2 {
  text-shadow: 0px 3px 5px rgba(0, 0, 0, 0.175);
}

/* div id="art-modal" class="modal hidden">
    <!-- BG alpha -->
    <div class="modal-content">
      <span id="modal-close">&times;</span>

      <img id="modal-img" src="" alt="">
      <h2 id="modal-title"></h2>
    </div>
  </div> */

.modal-content {
  max-height: 80vh;
  overflow-y: auto;
  padding: 1rem;
  box-sizing: border-box;
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.3);
  border-radius: 4px;
}

.modal {                           /* Full-screen modal overlay container */
  /* Fix element to the viewport (ignores scrolling) */
  position: fixed;
  /* Stretch to all screen edges (top/right/bottom/left = 0) */
  inset: 0;
  /* Semi-transparent dark backdrop */
  background-color: rgba(0, 0, 0, 0.5); 
  /* Enable flexbox for centering content */
  display: flex;
  /* Center modal content vertically */
  align-items: center;
  /* Center modal content horizontally */
  justify-content: center;
  /* Ensure modal appears above other elements */
  z-index: 999;
}

.modal > button {
  position: fixed;
  padding: 10px;
  /* border-radius: 100%; */
  background-color: rgba(0, 0, 0, 0);
  border: none;
}

.modal > button > img {
  width: 20px;
}

#modal-right-btn{
  right: 20px;
}
#modal-left-btn{
  left: 20px;
}

#modal-desc {
  max-width: 800px; /* or any value that works for readability */
  margin: 0 auto;   /* center if narrower than modal */
  white-space: normal;
  word-break: break-word;
}

#modal-desc > a {
  color: blue;
}

/* Inner modal box that holds content */
.modal-content {                   
  /* White background for contrast */
  background: #ffffff; 
  /* Black text color */
  color: black; 

  border-radius: var(--border-rad);

  /* Space between content and edges */
  /* padding: 20px;  */
  /* Prevent modal from being too wide */
  max-width: 100%; 
  /* Prevent modal from being too tall */
  max-height: 100%; 
  /* Anchor for absolutely positioned children */
  position: relative; 
  text-align: center; 
}

.modal-content > h2 {
  margin: 0px 0px 0px 0px;
}
.modal-content > p {
  margin: 0px 0px 0px 0px;
  color: grey;
}


.modal-content img {               /* Images inside the modal */
  /* Prevent horizontal overflow */
  max-width: 100%; 
  /* Limit image height to viewport height */
  max-height: 82vh; 
  border-radius: var(--border-rad-small);
}

#modal-close {                     /* Close (×) button */
/* Position relative to modal-content */
  position: absolute; 
  top: 40px;
  right: 40px;
  /*  Offset slightly from the top */
  /* top: 0.5rem; 
  /* right offset (currently disabled) */
  /* right: 0.75rem; 
  /* Make close icon large and clickable */
  font-size: 2rem; 
  /* Show pointer cursor on hover */
  cursor: pointer; 
}

.hidden {                          /* Utility class for hiding elements */
  display: none;                   /* Remove element from layout and rendering */
}