/* 1. Die Schriftart-Definition (bleibt gleich wie zuvor) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-v20-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-v20-latin-700.woff2') format('woff2');
}

/* 2. Schriftgröße und Blocksatz anwenden */
body {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;      /* Ein wenig größer als Standard (meist 1rem) */
  line-height: 1.7;       /* Mehr Zeilenabstand für bessere Lesbarkeit im Blocksatz */
  text-align: justify;    /* Erzwingt den Blocksatz */
  hyphens: auto;          /* WICHTIG: Erlaubt Silbentrennung, damit im Blocksatz keine großen Lücken entstehen */
  -webkit-hyphens: auto;
}

/* Überschriften sollten im Flattersatz bleiben, Blocksatz sieht bei Titeln nicht gut aus */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  text-align: left; 
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 1.5em;
}

/* Optional: Blocksatz für Tabellen oder Listen meist unschön, hier kann man es deaktivieren */
ul, ol, table {
  text-align: left;
}

.header {
    background: #b9b7a0 url("/images/dp001.jpg") center center / cover no-repeat;
}

/* --- Navigation & Header Fixierung --- */

.container-top-a {
    padding: 0.5rem;
    font-size: 1.5rem;
    border-bottom: thin inset;
    position: sticky;
    top: 108px; 
    z-index: 999;
    background-color: #ffffff; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between; /* Trennt Menü (links) von Sprachen (rechts) */
    align-items: center;
    flex-wrap: nowrap;
}

/* ERZWINGT HORIZONTALES MENÜ AUF DESKTOP (Metismenu Fix) */
@media (min-width: 992px) {
    .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
    }

    .mod-menu.metismenu {
        display: flex !important;
        flex-direction: row !important;
        gap: 1.5rem;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .metismenu li {
        display: block;
        flex: 0 0 auto;
    }
}

.top-a.card { border: none; }
.top-a .card-body { padding: 0; }

.mod-menu a {
    color: #000;
    text-decoration: none;
    white-space: nowrap;
}

.mod-menu a:hover {
    text-decoration: underline;
}

.mod-menu li.active > a, 
.mod-menu li.current > a {
    font-weight: 700 !important;
    text-decoration: underline !important;
}

/* Sprachen rechts halten auf Desktop */
.container-top-a > .top-a:last-child {
    flex: 0 0 auto;
    margin-left: auto;
}

/* --- Mobile Version (Hamburger & Sprachen zentriert) --- */

@media (max-width: 991.98px) {
    .container-top-a {
        position: static; 
        flex-direction: column !important; 
        align-items: stretch;
    }

    /* Menü untereinander im Hamburger */
    .mod-menu.metismenu {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem;
        padding: 1rem 0;
    }

    /* Sprachen mobil zentrieren */
    .container-top-a > .top-a:last-child {
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 15px 0;
        border-top: 1px solid rgba(0,0,0,0.1);
        margin-left: 0;
    }

    .mod-languages ul.mod-languages__list {
        display: flex !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    /* Personenliste: 1 Spalte auf Mobilgeräten */
    #personList {
        column-count: 1 !important;
        column-gap: 0 !important;
    }
}

.mod-languages__list img {
    width: 24px;
}

/* --- Inhalt & Komponenten --- */

.container-component { padding-left: 10px; }

li.field-entry.gps, li.field-entry.field-tag-id {
    display: none;
}

/* Startseiten Grid */
.start-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 40px 0;
    align-items: start;
}

.grid-item {
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 8px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.4s ease-in-out;
    overflow: hidden;
    position: relative;
    max-height: 280px;
    min-height: 280px;
    color: #333;
}

.grid-item h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: bold;
    color: #222;
    min-height: 3em;
}

.grid-item.spalte-links { background-color: #b9b7a0; }
.grid-item.spalte-mitte { background-color: #a4b2b5; }
.grid-item.spalte-rechts { background-color: #ecece9; }

.grid-item.is-open {
    max-height: 1500px; 
    background-color: #ffffff; 
    border: 1px solid #b9b7a0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.grid-item::after {
    content: '▼';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 10px;
    color: rgba(0,0,0,0.3);
    transition: transform 0.3s;
}

.grid-item.is-open::after {
    content: 'Schließen ▲';
    transform: rotate(180deg);
    top: auto;
    bottom: 15px;
}

.grid-item:not(.is-open)::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 100px;
    background: linear-gradient(transparent, rgba(255,255,255,0.4));
    z-index: 1;
    pointer-events: none;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #b9b7a0;
}

/* Bilder in Artikeln */
p:has(img.links) {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: flex-start;
    flex-wrap: wrap;
}

img.links, img.mitte, img.rechts {
    flex: 1;
    min-width: 250px;
    max-width: 32%;
    height: auto;
    display: block;
}

/* Teaser Boxen */
.image-teaser-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.teaser-box {
    flex: 1;
    min-width: 280px;
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.1);
}

.teaser-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.teaser-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 8px;
    font-size: 14px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.teaser-box:hover .teaser-overlay { opacity: 1; }

/* Projekt-Info Grid */
.project-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.info-block h3 {
    font-size: 1.1rem;
    border-bottom: 1px solid #b9b7a0;
    padding-bottom: 5px;
    margin-bottom: 10px;
    color: #555;
}

.info-block.full-width { grid-column: span 2; }

.names-list, .funding-list { font-style: italic; color: #666; }

.highlight-block {
    background: #fdfdfb;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #b9b7a0;
}

@media (max-width: 768px) {
    .project-info-grid { grid-template-columns: 1fr; }
    .info-block.full-width { grid-column: span 1; }
}

/* Förderer Logos */
.funding-logos-vertical {
    display: flex;
    flex-wrap: wrap;              /* erlaubt Umbruch */
    justify-content: center;      /* zentriert die Logos */
    align-items: center;
    gap: 40px;
    margin-top: 30px;
}

.logo-link-v {
    display: block;
    width: 30%;                   /* kleiner + nebeneinander */
    max-width: 250px;             /* maximale Größe begrenzen */
    text-decoration: none;
    flex: 1 1 200px;              /* flexibel, bricht nur bei Platzmangel um */
}

.logo-div-v {
    width: 100%;
    height: 80px;                 /* Höhe reduziert → kleiner */
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.2s;
}

.logo-link-v:hover .logo-div-v {
    transform: scale(1.05);
}

/* Mobile */
@media (max-width: 768px) {
    .logo-link-v {
        width: 45%;               /* 2 Logos pro Zeile wenn möglich */
    }
    .logo-div-v {
        height: 60px;
    }
}

/* --- Footer Optimierung --- */
.footer {
    background: #b9b7a0;
    padding: 10px 0;    /* Minimale Abstände oben und unten */
    min-height: auto;   /* Hebt eventuelle Mindesthöhen des Templates auf */
    height: auto;       /* Sorgt dafür, dass er nur mit dem Inhalt wächst */
}

/* Falls im Footer ein Container mit Standard-Abständen liegt */
.footer .grid-child, 
.footer .container,
.footer .card-body {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}