@font-face {
  font-family: 'MyFont';
  src: url('fonts/Simpsonfont\ DEMO.woff2') format('woff2'),
       url('fonts/Simpsonfont\ DEMO.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}
body{
  margin: 0;
  height: 100vh;
  font-family: inter;
  overflow: hidden;
  background-color: #aabc8e;
}

.sidebar{
    width: 300px;
    height: 100vh;
    background-color: rgb(22, 21, 21);
    position: fixed;
    left: 0; top:0;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 1);
    box-sizing: border-box;
}

.sidebar .logo{
    display: flex;
    justify-content: center;
}
.sidebar .logo img{
    max-width: 60%;
    height: auto;
}

.sidebar .nav-links{
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 12px;
    font-family: poppins;
    font-weight: bold;
    flex-direction: column;
    height: calc(100vh - 80px);
}

.sidebar .nav-links li{
    margin-bottom: 20px;
}

.sidebar .nav-links a{
    text-decoration: none;
    color: whitesmoke;
    font-size: 18px;
    display: block;
    padding: 2px;
    text-align: center;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.sidebar .nav-links a:hover{
    background-color: #aabc8e;
    color: black;
}
.main{
  position: fixed;
  left: 300px; right: 0; top: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #aabc8e;
  overflow: hidden;
  --sidebar-w: 300px;
}

.main svg{
  --pane-w: calc(100vw - var(--sidebar-w));
  --map-r: calc(1091.95 / 911.69);
  width:  min(var(--pane-w), calc(100vh * var(--map-r)));
  height: min(100vh,        calc(var(--pane-w) / var(--map-r)));
  display: block;
  max-width: 100%;
  max-height: 100%;
}
#main_buildings g {
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform, filter;
}

@keyframes idleFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.04);
  }
}

#main_buildings g:hover {
  animation: idleFloat 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(236, 240, 11, 0.495));
}

#main_buildings:nth-of-type(1){
    animation-delay: 0s;

}

#main_buildings:nth-of-type(2){
    animation-delay: 0.2s;

}

#main_buildings:nth-of-type(3){
    animation-delay: 0.3s;

}

#main_buildings:nth-of-type(4){
    animation-delay: 0.4s;

}

#main_buildings:nth-of-type(5){
    animation-delay: 0.5s;

}

#main_buildings:nth-of-type(6){
    animation-delay: 0.6s;

}

.overlay{
    display: none;
    position: fixed;
    top:0;
    left:0;
    width:100%;
    height: 100%;
    background:rgba(0, 0, 0, .5);
    z-index:999;
}

.popup{
      display: none; 
    position: fixed;
    top:50%;
    left:60%;
    transform: translate(-50%,-50%);
    background: #d8d8d8;
    padding: 0;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .1);
    z-index:1000;
    width: 100%;
    max-width: 800px;
    border: 3px solid black;
     max-height: min(80vh, 680px);  /* scroll if content is tall */
     overflow: auto;       

}

.overlay.show{
    display: block;
    position: fixed;
}

.popup.show{
    display: block;
    animation: slideIn 0.5s ease-out forwards;
}

.content-container{
    display: flex;
    align-items: stretch;
}

.text-container{
    flex:1;
    padding:20px
}

h2{
    font-family: poppins;
}
p{
    font-family: inter;
    font-size: 14px;
    padding:20px
}
#close-popup{
    position: relative;
    top:85%;
    left: 15%;
    width: clamp(120px, 40%, 200px);
    margin: 20px auto 24px;  
    transform: translateY(-50%);
    width:20%;
    padding: 10px;
    background-color: #d8d8d8;
    border: solid;
    border-radius: 5px 5px 5px 5px;
    cursor: pointer;
    text-align: center;
}

#close-popup:hover{
    background-color: black;
    color: #FADA00;
}

#page-close-btn{
    position: fixed;
    top:20px;
    right: 20px;
    font-weight: bold;
    background:none;
    color: black;
    border: none;
    cursor: pointer;
    z-index: 1001;
}
.map-icon { cursor: pointer; }

/* Hamburger button */
.menu-toggle{
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1100;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid black;
  background: #FADA00;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

/* default desktop sidebar stays fixed at 300px as you already have */

/* Mobile layout */
@media (max-width: 768px){
  /* slide the sidebar off-canvas by default */
  .sidebar{
    transform: translateX(-100%);
    transition: transform .25s ease;
    width: 85vw;
    max-width: 320px;
    box-shadow: 2px 0 12px rgba(0,0,0,.35);
    z-index: 1050;
  }
  /* when open, slide it in */
  .sidebar.open{ transform: translateX(0); }

  /* let the map fill the screen when menu is closed */
  .main{
    left: 0;                 /* undo the fixed 300px left */
    --sidebar-w: 0px;        /* keeps your svg sizing logic happy */
  }

  /* Ensure the popup fits small screens nicely */
  .popup{
    left: 50%;
    width: calc(100vw - 24px);
    max-height: 80vh;
  }

  /* Tighter inner spacing on mobile */
  .text-container{ padding: 16px; }
  h2{ font-size: 20px; margin: 8px 0 6px; }
  p{ font-size: 15px; padding: 10px 0; }

  /* Center and size the Close button for touch */
  #close-popup{
    display: block;
    width: 60%;
    margin: 20px auto 24px;
    font-size: 16px;
  }
}

/* make icons feel clickable everywhere */
.map-icon{ cursor: pointer; }
@media (max-width: 1024px){
  .sidebar{ width: 260px; }
  .main{ left: 260px; --sidebar-w: 260px; }
}
@media (max-width: 768px) {
  .popup {
    left: 50%;
    width: 90%;
    max-width: none;
    max-height: 85vh;
    padding: 10px 0;
    transform: translate(-50%, -50%);
  }

  .text-container {
    padding: 16px;
  }

  p {
    font-size: 15px;
    padding: 10px 0;
  }

  h2 {
    font-size: 20px;
    padding: 10px 0;
  }
  #close-popup {
    width: 60%;             /* more comfortable tap size */
    margin: 24px auto;      /* centers nicely */
    font-size: 16px;
  }
}