/* Startseite: Beiträge mit Seitenleiste */

.home-app {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  width: min(1200px, calc(100% - 40px));
  margin: 1.5rem auto 3rem;
  align-items: start;
}

.home-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  max-height: calc(100vh - var(--header-h) - 24px);
  overflow: auto;
  padding: 1rem;
}

.home-sidebar-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.home-new-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.home-post-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.home-post-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}

.home-post-link:hover {
  background: var(--surface-muted);
  text-decoration: none;
}

.home-post-link.is-active {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-left: 3px solid var(--accent);
}

.home-post-link-title {
  line-height: 1.25;
}

.home-post-link-excerpt,
.home-post-link-date {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.35;
}

.home-post-badge {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text-muted);
}

.home-post-empty {
  margin: 0;
  line-height: 1.45;
}

.home-main {
  min-width: 0;
}

.home-post-title-input {
  font-size: 1.65rem;
  font-weight: 700;
  border: none;
  background: transparent;
  padding: 0;
}

.home-post-meta {
  padding: 1rem 1rem 0;
}

.home-publish-check {
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.home-publish-check input {
  accent-color: var(--accent);
}

@media (max-width: 900px) {
  .home-app {
    grid-template-columns: 1fr;
  }

  .home-sidebar {
    position: static;
    max-height: none;
  }
}

.home-toolbar {
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-muted);
}

.home-toolbar[hidden] {
  display: none !important;
}

.home-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding-right: 0.45rem;
  margin-right: 0.35rem;
  border-right: 1px solid var(--border-strong);
}

.home-toolbar-group:last-child {
  border-right: none;
  padding-right: 0;
  margin-right: 0;
}

.home-tb-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
}

.home-tb-btn:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: var(--border-strong);
}

.home-tb-btn.is-active {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.home-tb-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.home-canvas {
  position: relative;
  min-height: 380px;
}

.editor-shell {
  position: relative;
}

.home-canvas .home-img-block {
  position: absolute;
  display: block;
  margin: 0;
  box-sizing: border-box;
  z-index: 2;
  pointer-events: auto;
}

.home-canvas--editable .home-img-block {
  cursor: pointer;
}

.home-canvas--editable .home-img-block::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  pointer-events: none;
  transition: box-shadow 0.15s ease;
}

.home-canvas--editable .home-img-block:hover::after {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
}

.home-canvas .home-img-block img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  pointer-events: none;
  user-select: none;
}

.editor-shell .home-img-block.is-selected {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 3px;
  z-index: 4;
}

.editor-shell .home-img-block,
.home-canvas--editable .home-img-block:hover,
.home-canvas--editable .home-img-block.is-selected {
  cursor: grab;
}

.editor-shell .home-img-block.is-dragging {
  opacity: 0.82;
  z-index: 5;
}

.home-img-drag,
.home-img-resize-handle,
.home-img-delete {
  position: absolute;
  z-index: 2;
  touch-action: none;
  pointer-events: auto;
}

.home-img-drag {
  top: 0.35rem;
  left: 0.35rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--surface) 92%, var(--accent));
  cursor: grab;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.home-img-drag::before {
  content: "⋮⋮";
  display: block;
  font-size: 0.62rem;
  line-height: 1.35rem;
  text-align: center;
  letter-spacing: -1px;
  color: var(--text-muted);
}

.editor-shell .home-img-block:hover .home-img-drag,
.editor-shell .home-img-block.is-selected .home-img-drag {
  opacity: 1;
}

.home-img-resize-handle {
  right: 0.25rem;
  bottom: 0.25rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 2px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent);
  cursor: nwse-resize;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.editor-shell .home-img-block:hover .home-img-resize-handle,
.editor-shell .home-img-block.is-selected .home-img-resize-handle {
  opacity: 1;
}

.home-img-delete {
  top: 0.35rem;
  right: 0.35rem;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, #c0392b 55%, var(--border-strong));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, #e74c3c 88%, var(--surface));
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.editor-shell .home-img-block:hover .home-img-delete,
.editor-shell .home-img-block.is-selected .home-img-delete {
  opacity: 1;
}

.home-img-delete:hover {
  background: #c0392b;
}

.editor-shell :where(h1, h2, h3),
.home-canvas :where(h1, h2, h3) {
  margin-top: 1.1em;
  margin-bottom: 0.45em;
}

.editor-shell :where(ul, ol),
.home-canvas :where(ul, ol) {
  margin: 0.65em 0;
  padding-left: 1.35em;
}

.editor-shell a,
.home-canvas a {
  color: var(--accent);
}
