/* ═══════════════════════════════════════════════════════
   Slate Content — Public rendering styles for rich post content
   Scoped under .slate-content to avoid conflicts with other styles.
   ═══════════════════════════════════════════════════════ */

.slate-content {
  font-size: 1rem;
  line-height: 1.75;
  color: inherit;
}

/* ── Typography ── */

.slate-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  line-height: 1.2;
}

.slate-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
  line-height: 1.3;
}

.slate-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  line-height: 1.4;
}

.slate-content h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  line-height: 1.4;
}

.slate-content p {
  margin: 0.5rem 0;
}

/* ── Blockquote ── */

.slate-content blockquote {
  border-left: 4px solid #003267;
  padding-left: 1rem;
  margin: 1rem 0;
  color: #555;
  font-style: italic;
}

/* ── Code blocks ── */

.slate-content pre {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1rem 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.slate-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

.slate-content code {
  background: #f0f0f0;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.875em;
}

/* ── Lists ── */

.slate-content ul,
.slate-content ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.slate-content ul {
  list-style-type: disc;
}

.slate-content ol {
  list-style-type: decimal;
}

.slate-content li {
  margin: 0.25rem 0;
}

/* ── Tables ── */

.slate-content .slate-table,
.slate-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.slate-content th,
.slate-content td {
  border: 1px solid #ddd;
  padding: 0.5rem;
  text-align: left;
  vertical-align: top;
}

.slate-content th {
  background: #f5f5f5;
  font-weight: 600;
}

/* ── Images ── */

.slate-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.slate-content figure {
  margin: 1rem 0;
}

.slate-content figcaption {
  text-align: center;
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.5rem;
}

/* ── Horizontal rule ── */

.slate-content hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 1.5rem 0;
}

/* ── Column layouts ── */

.slate-content .slate-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1rem 0;
}

.slate-content .slate-column {
  flex: 1 1 0;
  min-width: 0;
}

@media (max-width: 768px) {
  .slate-content .slate-columns {
    flex-direction: column;
  }

  .slate-content .slate-column {
    width: 100% !important;
    flex-basis: 100%;
  }
}

/* ── Links ── */

.slate-content a {
  color: #0066cc;
  text-decoration: underline;
}

.slate-content a:hover {
  color: #003267;
}

/* ── Marks ── */

.slate-content mark {
  background-color: #fef08a;
  padding: 0.0625rem 0.125rem;
}

.slate-content kbd {
  background: #f5f5f5;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 0.0625rem 0.375rem;
  font-size: 0.875em;
  font-family: inherit;
}

/* ── Callout ── */

.slate-callout {
  border-left: 4px solid #0066cc;
  background: #f0f7ff;
  padding: 1rem 1rem 1rem 1.25rem;
  border-radius: 4px;
  margin: 1rem 0;
}

.slate-callout-warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.slate-callout-error {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.slate-callout-success {
  border-left-color: #22c55e;
  background: #f0fdf4;
}

/* ── Toggle / Details ── */

.slate-content details {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

.slate-content details summary {
  cursor: pointer;
  font-weight: 600;
}

/* ── Media embed ── */

.slate-media-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1rem 0;
}

.slate-media-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ── Asset folder embed — List mode ── */

.slate-content .asset-folder-list {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0;
}

.slate-content .asset-folder-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.slate-content .asset-folder-list li:last-child {
  border-bottom: none;
}

.slate-content .asset-folder-list li img {
  max-width: 200px;
  border-radius: 4px;
}

/* ── Asset folder embed — Grid mode ── */

.slate-content .asset-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.slate-content .asset-folder-grid-item {
  text-align: center;
}

.slate-content .asset-folder-grid-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
}

.slate-content .asset-folder-grid-item a {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
}

/* ── Asset folder embed — Cards mode ── */

.slate-content .asset-folder-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.slate-content .asset-folder-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}

.slate-content .asset-folder-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.slate-content .asset-folder-card-body {
  padding: 0.75rem;
}

.slate-content .asset-folder-card-body a {
  font-weight: 600;
  font-size: 0.875rem;
}

.slate-content .asset-folder-card-size {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.25rem;
}
