.blog-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 3rem;
  align-items: end;
  padding: 9rem 6rem 4rem;
  max-width: 1440px;
  margin: 0 auto;
}

.blog-hero-copy h1 {
  max-width: 820px;
  font-size: clamp(2.5rem, 6vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: 0;
  margin: 0.75rem 0 1.2rem;
}

.blog-hero-copy p {
  max-width: 680px;
  font-size: 1.05rem;
}

.blog-eyebrow {
  display: inline-flex;
  color: var(--accent-emerald);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.blog-search {
  display: flex;
  gap: 0.65rem;
  padding: 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-lg);
  background: #fff;
  box-shadow: var(--card-shadow);
}

.blog-search input,
.admin-form input,
.editor-panel input,
.editor-panel textarea,
.editor-panel select {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  padding: 0.72rem 0.8rem;
  font: inherit;
  color: var(--text-primary);
  background: #fff;
}

.blog-search input {
  border: 0;
  background: #f8fafc;
}

.blog-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 3rem;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 6rem 6rem;
}

.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.blog-sidebar h2,
.blog-feed-header h2,
.admin-list-panel h2,
.editor-panel h2 {
  font-size: 1rem;
  letter-spacing: 0;
}

.blog-filter-list,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.blog-filter-list a,
.blog-filter-list button,
.tag-cloud button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  padding: 0.42rem 0.65rem;
  color: var(--text-secondary);
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.82rem;
}

.blog-filter-list a.active,
.blog-filter-list button.active,
.tag-cloud button.active {
  color: var(--accent-emerald);
  background: var(--accent-emerald-light);
  border-color: rgba(2, 102, 60, 0.18);
}

.blog-filter-list a span {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.blog-cta-panel {
  padding: 1.2rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-lg);
  background: #f8fafc;
}

.blog-cta-panel span {
  display: block;
  font-weight: 800;
  margin-bottom: 0.45rem;
}

.blog-cta-panel p {
  font-size: 0.86rem;
  margin-bottom: 1rem;
}

.blog-feed {
  min-width: 0;
}

.blog-feed-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.article-card {
  display: grid;
  grid-template-rows: 220px auto;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-lg);
  color: inherit;
  text-decoration: none;
  background: #fff;
  box-shadow: var(--card-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}

.article-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #f1f5f9;
}

.article-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.15rem;
}

.article-card-meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.article-card h3 {
  font-size: 1.16rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.article-card p {
  font-size: 0.88rem;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
}

.article-tags span {
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.blog-empty {
  padding: 2rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-lg);
  color: var(--text-secondary);
}

.article-page {
  padding: 8rem 1.5rem 5rem;
}

.article-detail {
  max-width: 820px;
  margin: 0 auto;
}

.article-back {
  display: inline-flex;
  margin-bottom: 2rem;
  color: var(--accent-emerald);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
}

.article-detail h1 {
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 1;
  letter-spacing: 0;
  margin: 0.8rem 0 1rem;
}

.article-detail .article-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--border-radius-lg);
  margin: 2rem 0;
}

.article-content {
  font-size: 1.02rem;
}

.article-content h2,
.article-content h3 {
  margin: 2rem 0 0.7rem;
  letter-spacing: 0;
}

