/* Homelab Blog — admin & extension styles
   Loaded after styles.css */

/* ---------- real cover images ---------- */
.cover-img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid var(--line-soft);
}
.entry.v-side .cover-img {
  height: 140px;
  margin-bottom: 0;
}
.entry.v-notebook .cover-img {
  height: 180px;
  margin: 14px 0;
}

/* ---------- entry wrapper + admin tools ---------- */
.entry-wrap {
  position: relative;
}
.entry-wrap.pinned::before {
  content: '📌 pinned';
  position: absolute;
  top: -10px;
  left: 14px;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  z-index: 2;
}
.entry-tools {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.15s;
}
.entry-wrap:hover .entry-tools { opacity: 1; }
.entry-wrap.pinned .pin-badge {
  /* The wrap pseudo-element shows pinned status; hide the inline badge */
  display: none;
}
.entry-tool {
  background: var(--bg-2);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}
.entry-tool:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ---------- admin top bar ---------- */
.admin-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  background: oklch(0.22 0.04 var(--hue));
  border-bottom: 1px solid var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink);
  box-shadow: 0 4px 16px oklch(0 0 0 / 0.3);
}
.admin-bar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 11px;
  margin-right: auto;
}
.admin-bar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.admin-bar button {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.admin-bar button:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ---------- /admin login screen ---------- */
.admin-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Lora', Georgia, serif;
}
.admin-checking {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--ink-faint);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.admin-login {
  width: 360px;
  max-width: 92vw;
}
.admin-login form {
  background: var(--bg-2);
  border: 1px dashed var(--line-soft);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-login-title {
  font-family: 'Lora', serif;
  font-weight: 600;
  font-size: 26px;
  color: var(--ink);
}
.admin-login-sub {
  color: var(--ink-faint);
  font-size: 13px;
  margin-bottom: 8px;
}
.admin-login input[type=password] {
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.admin-login input[type=password]:focus {
  border-color: var(--accent);
}
.admin-login button[type=submit] {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  padding: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 4px;
  transition: filter 0.15s;
}
.admin-login button[type=submit]:hover { filter: brightness(1.1); }
.admin-login button[type=submit]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.admin-login-err {
  color: oklch(0.7 0.15 25);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}
.admin-back {
  color: var(--ink-faint);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-decoration: none;
  text-align: center;
  margin-top: 4px;
}
.admin-back:hover { color: var(--accent); }

/* ---------- editor modal ---------- */
.admin-modal {
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.admin-editor {
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 24px;
  width: 640px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: 'Lora', serif;
}
.ae-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--line-soft);
  padding-bottom: 10px;
  margin-bottom: 4px;
}
.ae-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.ae-x {
  background: transparent;
  border: none;
  color: var(--ink-faint);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}
.ae-x:hover { color: var(--ink); }

.ae-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ae-field > span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.ae-field input[type=text],
.ae-field input:not([type]),
.ae-field input[type=date],
.ae-field textarea {
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.ae-field input:focus,
.ae-field textarea:focus { border-color: var(--accent); }
.ae-field textarea {
  resize: vertical;
  font-family: 'Lora', serif;
  line-height: 1.5;
}

.ae-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: end;
}
.ae-field-pin {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding-bottom: 8px;
}
.ae-field-pin > span {
  text-transform: none;
  letter-spacing: 0;
  font-family: 'Lora', serif;
  font-size: 14px;
  color: var(--ink);
}

.ae-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 8px;
}
.ae-tags input {
  background: transparent;
  border: none;
  outline: none;
  flex: 1;
  min-width: 120px;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}
.ae-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-soft);
  color: var(--tag);
  padding: 2px 8px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.ae-tag button {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.7;
}
.ae-tag button:hover { opacity: 1; }

.ae-cover {
  display: flex;
  gap: 12px;
  align-items: center;
}
.ae-cover img {
  width: 140px;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line-soft);
}
.ae-cover-empty {
  width: 140px;
  height: 90px;
  border: 1px dashed var(--line-soft);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.ae-cover-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ae-cover-actions input[type=file] {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-faint);
}
.ae-cover-actions button {
  background: transparent;
  color: var(--ink-faint);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 4px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  cursor: pointer;
}
.ae-cover-actions button:hover { color: var(--ink); border-color: var(--ink-dim); }

.ae-err {
  color: oklch(0.7 0.15 25);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.ae-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--line-soft);
  padding-top: 14px;
  margin-top: 4px;
}
.ae-actions-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.ae-actions button {
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--ink-dim);
  border-radius: 4px;
  padding: 8px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.ae-actions button:hover { color: var(--ink); border-color: var(--ink-dim); }
.ae-actions .ae-save {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.ae-actions .ae-save:hover { filter: brightness(1.1); }
.ae-actions .ae-delete {
  color: oklch(0.7 0.15 25);
  border-color: oklch(0.5 0.1 25);
}
.ae-actions .ae-delete:hover {
  background: oklch(0.55 0.18 25);
  color: white;
  border-color: transparent;
}
.ae-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* admin-mode shifts the page down for the sticky bar */
.admin-mode { /* nothing extra needed; bar is sticky */ }

/* ---------- reader overlay ---------- */
.reader-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.7);
  backdrop-filter: blur(6px);
  z-index: 90;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 20px 80px;
  animation: reader-fade 200ms ease-out;
}
@keyframes reader-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.reader {
  position: relative;
  width: 100%;
  max-width: 760px;
  background: oklch(0.18 0.04 var(--hue));
  border: 1px solid oklch(0.32 0.04 var(--hue));
  border-radius: 8px;
  box-shadow: 0 32px 80px oklch(0 0 0 / 0.6);
  overflow: hidden;
  animation: reader-rise 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes reader-rise {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.reader-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid oklch(0.4 0.04 var(--hue));
  background: oklch(0.12 0.04 var(--hue) / 0.7);
  color: oklch(0.85 0.02 var(--hue));
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms, color 120ms;
}
.reader-close:hover {
  background: var(--accent);
  color: oklch(0.12 0.04 var(--hue));
}
.reader-cover {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}
.reader-body {
  padding: 40px 56px 56px;
}
.reader-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: oklch(0.72 0.04 var(--hue));
  margin-bottom: 14px;
}
.reader-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}
.reader-meta .tag {
  color: oklch(0.78 0.11 55);
}
.reader-title {
  font-family: 'Lora', serif;
  font-size: 38px;
  line-height: 1.18;
  font-weight: 600;
  color: oklch(0.95 0.02 var(--hue));
  margin: 0 0 18px;
  text-wrap: pretty;
}
.reader-excerpt {
  font-family: 'Lora', serif;
  font-size: 18px;
  font-style: italic;
  line-height: 1.55;
  color: oklch(0.82 0.03 var(--hue));
  margin: 0 0 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid oklch(0.3 0.04 var(--hue));
}
.reader-p {
  font-family: 'Lora', serif;
  font-size: 17px;
  line-height: 1.7;
  color: oklch(0.88 0.02 var(--hue));
  margin: 0 0 20px;
  text-wrap: pretty;
}
.reader-empty {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: oklch(0.6 0.04 var(--hue));
  font-style: italic;
}
@media (max-width: 600px) {
  .reader-body { padding: 28px 24px 36px; }
  .reader-title { font-size: 28px; }
  .reader-cover { height: 200px; }
}
