* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background: #ffffff;
  color: #000000;
  overflow-x: hidden;
  padding-bottom:20px;
}

header {
  background: linear-gradient(
    to right,
    #0055A4 0%,
    #0055A4 33.33%,
    #FFFFFF 33.33%,
    #FFFFFF 66.66%,
    #EF4135 66.66%,
    #EF4135 100%
  );

  color: rgb(146, 157, 255);
  -webkit-text-stroke: 0.9px rgb(0, 0, 0);

  padding: 20px;
  text-align: center;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.main-chart {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 40px;
  align-items: center;
}

/* BIG MAP CONTAINER */
.main-chart .d3-container {
  width: 100%;
  max-width: 1200px;
  height: 600px;
  border-radius: 12px;
  flex:2;
}

.main-chart .secondary-card {
  flex:0.7;
}

.container .card {
    transition: transform 0.2s ease;
}

#map-text {
  text-align: center;
  font-size: medium;
  padding:20px;
}


#secondary-chart-text {
  text-align: center;
  font-size: medium;
}

#box-text {
  text-align: center;
  font-size: medium;
  padding:20px;
  object-position: center;
}

.secondary-chart #box-text {
  text-align: center;
  font-size: small;
  padding:20px;
  object-position: center;
}

.container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 20px;
}
.container .card:nth-child(3) {
  grid-column: 1 / -1;   /* spans both columns */
  justify-self: center;
  width: 50%;            /* optional: makes it look centered */
}

.secondary-chart {
  display: flex;
  gap: 20px;
  align-items: center;
  padding-top:60px;
  padding:20px;
}

.secondary-chart .secondary-card {
  transform: translateY(-45px);
  flex:2
}

.img-container {
  flex:4
}

.card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;

  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  align-items: center;
  display: flex;
}

.secondary-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;

  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  align-items: center;
  display: flex;
}

.card:hover {
  transform: scale(1.02);
}

.card img {
  width: 100%;
  height: 300px;
  object-fit: contain; /* 👈 shows whole graph */
  object-position: center 10%; /* 👈 default, but we can tweak */
  display: block;
}

#sankey-card {
  width: 100%;
  height: 300px;
  overflow: hidden;
  cursor: pointer;

  display: flex;
  justify-content: center;  /* horizontal center */
  align-items: center;      /* vertical center */
}

#sankey-card svg {
  width: 100%;
  height: 100%;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;

  background: rgba(0,0,0,0.9);
  display: none;
  flex-direction: column; /* stack vertically */
  justify-content: center;
  align-items: center;

  z-index: 9999;
}

#overlay-text {
  color: white;
  text-align: center;
  padding-left: 20px;
  padding-right: 30px;
}

/* image fullscreen */
#overlay img {
  max-width: 90%;
  max-height: 90%;
}

/* svg fullscreen */
#overlay svg {
  width: 50%;
  height: 50%;
}

footer {
  text-align: center;
  padding-top:40px;
  font-size: 12px;
  color: #666;
  white-space: pre-line;
}