/*fonts*/

@font-face {
  font-family: 'SI Cond';
  src: url('/static/fonts/SuisseIntlCond-Bold.otf');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'SI Med';
  src: url('/static/fonts/SuisseIntl-Medium.ttf');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'SI Bo';
  src: url('/static/fonts/SuisseIntl-Bold.ttf');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'SI Reg';
  src: url('/static/fonts/SuisseIntl-Regular.ttf');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'SN Reg';
  src: url('/static/fonts/SuisseNeue-Regular.ttf');
  font-weight: normal;
  font-style: normal;
}

h1 {
  font-family: 'SI Cond';
  font-size: 9rem;
  text-transform: uppercase;
  padding-top: 0px;
  line-height: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  margin: 0;
  padding: 0;
}

h2 {
  font-family: 'SI Cond';
  font-size: 2rem;
  text-transform: uppercase;
  margin-top: 1rem;
  margin-bottom: 0;
}

h3 {
  font-family: 'SI Med';
  font-size: 1rem;
  line-height: 1rem;
}

body {
  font-family: 'SN Reg';
  font-size: 1rem;
}

bodybold {
  font-family: 'SI Bo';
  font-size: 1rem;
}

info {
  font-family: 'SI Reg';
  font-size: 1rem;
}

a{
text-decoration: none;
color: black;
border-radius: 6px;
}

.button {
  border: 0px;
  font-family: 'SI Med';
  font-size: 1rem;
  line-height: 1.5rem;
  background: none;
  border-radius: 6px;
  padding: 0.3rem;
}

.button:hover {
border-radius: 6px;
background-color: #F9FF8C;
padding: 0.3rem;
}


/* Grid Container*/
body {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: auto;
  gap: 1%;
  margin: 1%;
  background-color: #fff;
}

/* Fix: Form darf Grid-Fluss nicht unterbrechen */
form#matchingForm{
display: contents;   /* lässt Kinder in den Body-Grid einfließen */
}

/* Grid Divisions */
.full-width-row {
  grid-column: 1 / -1; /* Geht über alle 8 Spalten */
  display: flex; /* Aktiviert Flexbox innerhalb der Grid-Zelle */
  justify-content: flex-start; /* Elemente linksbündig anordnen */
  gap: 0.5%;
  align-items: center;
  min-height: auto;
  flex-wrap: wrap;
}

.full-width-row-2 {
  grid-column: 1 / -1;
  display: flex;
}

.full-width-row-grid {
  grid-column: 1 / -1; /* Geht über alle 8 Spalten */
  align-items: center; /* Zentriert die Elemente vertikal */
  justify-content: flex-start; /* Elemente linksbündig anordnen */
  gap: 0.5%;
}

.col-6 {
  grid-column: 1 / 7; /* Geht über 1 und 6 */
  display: flex;
  padding-bottom: 8rem; /* mehr Platz am Ende fuer Scrollen */
}

.col-4 {
  grid-column: 1 / 4; /* Geht über 1 und 5 */
}

.col-4-2 {
grid-column: 5 / 9; /* Geht über 5 und 8 */
}
.col-78 {
  grid-column: 7 / 9; /* Geht über 7 und 8 */
}

/*Checkboxen neu*/

.aufgabe:hover {
background-color: #F9FF8C;
}

.aufgabe.active {
background-color: #F9FF8C;
}

label.aufgabe {
display: inline-block;
}

label.aufgabe:has(input:checked) {
background-color: #F9FF8C;
}

label.aufgabe input[type="checkbox"] {
display: none;
}

.aufgabe {
background: none;
border: none;
cursor: pointer;
padding: 0.3rem;
border-radius: 6px;
transition: background-color 0.2s ease;
}


/* Form */
.aufgaben-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1.5rem;
margin-bottom: 2rem;
}
.aufgabenbereich {
  border: none;
  padding: 0 0.5rem 0.5rem 0;   /* top 0, right 0.5rem, bottom 0.5rem, left 0 */
  border-radius: 6px;
}
.aufgabenbereich.collapsed .selection {
max-height: 0;
overflow: hidden;
opacity: 0;
transition: max-height .25s ease, opacity .25s ease;
}

.aufgabenbereich .selection{
max-height: 2000px;   /* gross genug */
opacity: 1;
transition: max-height .25s ease, opacity .25s ease;
}

.aufgabenbereich p {
margin-bottom: 0.5rem;
}
.checkbox-grid {
display: flex;
flex-direction: column;
gap: 0.5rem;
font-family: 'Suisse Neue';
font-size: 0.9rem;
}

.selection {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  width: 100%;        /* füllt die ganze Grid‑Spalte, damit Überschrift & Liste nicht nebeneinander rutschen */
  gap: 0.3rem;
}

/* Fix: Form darf Grid-Fluss nicht unterbrechen */
form#matchingForm{
display: contents;   /* lässt Kinder in den Body-Grid einfließen */
}

/* Ergebnisliste */
.score-list {
font-size: 0.8rem;
list-style: none;
line-height: 1.2rem;
margin: 0;
padding: 0.3rem;
}



/* Fix: Controls-Leiste bleibt an Ort und Stelle, auch wenn Aufgaben ein‑/ausklappen */
.full-width-row.controls {
position: sticky;
top: 0;
z-index: 50;
background-color: #fff;  /* gleiche Hintergrundfarbe wie Body */
}

/* Name link hover */
.result-entry a{
display:inline-block;      /* so padding does not affect line‑height of neighbours */
padding:0.3rem;            /* same padding as hover to avoid layout shift */
border-radius:6px;
transition:background-color .2s ease;
}