.article-content p,
.article-content li {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.article-content ul,
.article-content ol {
  padding-left: 1.25rem;
  margin-bottom: 1.25rem;
}

.article-inline-cta {
  margin: 2rem 0;
  padding: 1.25rem;
  border: 1px solid #dbeafe;
  border-radius: var(--border-radius-lg);
  background: #f8fafc;
}

.admin-body {
  background: #f8fafc;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.admin-rail {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1.5rem;
  border-right: 1px solid #e2e8f0;
  background: #fff;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.admin-nav a,
.admin-nav button {
  text-align: left;
  border: 0;
  border-radius: var(--border-radius-md);
  padding: 0.7rem 0.75rem;
  color: var(--text-secondary);
  background: transparent;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.admin-nav a:hover,
.admin-nav button:hover {
  color: var(--accent-emerald);
  background: var(--accent-emerald-light);
}

.admin-login,
.admin-workspace {
  padding: 3rem;
}

.admin-login {
  max-width: 560px;
  align-self: center;
}

.admin-login h1,
.admin-header h1 {
  margin: 0.55rem 0;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.admin-form,
.editor-panel,
.admin-list-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-lg);
  background: #fff;
}

.admin-form label,
.editor-panel label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.admin-metrics div {
  padding: 1.15rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-lg);
  background: #fff;
}

.admin-metrics span {
  display: block;
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.admin-metrics p {
  font-size: 0.8rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.25fr) minmax(240px, 0.55fr);
  gap: 1rem;
  align-items: start;
}

.admin-list-panel,
.category-panel {
  position: sticky;
  top: 1rem;
}

.admin-article-row {
  padding: 0.9rem 0;
  border-top: 1px solid #f1f5f9;
}

.admin-article-row:first-child {
  border-top: 0;
}

.admin-article-row button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: var(--border-radius-md);
  padding: 0.55rem;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease;
}

.admin-article-row button:hover {
  background: #f8fafc;
}

.admin-article-row strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.admin-article-row span {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.editor-topline,
.editor-actions,
.editor-row {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.editor-row > label {
  flex: 1;
}

.editor-topline {
  justify-content: space-between;
}

.editor-topline select {
  max-width: 180px;
}

.visual-editor-wrap {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-lg);
  background: #fff;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.55rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.editor-toolbar button {
  min-width: 36px;
  min-height: 34px;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  background: #fff;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.editor-toolbar button:hover {
  color: var(--accent-emerald);
  border-color: rgba(2, 102, 60, 0.24);
}

.visual-editor {
  min-height: 440px;
  padding: 1.2rem;
  outline: none;
  color: var(--text-primary);
  line-height: 1.7;
}

.visual-editor:empty::before {
  content: 'Write your blog article here...';
  color: var(--text-muted);
}

.visual-editor h2,
.visual-editor h3 {
  margin: 1.25rem 0 0.6rem;
  letter-spacing: 0;
}

.visual-editor p,
.visual-editor li {
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
}

.visual-editor img {
  max-width: 100%;
  border-radius: var(--border-radius-lg);
}

.visual-editor figure {
  margin: 1.25rem 0;
}

.visual-editor figcaption {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.45rem;
}

.visual-editor ul,
.visual-editor ol {
  padding-left: 1.4rem;
}

.category-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-lg);
  background: #fff;
}

.media-upload-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-lg);
  background: #fbfdff;
}

.upload-hint {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.upload-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.upload-controls input[type='file'] {
  flex: 1;
  min-width: 220px;
  padding: 0.55rem;
  border: 1px dashed #cbd5e1;
  border-radius: var(--border-radius-md);
  background: #fff;
}

.upload-preview {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-lg);
  background: #fff;
}

.upload-preview img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
}

.category-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.category-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
}

.category-form input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  padding: 0.72rem 0.8rem;
  font: inherit;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.category-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.7rem;
  border: 1px solid #f1f5f9;
  border-radius: var(--border-radius-md);
  color: inherit;
  text-decoration: none;
}

.category-row:hover {
  border-color: rgba(2, 102, 60, 0.22);
  background: #f8fafc;
}

.category-row strong {
  font-size: 0.88rem;
}

.category-row span {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.danger {
  color: var(--accent-coral);
}

.form-message {
  min-height: 1.2rem;
  font-size: 0.82rem;
  color: var(--accent-emerald);
}

@media (max-width: 980px) {
  .blog-hero,
  .blog-shell,
  .admin-grid,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .blog-hero {
    padding: 7rem 1.5rem 3rem;
  }

  .blog-shell {
    padding: 0 1.5rem 4rem;
  }

  .article-grid,
  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .admin-rail {
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }

  .admin-login,
  .admin-workspace {
    padding: 1.5rem;
  }
}

@media (max-width: 640px) {
  .blog-search,
  .blog-feed-header,
  .admin-header,
  .editor-actions,
  .editor-row {
    flex-direction: column;
    align-items: stretch;
  }

  .article-card {
    grid-template-rows: 180px auto;
  }
}
