/*--------------------- Global Reset ---------------------*/
* {
  margin: 0;
  padding: 0;
  border: 0;
  box-sizing: border-box;
}

html {
  -ms-scroll-snap-type: y mandatory;
  scroll-snap-type: y mandatory;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overflow-y: auto;
}

::-webkit-scrollbar {
  width: 0;
  background: transparent;
}

.modal,
.modal-body {
  overflow-y: auto !important; /* Restore scroll behavior */
  scrollbar-width: auto !important; /* Firefox */
  -ms-overflow-style: auto !important; /* IE/Edge */
}

/* WebKit-based browsers */
.modal::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
  display: block !important;
  width: 8px !important; /* Or whatever width you prefer */
}

.modal::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.1);
}

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

/* --------------------- Root Variables --------------------- */
/* Global color and filter variables */
:root {
  --logo-filter: invert(100%) sepia(31%) saturate(6%) hue-rotate(179deg) brightness(115%) contrast(100%);
  --modal-filter: invert(27%) sepia(34%) saturate(599%) hue-rotate(135deg) brightness(88%) contrast(94%);
}

/*--------------------- Body Styles ---------------------*/
body {
  background: url(../page/bg.webp) fixed no-repeat center / cover;
  color: #fff;
  /*font-family: Arial, sans-serif;*/
  /*font-family: 'Verdana', Geneva, sans-serif;*/
  font-family: 'Roboto', sans-serif;
  user-select: none;
  scroll-behavior: smooth;
  padding: 0;
  margin: 0;
  position: relative; /* for z-index stacking context */
  z-index: 0;
}

/*--------------------- Section Layout ---------------------*/
section {
  display: flex;
  flex-wrap: wrap;
  height: 100vh; /* Full viewport height */
  height: 100dvh; /* Mobile support */
  width: 100vw;
  flex-direction: row;
  align-items: center; /* Vertically center children */
  justify-content: center;
  flex-shrink: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: rgba(63, 62, 62, 0.1);
  z-index: 1;
  /* Fade-In Animation */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

section:after {
  content: "";
  display: table;
  clear: both;
}

section.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/*--------------------- Columns Layout ---------------------*/
.column {
  display: flex;
  flex-direction: column;
}

.left, .right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%; /* Full height for centering */
}

.left {
  width: 60%;
}

.right {
  width: 40%;
  align-items: center;
  text-align: center;
  padding-left: 0;
  padding-right: 60px;
}

/* Optional debug borders */
.left {
  border: transparent;
}

.right {
  border: transparent;
}

/*--------------------- Figures ---------------------*/
section figure {
  display: inline-block;
  position: relative;
  margin: 0 auto;
  text-align: center;
  font-size: 15px;
}

section figure img {
  max-width: 100%;
  max-height: 100vh;
  vertical-align: top;
  border-radius: 5px;
}

section figure figcaption {
  position: absolute;
  top: -3px;
  color: #fff;
  text-shadow: 2px 2px 3px #000;
  padding: 10px;
  font-size: clamp(1rem, 5vw, 1.5rem);
}


/* ============================ MODAL STARTS ============================ */
.openModalLink {
  cursor: pointer;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  padding: 1rem;
  z-index: 1000;
  overflow: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: rgb(255, 255, 255);
  background-image: url('../page/topography.svg');
  background-repeat: repeat;
  background-position: top left;
  background-size: auto;
  max-width: 850px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 8px;
  padding: 1.5rem 2rem 2rem;
  position: relative;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal h2 {
  margin-top: 0;
  font-size: 1.6rem;
  color: #222;
  border-bottom: 2px solid #ddd;
  padding-bottom: 0.5rem;
}

.modal p {
  font-size: 1rem;
  font-size: clamp(  0.7em, calc(1vw + 0.4rem),  1em ) !important;
  line-height: 1.5;
  margin-bottom: 0.8rem;
  color: #444;
}
.modal p:first-of-type {font-style: italic;color:rgb(65, 65, 65);font-weight: 600;}
/*.modal p:nth-of-type(5) {font-style: italic;color:rgb(65, 65, 65);font-weight: 600;}*/

.modal a {
  color: #319197;
  text-decoration: none;
}

.modal a:hover {
  text-decoration: underline;
}

.modal em {
  color: #666;
  font-weight: 600;
  font-style: italic;
}

.modal strong {
  color: #319197;
}

.close-btn1 {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2.8rem;
  font-weight: bold;
  line-height: 1;
  color: #999;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-btn1:hover {
  color: #333;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.author-info svg {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.author-info span {
  font-size: 0.9rem;
  color: #666;
}

.logo-modal {
  width: 40px;
  height: auto;
  filter: var(--modal-filter);
  display: block;
}

.modal .link-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}

.modal .link-icon img,
.modal .link-icon svg {
  width: 15px;
  height: auto;
  flex: none; /* or flex-shrink: 0 */
  flex-shrink: 0;
}

/*.modal a{display:block;}*/

/* ============================ MODAL ENDS ============================ */

