/* cameron.stream site theme */

:root {
  --site-bg: #fff;
  --site-surface: #fff;
  --site-text: #1a1a1a;
  --site-text-secondary: #2a2a2a;
  --site-text-muted: #555;
  --site-accent: #b497bf;
  --site-border: #e8e8e8;
  --site-code-bg: #f5f5f5;
  --site-max-width: 640px;
  --site-font-body: "Inter", system-ui, -apple-system, sans-serif;
}

/* Dark mode: explicit toggle or system preference fallback */
:root[data-theme="dark"] {
  --site-bg: #0a0a0a;
  --site-surface: #141414;
  --site-text: #e5e5e5;
  --site-text-secondary: #b0b0b0;
  --site-text-muted: #8a8a8a;
  --site-accent: #c4aacf;
  --site-border: #2a2a2a;
  --site-code-bg: #1a1a1a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --site-bg: #0a0a0a;
    --site-surface: #141414;
    --site-text: #e5e5e5;
    --site-text-secondary: #b0b0b0;
    --site-text-muted: #8a8a8a;
    --site-accent: #c4aacf;
    --site-border: #2a2a2a;
    --site-code-bg: #1a1a1a;
  }
}

/* Inlay dark overrides */
:root[data-theme="dark"] at-inlay-root {
  --text-primary: #ddd;
  --text-body: #bbb;
  --text-secondary: #888;
  background: var(--site-surface);
}
:root[data-theme="dark"] org-atsui-avatar[lift] {
  box-shadow: 0 0 0 3px var(--site-surface);
}
:root[data-theme="dark"] org-atsui-tabs .tabs-bar {
  background: var(--site-surface);
  border-bottom-color: var(--site-border);
}
:root[data-theme="dark"] hr {
  background: var(--site-border);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) at-inlay-root {
    --text-primary: #ddd;
    --text-body: #bbb;
    --text-secondary: #888;
    background: var(--site-surface);
  }
  :root:not([data-theme="light"]) org-atsui-avatar[lift] {
    box-shadow: 0 0 0 3px var(--site-surface);
  }
  :root:not([data-theme="light"]) org-atsui-tabs .tabs-bar {
    background: var(--site-surface);
    border-bottom-color: var(--site-border);
  }
  :root:not([data-theme="light"]) hr {
    background: var(--site-border);
  }
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 1em;
  right: 1em;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--site-text-muted);
  font-size: 1.125rem;
  padding: 0.25em;
  line-height: 1;
  transition: color 0.15s;
  z-index: 10;
}
.theme-toggle:hover {
  color: var(--site-text);
}

