/* Galerie — samostatný styl, načítá se jen na stránce galerie */

.gal-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.gal-role {
    font-size: 13px;
    color: #555;
}

.gal-role a {
    color: #8a7a00;
}

.gal-breadcrumbs {
    margin: 4px 0 20px 0;
    font-size: 14px;
    color: #666;
}

.gal-breadcrumbs a {
    color: #3a3a3a;
    text-decoration: none;
}

.gal-breadcrumbs a:hover {
    text-decoration: underline;
}

.gal-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 14px;
}

.gal-alert-ok {
    background: #e6f4ea;
    color: #1e5c31;
    border: 1px solid #b7ddc2;
}

.gal-alert-warn {
    background: #fff6e0;
    color: #7a5c00;
    border: 1px solid #f0dd9c;
}

.gal-alert-error {
    background: #fdecea;
    color: #8a1c11;
    border: 1px solid #f3c2bd;
}

.gal-empty {
    color: #777;
    font-style: italic;
}

/* Grid */

.gal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.gal-card {
    position: relative;
    display: block;
    border-radius: 10px;
    overflow: hidden;
    background: #F9F5D7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.gal-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-position: center;
    background-size: cover;
    background-color: #eee2b0;
}

.gal-card-name {
    text-align: center;
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 600;
}

.gal-card-photo {
    cursor: pointer;
}

.gal-card-video .gal-video-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #2c2c2c;
    color: #eee;
    text-align: center;
    padding: 8px;
}

.gal-card-video .gal-video-thumb.gal-video {
    cursor: pointer;
}

.gal-video-icon {
    font-size: 28px;
}

.gal-video-name {
    font-size: 12px;
    word-break: break-all;
    opacity: 0.8;
    max-width: 90%;
}

.gal-card-video .gal-photo-tools {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 6px;
    opacity: 1;
}

.gal-icon-download {
    text-decoration: none;
}

.gal-hint {
    font-size: 12px;
    color: #777;
    margin: 6px 0 0 0;
}

.gal-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gal-progress-track {
    flex: 1;
    height: 10px;
    border-radius: 5px;
    background: #ecdf9e;
    overflow: hidden;
}

.gal-progress-bar {
    height: 100%;
    width: 0%;
    background: #e4d34b;
    transition: width 0.15s ease;
}

.gal-progress-text {
    font-size: 13px;
    font-weight: 700;
    color: #6a5f10;
    min-width: 3.5em;
    text-align: right;
}

.gal-photo-tools {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.gal-card-photo:hover .gal-photo-tools {
    opacity: 1;
}

.gal-inline-form {
    margin: 0;
}

.gal-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gal-icon-btn:hover {
    background: rgba(0, 0, 0, 0.85);
}

.gal-icon-star:hover {
    background: #e4d34b;
    color: #4a3d00;
}

.gal-icon-delete:hover {
    background: #c0392b;
}

/* Akce / panely */

.gal-actions {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gal-panel {
    background: #F9F5D7;
    border-radius: 10px;
    padding: 12px 18px;
}

.gal-panel > summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    padding: 4px 0;
}

.gal-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

.gal-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.gal-form button {
    padding: 8px 18px;
    border-radius: 6px;
    border: none;
    background: #e4d34b;
    color: #3a3200;
    font-weight: 700;
    cursor: pointer;
}

.gal-form button:hover {
    background: #d8c62f;
}

.gal-form button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Upload dropzone */

.gal-upload-form {
    flex-direction: column;
    align-items: stretch;
}

.gal-dropzone {
    border: 2px dashed #c9b94a;
    border-radius: 10px;
    padding: 28px 16px;
    text-align: center;
    position: relative;
    background: #fffdf3;
    cursor: pointer;
}

.gal-dropzone.gal-dropzone-over {
    background: #f5edc0;
    border-color: #8a7a00;
}

.gal-dropzone p {
    margin: 0;
    color: #6a5f10;
    pointer-events: none;
}

.gal-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.gal-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.gal-preview-item {
    width: 84px;
    height: 84px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    border: 1px solid #ddd;
}

/* Login */

.gal-login-wrap {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.gal-login-card {
    max-width: 420px;
    width: 100%;
    background: #F9F5D7;
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.gal-login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.gal-login-form label {
    font-weight: 600;
    font-size: 14px;
}

.gal-login-form input {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 16px;
}

.gal-login-form button {
    padding: 10px 16px;
    border-radius: 6px;
    border: none;
    background: #e4d34b;
    color: #3a3200;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
}

.gal-login-form button:hover {
    background: #d8c62f;
}

/* Lightbox */

.gal-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    z-index: 200;
}

.gal-lightbox img,
.gal-lightbox video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
}

.gal-lightbox video {
    display: none;
    background: #000;
}

.gal-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2em;
    color: #fff;
    cursor: pointer;
    user-select: none;
    padding: 12px;
}

.gal-lightbox-prev {
    left: 10px;
}

.gal-lightbox-next {
    right: 10px;
}

.gal-lightbox-close {
    position: fixed;
    top: 10px;
    right: 16px;
    font-size: 2em;
    color: #fff;
    cursor: pointer;
}

@media (max-width: 600px) {
    .gal-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }
}
