@font-face {
  font-family: 'TimesTen';
  src: url('fonts/TimesTen.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: block; 
}

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

html, body {
  height: 100%;
  width: 100%;
  font-family: 'TimesTen', Times, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.2;
  background-color: #ffffff;
  color: #000000;
  overflow: hidden;
}

/* --- UI Bars --- */
.top-bar, .bottom-bar {
  position: fixed;
  left: 0;
  width: 100%;
  padding: 0 0.75rem;
  z-index: 11000;
  display: flex;
  align-items: center;
  color: black;
  background-color: rgba(255 255 255 / 0.15);
}

.top-bar {
  top: env(safe-area-inset-top);
  height: 2.5rem;
  justify-content: space-between;
}

.bottom-bar {
  bottom: env(safe-area-inset-bottom);
  height: 2rem;
}

/* Light text variant for dark backgrounds */
.top-bar.light-text,
.bottom-bar.light-text {
  color: white;
  background-color: rgba(0 0 0 / 0.3);
}

#info-toggle {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
}

/* --- Image & Navigation --- */
#image-container {
  position: fixed;
  top: calc(2.5rem + env(safe-area-inset-top));
  bottom: calc(2rem + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#image-container img,
#image-container video {
  max-width: 100%;
  max-height: 100%;
  padding: 0 0.6rem;
  object-fit: contain;
  pointer-events: none;
}

/* ensure video actually plays */
#image-container video {
  pointer-events: none;
}

/* click zones */
.click-zone {
  position: fixed;
  top: calc(2.5rem + env(safe-area-inset-top));
  bottom: calc(2rem + env(safe-area-inset-bottom));
  width: 50%;
  z-index: 1000;
}

.left-zone { left: 0; cursor: w-resize; }
.right-zone { right: 0; cursor: e-resize; }

/* --- Info Panel --- */
#info-panel {
  display: none;
  position: fixed;
  top: calc(1.8rem + env(safe-area-inset-top));
  left: 0;
  width: 100vw;
  height: calc(100vh - 1.8rem - env(safe-area-inset-bottom));
  background: white;
  padding: 0 0.75rem calc(3rem + env(safe-area-inset-bottom));
  z-index: 12000;
  overflow-y: auto;
  line-height: 1.2;
}

#info-text {
  white-space: pre-wrap;
  padding-bottom: 2rem;
}

#info-panel a {
  color: inherit;
  text-decoration: none;
}

#info-text a {
  color: inherit;
  text-decoration: none;
  position: relative;
}

#info-text a:hover {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;        /* underline thickness */
  text-underline-offset: 0.2em;          /* distance from text */
  text-decoration-color: currentColor;   /* matches text color */
}

/* --- Responsive Adjustments --- */
.mobile-only { display: none; }
.desktop-only { display: inline; }

@media (max-width: 767px) {
  .bottom-bar { display: flex; }
  .desktop-only { display: none; }
  .mobile-only { display: flex; }
}

@media (min-width: 768px) {
  html, body {
    font-size: calc(18px + (38 - 17) * ((100vw - 768px) / (1920 - 768)));
  }
  .top-bar { top: 0; }
  .bottom-bar { bottom: 0; }
  #image-container { top: 2.5rem; bottom: 2rem; }
  .click-zone { top: 2.5rem; bottom: 2rem; }
  #info-panel { top: 1.8rem; height: calc(100vh - 1.8rem); padding-bottom: 2rem; }
}

/* --- Info Panel Open --- */
body.info-panel-open {
  background-color: #ffffff !important;
}

body.info-panel-open #info-panel {
  display: block;
}

body.info-panel-open .top-bar {
  color: black !important;
  background-color: #ffffff !important;
}

body.info-panel-open .bottom-bar,
body.info-panel-open .click-zone,
body.info-panel-open #image-container {
  display: none;
}

body.info-panel-open .top-bar .desktop-only {
  display: none;
}