body {
  margin: 0;
  font-family: var(--site-font-body);
  background: var(--site-bg);
  color: var(--site-text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Page headings */

h1 {
  font-family: var(--site-font-body);
}

/* Blog post rendered HTML */

.blog-content {
  line-height: 1.7;
  color: var(--site-text);
}

.blog-content h1,
.blog-content h2,
.blog-content h3 {
  font-family: var(--site-font-body);
  color: var(--site-text);
  margin-top: 2em;
  margin-bottom: 0.5em;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.blog-content h1 { font-size: 1.625rem; font-weight: 700; }
.blog-content h2 { font-size: 1.25rem; font-weight: 700; }
.blog-content h3 { font-size: 1.125rem; font-weight: 600; }

.blog-content p {
  margin: 1em 0;
}

.blog-content a {
  color: var(--site-accent);
  text-decoration: none;
}
.blog-content a:hover {
  text-decoration: underline;
}

.blog-content code {
  font-family: "SF Mono", "Menlo", monospace;
  font-size: 0.875em;
  background: var(--site-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.blog-content pre {
  background: var(--site-code-bg);
  padding: 1em;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.875em;
  line-height: 1.5;
  margin: 1.5em 0;
}

.blog-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.blog-content blockquote {
  border-left: 3px solid var(--site-border);
  margin: 1.5em 0;
  padding: 0.5em 1em;
  color: var(--site-text-secondary);
}

.blog-content img {
  max-width: 100%;
  border-radius: 8px;
}

.blog-content .bluesky-embed {
  margin: 1.5em auto;
  max-width: 100%;
}

.blog-content ul, .blog-content ol {
  padding-left: 1.5em;
}

.blog-content li {
  margin: 0.3em 0;
}

/* Nav */

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5em;
  padding: 1em 0;
  font-size: 0.875rem;
}

.site-nav a {
  color: var(--site-text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.site-nav a:hover {
  color: var(--site-text);
}

/* Post list items */

.post-item {
  padding: 1em 0;
}
.post-item + .post-item {
  border-top: 1px solid var(--site-border);
}

.post-date {
  font-size: 0.8125rem;
  color: var(--site-text-muted);
}

.post-title {
  font-family: var(--site-font-body);
  font-weight: 600;
  color: var(--site-text);
  text-decoration: none;
  line-height: 1.3;
}
.post-title:hover {
  color: var(--site-accent);
}

.post-summary {
  font-size: 0.9rem;
  color: var(--site-text-secondary);
  margin-top: 0.3em;
  line-height: 1.5;
}

/* Annotations */

.annotations-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.annotation-item {
  padding: 0.75em 0;
}
.annotation-item + .annotation-item {
  border-top: 1px solid var(--site-border);
}

.annotation-body {
  font-size: 0.9rem;
  margin: 0.3em 0 0;
  line-height: 1.5;
}

.annotation-quote {
  font-size: 0.8125rem;
  color: var(--site-text-secondary);
  border-left: 2px solid var(--site-accent);
  padding-left: 0.75em;
  margin: 0.4em 0;
  font-style: italic;
}

.annotation-meta {
  display: flex;
  gap: 0.75em;
  align-items: center;
  margin-top: 0.3em;
  font-size: 0.75rem;
  color: var(--site-text-muted);
}

/* Endorsements */

.endorsements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75em;
}

.endorsement-card {
  padding: 0.75em 1em;
  border: 1px solid var(--site-border);
  border-radius: 6px;
  transition: border-color 0.15s;
}
.endorsement-card:hover {
  border-color: var(--site-accent);
}

.endorsement-name {
  color: var(--site-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.endorsement-name:hover {
  color: var(--site-accent);
}

.endorsement-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.3em;
  font-size: 0.75rem;
  color: var(--site-text-muted);
}

/* Margin annotations */

.margin-annotations {
  margin-top: 2em;
  padding-top: 1.5em;
  border-top: 1px solid var(--site-border);
}

.margin-annotation {
  padding: 0.75em 0;
}
.margin-annotation + .margin-annotation {
  border-top: 1px solid var(--site-border);
}

.margin-highlight {
  font-size: 0.8125rem;
  color: var(--site-text-secondary);
  border-left: 2px solid var(--site-accent);
  padding-left: 0.75em;
  margin: 0 0 0.4em 0;
  font-style: italic;
}

.margin-body {
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.5;
}

.margin-meta {
  font-size: 0.75rem;
  color: var(--site-text-muted);
  margin-top: 0.3em;
  display: flex;
  gap: 0.75em;
}

.margin-meta a {
  color: var(--site-accent);
  text-decoration: none;
}

/* Feed */

.feed {
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

.feed-post {
  padding: 0.75em 0;
}
.feed-post + .feed-post {
  border-top: 1px solid var(--site-border);
}

.feed-post-header {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.4em;
}

.feed-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.feed-avatar-sm {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.feed-display-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.feed-handle {
  color: var(--site-text-muted);
  font-size: 0.8rem;
  margin-left: 0.25em;
}

.feed-time {
  color: var(--site-text-muted);
  font-size: 0.75rem;
  text-decoration: none;
  margin-left: 0.5em;
}
.feed-time:hover {
  text-decoration: underline;
}

.feed-text {
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.feed-link {
  color: var(--site-accent);
  text-decoration: none;
  word-break: break-all;
}
.feed-link:hover {
  text-decoration: underline;
}

.feed-mention {
  color: var(--site-accent);
  text-decoration: none;
}

/* Feed images */

.feed-images {
  margin-top: 0.5em;
  border-radius: 8px;
  overflow: hidden;
  max-height: 240px;
}
.feed-images img {
  width: 100%;
  display: block;
  max-height: 240px;
  object-fit: cover;
}
.feed-images-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.feed-images-grid img {
  aspect-ratio: 1;
  object-fit: cover;
}

/* Feed link card */

.feed-card {
  display: flex;
  margin-top: 0.5em;
  border: 1px solid var(--site-border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.feed-card:hover {
  border-color: var(--site-text-muted);
}
.feed-card-thumb {
  width: 100px;
  object-fit: cover;
  flex-shrink: 0;
}
.feed-card-body {
  padding: 0.5em 0.75em;
  min-width: 0;
}
.feed-card-title {
  font-weight: 600;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-card-desc {
  font-size: 0.75rem;
  color: var(--site-text-secondary);
  margin-top: 0.15em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-card-url {
  font-size: 0.7rem;
  color: var(--site-text-muted);
  margin-top: 0.25em;
}

/* Feed quote post */

.feed-quote {
  margin-top: 0.5em;
  border: 1px solid var(--site-border);
  border-radius: 8px;
  padding: 0.5em 0.75em;
}
.feed-quote-author {
  display: flex;
  align-items: center;
  gap: 0.35em;
  margin-bottom: 0.25em;
}
.feed-quote-text {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--site-text-secondary);
}

/* Feed stats */

.feed-stats {
  display: flex;
  gap: 1em;
  margin-top: 0.4em;
  font-size: 0.75rem;
  color: var(--site-text-muted);
}

/* Semble */

.semble-collections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75em;
}

.semble-collection-card {
  display: block;
  padding: 0.75em 1em;
  border: 1px solid var(--site-border);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.semble-collection-card:hover {
  border-color: var(--site-accent);
}

.semble-collection-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--site-text);
}

.semble-collection-desc {
  font-size: 0.8125rem;
  color: var(--site-text-secondary);
  margin-top: 0.2em;
  line-height: 1.4;
}

.semble-collection-meta {
  font-size: 0.75rem;
  color: var(--site-text-muted);
  margin-top: 0.4em;
}

.semble-cards {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.semble-card-item {
  padding: 0.75em 0;
}
.semble-card-item + .semble-card-item {
  border-top: 1px solid var(--site-border);
}

.semble-card-item a:hover {
  color: var(--site-accent);
}

.semble-card-note {
  font-size: 0.8125rem;
  color: var(--site-text-secondary);
  border-left: 2px solid var(--site-accent);
  padding-left: 0.75em;
  margin: 0.3em 0;
  font-style: italic;
}

.semble-card-meta {
  display: flex;
  gap: 0.75em;
  font-size: 0.75rem;
  color: var(--site-text-muted);
  margin-top: 0.3em;
}

/* Responsive: stack columns on mobile */

@media (max-width: 680px) {
  .page-container {
    max-width: 100% !important;
  }
}
