/* --- Podstawowe style i reset --- */
html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #000;
    color: #fff;
    overflow: hidden;
}

/* --- Nagłówek z tytułem i menu --- */
#gallery-header {
    position: fixed;
    top: 15px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    z-index: 1002;
    height: 30px;
}

#gallery-title {
    color: #fff;
    font-size: 1.5em;
    text-align: right;
    flex-grow: 1;
    padding-right: 30px;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
    line-height: 26px;
    margin: 0;
    position: relative;
    top: 0px; /* Możesz zmieniać tę wartość (+ przesuwa w dół, - w górę) */
}

/* --- Menu i przycisk --- */
#menu-trigger {
    position: relative;
    font-size: 30px;
    cursor: pointer;
    padding: 5px;
    background-color: rgba(30, 30, 30, 0.5);
    border-radius: 5px;
    line-height: 30px;
    vertical-align: middle;
    z-index: 1001;
}

#main-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(15, 15, 15, 0.95);
    z-index: 1000;
    padding-top: 60px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.5s ease-in-out;
}

#main-menu.visible {
    max-height: 100vh;
}

#main-menu ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

#main-menu li a {
    display: block;
    padding: 15px;
    text-decoration: none;
    color: #fff;
    font-size: 1.2em;
    border-bottom: 1px solid #333;
}

#main-menu li:last-child a {
    border-bottom: none;
}

/* --- Galeria i obraz --- */
#image-viewer {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    touch-action: none;
    position: relative;
    padding-top: 60px; /* Dodajemy odstęp dla nagłówka */
    padding-bottom: 10px; /* Margines dolny */
}

#image-wrapper {
    width: 100%;
    height: calc(100% - 70px); /* Uwzględniamy marginesy */
    display: flex;
    justify-content: center;
    align-items: center;
}

#gallery-image {
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.2s ease-out;
    -webkit-user-drag: none;
    user-select: none;
}

.counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9em;
    opacity: 0.7;
    background: rgba(0,0,0,0.5);
    padding: 5px 10px;
    border-radius: 10px;
    z-index: 10;
}

/* --- Styl dla trybu pełnoekranowego --- */
body.fullscreen-mode #image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    background: #000;
    padding: 0;
}

body.fullscreen-mode #gallery-image {
    max-width: none;
    max-height: none;
}

body.fullscreen-mode #gallery-header,
body.fullscreen-mode .counter,
body.fullscreen-mode .nav-button {
    display: none;
}

/* --- Nawigacja (Strzałki) --- */
.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(30, 30, 30, 0.6);
    color: #fff;
    border: none;
    padding: 15px 20px;
    font-size: 2em;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    display: none;
    border-radius: 5px;
}

.nav-button:hover {
    opacity: 1;
}

.left-arrow {
    left: 20px;
}

.right-arrow {
    right: 20px;
}

/* Pokaż przyciski nawigacyjne na tabletach i większych ekranach */
@media (min-width: 768px) {
    .nav-button {
        display: block;
    }
}