/* =======================================================
   GALERIA HOSPEDAGEM – TEMA STUDIOC (PRETO / BRANCO / VERMELHO)
   ======================================================= */

/* ========== ADMIN (painel) ========== */

.gh-admin {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e5e7eb;
}

.gh-title {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  color: #f9fafb;
}

.gh-subtitle {
  margin: 0 0 16px;
  font-size: 13px;
  color: #9ca3af;
}

.gh-alert {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.gh-alert-ok {
  background: #022c22;
  color: #bbf7d0;
  border: 1px solid #16a34a;
}

.gh-alert-bad {
  background: #450a0a;
  color: #fecaca;
  border: 1px solid #ef4444;
}

.gh-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: flex-start;
}

/* sidebar */

.gh-sidebar {
  background: #020617;
  border-radius: 12px;
  border: 1px solid #1f2937;
  padding: 12px 12px 14px;
}

.gh-section-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #f9fafb;
}

.gh-collections-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.gh-collections-item {
  margin: 2px 0;
}

.gh-collections-link {
  display: block;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 13px;
  color: #e5e7eb;
  text-decoration: none;
  border: 1px solid transparent;
}

.gh-collections-item.is-active .gh-collections-link {
  background: #111827;
  border-color: #ef4444;
  color: #f9fafb;
  font-weight: 600;
}

.gh-collections-empty {
  font-size: 13px;
  color: #6b7280;
}

/* formulários */

.gh-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gh-form-new {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #1f2937;
}

.gh-form-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: #9ca3af;
}

.gh-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gh-field-label {
  font-size: 12px;
  color: #9ca3af;
}

.gh-input {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #4b5563;
  font-size: 13px;
  background: #020617;
  color: #f9fafb;
}

.gh-input::placeholder {
  color: #6b7280;
}

.gh-input:focus {
  outline: none;
  border-color: #ef4444;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.4);
}

.gh-help {
  margin: 0 0 6px;
  font-size: 12px;
  color: #6b7280;
}

.gh-empty-main {
  margin: 0;
  font-size: 14px;
  color: #9ca3af;
}

/* botões */

.gh-btn {
  border-radius: 999px;
  border: 0;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.gh-btn-primary {
  background: linear-gradient(135deg, #ef4444, #991b1b);
  color: #f9fafb;
}

.gh-btn-secondary {
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #4b5563;
}

.gh-btn-danger {
  background: #7f1d1d;
  color: #f9fafb;
}

.gh-btn-xs {
  padding: 4px 9px;
  font-size: 12px;
}

/* main */

.gh-main {
  background: #020617;
  border-radius: 12px;
  border: 1px solid #1f2937;
  padding: 12px 14px 16px;
}

/* dropzone */

.gh-dropzone {
  border-radius: 14px;
  border: 2px dashed #4b5563;
  background: #030712;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

.gh-dropzone-title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: #f9fafb;
}

.gh-dropzone-sub {
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
}

.gh-dropzone-input {
  display: none;
}

.gh-dropzone.is-dragover {
  background: #111827;
  border-color: #ef4444;
  transform: scale(1.01);
}

/* galeria admin */

.gh-gallery-block {
  margin-top: 16px;
}

.gh-gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.gh-gallery-empty {
  margin: 4px 0 0;
  font-size: 13px;
  color: #9ca3af;
}

.gh-gallery-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.gh-gallery-item {
  border-radius: 10px;
  border: 1px solid #1f2937;
  background: #020617;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gh-gallery-thumb-wrap {
  position: relative;
  background: #0b1120;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.gh-gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gh-gallery-handle {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.8);
  color: #f9fafb;
  font-size: 12px;
  cursor: grab;
}

.gh-gallery-handle:active {
  cursor: grabbing;
}

.gh-gallery-meta {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.gh-gallery-name {
  font-size: 11px;
  color: #e5e7eb;
  word-break: break-all;
}

.gh-form-inline {
  margin: 0;
}

/* estado fantasma Sortable */
.gh-item-ghost {
  opacity: 0.6;
  transform: scale(0.98);
}

/* responsivo admin */

@media (max-width: 900px) {
  .gh-layout {
    grid-template-columns: 1fr;
  }
}

/* =======================================================
   PÁGINA PÚBLICA – TEMA STUDIOC
   ======================================================= */

.gallery-studioc {
  background: #020617;
  border-radius: 18px;
  border: 1px solid #111827;
}

.gallery-hosted-block {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 32px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.gallery-header {
  border-bottom: 1px solid #111827;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.gallery-title {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f9fafb;
}

.gallery-subtitle {
  margin: 0;
  font-size: 14px;
  color: #9ca3af;
}

.gallery-hosted-empty {
  margin-top: 8px;
  font-size: 14px;
  color: #9ca3af;
}

/* abas */

.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.gallery-tab-btn {
  border-radius: 999px;
  border: 1px solid #1f2937;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  background: #020617;
  color: #e5e7eb;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}

.gallery-tab-btn:hover {
  border-color: #ef4444;
  color: #f9fafb;
  transform: translateY(-1px);
}

.gallery-tab-btn.is-active {
  background: #111827;
  border-color: #ef4444;
  color: #fef2f2;
  font-weight: 600;
}

/* painéis */

.gallery-tab-panel {
  display: none;
}

.gallery-tab-panel.is-active {
  display: block;
}

/* grid 5 colunas (responsivo) */

.gallery-hosted-grid {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.gallery-hosted-item {
  border-radius: 10px;
  overflow: hidden;
  background: #020617;
  border: 1px solid #111827;
  position: relative;
}

.gallery-hosted-item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.7);
}

.gallery-hosted-img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.2s, opacity 0.2s;
  cursor: zoom-in;
}

.gallery-hosted-img:hover {
  transform: scale(1.04);
  opacity: 0.92;
}

/* responsivo público */

@media (max-width: 1024px) {
  .gallery-hosted-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .gallery-hosted-block {
    padding: 18px 12px 28px;
  }

  .gallery-hosted-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .gallery-hosted-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

/* =======================================================
   LIGHTBOX / MODAL
   ======================================================= */

body.gallery-lightbox-open {
  overflow: hidden;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.gallery-lightbox.is-open {
  display: block;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.gallery-lightbox-dialog {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 32px auto;
  padding: 16px;
  border-radius: 16px;
  background: #020617;
  border: 1px solid #ef4444;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox-inner {
  max-height: calc(100vh - 160px);
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  object-fit: contain;
}

/* botões */

.gallery-lightbox-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: #111827;
  color: #f9fafb;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox-close:hover {
  background: #b91c1c;
}

.gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: rgba(0, 0, 0, 0.75);
  color: #f9fafb;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.gallery-lightbox-prev {
  left: 10px;
}

.gallery-lightbox-next {
  right: 10px;
}

.gallery-lightbox-nav:hover {
  background: #b91c1c;
}

/* responsivo modal */

@media (max-width: 768px) {
  .gallery-lightbox-dialog {
    margin: 24px 10px;
    padding: 12px;
  }

  .gallery-lightbox-nav {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .gallery-lightbox-close {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }
}