/*--------------------- Scroll Down Prompt ---------------------*/
.scroll-down {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: none;
  text-align: center;
  pointer-events: none;
  user-select: none;
  max-width: 400px;
  text-shadow: 2px 2px 3px #000;
  color: white;
}
.scroll-down h4 {
    font-weight: 400;
    padding: 0;
    margin: 0px 0px 5px 0px;
}
.scroll-down h4 {
  font-size: 1.2em; /* fallback for older browsers */
  /* proper clamp usage with calc: min, dynamic, max */
  font-size: clamp(1em, calc(-0.7em + 3.1vw),  1.1em ) !important;
}
.arrows {font-size: clamp(1.5em, calc(-0.7em + 3.1vw),  2em ) !important;
  color: rgb(255, 255, 255);
  display: inline-block;
  animation: jump 0.9s infinite ease-in-out;
}

@keyframes jump {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ========================== Go to Top Button ========================== */
.end-of-gallery {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  text-align: center;
  padding: 0 0 0.4em 0;
  font-style: italic;
  font-size: 1.2em;
  z-index: 10000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
  user-select: none;
}

#goToTopBtn {
  display: inline-block;
  margin-top: 0.5em;
  padding: 0.3em 1em;
  background: #444;
  color: #fff;
  font-size: 1em;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s ease;
  animation: jumpUp 0.9s infinite ease-in-out;
}

@keyframes jumpUp {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

#goToTopBtn:hover {
  background: #666;
}


/* --------------------- Accessibility --------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* Development Debugging (temporary) */
.develop {
  /*position: sticky;*/
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  z-index: 10000;
  /* Optionally add a background color or border to make it visible */
  /*background-color: rgba(0, 0, 0, 0.1);  Semi-transparent background */
  /*border: 1px solid rgba(255, 0, 0, 0.5)!important;  Border for visibility (optional) */
}

.develop a.fill-div {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  /* Ensures the anchor fills the div and makes it clickable */
}

.develop a.fill-div,
.develop a.fill-div:focus,
.develop a.fill-div:active {
  outline: none;
  border: none;
}


/* --------------------- Text Styles --------------------- */
p,
img,
body {
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.left p {
  text-align: left;
}
/*
.right p {
  line-height: 1.2;
  font-size: clamp(1.2rem, -0.875rem + 3.3vw, 2.2rem);
  margin-top: -5px;
}*/

.right .first-p {
  font-style: italic;
  color: rgba(241, 241, 241, 0.918);
  font-size: clamp(1rem, -0.875rem + 3.3vw, 2rem);
  margin-bottom: 15px;
}
.right p {
    line-height: 1.6;
    font-size: 1.7em;
    display: block;
    margin-block-start: 1em;
    margin-block-end: 1em;
    margin-inline-start: 0;
    margin-inline-end: 0;
    font-size: clamp(1.2rem, -0.875rem + 3.3vw, 2.2rem);
    margin-top: -5px;
}

span.year {
  font-size: clamp(0.9rem, -0.875rem + 3.3vw, 1.3rem);
  font-style: italic;
  color: rgba(241, 241, 241, 0.918);
}

hr {
  border: none;                     /* Remove default borders */
  height: 1px;                      /* Ensure visible height */
  background-color: #ddd;;            /* Set the color of the line */
  margin-bottom:5px;
}

p {
  letter-spacing: normal;
  /*text-decoration: underline;
  text-underline-offset: 3px;*/
}

/* --------------------- Logo Styles --------------------- */


.logo-container {
  width: clamp(150px, 20vw, 250px);
}

.logo-head {
  width: 100%;
  height: auto;
  filter: var(--logo-filter); /* Remove !important if not needed */
  pointer-events: none;
  margin-bottom: 10px;
  display: block;
}




/* ========================== Responsive Styles ========================== */
@media screen and (max-width: 670px) {
    .logo-top-mobile {
    display: block;
    position: fixed;
    top: 10px;
    right: 10px;
    width: 40px;
    height: auto;
    z-index: 1000;
    pointer-events: auto; /* allow pointer events! */
    cursor: pointer; /* show clickable cursor */
  }


.logo-mobile {
  display: block;
  width: 100%;
  height: auto;
  filter: var(--logo-filter);
  pointer-events: none;   /* so it doesn't block clicks behind it */
}



  .column {
    width: 100%;
  }

  .right {
    display: none;
  }

  .scroll-down {
    bottom: 3vh !important;
  }

  section figure figcaption {
    position: absolute;
    bottom: -7em !important;
    color: #fff !important;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    width: 100%;
  }

  span.year {
    font-size: clamp(1rem, 3vw, 1.1rem) !important;
    color: #ecebeb !important;
   }



.modal h2 {
  font-size: 1.3rem;
  padding-bottom: 0.2rem;
}

.modal p {
  font-size: 1rem;
  line-height: 1.4;
}



}

@media screen and (min-width: 671px) {
  .figcap {
    display: none;
  }

  .logo-top-mobile {
    display: none;
  }
}

@media (min-width: 1250px) {
  .right {
    width: 40%;
  }

  .left {
    width: 60%;
  }

  div .right-top {
    margin-right: 10%;
  }
}

@media (min-width: 1700px) {
  .left {
    width: 50%;
  }

  div .right-top {
    margin-right: 20%;
  }
}

@media (min-width: 2000px) {
  div .right-top {
    margin-right: 50%;
  }
}
