@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg:        #111111;
  --bg-card:   #191919;
  --border:    #2a2a2a;
  --accent:    #496b64;
  --accent-hi: #628f85;
  --link:      #496b64;
  --link-hi:   #628f85;
  --text:      #e8e8e8;
  --text-dim:  #bbbbbb;
  --success:   #4ade80;
  --error:     #ef4444;
  --radius:    4px;
  --font:      'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono:      'Fira Code', "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
}

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; overflow-y: scroll; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }

/* ── Layout ───────────────────────────────────────────────────── */
#wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#content { flex: 1; padding-bottom: 48px; }

/* ── Header ───────────────────────────────────────────────────── */
#site-header {
  padding: 24px 0 14px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

#site-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 32px; height: 2px;
  background: var(--accent);
  opacity: 0.4;
}

#site-title a {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
#site-title a:hover { color: var(--accent); }

.tw-cursor {
  animation: blink 0.8s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

#site-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 5px;
  font-family: var(--font);
  font-weight: 500;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── Entry Feed ───────────────────────────────────────────────── */
.entry {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid transparent;
  transition: border-left-color .2s ease, background-color .2s ease;
  margin-left: -12px;
  border-radius: var(--radius);
}
.entry:last-of-type { border-bottom: none; }
.entry:hover {
  border-left-color: var(--accent);
  background-color: rgba(255, 255, 255, 0.015);
}

/* ── Global Buttons ───────────────────────────────────────────── */
.admin-btn {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text) !important;
  font-size: 0.82rem;
  font-family: var(--font);
  text-decoration: none !important;
  transition: background .12s, border-color .12s, color .12s;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
}
.admin-btn:hover {
  background: #222222;
  border-color: #444444;
  color: #ffffff !important;
}

.admin-btn-dim {
  color: var(--text-dim) !important;
}
.admin-btn-dim:hover {
  color: var(--text) !important;
}

.admin-bar-sep {
  color: var(--border);
  font-size: 0.9rem;
  user-select: none;
  opacity: 0.7;
}

.title-prefix {
  color: var(--accent);
  opacity: 0.4;
  font-family: var(--mono);
  font-weight: 400;
  margin-right: 2px;
  transition: opacity .2s ease;
}
.entry-title:hover .title-prefix {
  opacity: 0.7;
}

.entry-title {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.02em;
  font-family: var(--font);
  position: relative;
  padding-bottom: 2px;
  transition: color .2s ease;
}

/* Subtle dotted underline by default */
.entry-title::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  border-bottom: 1px dotted var(--border);
  z-index: 1;
}

/* Animated solid underline on hover */
.entry-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width .25s ease;
  z-index: 2;
}
.entry-title:hover::after { width: 100%; }

.entry-title:hover {
  color: var(--accent);
}

.entry-body {
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.55;
}

/* ── Entry body links — clearly distinct ─────────────────────── */
.entry-body a {
  color: var(--link);
  border-bottom: 1px solid rgba(92, 200, 200, 0.25);
  transition: color .12s, border-color .12s;
}
.entry-body a:hover {
  color: var(--link-hi);
  border-bottom-color: var(--link-hi);
}

.entry-body p  { margin-bottom: 6px; }
.entry-body ul,
.entry-body ol { padding-left: 18px; margin-bottom: 6px; }
.entry-body li { margin-bottom: 2px; }

.entry-body strong { color: var(--text); font-weight: 600; }
.entry-body em     { color: var(--text-dim); font-style: italic; }

.entry-body h2 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 14px 0 6px;
}

.entry-body code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: 0.8em;
  color: var(--text);
}

.entry-body pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  overflow-x: auto;
  margin-bottom: 8px;
}
.entry-body pre code { background: none; border: none; padding: 0; }

.entry-body blockquote {
  border-left: 2px solid var(--border);
  margin: 6px 0;
  padding: 3px 10px;
  color: var(--text-dim);
  font-style: italic;
}

.entry-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

/* ── Pagination ───────────────────────────────────────────────── */
.split {
  display: flex;
  justify-content: space-between;
  padding: 24px 0 10px;
}

.navitem {
  font-size: 0.78rem;
  color: var(--text-dim);
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  transition: border-color .15s, color .15s;
}
.navitem:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ── Footer ───────────────────────────────────────────────────── */
#site-footer {
  padding: 16px 0 20px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-dim);
  opacity: 0.5;
  font-family: var(--mono);
}
#site-footer a { color: var(--text-dim); }
#site-footer a:hover { color: var(--accent); }

