/* ============================================================
   Chapter Screenshot Gallery Styles
   ============================================================ */


/* ── Submit Widget ───────────────────────────────────────── */
.chapter-gallery-intro {
    font-size: .9rem;
    color: #6b7280;
    margin-bottom: 20px;
    line-height: 1.6;
}

.chapter-gallery-current {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
}

.chapter-gallery-current-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6b7280;
    margin: 0 0 12px;
}

.chapter-gallery-current-preview {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.chapter-gallery-thumb {
    width: 160px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
    display: block;
}

.chapter-gallery-current-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .85rem;
    color: #374151;
    min-width: 0;
}

.chapter-gallery-current-info a {
    word-break: break-all;
    text-decoration: none;
    transition: opacity .15s;
}

.chapter-gallery-current-info a:hover { opacity: .75; }

.chapter-gallery-date {
    font-size: .75rem;
    color: #9ca3af;
}

/* Form */
.chapter-gallery-form-title {
    font-size: .82rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 16px;
}

.chapter-gallery-field { margin-bottom: 16px; }

.chapter-gallery-field label {
    display: block;
    font-size: .82rem;
    color: #374151;
    margin-bottom: 6px;
}

.chapter-gallery-field input {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .88rem;
    font-family: inherit;
    color: #111827;
    box-sizing: border-box;
}

.chapter-gallery-field input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(82,105,113,.15);
}

.chapter-gallery-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.chapter-gallery-submit-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity .15s;
}

.chapter-gallery-submit-btn:hover { opacity: .85; }
.chapter-gallery-submit-btn:disabled { opacity: .6; cursor: wait; }

.chapter-gallery-delete-btn {
    padding: 10px 16px;
    border: 1.5px solid #fca5a5;
    border-radius: 6px;
    background: #fff;
    color: #ef4444;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}

.chapter-gallery-delete-btn:hover { background: #fef2f2; }

.chapter-gallery-message {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: .85rem;
    margin-bottom: 12px;
}

.chapter-gallery-message--success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.chapter-gallery-message--error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.chapter-gallery-note {
    font-size: .75rem;
    color: #9ca3af;
    margin: 0;
    font-style: italic;
}


/* ── Gallery Display ─────────────────────────────────────── */
.chapter-gallery-grid {
    display: grid;
    gap: 20px;
}

.chapter-gallery-cols-1 { grid-template-columns: 1fr; }
.chapter-gallery-cols-2 { grid-template-columns: repeat(2, 1fr); }
.chapter-gallery-cols-3 { grid-template-columns: repeat(3, 1fr); }
.chapter-gallery-cols-4 { grid-template-columns: repeat(4, 1fr); }

.chapter-gallery-item {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #fff;
    transition: box-shadow .2s, transform .2s;
}

.chapter-gallery-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    transform: translateY(-2px);
}

.chapter-gallery-item.is-current {
    border-color: var( --item-accent, #526971 );
    box-shadow: 0 0 0 2px var( --item-accent, #FFFFFF );
}

.chapter-gallery-item-link { display: block; text-decoration: none; }

.chapter-gallery-item-img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #f8fafc;
}

.chapter-gallery-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.chapter-gallery-item:hover .chapter-gallery-item-img {
    transform: scale(1.03);
}

.chapter-gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
}

.chapter-gallery-item:hover .chapter-gallery-item-overlay { opacity: 1; }

.chapter-gallery-item-visit {
    color: #fff;
    font-size: .88rem;
    font-weight: 700;
    letter-spacing: .03em;
}

.chapter-gallery-item-caption {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chapter-gallery-item-name {
    font-size: .88rem;
    color: #111827;
    display: block;
}

.chapter-gallery-you {
    font-weight: 400;
    font-size: .8em;
    opacity: .7;
}

.chapter-gallery-item-label {
    font-size: .78rem;
    color: #6b7280;
}


/* ── Responsive ──────────────────────────────────────────── */
@media ( max-width: 768px ) {
    .chapter-gallery-cols-3,
    .chapter-gallery-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media ( max-width: 480px ) {
    .chapter-gallery-cols-2,
    .chapter-gallery-cols-3,
    .chapter-gallery-cols-4 { grid-template-columns: 1fr; }

    .chapter-gallery-current-preview { flex-direction: column; }
    .chapter-gallery-thumb { width: 100%; height: 140px; }
}