/* adityamishra.in — one stylesheet for the whole site.
   The accent colour is set in _config.yml (accent:) and arrives here as --accent. */

:root {
  --text: #37352f;
  --text-strong: #2b2a27;
  --text-muted: #5f5e5a;
  --text-faint: #6f6e69;
  --rule: #e6e4df;
  --rule-light: #f1f0ec;
  --tint: #f7f6f3;
  --accent: #C93A27;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #ffffff;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 20px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-strong);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

/* ---------- Header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 28px;
  padding: 24px 32px;
  border-bottom: 1px solid var(--accent);
}
.site-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  font-size: 17px;
}
.site-nav a { color: #4a4945; text-decoration: none; }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* ---------- Page containers ---------- */

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 24px 112px;
}
.container-narrow { max-width: 720px; padding-top: 72px; }

h1, h2, h3, h4 { color: var(--text-strong); }

.page-title,
.intro h1 {
  margin: 0 0 24px;
  font-size: 56px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--accent);
}

/* ---------- Home ---------- */

.intro {
  display: flex;
  flex-wrap: wrap;
  gap: 36px 56px;
  align-items: flex-start;
}
.intro-text { flex: 999 1 420px; min-width: 0; }
.intro-text p { margin: 0 0 18px; }
.intro-text p:last-child { margin-bottom: 0; }
.intro-photo { flex: 1 1 190px; max-width: 210px; margin: 10px 0 0; }
.intro-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 6;
  object-fit: cover;
  border-radius: 4px;
}

.home-sections h2 {
  margin: 80px 0 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  font-size: 24px;
  font-weight: 600;
  color: var(--accent);
}
.home-sections h2 + * { margin-top: 0; }
.home-sections h2 ~ h2 { margin-top: 64px; }
.home-sections p { margin: 0 0 10px; }
.home-sections ul { margin: 0; padding-left: 22px; }
.home-sections li + li { margin-top: 12px; }
.home-sections strong { font-weight: 600; }
.home-sections .muted { color: var(--text-faint); }

/* ---------- Notes index (page layout) ---------- */

.layout-page .prose > h2 {
  margin: 72px 0 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  font-size: 28px;
  color: var(--accent);
}
.layout-page .prose > h2 + p { margin-top: 20px; color: var(--text-muted); font-size: 19px; }
.layout-page .prose > h3 { margin: 40px 0 8px; font-size: 21px; }
.layout-page .prose > h3 + p { color: var(--text-muted); font-size: 18px; }

/* ---------- Article ---------- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-faint);
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.article-title {
  margin: 0 0 20px;
  font-size: 52px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.standfirst {
  margin: 0 0 44px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--rule);
  font-size: 22px;
  line-height: 1.55;
  color: var(--text-muted);
}

.more {
  margin-top: 56px;
  padding: 28px 28px 24px;
  background: var(--tint);
  border-radius: 4px;
}
.more h2 { margin: 0 0 14px; font-size: 18px; color: var(--accent); }
.more ul { margin: 0; padding-left: 22px; font-size: 19px; line-height: 1.6; }
.more li + li { margin-top: 8px; }

/* ---------- Prose: every element an article can use ---------- */

.prose p { margin: 0 0 24px; line-height: 1.7; }
.prose strong { font-weight: 600; color: var(--text-strong); }

.prose h2 {
  margin: 56px 0 18px;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent);
}
.prose h3 { margin: 40px 0 14px; font-size: 24px; line-height: 1.3; font-weight: 600; }
.prose h4 { margin: 32px 0 10px; font-size: 20px; line-height: 1.4; font-weight: 600; color: #4a4945; }
.prose > :first-child { margin-top: 0; }

.prose ul, .prose ol { margin: 0 0 24px; padding-left: 28px; line-height: 1.7; }
.prose li + li { margin-top: 8px; }
.prose li > ul, .prose li > ol { margin: 8px 0 0; padding-left: 24px; }
.prose li > ol { list-style-type: lower-alpha; }
.prose li > p { margin: 0 0 8px; }

.prose blockquote {
  margin: 40px 0;
  padding: 4px 0 4px 26px;
  border-left: 3px solid var(--accent);
  font-size: 21px;
  line-height: 1.6;
  color: var(--text-strong);
}
.prose blockquote p { margin: 0 0 12px; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote .attribution { font-size: 16px; color: var(--text-faint); }

.prose .pullquote {
  margin: 48px 0;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 30px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.prose img { display: block; border-radius: 4px; }
.prose .caption {
  margin-top: -12px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-faint);
}

.prose table {
  display: block;
  overflow-x: auto;
  width: 100%;
  margin: 0 0 32px;
  border-collapse: collapse;
  font-size: 17px;
  line-height: 1.5;
}
.prose th, .prose td { padding: 10px 14px; text-align: left; }
.prose th:first-child, .prose td:first-child { padding-left: 0; }
.prose th { border-bottom: 2px solid var(--text-strong); font-weight: 600; }
.prose td { border-bottom: 1px solid var(--rule); }

.prose code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: #f4f3ef;
  padding: 2px 6px;
  border-radius: 3px;
}
.prose pre {
  margin: 0 0 24px;
  padding: 16px 18px;
  overflow-x: auto;
  background: #f4f3ef;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1.55;
}
.prose pre code { background: none; padding: 0; font-size: inherit; }

.prose hr {
  width: 64px;
  margin: 48px auto;
  border: 0;
  border-top: 2px solid var(--accent);
}

/* Footnote markers in the text */
.prose sup { font-size: 13px; line-height: 0; margin-left: 2px; }
.prose a.footnote { text-decoration: none; color: var(--accent); font-weight: 600; }

/* "## Sources" at the end of an article: smaller and quieter than other headings */
.prose h2#sources {
  margin: 56px 0 14px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 18px;
  letter-spacing: 0;
  color: var(--text-strong);
}
.prose h2#sources + ul,
.prose h2#sources + ol { font-size: 17px; line-height: 1.6; color: var(--text-muted); }
.prose h2#sources + ul li + li,
.prose h2#sources + ol li + li { margin-top: 6px; }

/* Footnotes block, added by Jekyll at the very end of an article */
.prose .footnotes {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
}
.prose .footnotes::before {
  content: "Footnotes";
  display: block;
  margin-bottom: 14px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-strong);
}
.prose .footnotes ol { padding-left: 22px; font-size: 17px; }
.prose .footnotes p { margin: 0; line-height: 1.6; }
.prose a.reversefootnote { text-decoration: none; color: var(--accent); margin-left: 4px; }

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
  body { font-size: 18px; }
  .site-header { padding: 18px 20px; }
  .site-nav { font-size: 16px; gap: 6px 18px; }
  .container { padding: 48px 20px 80px; }
  .page-title, .intro h1 { font-size: 42px; }
  .article-title { font-size: 40px; }
  .standfirst { font-size: 20px; }
  .prose h2 { font-size: 26px; }
  .prose .pullquote { font-size: 24px; }
  .prose blockquote { font-size: 19px; }
}
