/* ── ff blog layouts ─────────────────────────────────────────────────── */

.ff-blog {
  min-height: 50vh;
}

/* ── Tag filter bar (shared across layouts) ─────────────────────────────── */

.ff-blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 16px;
}

.ff-blog-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 16px;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.ff-blog-tag:hover {
  background: #e2e8f0;
}

.ff-blog-tag.active {
  background: #4f46e5;
  color: #fff;
}

/* ── Layout: Sidebar + Content ──────────────────────────────────────────── */

.ff-blog.layout-sidebar {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  min-height: 60vh;
  margin: 0 -12px;
}

@media (max-width: 768px) {
  .ff-blog.layout-sidebar {
    grid-template-columns: 1fr;
  }
  .ff-blog-sidebar {
    border-right: none !important;
    border-bottom: 1px solid #e5e7eb;
    max-height: 40vh !important;
  }
}

.ff-blog-sidebar {
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  max-height: calc(100vh - 160px);
  position: sticky;
  top: 100px;
  align-self: start;
}

.ff-blog-sidebar-header {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
}

.ff-blog-sidebar-header input[type="search"] {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}

.ff-blog-sidebar-header input[type="search"]:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.12);
}

.ff-blog-post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ff-blog-post-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.1s ease;
  text-decoration: none;
  color: inherit;
}

.ff-blog-post-item:hover {
  background: #f8fafc;
}

.ff-blog-post-item.active {
  background: #eff6ff;
  border-left: 3px solid #4f46e5;
  padding-left: 13px;
}

.ff-blog-post-item .post-title {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 2px;
  color: #111827;
  line-height: 1.3;
}

.ff-blog-post-item .post-meta {
  font-size: 12px;
  color: #9ca3af;
}

.ff-blog-post-item .post-summary {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ff-blog-post-item .badge-draft {
  display: inline-block;
  background: #f59e0b;
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}

.ff-blog-new-btn {
  display: block;
  width: calc(100% - 24px);
  margin: 12px auto;
  padding: 8px 16px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.ff-blog-new-btn:hover {
  background: #15803d;
}

/* Reader pane */
.ff-blog-reader {
  padding: 32px 40px;
  max-width: 820px;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .ff-blog-reader {
    padding: 20px 16px;
  }
}

.ff-blog-reader .reader-empty {
  text-align: center;
  padding: 80px 20px;
  color: #9ca3af;
}

.ff-blog-reader .reader-empty i {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
  color: #d1d5db;
}

.ff-blog-reader .reader-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f3f4f6;
}

.ff-blog-reader .reader-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #111827;
}

.ff-blog-reader .reader-header .reader-meta {
  font-size: 14px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ff-blog-reader .reader-header .reader-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.ff-blog-reader .reader-header .reader-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
}

.ff-blog-reader .reader-hero {
  margin-bottom: 24px;
  border-radius: 8px;
  overflow: hidden;
  max-height: 400px;
}

.ff-blog-reader .reader-hero img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.ff-blog-reader .reader-body {
  line-height: 1.7;
  font-size: 16px;
  color: #374151;
}

.ff-blog-reader .reader-edit-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.ff-blog-reader .reader-edit-bar a,
.ff-blog-reader .reader-edit-bar button {
  font-size: 13px;
  color: #4f46e5;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.ff-blog-reader .reader-edit-bar a:hover,
.ff-blog-reader .reader-edit-bar button:hover {
  color: #4338ca;
  text-decoration: underline;
}

.ff-blog-reader .reader-edit-bar .badge-status {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-left: auto;
}

.ff-blog-reader .reader-edit-bar .badge-published {
  background: #16a34a;
  color: #fff;
}

.ff-blog-reader .reader-edit-bar .badge-draft {
  background: #f59e0b;
  color: #fff;
}

/* ── Layout: Card Grid ──────────────────────────────────────────────────── */

.ff-blog.layout-cards .blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.ff-blog-card {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  background: #fff;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.ff-blog-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.ff-blog-card .card-image {
  height: 200px;
  background: #f1f5f9;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 14px;
}

.ff-blog-card .card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ff-blog-card .card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.3;
}

.ff-blog-card .card-title a {
  color: inherit;
  text-decoration: none;
}

.ff-blog-card .card-title a:hover {
  color: #4f46e5;
}

.ff-blog-card .card-date {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 8px;
}

.ff-blog-card .card-summary {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ff-blog-card .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

.ff-blog-card .card-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
}

.ff-blog-card .card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
}

.ff-blog-card .card-actions a,
.ff-blog-card .card-actions button {
  font-size: 13px;
  color: #4f46e5;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.ff-blog-card .card-actions button.delete-btn {
  color: #dc2626;
}

/* ── Layout: Featured + Grid ────────────────────────────────────────────── */

.ff-blog.layout-featured .featured-post {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
  .ff-blog.layout-featured .featured-post {
    grid-template-columns: 1fr;
  }
}

.ff-blog.layout-featured .featured-image {
  border-radius: 8px;
  overflow: hidden;
  min-height: 280px;
  background: #f1f5f9;
  background-size: cover;
  background-position: center;
}

.ff-blog.layout-featured .featured-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ff-blog.layout-featured .featured-body h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.2;
}

.ff-blog.layout-featured .featured-body h2 a {
  color: inherit;
  text-decoration: none;
}

.ff-blog.layout-featured .featured-body .featured-date {
  font-size: 14px;
  color: #9ca3af;
  margin-bottom: 12px;
}

.ff-blog.layout-featured .featured-body .featured-summary {
  font-size: 15px;
  color: #6b7280;
  line-height: 1.6;
}

.ff-blog.layout-featured .blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* ── Layout: Simple List ────────────────────────────────────────────────── */

.ff-blog.layout-list .blog-entries {
  max-width: 720px;
}

.ff-blog-entry {
  padding: 20px 0;
  border-bottom: 1px solid #f3f4f6;
}

.ff-blog-entry:first-child {
  padding-top: 0;
}

.ff-blog-entry .entry-date {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 4px;
}

.ff-blog-entry h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.3;
}

.ff-blog-entry h3 a {
  color: #111827;
  text-decoration: none;
}

.ff-blog-entry h3 a:hover {
  color: #4f46e5;
}

.ff-blog-entry .entry-summary {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 6px;
}

.ff-blog-entry .entry-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.ff-blog-entry .entry-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
}

/* ── Shared empty states ────────────────────────────────────────────────── */

.ff-blog-empty {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
}