.result-entry a:hover {
background-color: #FFCBFF;
border-radius: 6px;
}

.tag-high {
background-color: #FFCBFF;
padding: 0.3rem;
border-radius: 6px;
}

.tag-mid {
color: #111;
font-weight: bold;
}

.tag-low {
color: #999;
}

/* Legende für Score‑Tags */
.legend{
  display:flex;
  gap:2rem;      /* Abstand zwischen "Experte", "Solide", "Grundlagen" */
  margin-bottom:2rem;
  flex-wrap:wrap;
  align-items:center;
}

/* Empfohlene Personen horizontal neben dem Text anzeigen */
.summary ul{
  display:flex;
  flex-wrap:wrap;
  gap:1rem;
  list-style:none;
  padding:0;
  margin:0;
}

/* Abstände */

:root {
--space-0: 0;        /* 0 px  */
--space-1: 1rem;  /* 4 px  */
--space-2: 2rem;   /* 8 px  */
--space-3: 4rem;     /* 16 px */
--space-4: 8rem;   /* 24 px */
--space-5: 16rem;     /* 32 px */
}

.spacer {
width: 100%;
flex-shrink: 0;          /* verhindert, dass Flexbox ihn zusammenquetscht */
}

.spacer-1 { height: var(--space-1); }
.spacer-2 { height: var(--space-2); }
.spacer-3 { height: var(--space-3); }
.spacer-4 { height: var(--space-4); }
.spacer-5 { height: var(--space-5); }
.person-summary{
display:flex;
align-items:baseline;
gap:0.25rem;           /* small gap between name and role */
}

/* show names inline inside department result lists */
.score-list li{
display:inline-flex;
align-items:baseline;
gap:0.25rem;
margin-right:1rem;     /* distance between people */
}

/* reduce vertical whitespace below each department block */

/* --- layout for department groups and inline person list --- */
.department-group{
margin-bottom:1.5rem;
}


/* --- Department heading as real <h2> and consistent alignment --- */
.department-heading{
font-family:'SI Cond';
font-size:2rem;
text-transform:uppercase;
margin:1rem 0 0.5rem 0;   /* top / right / bottom / left */
line-height:1.2;
}

/* keep department group flush with overlay/grid padding */
.department-group{
margin-left:0;           /* no extra indent */
}

/* Personen innerhalb einer Abteilung horizontal anordnen */
.department-persons{
list-style:none;          /* keine Bullet‑Points */
margin:0;
padding:0;
display:flex;
flex-wrap:wrap;
gap:1.5rem;               /* Abstand zwischen Personen */
}

.department-persons li{
list-style:none;          /* sicherheitshalber Bullet‑Points entfernen */
}

.result-entry{
display:flex;
flex-direction:column;    /* Name/Score über Score‑Liste stapeln */
gap:0.25rem;
margin:0;                 /* kein extra Abstand */
padding:0;                /* kein extra Abstand */
}

/* ---------- Overlay & selector scrolling -------------- */
#matchingOverlay{
position:fixed;
left:0;
right:0;
top:0;          
bottom:0;
background:#FAF5EE;
overflow-y:auto;
transform:translateY(100%);
transition:transform 0.4s ease;
z-index:1000;
padding:1.5rem 2rem;
}
#matchingOverlay.open{
transform:translateY(0);
}
.col-6{
max-height:70vh;     /* selector scrolls, page stays */
overflow-y:auto;
}
/* body{
height:100vh;
overflow:hidden;
} */
#closeOverlay{
display:block;
margin-top:2rem;
margin-left:auto;
}

#matchingOverlay .summary{
margin-bottom:1.5rem;
}

/* ---------- Responsive Design -------------- */

/* Tablet (768px und kleiner) */
@media screen and (max-width: 768px) {

  h1 {
    font-size: 6rem;
    line-height: 1;
    margin-bottom: 1rem;
  }
  
  .col-6 {
    grid-column: 1 / -1;
    max-height: none;
    overflow-y: visible;
  }
  
  .col-78 {
    grid-column: 1 / -1;
  }
  
  .full-width-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .full-width-row.controls {
    position: static;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
  
  .summary ul {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .person-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
  }
  
  .selection {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .aufgabe {
    width: 100%;
    text-align: left;
  }
  
  #matchingOverlay {
    padding: 1rem;
  }
  
  .legend {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .department-persons {
    flex-direction: column;
    gap: 1rem;
  }
  
  .score-list li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
}

/* Mobile (480px und kleiner) */
@media screen and (max-width: 480px) {
  
  h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1rem;
  }
  
  .button {
    padding: 0.5rem;
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .full-width-row.controls {
    flex-direction: column;
  }
  
  .aufgabenbereich {
    padding: 0 0.5rem 0.5rem 0;
  }
  
  .aufgabe {
    padding: 0.5rem;
    margin-bottom: 0.25rem;
  }
  
  #matchingOverlay {
    padding: 0.5rem;
  }

}

/* Große Bildschirme (1200px und größer) */
@media screen and (min-width: 1200px) {
  body {
    margin: 2%;
  }
  
  .col-6 {
    max-height: 80vh;
  }
}

/* Landscape-Modus auf mobilen Geräten */
@media screen and (max-height: 500px) and (orientation: landscape) {
  body {
    margin: 1%;
  }
  
  h1 {
    font-size: 4rem;
    line-height: 0.8;
  }
  
  .col-6 {
    max-height: 60vh;
  }
  
  .full-width-row.controls {
    position: static;
  }
}

/* Very small screens */
@media screen and (max-width: 320px) {
  h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }
}