/* Gallery page */

.admin-mode [contenteditable="true"] {
    background: var(--primary);
    border-radius: 0.3rem;
    padding: 4px;
}

#gallery-main {
    background: none;
    max-width: 100%;        /* žádné omezení */
    width: 100%;            /* natáhni na celou šířku */
    border: none;
    flex: 1;
    overflow: hidden;       /* aby se nescrollovalo celé main */
    display: flex;
    flex-direction: column;
    border-radius: 0;
    margin: 0;
    padding: 0;
    align-self: stretch;    /* místo centrování vyplň flex */
}

#gallery-layout {
    display: flex;
    height: 100%;           /* zabere plnou výšku mainu */
}

/* levý panel se složkama */
#left-pane {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 10rem;           /* fixní šířka sidebaru */
    background: var(--primary);
    padding: 1rem;
    border-right: 1px solid var(--border);
    max-height: 100%;
    border-radius: 0;
    flex-shrink: 0;         /* sidebar se nezmenší */
    overflow-y: auto;       /* kdyby byl dlouhý seznam složek */
}

/* pravý panel – obsah */
#gallery-content {
    flex: 1;
    overflow-y: auto;       /* jenom tady se scrolluje */
    padding: 1rem; 
}

.gallery-tab {
    padding: 0.5rem 1rem;
    border-radius: 0.3rem;
    text-decoration: none;
    text-align: left;
}

.gallery-tab.active {
    background: var(--primary);
    font-weight: 800;
}

.new-album-input {
    width: 100%;
}

.folder-info {
    margin: 1em;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#folder-title {
    line-height: 1em;
    margin: 0;
}

#folder-desc {
    line-height: 1.5em;
}

.photo-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

.photo-item {
    overflow: hidden;
    border-radius: 0.5rem;
    max-width: 15em;
    width: auto;            /* šířka se dopočítá podle poměru stran */
    object-fit: contain;    /* zajistí, že se nedeformují */
    margin: 0.25em;
}

.photo-item img {
    height: 10rem;
    width: 100%;
    object-fit: cover;
}

.photo-caption {
    margin-top: 0.3em;
    color: var(--unimportant);
    font-size: smaller;
    overflow-wrap: break-word;
    white-space: normal;    /* tohle zajišťuje zalomení */
    max-width: 100%;        /* nepřekročí rodiče */
    display: none;
    border-start-start-radius: 0;
    padding: 3px 4px;
    word-break: break-word; /* fallback když je fakt dlouhý řetězec */
}

#save-gallery-meta {
    position: absolute;
    bottom: 7em;
    left: 2em;
    font-weight: bold;
}

#log-out {
    position: absolute;
    color: var(--wrong);
    bottom: 11em;
    left: 2em;
}