:root {
  --app-bg: #f1f2ea;
  --nav-bg: #d9e1cf;
  --frame-bg: #ffffff;
  --frame-border: #cad4c2;
  --accent: #254336;
  --nav-active: black; /*#6dbedb;*/
  --text: #1a1f1d;
  --stage-width: 1600px;
  --stage-height: 900px;
  --edge-gap: 12px;
  --h-gap: 20px;
  --nav-col-width: 170px;
  --content-top-gap: var(--edge-gap);
  --content-bottom-gap: var(--edge-gap);
  --nav-button-gap: 14px;
  --icon-label-font-size: 20px;
  --info-body-font-size: 16px;
  --info-body-line-height: 1.45;
  --info-body-line-space: calc(var(--info-body-font-size) * (var(--info-body-line-height) - 1));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

#app-shell {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--stage-width);
  height: var(--stage-height);
  display: grid;
  grid-template-columns: var(--h-gap) var(--nav-col-width) var(--h-gap) minmax(0, 1fr) var(--h-gap);
  transform-origin: top left;
}

#nav-menu {
  grid-column: 2;
  min-width: 0;
  padding-top: var(--edge-gap);
  display: flex;
  justify-content: center;
  align-items: center;
}

#nav-buttons {
  width: 100%;
  height: calc(100% - (2 * var(--edge-gap)));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--nav-button-gap);
}

.nav-icon {
  width: 100%;
  max-width: none;
  aspect-ratio: 1 / 1;
  border: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  box-shadow: none;
}

.nav-icon:hover {
  transform: translateY(-2px);
}

.nav-icon.active {
  border-color: grey; /*var(--nav-active);*/
  box-shadow: none;
}

.vis-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.info-icon {
  background: #eeeeee;
  border-color: transparent;
  display: grid;
  place-items: center;
}

.info-icon.active {
  border-color: grey; /*var(--nav-active);*/
}

.info-label {
  font-size: var(--icon-label-font-size);
  font-weight: 600;
  color: #000000;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

#content-area {
  grid-column: 4;
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: var(--content-top-gap) 0 var(--content-bottom-gap) 0;
  overflow: hidden;
}

#language-switcher {
  position: absolute;
  top: var(--content-top-gap);
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  transform: translateY(calc(-100% - 8px));
}

.lang-button {
  min-width: 40px;
  height: 28px;
  border: 1px solid #6e7d72;
  background: #ffffff;
  color: #23322a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.lang-button:hover {
  border-color: var(--nav-active);
}

.lang-button.active {
  background: var(--nav-active);
  color: #ffffff;
  border-color: var(--nav-active);
}

#content-area::before {
  content: '';
  position: absolute;
  left: 0;
  top: var(--content-top-gap);
  bottom: var(--content-bottom-gap);
  width: 1px;
  background: #000000;
}

#content-frame {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--frame-bg);
  border: 1px solid var(--frame-border);
  border-radius: 0;
  overflow: hidden;
}

#canvas-host,
#canvas-host canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

#loading-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  z-index: 3;
}

#year-picker {
  position: absolute;
  left: calc((2 * var(--h-gap)) + var(--nav-col-width));
  right: var(--h-gap);
  bottom: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 4px 0 0 0;
  background: transparent;
  border: 0;
  z-index: 2;
}

.year-link {
  border: 0;
  background: transparent;
  color: #2a3d33;
  text-decoration: underline;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  line-height: 1.2;
}

.year-link:hover {
  color: #1a2a20;
}

.year-link.active {
  font-weight: 700;
  text-decoration: none;
}

#info-view {
  position: absolute;
  inset: 0;
  padding: 20px;
  overflow: hidden;
  background: #ffffff;
  z-index: 2;
}

#info-layout {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

#info-text-panel,
#info-image-panel {
  min-width: 0;
  min-height: 0;
}

#info-text-panel {
  padding: 0 26px 0 0;
  overflow-y: auto;
}

#info-text-panel h1 {
  margin: 0 0 12px;
  font-size: 24px;
}

#info-text-content {
  white-space: pre-wrap;
  line-height: var(--info-body-line-height);
  font-size: var(--info-body-font-size);
}

#info-image-panel {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
}

#info-graphic {
  width: 100%;
  height: calc(100% - 34px);
  margin-top: calc(
    34px +
    (2 * var(--info-body-font-size) * var(--info-body-line-height)) +
    (2 * var(--info-body-line-space))
  );
  object-fit: contain;
  object-position: top center;
}
