/* ── Custom Gallery — Public Styles ── */

/* Form wrapper */
.cg-form-wrap { max-width: 680px; margin: 0 auto; font-family: inherit; }

/* Info banner */
.cg-info-banner {
    background: #eff6ff; border: 1px solid #bfdbfe;
    border-radius: 8px; padding: 12px 16px;
    font-size: 14px; color: #1e40af; margin-bottom: 1.5rem;
    display: flex; align-items: flex-start; gap: 10px;
}
.cg-icon { font-style: normal; font-size: 16px; flex-shrink: 0; }

/* Messages */
.cg-success-msg {
    background: #dcfce7; border: 1px solid #86efac;
    color: #166534; border-radius: 8px; padding: 14px 16px;
    font-size: 15px; margin-bottom: 1.25rem;
}
.cg-error-msg {
    background: #fef2f2; border: 1px solid #fca5a5;
    color: #991b1b; border-radius: 8px; padding: 14px 16px;
    font-size: 15px; margin-bottom: 1.25rem;
}

/* Form sections */
.cg-form-section { margin-bottom: 1.75rem; }
.cg-form-section h3 {
    font-size: 13px; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: #9ca3af;
    margin: 0 0 14px; padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

/* Fields */
.cg-field { margin-bottom: 1rem; }
.cg-field label {
    display: block; font-size: 13px; font-weight: 500;
    color: #374151; margin-bottom: 6px;
}
.cg-req { color: #ef4444; }
.cg-field input[type="text"],
.cg-field input[type="email"],
.cg-field textarea,
.cg-field select {
    width: 100%; padding: 9px 13px;
    border: 1px solid #d1d5db; border-radius: 7px;
    font-size: 14px; color: #111827;
    background: #fff; font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.cg-field input:focus, .cg-field textarea:focus, .cg-field select:focus {
    outline: none; border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.cg-field textarea { resize: vertical; min-height: 80px; line-height: 1.55; }

/* Drop zone */
.cg-drop-zone {
    border: 2px dashed #d1d5db; border-radius: 10px;
    padding: 2.5rem 1.5rem; text-align: center;
    cursor: pointer; background: #fafafa;
    transition: background .15s, border-color .15s;
}
.cg-drop-zone:hover, .cg-drop-zone.drag-over {
    background: #eff6ff; border-color: #6366f1;
}
.cg-drop-icon { font-size: 36px; display: block; margin-bottom: 10px; }
.cg-drop-zone p { font-size: 14px; color: #6b7280; margin: 4px 0; }
.cg-drop-zone strong { color: #111827; }
.cg-drop-hint { font-size: 12px !important; color: #9ca3af !important; margin-top: 4px !important; }

/* Preview grid */
.cg-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 10px; margin-top: 14px;
}
.cg-preview-item {
    position: relative; aspect-ratio: 1;
    border-radius: 8px; overflow: hidden;
    background: #f3f4f6; border: 1px solid #e5e7eb;
}
.cg-preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cg-preview-remove {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(0,0,0,.6); border: none;
    color: #fff; font-size: 11px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}
.cg-size-badge {
    position: absolute; bottom: 4px; left: 4px;
    background: rgba(0,0,0,.55); color: #fff;
    font-size: 10px; padding: 2px 5px; border-radius: 4px;
}
.cg-size-over { border: 2px solid #ef4444 !important; }
.cg-size-over .cg-size-badge { background: #ef4444; }

/* File count */
.cg-file-count { font-size: 12px; color: #9ca3af; margin-top: 8px; }

/* Form footer */
.cg-form-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 1.5rem; }
.cg-btn { padding: 10px 22px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid #d1d5db; background: #fff; color: #374151; transition: background .15s; }
.cg-btn:hover { background: #f9fafb; }
.cg-btn-primary { background: #aa3854; color: #fff; border-color: transparent; }
.cg-btn-primary:hover { background: #a54059; }
.cg-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Guidelines */
.cg-guidelines {
    background: #f9fafb; border: 1px solid #f3f4f6;
    border-radius: 10px; padding: 1.25rem; margin-top: 1.5rem;
}
.cg-guidelines h4 { font-size: 13px; color: #6b7280; margin: 0 0 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.cg-guidelines ul { list-style: none; margin: 0; padding: 0; }
.cg-guidelines li { font-size: 13px; color: #374151; padding: 4px 0; }
.cg-guidelines li.cg-ok::before { content: '✓ '; color: #16a34a; font-weight: 700; }
.cg-guidelines li.cg-no::before { content: '✕ '; color: #dc2626; font-weight: 700; }

/* ── Gallery shortcode ── */
.cg-gallery-wrap { max-width: 1100px; margin: 0 auto; }

/* Filter bar */
.cg-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.5rem; }
.cg-filter-btn {
    padding: 6px 16px; border-radius: 99px;
    border: 1px solid #e5e7eb; background: #fff;
    font-size: 13px; color: #374151; cursor: pointer;
    transition: background .15s, border-color .15s;
}
.cg-filter-btn:hover, .cg-filter-btn.active {
    background: #111827; color: #fff; border-color: transparent;
}

/* Gallery grid */
.cg-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.cg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.cg-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) {
    .cg-gallery-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 480px) {
    .cg-gallery-grid { grid-template-columns: 1fr !important; }
}

.cg-gallery-item { border-radius: 10px; overflow: hidden; }
.cg-gallery-item a { display: block; position: relative; aspect-ratio: 4/3; }
.cg-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.cg-gallery-item:hover img { transform: scale(1.04); }

.cg-item-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 50%);
    opacity: 0; transition: opacity .25s;
    display: flex; flex-direction: column;
    justify-content: flex-end; padding: 14px;
}
.cg-gallery-item:hover .cg-item-overlay { opacity: 1; }
.cg-item-cat {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: #e5e7eb; margin-bottom: 4px;
}
.cg-item-caption { font-size: 13px; color: #f9fafb; margin: 0; line-height: 1.4; }

/* Empty gallery */
.cg-empty-gallery { text-align: center; padding: 3rem; color: #9ca3af; }

/* Lightbox */
.cg-lightbox-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.92);
    display: flex; align-items: center; justify-content: center;
}
.cg-lb-content { max-width: 90vw; max-height: 90vh; text-align: center; }
.cg-lb-content img { max-width: 100%; max-height: 80vh; border-radius: 4px; display: block; margin: 0 auto; }
.cg-lb-content p { color: #d1d5db; font-size: 14px; margin: 12px 0 0; }
.cg-lb-close, .cg-lb-prev, .cg-lb-next {
    position: fixed; background: rgba(255,255,255,.1);
    border: none; color: #fff; font-size: 22px; cursor: pointer;
    border-radius: 50%; width: 44px; height: 44px; line-height: 44px; text-align: center;
    transition: background .15s;
}
.cg-lb-close:hover, .cg-lb-prev:hover, .cg-lb-next:hover { background: rgba(255,255,255,.25); }
.cg-lb-close { top: 20px; right: 20px; }
.cg-lb-prev  { left: 20px;  top: 50%; transform: translateY(-50%); }
.cg-lb-next  { right: 20px; top: 50%; transform: translateY(-50%); }
