/* Tiergalerie – Frontend Styles */
.tg-wrap { font-family: inherit; }

/* Tabs */
.tg-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.tg-tab {
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}
.tg-tab:hover { color: #111827; }
.tg-tab.active { color: #2563eb; border-bottom-color: #2563eb; }
.tg-tab[aria-selected="true"] { color: #2563eb; border-bottom-color: #2563eb; }

/* Badge */
.tg-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
}

/* Gallery */
.tg-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 2rem;
}
@media (max-width: 600px) { .tg-gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .tg-gallery { grid-template-columns: 1fr; } }

.tg-gallery-item {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    transition: transform .2s, box-shadow .2s;
}
.tg-gallery-item:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.10); }
.tg-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tg-gallery-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,.6));
    color: #fff;
    font-size: 12px;
    padding: 16px 8px 8px;
    opacity: 0;
    transition: opacity .2s;
}
.tg-gallery-item:hover .tg-gallery-caption { opacity: 1; }

.tg-empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 2.5rem;
    color: #9ca3af;
    font-size: 15px;
}

/* Upload Card */
.tg-upload-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.75rem;
    max-width: 680px;
}
.tg-form-title { font-size: 20px; font-weight: 700; margin: 0 0 .4rem; }
.tg-form-hint  { font-size: 14px; color: #6b7280; margin: 0 0 1.25rem; }

.tg-field { margin-bottom: 1rem; }
.tg-field label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 5px; }
.tg-field input,
.tg-field select,
.tg-field textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: #111827;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.tg-field input:focus,
.tg-field select:focus,
.tg-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.tg-field textarea { resize: vertical; min-height: 80px; }
.tg-req  { color: #ef4444; }
.tg-opt  { color: #9ca3af; font-size: 12px; font-weight: 400; }

.tg-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px) { .tg-field-row { grid-template-columns: 1fr; } }

/* Dropzone */
.tg-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 1.75rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: #fff;
}
.tg-dropzone:hover, .tg-dropzone.drag-over {
    border-color: #2563eb;
    background: #eff6ff;
}
.tg-dropzone-icon { font-size: 36px; display: block; margin-bottom: 8px; }
.tg-dropzone p   { font-size: 14px; color: #6b7280; margin: 0; }
.tg-dropzone-hint { font-size: 12px; color: #9ca3af; margin-top: 4px; }

/* Preview */
.tg-preview {
    margin-top: 12px;
    position: relative;
    display: inline-block;
}
.tg-preview img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    display: block;
}
.tg-remove-preview {
    position: absolute;
    top: -6px; right: -6px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
    padding: 0;
}

/* Buttons */
.tg-form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 1.25rem; }
.tg-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, opacity .15s;
    border: 1px solid transparent;
}
.tg-btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.tg-btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.tg-btn-primary:disabled { opacity: .65; cursor: not-allowed; }
.tg-btn-secondary {
    background: #fff;
    color: #374151;
    border-color: #d1d5db;
}
.tg-btn-secondary:hover { background: #f9fafb; }

/* Notices */
.tg-notice {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
}
.tg-notice-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.tg-notice-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Lightbox */
.tg-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.tg-lightbox[hidden] { display: none; }
.tg-lightbox-close {
    position: absolute;
    top: 16px; right: 20px;
    background: rgba(255,255,255,.15);
    color: #fff;
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    line-height: 36px;
    text-align: center;
    padding: 0;
}
.tg-lightbox-close:hover { background: rgba(255,255,255,.3); }
.tg-lightbox-inner {
    max-width: 800px;
    width: 100%;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
}
.tg-lightbox-inner img {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    display: block;
    background: #000;
}
.tg-lb-info { padding: 1rem 1.25rem; }
.tg-lb-info h3 { font-size: 18px; font-weight: 700; margin: 0 0 .4rem; }
.tg-lb-info p  { font-size: 14px; color: #6b7280; margin: 0; }
.tg-lb-autor   { font-size: 13px; color: #9ca3af; margin-top: 4px !important; }
