/* =============================================
   Body font size — one Tailwind step up from text-lg (1.125rem)
   to text-xl (1.25rem). Applies to all non-header body text.
   Nav links use explicit text-base (1rem) so they are unaffected.
   ============================================= */
body {
  font-size: 1.25rem !important;
}

/* =============================================
   Page background — light 10% darker, dark 10% lighter
   (overrides Blowfish's bg-neutral / dark:bg-neutral-800)
   Light base: rgb(255,255,255) → 10% darker = rgb(229,229,229)
   Dark base:  rgb(31,41,55)   → 10% lighter = rgb(53,62,75)
   ============================================= */
html:not(.dark) body {
  background-color: rgb(229, 229, 229) !important;
  color: rgb(44, 52, 65);
}

html:not(.dark) .prose {
  --tw-prose-body: rgb(44, 52, 65);
  --tw-prose-headings: rgb(25, 33, 44);
  --tw-prose-quotes: rgb(44, 52, 65);
  --tw-prose-counters: rgb(25, 33, 44);
  --tw-prose-pre-code: rgb(44, 52, 65);
}
html.dark body {
  background-color: rgb(43, 50, 61) !important;
}

/* =============================================
   Logo dark/light mode switching
   Both modes render at identical dimensions via
   the shared .landing-logo / .header-logo rules.
   ============================================= */
.logo-dark {
  display: none;
}
.logo-light {
  display: block;
}
.dark .logo-dark {
  display: block;
}
.dark .logo-light {
  display: none;
}

/* Ensure both logo images fill their container identically */
.landing-logo img,
.header-logo-wrap img {
  width: 100%;
  height: auto;
}

/* =============================================
   Link colors — dark slate blue-gray
   ============================================= */
html:not(.dark) a,
html:not(.dark) .prose a {
  color: rgb(15, 17, 21) !important;
  font-weight: bold;
}
html:not(.dark) a:hover,
html:not(.dark) .prose a:hover {
  color: rgb(8, 9, 11) !important;
}
html.dark a,
html.dark .prose a {
  color: rgb(236, 241, 247) !important;
  font-weight: bold;
}
html.dark a:hover,
html.dark .prose a:hover {
  color: rgb(246, 248, 252) !important;
}

/* =============================================
   Sidenote layout
   ============================================= */
.sidenote-layout {
  position: relative;
  overflow: visible;
}

/* Sidenote reference superscript */
.sidenote-ref {
  font-size: 0.72em;
  font-weight: 600;
  line-height: 0;
  vertical-align: super;
  opacity: 0.7;
  padding: 0 1px;
  cursor: default;
  user-select: none;
}

/* Sidenotes: positioned absolutely — pushed right of prose.
   font-size is intentionally NOT set here so that the `ch` unit
   in `left` is resolved at the inherited body font-size (1.25rem),
   matching .post-prose's own 81ch measurement exactly. */
.sidenote {
  position: absolute;
  left: calc(81ch + 4rem);
  width: 220px;
  top: 0; /* overridden by JS */
  padding: 0 0 0 0.5rem;
  margin: 0;
  border-left: 1.5px solid currentColor;
}

/* Sidenote text — smaller size applied to inner content only */
.sidenote-inner {
  display: block;
  font-size: 0.69em;
  line-height: 1.55;
}

/* Sidenote number prefix — superscript */
.sidenote::before {
  content: attr(data-num);
  font-size: 0.6em;
  font-weight: 600;
  vertical-align: super;
  line-height: 0;
  opacity: 0.8;
  margin-right: 1px;
}

/* Light mode sidenote color */
html:not(.dark) .sidenote {
  color: rgba(55, 55, 55, 0.62);
}

/* Dark mode sidenote color */
.dark .sidenote {
  color: rgba(200, 200, 200, 0.58);
}

/* Collapse sidenotes to inline on screens too narrow for the margin */
@media (max-width: 1280px) {
  .sidenote {
    position: static;
    display: block;
    width: auto;
    left: auto;
    margin: 0.6em 0 0.6em 1.5em;
    padding: 0.4em 0.75em;
    border-left: 2px solid currentColor;
    opacity: 0.72;
  }
}

/* =============================================
   Landing page logo — 60% width (20% larger than original 50%)
   Both dark and light SVGs share the same container so their
   rendered size is always identical regardless of mode.
   ============================================= */
.landing-logo {
  width: 80%;
  max-width: 768px;
  margin: 2rem auto 2.5rem auto;
  display: block;
}

/* =============================================
   Post prose width — 25% wider than Tailwind's max-w-prose (65ch → 81ch)
   ============================================= */
.post-prose {
  max-width: 81ch;
}

/* =============================================
   Post / The End title — 3× body size
   ============================================= */
.post-title {
  font-size: 3em;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* =============================================
   Footer disclaimer
   ============================================= */
.site-disclaimer {
  text-align: center;
  font-size: 0.71em;
  line-height: 1.9;
  padding: 1.25rem 0 0.5rem 0;
  border-top: 1px solid rgba(128, 128, 128, 0.25);
  margin-top: 1.5rem;
}

html:not(.dark) .site-disclaimer {
  color: rgba(60, 60, 60, 0.65);
}

.dark .site-disclaimer {
  color: rgba(200, 200, 200, 0.55);
}

.site-disclaimer p {
  margin: 0;
  padding: 0;
}

/* =============================================
   Post index list: clean spacing
   ============================================= */
.posts-index .article-link--simple {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(128, 128, 128, 0.18);
}

/* =============================================
   Header logo sizing
   ============================================= */
.header-logo {
  height: 78px;
  max-width: 240px;
  object-fit: contain;
}

/* =============================================
   Comments section
   ============================================= */
.comments-section {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(128, 128, 128, 0.25);
}

.comments-heading {
  font-size: 1.4em;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.comments-status {
  font-size: 0.85em;
  opacity: 0.6;
  margin: 0.5rem 0 1rem;
}

.comment-item {
  border-bottom: 1px solid rgba(128, 128, 128, 0.15);
  padding: 0.9rem 0;
}

.comment-meta {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.3rem;
}

.comment-author {
  font-size: 0.9em;
  font-weight: 600;
}

.comment-date {
  font-size: 0.78em;
  opacity: 0.55;
}

.comment-body {
  font-size: 0.88em;
  line-height: 1.6;
  margin: 0;
}

.comment-form {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-form-fields {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9em;
  font-family: inherit;
  border-radius: 4px;
  border: 1px solid rgba(128, 128, 128, 0.35);
  background: transparent;
  color: inherit;
  box-sizing: border-box;
}

.comment-form textarea {
  resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: rgba(128, 128, 128, 0.65);
}

.comment-form button {
  align-self: flex-start;
  padding: 0.45rem 1.1rem;
  font-size: 0.88em;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid rgba(128, 128, 128, 0.45);
  background: transparent;
  color: inherit;
  transition: opacity 0.15s;
}

.comment-form button:hover:not(:disabled) {
  opacity: 0.75;
}

.comment-form button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.comment-error {
  font-size: 0.82em;
  color: #c0392b;
  margin: 0;
}

.dark .comment-error {
  color: #e07070;
}
