.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.blog-page {
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}

.blog-page .blog-manage {
  margin-bottom: 1.5rem;
}

.blog-page .blog-public-list {
  margin-top: 0.5rem;
}

.blog-page .blog-settings {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.blog-page .grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.blog-api-token {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}

.blog-api-token input {
  min-width: 16rem;
}

.blog-editor-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 800px) {
  .blog-editor-layout {
    grid-template-columns: 1fr;
  }
}

.blog-manage-head {
  margin-bottom: 0.75rem;
}

.blog-settings-fold {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  background: var(--surface, #fff);
}

.blog-settings-fold > summary {
  cursor: pointer;
  font-weight: 600;
}

.blog-settings-fold .blog-settings {
  margin-top: 1rem;
  margin-bottom: 0;
}

.blog-post-list-items {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}

.blog-post-list-item {
  margin: 0.35rem 0;
}

.blog-post-list-item.is-active .blog-post-list-select {
  border-color: var(--primary, #8b2252);
  box-shadow: 0 0 0 1px var(--primary, #8b2252);
}

.blog-post-list-row {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}

.blog-post-list-select {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border, #ddd);
  background: var(--surface, #fff);
  border-radius: 6px;
  cursor: pointer;
}

.blog-post-list-title {
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}

.blog-post-list-date {
  font-size: 0.8rem;
  color: var(--muted, #5a6570);
}

.blog-draft-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: #fff3cd;
  color: #856404;
}

.blog-post-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog-post-form-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog-field-title {
  position: relative;
  margin: 0;
}

.blog-field-title input {
  font-size: 1.35rem;
  font-weight: 600;
  padding-right: 2.5rem;
}

.blog-field-title .blog-i18n-btn {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
}

.blog-cover-tile {
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  padding: 0.75rem;
  background: var(--surface-alt, #fafafa);
}

.blog-body-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.blog-body-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.blog-body-label {
  font-weight: 600;
}

.blog-quill {
  min-height: 360px;
  background: #fff;
}

.blog-quill .ql-editor {
  min-height: 320px;
  font-size: 1rem;
  line-height: 1.65;
}

.blog-body-html {
  width: 100%;
  min-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 0.75rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 6px;
  resize: vertical;
  box-sizing: border-box;
}

.blog-seo-fold {
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}

.blog-seo-fold > summary {
  cursor: pointer;
  font-weight: 600;
}

.blog-seo-fold label {
  margin-top: 0.75rem;
}

.blog-post-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 0.75rem 0;
  margin: 0;
  background: linear-gradient(to top, var(--surface, #fff) 70%, transparent);
}

.blog-form-msg {
  margin: 0;
  flex: 1 1 100%;
}

.blog-card-manage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #eee);
}

.blog-seo {
  margin: 1rem 0;
  padding: 1rem;
}

.blog-published-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.blog-cover-preview {
  max-width: 160px;
  max-height: 100px;
  object-fit: cover;
  border-radius: 6px;
}

.blog-cards,
.lp-blog-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.blog-card img,
.lp-blog-cover img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
}

.blog-article {
  overflow: hidden;
  max-width: 100%;
}

.blog-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.5rem;
}

.blog-article-back {
  margin: 0;
}

.blog-article-date {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted, #5a6570);
  white-space: nowrap;
}

.blog-article-cover {
  margin: 1rem 0;
  max-width: 100%;
  overflow: hidden;
  border-radius: 10px;
}

.blog-article-cover img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

.blog-article-body {
  line-height: 1.65;
}

.blog-article-body img {
  max-width: 100%;
  height: auto;
}

.lp-blog-excerpt {
  color: var(--lp-text-muted, #555);
  font-size: 0.95rem;
}

/* WP-like layout: list + sidebar menu */
.blog-with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.25rem; align-items: start; }
.blog-with-sidebar.blog-no-sidebar { grid-template-columns: minmax(0, 1fr); }
.blog-page.blog-with-sidebar > .blog-article { min-width: 0; }
@media (max-width: 900px) { .blog-with-sidebar { grid-template-columns: minmax(0, 1fr); } }
.blog-sidebar { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; padding: 1rem 1.1rem; }
.blog-sidebar-title { font-size: 1.05rem; margin: 0 0 .6rem; }
.blog-menu-list { list-style: none; margin: 0; padding: 0; }
.blog-menu-list .blog-menu-list { padding-left: .9rem; border-left: 1px solid var(--border, rgba(127,127,127,.25)); margin: .2rem 0 .4rem .3rem; }
.blog-menu-list li { margin: .15rem 0; }
.blog-menu-list a { text-decoration: none; color: inherit; display: inline-block; padding: .1rem 0; }
.blog-menu-list a:hover, .blog-menu-list a[aria-current="page"] { color: var(--accent, #2563eb); }
.blog-menu-list a[aria-current="page"] { font-weight: 600; }
.blog-menu-list summary { cursor: pointer; }
.blog-card-meta { font-size: .85rem; opacity: .75; margin: .2rem 0 .4rem; }
.blog-card-meta a { color: inherit; }
.blog-chip { display: inline-block; padding: .1rem .55rem; margin: .15rem .25rem .15rem 0; border-radius: 999px; border: 1px solid var(--border, rgba(127,127,127,.35)); font-size: .85rem; text-decoration: none; color: inherit; }
.blog-pager { display: flex; gap: .75rem; align-items: center; justify-content: center; margin-top: 1.25rem; }
.blog-article-author { margin-left: .75rem; opacity: .8; }
.blog-article-terms { margin-top: 1.5rem; border-top: 1px solid var(--border, rgba(127,127,127,.25)); padding-top: .75rem; }
.blog-article-body pre { overflow-x: auto; padding: .75rem 1rem; border-radius: 8px; background: rgba(127,127,127,.12); font-size: .9rem; white-space: pre; }
.blog-article-body img { max-width: 100%; height: auto; }
.blog-menu-text { width: 100%; font-family: ui-monospace, monospace; font-size: .85rem; }
.blog-wp-result { white-space: pre-wrap; max-height: 360px; overflow: auto; background: rgba(127,127,127,.1); padding: .75rem; border-radius: 8px; }
@media (max-width: 900px) {
  .blog-with-sidebar > .blog-sidebar { order: -1; position: static; max-height: 45vh; }
}

/* v7: sidebar on the left + search */
.blog-with-sidebar { grid-template-columns: 280px minmax(0, 1fr); }
.blog-with-sidebar > .blog-sidebar { order: -1; }
.blog-search { display: flex; gap: .4rem; margin-bottom: .9rem; }
.blog-search input { flex: 1; min-width: 0; padding: .45rem .6rem; border-radius: 8px; border: 1px solid var(--border, rgba(127,127,127,.35)); background: transparent; color: inherit; }
.blog-cats > summary { cursor: pointer; list-style: none; }
.blog-cats > summary::-webkit-details-marker { display: none; }
.blog-cats > summary::after { content: " ▾"; opacity: .6; }
.blog-cats:not([open]) > summary::after { content: " ▸"; }
@media (max-width: 900px) {
  .blog-with-sidebar { grid-template-columns: minmax(0, 1fr); }
  .blog-with-sidebar > .blog-sidebar { max-height: none; }
  .blog-cats[open] .blog-menu { max-height: 50vh; overflow: auto; }
}
.blog-card p, .blog-card h2 { overflow-wrap: anywhere; }

.blog-covergen{margin-top:.5rem}
.blog-covergen-panel{margin-top:.5rem;display:grid;gap:.5rem}
.blog-covergen-panel textarea{width:100%;font-size:.9rem}
.blog-covergen-actions{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}
.blog-post-list-covergen{font-size:.85rem;opacity:.7}
.blog-post-list-covergen.has-cover{opacity:.3}
.blog-post-list-covergen:hover{opacity:1}
