/*
 * Theme: Default
 * Author: Jottit
 * Version: 1.0
 * License: MIT
 */

/* ── Body ────────────────────────────── */
body {
  font-family: var(--site-font);
  font-size: var(--site-font-size);
  font-weight: var(--weight-normal);
  line-height: var(--site-leading);
  color: var(--site-text);
  background: var(--site-bg);
}

/* ── Headings ────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--site-font-header);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-5);
}

h2 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

h4, h5, h6 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

/* ── Text ────────────────────────────── */
p {
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

strong, b {
  font-weight: var(--weight-bold);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
  color: var(--site-text-muted);
}

/* ── Links ───────────────────────────── */
a {
  color: var(--site-text-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--speed-fast);
}

a:hover {
  color: var(--site-text-muted);
}

/* ── Lists ───────────────────────────── */
ul, ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-5);
}

li {
  margin-bottom: var(--space-2);
}

li:last-child {
  margin-bottom: 0;
}

/* ── Blockquote ──────────────────────── */
blockquote {
  border-left: 2px solid var(--site-divider);
  padding-left: var(--space-4);
  color: var(--site-text-muted);
  margin-bottom: var(--space-4);
}

/* ── Code ────────────────────────────── */
code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--site-code-bg);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

pre {
  background: var(--site-code-bg);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--space-4);
}

pre code {
  background: none;
  padding: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-loose);
}

/* ── Horizontal rule ─────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--site-divider);
  margin: var(--space-8) 0;
}

/* ── Images & figures ────────────────── */
img {
  margin-bottom: var(--space-4);
}

figure {
  margin-bottom: var(--space-4);
}

figcaption {
  font-size: var(--text-sm);
  color: var(--site-text-muted);
  margin-top: var(--space-2);
}

/* ── Tables ──────────────────────────── */
th, td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--site-divider);
}

th {
  font-weight: var(--weight-bold);
  color: var(--site-text-bright);
}

/* ── Header ──────────────────────────── */
header {
  text-align: center;
  margin-bottom: var(--space-8);
}

header.site-header-home::after {
  content: "";
  display: block;
  width: 100px;
  height: 1px;
  background: var(--site-text-muted);
  margin: var(--space-5) auto 0;
}

header.site-header h1 {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--site-text);
}

header h1 a {
  text-decoration: none;
  color: inherit;
}

/* ── Footer ──────────────────────────── */
footer {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  font-size: var(--text-sm);
  color: var(--site-text-muted);
}

footer .license {
  margin-top: var(--space-4);
}

.post-subscribe-bio {
  text-align: center;
  font-size: var(--text-base);
  color: var(--site-text-muted);
  margin-top: var(--space-8);
}

.subscribe-form {
  display: flex;
  justify-content: center;
  margin-top: var(--space-5);
}

.subscribe-form .pill-input {
  font-family: var(--font-mono);
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-4);
  background: var(--site-bg);
  border-color: var(--site-divider);
}

.subscribe-form .pill-input button {
  color: var(--site-bg);
  background: var(--site-text-bright);
}

.subscribe-form input[type="email"] {
  width: 180px;
  font-size: var(--text-sm);
}

/* ── Article ─────────────────────────── */
article {
  position: relative;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-8);
}

a.article-link {
  position: absolute;
  inset: 0;
}

article:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

article time {
  font-size: var(--text-sm);
  color: var(--site-text-muted);
  display: block;
}

article h2 {
  margin-bottom: var(--space-4);
}

article img {
  margin-bottom: var(--space-6);
}

article h2 a {
  color: var(--site-text-bright);
  text-decoration: none;
}

article h2 a:hover {
  color: var(--site-text-muted);
}

/* ── Post body ───────────────────────── */
.post-body {
  font-size: var(--text-lg);
}

.post-body a,
.page-body a {
  color: var(--site-accent);
}

.page-body {
  font-size: var(--text-lg);
}

/* ── Site header avatar ──────────────── */
.site-header img[alt="avatar"] {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  object-fit: cover;
  margin: 0 auto var(--space-4);
}

