/* Note page */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.notes-year {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-wide);
  margin-bottom: 0.75rem;
}

.notes-entries {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.note-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  color: var(--foreground);
  text-decoration: none;
  transition: color 0.15s;
}

.note-item:hover {
  color: var(--primary);
}

.note-item-title {
  font-weight: var(--weight-medium);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.note-item-date {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  white-space: nowrap;
  flex-shrink: 0;
}

.unpublished-note {
  font-size: 0.7em;
  color: var(--red);
  text-transform: uppercase;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  border: 1px solid var(--red);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  vertical-align: middle;
}

.note-header {
  margin-bottom: 2.5rem;
}

.note-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: 0.75rem;
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  font-family: var(--font-mono);
}

/* Article prose */

article {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--foreground);
}

/* Headings */
article h1,
article h2,
article h3,
article h4,
article h5,
article h6 {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--foreground);
}

article h1 { font-size: 1.875rem; margin: 2.5rem 0 1rem; }
article h2 { font-size: 1.5rem;   margin: 2rem 0 0.75rem; }
article h3 { font-size: 1.25rem;  margin: 1.75rem 0 0.5rem; }
article h4 { font-size: 1.125rem; margin: 1.5rem 0 0.5rem; }
article h5 { font-size: 1rem;     margin: 1.25rem 0 0.5rem; }
article h6 { font-size: 0.875rem; margin: 1.25rem 0 0.5rem; text-transform: uppercase; letter-spacing: var(--tracking-wide); }

/* Paragraphs & spacing */
article p {
  margin: 1.25rem 0;
}

article > *:first-child {
  margin-top: 0;
}

/* Links */
article a {
  color: var(--primary);
  text-decoration: none;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color 0.15s;
}

article a:hover {
  text-decoration: underline;
}

/* Bold & italic */
article strong {
  font-weight: var(--weight-semibold);
}

article em {
  font-style: italic;
}

/* Lists */
article ul,
article ol {
  margin: 1.25rem 0;
  padding-left: 1.5rem;
}

article ul { list-style-type: disc; }
article ol { list-style-type: decimal; }

article li {
  margin: 0.375rem 0;
}

article li > ul,
article li > ol {
  margin: 0.25rem 0;
}

/* Blockquotes */
article blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--primary);
  background: var(--muted);
  color: var(--muted-foreground);
  border-radius: 0 4px 4px 0;
}

article blockquote p {
  margin: 0.5rem 0;
}

article blockquote p:first-child {
  margin-top: 0;
}

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

/* Inline code */
article code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--muted);
  padding: 0.15em 0.35em;
  border-radius: 4px;
}

/* Code blocks */
article pre {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.5;
}

article pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: var(--text-sm);
}

/* Horizontal rules */
article hr {
  margin: 2rem 0;
  border: none;
  border-top: 1px solid var(--border);
}

/* Images */
article img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5rem 0;
}

/* Tables (GFM) */
article table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

article th,
article td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

article th {
  font-weight: var(--weight-semibold);
  background: var(--muted);
}

/* Task lists (GFM) */
article ul:has(> li > input[type="checkbox"]) {
  list-style: none;
  padding-left: 0;
}

article li > input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* Footnotes */
article .footnotes {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

/* Strikethrough (GFM) */
article del {
  text-decoration: line-through;
  color: var(--muted-foreground);
}

/* Sup / Sub */
article sup { vertical-align: super; font-size: 0.75em; }
article sub { vertical-align: sub; font-size: 0.75em; }

/* Details / Summary */
article details {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--muted);
}

article details[open] {
  padding-bottom: 1rem;
}

article details summary {
  cursor: pointer;
  font-weight: var(--weight-semibold);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

article details summary::before {
  content: "▶";
  font-size: 0.65em;
  transition: transform 0.2s;
}

article details[open] summary::before {
  transform: rotate(90deg);
}

article details summary::-webkit-details-marker {
  display: none;
}

article details > *:not(summary) {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* Tags page */

.tags-list {
  list-style: none;
  padding: 0;
  margin: 0 0 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-item {
  display: inline-block;
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  color: var(--primary);
  background: var(--muted);
  padding: 0.3em 0.7em;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.tag-item:hover {
  background: var(--primary);
  color: var(--background);
}

.tag-group {
  margin-bottom: 2.5rem;
}

.tag-group-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  font-family: var(--font-mono);
  color: var(--muted-foreground);
  letter-spacing: var(--tracking-wide);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
}

.tag-notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
