/* Vizuální styly pro sémantický editor v adminu */
.cms-editor-wrapper {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.cms-editor-wrapper:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cms-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.cms-editor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: all 0.1s ease;
}

.cms-editor-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.cms-editor-btn:active,
.cms-editor-btn.is-active {
  background: #cbd5e1;
  color: #0f172a;
  border-color: #94a3b8;
}

.cms-editor-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: #cbd5e1;
}

.cms-editor-content {
  min-height: 160px;
  max-height: 480px;
  overflow-y: auto;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  color: #1e293b;
  outline: none;
}

.cms-editor-content p {
  margin: 0 0 0.8em 0;
}

.cms-editor-content p:last-child {
  margin-bottom: 0;
}

.cms-editor-content h2,
.cms-editor-content h3,
.cms-editor-content h4 {
  margin: 1.2em 0 0.4em 0;
  font-weight: 600;
  color: #0f172a;
}

.cms-editor-content h2 {
  font-size: 1.4em;
}
.cms-editor-content h3 {
  font-size: 1.2em;
}
.cms-editor-content h4 {
  font-size: 1.05em;
}

.cms-editor-content blockquote {
  margin: 1em 0;
  padding: 8px 16px;
  border-left: 4px solid #94a3b8;
  background: #f8fafc;
  color: #475569;
  font-style: italic;
}

.cms-editor-content ul,
.cms-editor-content ol {
  margin: 0.8em 0;
  padding-left: 24px;
}

.cms-editor-content li {
  margin-bottom: 0.3em;
}

.cms-editor-content hr {
  margin: 1.5em 0;
  border: 0;
  border-top: 1px solid #cbd5e1;
}

.cms-editor-content a {
  color: #2563eb;
  text-decoration: underline;
}

.cms-editor-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 0.5em 0;
}

.cms-editor-wrapper.is-code-view textarea {
  min-height: 180px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  border: none;
  border-radius: 0;
  padding: 12px 16px;
  outline: none;
  resize: vertical;
}

/* ==========================================================================
   Galerie ve formulářích
   ========================================================================== */

.cms-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.cms-gallery-item {
  background: #ffffff;
  border: 1px solid var(--cms-border);
  border-radius: var(--cms-radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: relative;
}

.cms-gallery-thumb {
  position: relative;
  width: 100%;
  height: 96px;
  background: #f1f5f9;
  overflow: hidden;
}

.cms-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cms-gallery-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s ease;
}

.cms-gallery-remove:hover {
  background: #dc2626;
}

.cms-gallery-meta {
  padding: 4px 6px;
}

.cms-gallery-caption {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 2px 4px;
  font-size: 0.75rem;
  background: transparent;
  font-family: inherit;
  box-sizing: border-box;
}

.cms-gallery-caption:focus {
  border-color: var(--cms-primary);
  background: #ffffff;
  outline: none;
}

.cms-gallery-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
