html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

main {
  flex: 1;
  display: flex;
  flex-direction: row;
  height: calc(100vh - 60px - var(--intro-height, 140px));
}
/* HEADER BAR */

#topbar {

  height: 60px;
  background: #111;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 0 20px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  z-index: 2000;
}


.topbar-left {

  display: flex;
  align-items: center;
  gap: 12px;

}

#logo {
  height: 36px;
  width: auto;
  max-height: 36px;
  object-fit: contain;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

#siteTitle {

  font-size: 20px;
  font-weight: bold;

}

/* INTRO SECTION */

#intro {

  margin-top: 40px;
  padding: 20px 30px;
  background: white;
  border-bottom: 1px solid #ddd;

}


.intro_title {
  margin-bottom: 10px;
  font-size: 28px;
  font-weight: bold;
}

.intro_text {
  font-size: 18px;
  line-height: 1.5;
  max-width: 900px;
}


#intro.collapsed {
  height: 0;
  overflow: hidden;
  padding: 0;
}



.topbar-right {

  display: flex;
  align-items: center;
  gap: 15px;

}



/* Language */

.language-selector {
  display: flex;
  gap: 6px;

}

.flag {
  width: 16px;
  height: 12px;
  cursor: pointer;
  opacity: 0.6;
  transition: 0.2s;
}

.flag:hover {
  opacity: 1;
}

.flag.active {
  opacity: 1;
  transform: scale(1.15);
}


.view-toggle{
  display:inline-flex;
  /*justify-content:center;*/
  margin: 8px;
  width: fit-content;
  padding: 6px;
  background-color: #007cbf;
  border-radius: 20px;
  /*height:*/
}

.toggle-container{
  cursor:pointer;
}

.toggle-btn{
  padding:8px 18px;
  border-radius:20px;
  background:#f0f0f0;
  margin:0 3px;
}

.toggle-container input{
  display:none;
}

.toggle-container input:checked + .toggle-btn{
  background:#1c6ed5;
  color:white;
}

/* FILTER TAGS */
#filtersContainer{
  display:flex;
  gap:20px;
  margin-bottom:20px;
  flex-wrap:wrap;
}

.filter-group{
  padding:10px;
  border-radius:6px;
}

.filter-title{
  font-weight:bold;
  margin-bottom:6px;
}

.filter-tag{
  display:inline-block;
  padding:4px 10px;
  border-radius:12px;
  margin:4px;
  cursor:pointer;
  color:white;
}

/* type colors */

.tag-keywords{
  background:rgba(23,140,242,0.7);
}

.tag-technology{
  background:rgba(5,155,75,0.7);
}

.tag-category{
  background:rgba(141,10,229,0.7);
}

/* selected tag */

.filter-tag.active{
  outline:2px solid #222;
  transform:scale(1.05);
}



.filter-tag:hover {
  background-color: #0928db;
}




/* LOGIN BUTTON */

#authButton {

  background: #4CAF50;
  border: none;
  color: white;
  padding:8px 18px;
  border-radius:20px;
  cursor: pointer;

}

#filterButton, #projectionButton {
  padding:8px 18px;
  border-radius:20px;
  background:#f0f0f0;
  margin:0 3px;
  cursor:pointer;
  border-width: 0;
}

#filterTags {
  display: none;
}




#map {
  width: 50%;
  height: 100%;
  position: relative;
}

/* SCROLLY */

#scrolly {

  width: 50%;
  height: 100%;
  overflow-y: scroll;
  background: #f9f9f9;

}

.scroll__text {
  padding: 2em;
}



/* STORY STEPS */

.step {
  margin-bottom: 80vh;
  min-height:80vh;
  opacity: 0.5;
  transition: 0.3s;
}


.step.is-active {

  opacity: 1;
  background: white;
  padding: 1.5em;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);

}



.marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  background-size: contain;
  background-repeat: no-repeat;
}

.marker-default {
  background-image: url('/static/images/markers/default.png');
}

.marker-training {
  background-image: url('/static/images/markers/training.png');
}

.marker-subcluster {
  background-image: url('/static/images/markers/subcluster.png');
}

.marker-deployment {
  background-image: url('/static/images/markers/deployment.png');
}

.marker-duty_station {
  background-image: url('/static/images/markers/duty_station.png');
}

.marker-workshop {
  background-image: url('/static/images/markers/workshop.png');
}

.marker-mapping {
  background-color: #007cbf;
}

.marker-research {
  background-color: #f28cb1;
}

.marker-analysis {
  background-color: #51bbd6;
}

.story-organization {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.story-main{
  font-size:1.05em;
  line-height:1.5;
}

.story-tasks{
  margin:8px 0 12px 0;
  padding-left:18px;
}

.story-tasks li{
  margin-bottom:4px;
}

.story-extract{
  font-style:italic;
  color:#5f6b7a;
  border-left:3px solid #ccd3db;
  padding-left:12px;
  margin:12px 0;
}

.story-highlight{
  margin-top:10px;
  display:flex;
  align-items:center;
  gap:8px;
  font-size:0.95em;
}

.tech-icon{
  width:22px;
}

.org-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.org-name {
  font-size: 14px;
}


.story-carousel{
  display:flex;
  align-items:center;
  gap:8px;
  margin:10px 0;
}

.story-image{
  max-width: 500px;
  max-height: 350px;
  border-radius:6px;
}

.carousel-prev,
.carousel-next{
  background:#eee;
  border:none;
  padding:6px 10px;
  cursor:pointer;
}

#mapLegend{
  position:absolute;
  bottom:20px;
  left:20px;
  background:white;
  padding:8px 10px;
  border-radius:4px;
  font-size:12px;
}

.legend-item{
  display:flex;
  align-items:center;
  margin:3px 0;
}

.legend-color{
  width:14px;
  height:14px;
  margin-right:6px;
}

/* colors from your map logic */

.legend-color.data{
  background:rgba(23,140,242,0.3);
}

.legend-color.deployment{
  background:rgba(141,10,229,0.6);
}

.legend-color.remote{
  background:rgba(5,155,75,0.6);
}

.legend-color.duty{
  background:rgba(0,69,128,0.9);
}

.projection-list{
  display:none;
  background:white;
  padding:10px;
  border-radius:6px;
  margin-top:5px;
  width:200px;
}

.projection-list label{
  display:block;      /* one per line */
  margin-bottom:6px;
  cursor:pointer;
}

#projectionControls {
  display : none; 
}