@import url("./lib/leaflet.css");
@import url("./lib/MarkerCluster.css");
@import url("./lib/MarkerCluster.Default.css");

* {box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui; font-size: 16px; font-weight: 400;}

::backdrop {opacity: 0.9;}

/*==========================================================================================*\
|  PERUSRAKENNE
\*==========================================================================================*/

html, body {height: 100%;}

body 
  {
  padding: 10px;
  background: rgb(46,80,68);
  }

.kehys
  {
  display: grid;
  grid-template-areas:
    "otsikkopalkki"
    "menupalkki"
    "kartta";
  grid-template-columns: auto;
  grid-template-rows: 60px 34px auto;
  gap: 2px;

  margin: 0 auto;
  padding: 4px;
  height: 100%;
  width:  1400px;
  max-width: 100%;
  background-color: #ccc;
  }

.kehys>*
  {
  border: solid 1px grey; 
  overflow: auto;
  }

/*==========================================================================================*\
|  OTSIKKOPALKKI - Grid-alue "otsikkopalkki"
\*==========================================================================================*/

header
  {
  grid-area:        otsikkopalkki;
  display:          flex;
  background-color: #abc;
  }

.logo
  {
  aspect-ratio: 1 / 1;
  padding: 10px;

  background-image: url("logo.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-origin: content-box;
  }

.muokkaustila
  {
  background-color: yellow;
  }

.otsikot
  {
  flex-grow: 1;
  display:          grid;
  justify-content:  center;
  align-items:      center;
  padding: 6px;
  }

.menu
  {
  aspect-ratio: 1 / 1;
  padding: 10px;
  background-image: url("menu.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-origin: content-box;
  }

header h1 
  {
  color:          #fff;
  font-size:      1.6rem;
  font-weight:    600;
  letter-spacing: 3px;
  text-align:     center;
  line-height:    90%;

  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  }

header h2 
  {
  color:          #fff;
  font-size:      1.0rem;
  font-weight:    500;
  letter-spacing: 1px;
  text-align:     center;

  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  }

/*==========================================================================================*\
|  MENUPALKKI
\*==========================================================================================*/

.menupalkki
  {
  grid-area: menupalkki;
  padding: 0;

  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px;
  color: #bbb;
  background-color: #732010;
  }

.menupalkki input
  {
  padding: 0 10px;
  }

.menupalkki .hakukenttä
  {
  width: 100px;
  }

/*==========================================================================================*\
|  KARTTA - Grid-alue "kartta"
\*==========================================================================================*/

#map
  {
  grid-area:  kartta;
  position:   relative;
  overflow:   hidden;
  }

.leaflet-layer,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out,
.leaflet-control-attribution 
  {
  XXXfilter: invert(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
  }

.leaflet-control-attribution 
  {
  XXXfont-family: system-ui; 
  XXXfont-size: 4px;
  }

/*==========================================================================================*\
|  Omat kartta-markkerit
\*==========================================================================================*/

/* Markkerin ulkokuori */

.kustomi-markkeri 
  {
  /* Käytetään annettua muuttujaa tai oletusta 20px */

  --sivu: var(--koko, 20px);
  
  width: var(--sivu);
  height: var(--sivu);
  
  border-radius: 50% 50% 50% 0;
  position: absolute;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
  }

.kustomi-markkeri span 
  {
  transform: rotate(45deg);
  color: var(--tekstivari, black);
  font-family: system-ui, sans-serif;

  font-size: calc(var(--sivu) / 3); 
  font-weight: bold; 
  pointer-events: none;
  }


/*==========================================================================================*\
|  KOHDE-INFO -IKKUNA
\*==========================================================================================*/

.kohde_info_ikkuna
  {
  position: absolute;

  margin: auto;
  padding: 10px;

  top:    80px;
  bottom: 40px;
  width:  400px;
  max-width: 90%;

  background-color: #ade;
  border: solid 3px #ccc;
  border-radius: 5px;

  z-index:  450;
  }

.kohde_info_ikkuna>h2
  {
  font-size:      1.2rem;
  text-align:     center;
  padding:        3px;
  }

.kohde_info_ikkuna>h3
  {
  font-size:      0.7rem;
  text-align:     center;
  padding:        2px;
  }

.kohde_toimet
  {
  width:    100%;
  padding: 0.2rem 0;
  margin-top: 5px;
  overflow: hidden;

  background-color: #ddd;
  border: solid 1px #888;
  border-radius: 5px;
  }

.kohde_toimet>*
  {
  padding: 0.1rem 0.5rem;
  }

.pdf_kartta_linkki, .sulje_kohde_info_nappi
  {
  display: block;
  cursor: pointer;
  padding: 4px;
  background-color: #eee;
  border: solid 1px #bbb;
  border-radius: 5px;
  font-size: 1rem;
  text-decoration: none;
  height: 56px;
  }



/*==========================================================================================*\
|  JSONin purkaminen html-hierarkiaksi
\*==========================================================================================*/

.tosi, .vale
  {
  font-weight: 900;
  }

.tosi
  {
  color: #5b5; /* vihreä */
  }

.vale
  {
  color: #f77;  /* punainen */
  }

ul.objekti-lista 
  {
  list-style-type: none; /* Poistaa listapallot */
  padding-left: 0.8rem;  /* Määrittää sisennyksen suuruuden */
  XXXmargin: 0.2rem 0;
  border-left: 1px solid #ddd; /* Lisää pystylinjan helpottamaan hierarkian hahmottamista */
  }

.avain 
  {
  text-transform: capitalize;
  font-weight: 600;
  color: #444;
  }

.arvo 
  {
  color: #555;
  margin-left: 0.5rem;
  }


ul.objekti-lista 
  {
  list-style-type: none;
  list-style-position: inside;
  XXXpadding-left: 1.5rem;
  margin: 0.2rem 0;
  }

li 
  {
  margin: 0.1rem 0;
  }

li::before
  {
  content: '•';
  font-size: 16px;
  padding-right: 8px;
  color: #89a;
  }

.avain-linkki
  {
  margin-bottom: 3rem;
  }

/*==========================================================================================*\
|  MUUT KARTAT
\*==========================================================================================*/

.muut_kartat_valikko
  {
  position: absolute;
  z-index: 500;

  top: 80px;
  bottom: 40px;
  width: 300px;

  background-color: #888;
  border: solid 3px #ccc;
  }

.muut_kartat_valikko ul
  {
  list-style-type: none;
  }

.muut_kartat_valikko a
  {
  display: block;
  background-color: white;
  padding: 3px;
  margin: 3px;
  text-decoration: none;
  border: solid 1px #888;
  border-radius: 5px;
  }



/*==========================================================================================*\
|  KOHTEET -LISTA
\*==========================================================================================*/

.kohteet_lista
  {
  position: absolute;
  top: 80px;
  bottom: 40px;
  width: 300px;
  max-width: 80%;
  height: 500px;
  max-height: 80%;
  color: #567;
  font-size: 1.2rem;
  background-color: #888;
  border: solid 3px #ccc;
  z-index: 450;
  overflow-y: auto;


  padding: 0.5rem;
  border: solid 1px grey;
  border-radius: 0.5rem;
  margin: auto;
  background-color: rgba(200,200,250,0.9);

  box-shadow: 0px 0px 14px 0px rgba(0,0,0,0.75);
  -webkit-box-shadow: 0px 0px 14px 0px rgba(0,0,0,0.75);
  -moz-box-shadow: 0px 0px 14px 0px rgba(0,0,0,0.75);
  }

.kohteet_lista ul
  {
  position: absolute;
  list-style-type: none;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  }

.kohteet_lista li
  {
  background-color: #aaa;
  cursor: pointer;

  margin: 0;
  border-bottom: solid 1px #ccf;
  overflow-x: ellipses;
  }

.kohteet_lista li:nth-child(6n+1) {background-color: #f0f0f0;}
.kohteet_lista li:nth-child(6n+2) {background-color: #f0f0f0;}
.kohteet_lista li:nth-child(6n+3) {background-color: #f0f0f0;}

.kohteet_lista li:nth-child(6n+4) {background-color: #d7e7f0;}
.kohteet_lista li:nth-child(6n+5) {background-color: #d7e7f0;}
.kohteet_lista li:nth-child(6n+6) {background-color: #d7e7f0;}

.kohteet_lista a
  {
  display: block;
  text-decoration: none;
  padding: 5px;
  }


/*==========================================================================================*\
|  TEEMAVALIKKO
\*==========================================================================================*/

.teema_valikko
  {
  position: absolute;
  display: none;
  left: 0;
  top: 0;
  padding: 0;
  list-style-type: none;
  font-size: 0.9rem;
  background-color: #8de;
  z-index: 1001;
  }

.teema_valikko li
  {
  display: block;
  padding: 16px;
  margin-top: 1px;
  border-bottom: #aaa;
  background-color: #f0f0f0;
  cursor: pointer;
  }

/*==========================================================================================*\
|  KOSKETUSNÄYTTÖ
\*==========================================================================================*/

@media (pointer: coarse) 
  {
  li > a 
    {
    text-decoration: none;

    }

li:has(> a)::before
  {
  content: '';
  }

li > a::after
  {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  }

  li:has(> a) 
    {
    position: relative;
    width: max-content;
    min-width: 200px;
    max-width: 100%;
    overflow: hidden; 
    text-overflow: ellipsis;
    list-style-type: none;
    border: solid 5px #36D6AF;
    border-radius: 0 999px 999px 0;
    margin: 0.5rem 0;
    padding: 0.6rem 0.8rem 0.6rem 0.0rem;
    background-color: #bdf;
    }
  }