/* ── Social links ────────────────────── */
.social-links {
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.social-links a {
  color: var(--site-text-muted);
  text-decoration: none;
  margin: 0 var(--space-2);
}

.social-links a:hover {
  color: var(--site-text-bright);
}

/* ── Nav ─────────────────────────────── */
nav {
  font-size: var(--text-sm);
}

nav a {
  color: var(--site-text-muted);
  text-decoration: none;
  margin-left: var(--space-4);
}

nav a:hover {
  color: var(--site-text-bright);
}

/* ── Page nav ────────────────────────── */
.page-nav {
  display: inline-block;
  position: relative;
  margin-bottom: var(--space-8);
  font-size: var(--text-base);
}

.page-nav a {
  color: var(--site-accent);
  text-decoration: none;
  text-transform: lowercase;
  margin: 0;
}

.page-nav a:hover {
  color: var(--site-text-bright);
}

.page-nav-sep {
  color: var(--site-text-muted);
  margin: 0 var(--space-2);
}

.page-nav-draft {
  opacity: 0.5;
}

/* ── Inline nav management ──────────── */
.page-nav-item {
  display: inline;
  position: relative;
}

.page-nav-item.dragging {
  opacity: 0.4;
}

.page-nav-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  white-space: nowrap;
  border-radius: var(--radius-full);
  border: 1px solid var(--site-text-muted);
  font-size: var(--text-sm);
  color: var(--site-text-muted);
  vertical-align: middle;
  line-height: 1;
  transition: color var(--speed-fast), border-color var(--speed-fast);
}

.page-nav-add--pill {
  width: auto;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
}

.page-nav-add:hover {
  color: var(--site-text-bright);
  border-color: var(--site-text-bright);
}

.page-nav-item ~ .page-nav-add-wrap {
  position: absolute;
  left: calc(100% + var(--space-5));
  top: 50%;
  transform: translateY(-50%);
}

input.page-nav-add-input {
  position: absolute;
  left: calc(100% + var(--space-3));
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  width: 10ch;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  border-radius: var(--radius-pill);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--speed-normal), transform var(--speed-normal);
}

input.page-nav-add-input.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

/* ── Homepage layout ────────────────── */
.has-sidebar main {
  max-width: var(--content-width);
}

.site-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--space-10);
  align-items: start;
  min-width: 0;
}

.site-layout > * {
  min-width: 0;
}

@media (max-width: 864px) {
  main:has(.admin-menu) {
    padding-top: var(--space-10);
  }

  .site-layout {
    grid-template-columns: 1fr;
  }

  .site-sidebar {
    margin-top: var(--space-8);
    border-top: 1px solid color-mix(in srgb, var(--site-divider), transparent 50%);
    padding-top: var(--space-8);
  }
}

/* ── Sidebar ────────────────────────── */
.site-sidebar {
  position: sticky;
  top: var(--space-6);
}

.sidebar-avatar {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
}

.sidebar-title {
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

.sidebar-bio {
  font-size: var(--text-sm);
  color: var(--site-text-muted);
  margin-bottom: var(--space-2);
}

.site-sidebar .subscribe-form {
  justify-content: flex-start;
  margin-top: var(--space-4);
  margin-bottom: var(--space-5);
}

.site-sidebar .social-links {
  margin-bottom: var(--space-5);
}

.site-sidebar .social-links a {
  margin: 0 var(--space-2) 0 0;
}

.sidebar-section {
  margin-top: var(--space-6);
}

.sidebar-section:first-child {
  margin-top: 0;
}

.sidebar-section h3 {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--site-text-muted);
  margin-bottom: var(--space-3);
}

.sidebar-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-section li {
  margin-bottom: var(--space-2);
}

.blogroll-item {
  display: flex;
  align-items: start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--site-text-muted);
}

.blogroll-icon {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  margin-bottom: 0;
  margin-top: 2px;
}

.blogroll-icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--site-code-bg);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--site-text-muted);
}

.blogroll-item-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.blogroll-item-name {
  text-decoration: none;
  color: var(--site-text);
}

.blogroll-item-name:hover {
  color: var(--site-text-bright);
}

.blogroll-item-meta {
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
  min-width: 0;
}

.blogroll-item-post {
  font-size: var(--text-xs);
  color: var(--site-text-muted);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.blogroll-item-post:hover {
  color: var(--site-text-bright);
}

.blogroll-item-time {
  font-size: var(--text-xs);
  color: var(--site-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.blogroll-see-all {
  display: block;
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--site-text-muted);
}

.blogroll-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blogroll-list li {
  margin-bottom: var(--space-3);
}

/* ── Empty state ────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-6) 0;
}

.empty-state-text {
  font-size: var(--text-lg);
  color: var(--site-text-muted);
  margin-bottom: var(--space-5);
}
