/* css/style.css */

:root {
    --primary-color: #005A9C;
    --secondary-color: #f4f4f4;
    --font-color: #333;
    --light-gray: #ddd;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    color: var(--font-color);
	background: #DDD;
    /* background: url(../images/background_hell.jpg) center fixed; */
    background-size: cover;
    overflow-y: scroll;
}

header {
    background-color: #f8f8f8;
    color: #ccc;
    padding: 1rem 2rem;
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 900;
    transition: height 0.3s ease; /* Sanfter Übergang für Höhenänderung */
}

nav a {
    color: #555555;
    text-decoration: none;
    text-transform: uppercase;
    margin-right: 20px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-size: 1.5rem;
    font-weight: bold;
}

nav a:hover, nav a.active {
    background-color: #e7e7e7;
}

.search-bar-container {
    background-color: #f0f0f0;
    padding: 1rem 2rem;
    position: sticky;
    top: 72px; 
    z-index: 899;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: center;
    transition: top 0.3s ease; /* Sanfter Übergang für Positionsänderung */
}

#searchInput {
    padding: 10px;
    height: 26px; 
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    width: 100%;
    max-width: 800px;
    font-size: 1.3rem;
}

.header-logo-link {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 40px;
    width: auto;
}

main {
    padding: 2rem;
}

#poster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    justify-content: center;
    /* --- ÄNDERUNG 1: Zentriert die Kacheln innerhalb ihrer Spalten --- */
    justify-items: center;
}

.poster-item {
    background-color: #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%; /* Wichtig, damit das Item in der Grid-Spur responsive bleibt */
    /* --- ÄNDERUNG 2: Verhindert, dass die Kachel wächst --- */
    max-width: 400px;
}

.poster-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.poster-meta-top {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 0.9em;
    color: #666;
    border-bottom: 1px solid var(--secondary-color);
}

.poster-number {
    font-weight: bold;
}

.poster-thumb {
    width: 100%;
    height: auto;
    cursor: pointer;
    display: block;
}

.poster-caption {
    padding: 12px;
    flex-grow: 1;
}

.poster-title {
    font-size: 1.1em;
    margin: 0 0 5px 0;
}

.poster-authors {
    font-size: 0.9em;
    color: #555;
    margin: 0;
}

.abstract-btn {
    display: none;
    width: calc(100% - 24px);
    margin: 0 12px 12px 12px;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s;
}

.abstract-btn:hover { 
    background-color: #004170;
}
.hidden { 
    display: none !important;
}

/* --- Lightbox / Vollbild-Styling --- */

.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

#lightbox-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lightbox-content img,
#lightbox-content video,
#lightbox-content iframe {
    max-width: 100%;
    max-height: 100%;
    border: none;
    object-fit: contain;
}

#lightbox-content img {
    transition: transform 0.1s ease-out;
    transform-origin: 0 0;
    cursor: grab;
}

#lightbox-content img.dragging {
    cursor: grabbing;
}

#lightbox-content iframe {
    width: 100%;
    height: 100%;
}

.close-btn {
    position: absolute;
    top: 30px;
    right: 35px;
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 1000;
    text-shadow: 2px 2px #000;
}

.close-btn:hover {
    color: var(--light-gray);
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 20px;
    user-select: none;
    transition: background-color 0.3s;
    z-index: 1000;
    text-shadow: 2px 2px 4px #000;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

/* Back-To-Top */

#backToTopBtn {
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 99;
  border: none;
  outline: none;
  background-color: var(--primary-color);
  color: white;
  cursor: pointer;
  padding: 15px;
  border-radius: 10px;
  font-size: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}

#backToTopBtn.show {
  opacity: 1;
  visibility: visible;
}

#backToTopBtn:hover {
  background-color: #333;
}

/* Platzhalter für andere Seiten-Styles, unverändert */
.gallery-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 60px; max-width: 1600px; margin: 100px auto; }
/*.gallery-item { width: calc(50% - 30px); box-sizing: border-box; } */
.gallery-item img { width: 100%; height: auto; display: block; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.session-titel { text-align: center; font-weight: bold; color: #666; text-transform: uppercase; margin-top: 1rem; font-size: 2rem; }
.navbar-logo { font-size: 1.5rem; font-weight: bold; }


/* --- RESPONSIVE ANPASSUNGEN --- */

/* Für Tablets und kleinere Desktops (bis 992px) */
@media (max-width: 992px) {
    main {
        padding: 1.5rem;
    }
    #poster-grid {
        gap: 1.5rem;
    }
}

/* Für Mobilgeräte (bis 768px) */
@media (max-width: 768px) {
    /*.hide-on-small {
        display: none;
    }*/

    header {
        flex-direction: column; /* Logo und Navi untereinander */
        height: auto;          /* Höhe automatisch anpassen */
        padding: 1rem;
        gap: 1rem;             /* Abstand zwischen Logo und Navi */
    }

    nav {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
    }
    
    nav a {
        margin: 0 5px; /* Weniger Abstand zwischen den Links */
        font-size: 1.2rem;
    }

    .search-bar-container {
        padding: 0.8rem 1rem;
        top: 125px; 
    }

    #searchInput {
        width: 90%;
        font-size: 1.1rem;
    }

    main {
        padding: 1rem;
    }

    #poster-grid {
        gap: 1rem; 
    }

    .nav-btn {
        font-size: 24px;
        padding: 15px;
    }
    .prev-btn { left: 5px; }
    .next-btn { right: 5px; }

    .close-btn {
        top: 15px;
        right: 20px;
        font-size: 28px;
    }
}

/* Weitere Anpassungen für sehr kleine Bildschirme (bis 480px) */
@media (max-width: 480px) {
    nav a {
        font-size: 1rem;
    }
    
    .poster-title {
        font-size: 1em;
    }
    
    .poster-authors {
        font-size: 0.8em;
    }

    #backToTopBtn {
        padding: 12px;
        font-size: 16px;
        right: 15px;
        bottom: 15px;
    }
}