/* ── Error / Success ──────────────────────────────────────────── */
.error   { color: var(--error);   font-size: 0.85rem; }
.success { color: var(--success); font-size: 0.85rem; }

/* ── Entry lock prompt ────────────────────────────────────────── */
.entry-lock {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 0 10px;
}

.lock-icon {
  display: flex; align-items: center;
  opacity: 0.3; margin-top: 3px; flex-shrink: 0;
}
.lock-icon svg { stroke: var(--accent); }

.lock-form { display: flex; flex-direction: column; gap: 8px; }

.lock-form input[type=password] {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.85rem;
  font-family: var(--font);
  outline: none;
  transition: border-color .15s;
  width: 200px; max-width: 100%;
}
.lock-form input[type=password]:focus { border-color: var(--accent); }
.lock-form input[type=password]::placeholder { color: var(--text-dim); opacity: 0.6; }

.lock-form button {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius);
  padding: 7px 16px;
  font-size: 0.82rem;
  font-family: var(--mono);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.lock-form button:hover { border-color: var(--accent); color: var(--text); }

.lock-error { font-size: 0.78rem; color: var(--error); }

/* ── Feed badges ──────────────────────────────────────────────── */
.entry-pin-badge, .entry-locked-badge, .entry-draft-badge {
  display: inline-flex; align-items: center;
  margin-left: 5px; vertical-align: middle;
  opacity: 0.35; transition: opacity 150ms ease;
}
.entry-pin-badge svg, .entry-locked-badge svg, .entry-draft-badge svg { stroke: var(--accent); }

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #wrap { padding: 0 16px; }
  #site-header { padding: 24px 0 18px; }
}

/* ── Lightbox Overlay ─────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  backdrop-filter: blur(6px);
}
.lightbox-img {
  max-width: 90%; max-height: 90%;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  object-fit: contain;
}
.entry-body img {
  cursor: zoom-in;
  display: block;
  width: auto;
  max-width: min(100%, 360px);
  max-height: 240px;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 8px 0;
}
.entry-body a:has(img) {
  border-bottom: 0;
}

@media (max-width: 600px) {
  .entry-body img {
    max-width: 100%;
    max-height: 220px;
  }
}

/* ── Links Directory ───────────────────────────────────────────── */
.link-entry {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid transparent;
  transition: border-left-color .2s ease, background-color .2s ease;
  margin-left: -12px;
  border-radius: var(--radius);
}

.link-entry:last-of-type { border-bottom: none; }
.link-entry:hover {
  border-left-color: var(--accent);
  background-color: rgba(255, 255, 255, 0.015);
}

.link-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.link-favicon-wrapper {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-favicon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 2px;
  filter: grayscale(30%);
  opacity: 0.85;
}

.link-meta {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.link-title {
  font-weight: 600;
  color: var(--text);
  font-size: 1.1rem;
  text-decoration: none;
}

.link-title:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}

.link-arrow {
  font-size: 0.8em;
  opacity: 0.4;
  margin-left: 4px;
  font-family: var(--font);
}

.link-description {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.4;
}

.link-tags {
  display: inline-flex;
  gap: 6px;
}

.link-tags span {
  color: var(--text-dim);
  background: var(--bg-card);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.65rem;
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.link-content {
  margin-top: 10px;
  font-size: 0.95rem;
}

.link-content p {
  margin-bottom: 8px;
}

.link-group-heading,
.link-group summary {
  color: var(--text);
  font-size: 0.95rem;
  letter-spacing: 0;
  margin: 22px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.link-group {
  margin-top: 14px;
}
.link-group summary {
  cursor: pointer;
  list-style-position: inside;
}
.link-group-body {
  margin-top: 4px;
}

.announcement-banner {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  color: var(--text);
  margin: 0 0 18px;
  padding: 10px 12px;
}
.announcement-banner p {
  margin: 0;
}
.announcement-banner a {
  color: var(--link);
  border-bottom: 1px solid rgba(92, 200, 200, 0.35);
  text-decoration: none;
}
.announcement-banner a:hover {
  color: var(--link-hi);
  border-bottom-color: var(--link-hi);
}
