html {
  overflow-y: scroll;
}

html, body {
	font-size: 10px;
  margin: 0;
  padding: 0;
}

body {
	display: flex;
	flex-direction: column;

  min-height: 100svh;
  min-width: 100svw;

	align-items: center;

	background-image: url("/black-linen-pattern.png");
	background-color: #660818;

	color: white;
  font-family: 'Courier New', monospace;
}

main{
  flex: 1;
  height: 80%;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.no-select {
  -webkit-touch-callout: none; /* iOS Safari: disables the callout menu on long-press */
  -webkit-user-select: none;   /* Safari, Chrome, Opera, Samsung Internet */
  -khtml-user-select: none;    /* Konqueror (legacy) */
  -moz-user-select: none;      /* Firefox */
  -ms-user-select: none;       /* Internet Explorer/Edge (legacy) */
  user-select: none;           /* Standard syntax for modern browsers */
  outline: none; 
  /* 1. WebKit Browsers (Safari, Chrome, Edge, Samsung Internet) */
  -webkit-tap-highlight-color: transparent;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); /* Fallback for older Android */
}   

header {
   text-align: right;
   margin-right: 10%;
   margin-left: auto;

   font-size: clamp(3vh, 5vh, 5em);
   padding-bottom: 1vh;

   position: sticky;
}

footer p {
  padding-bottom: 20%;
}

figure {
  margin: 0;
}

/*grid style*/
#grid {
  columns: 2;
  padding: 2%;
}

#grid img {
  max-height: 85%;
  width: 95%;
  display: block;
  margin: 0 auto 10% auto;
  break-inside: avoid;
}

.caption {
  display: none;
}

/*lightbox style*/
#lightbox {
  display: none;
}

#lightbox.show {
  display: flex;
  flex-direction: column;

  justify-content: center;
  align-items: center;
  margin: auto; 

  /* CRITICAL: Allows browser to calculate height based on natural ratio */
  /* Optional: Ensures it shrinks if natural height > max-height */
  max-width: 90svw;   
  max-height: 90svh;
  background-color: rgba(0,0,0,0);
}

dialog {
  border: none;
  box-shadow: none;
}

dialog::backdrop {
  background-color: rgba(0,0,0,0.85);
}

#lightbox-img {
  max-width: 100%;   
  max-height: 70svh;
}

#lightbox-caption {
  color: white;
  text-align: center;
  font-size: 3svh;
}

.zoomable {
    cursor: pointer;
}

/* tablet */
@media (min-width: 768px) {
  #grid {
    columns: 3;
  }
}

/* desktop */
@media (min-width: 1200px) {
  #grid {
    columns: 4;
  }
}

/* large desktop */
@media (min-width: 1600px) {
  #grid {
    columns: 5;
  }
}

