/* ═══════════════════════════════════════════════
   ANIRUDH SHARMA'S BLOG
   Blot Journal theme — ET Book on cream
   ═══════════════════════════════════════════════ */

@font-face { font-family: 'ET Book'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/et-book-400.woff') format('woff'); }
@font-face { font-family: 'ET Book'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fonts/et-book-400-italic.woff') format('woff'); }
@font-face { font-family: 'ET Book'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/et-book-600.woff') format('woff'); }

.pull-double { margin-left: -.4248046875em; }
.push-double { margin-right: .4248046875em; }
.pull-single { margin-left: -.1845703125em; }
.push-single { margin-right: .1845703125em; }
.push-double, .push-single { display: inline-block; }

body {
  font-size: 1.4rem;
  line-height: 2rem;
  font-family: 'ET Book', serif;
  color: #111;
  background: #FFFFF8;
  padding: 1.5em 4em 5em;
  word-wrap: break-word;
}

::selection {
  background: #7A2680;
  color: #FFFFF8;
}

a {
  color: #111;
  text-decoration: underline;
}

a:hover {
  text-decoration: underline;
}

/* ── Main Site Link — fixed top right ────── */

.site-link {
  position: fixed;
  top: 24px;
  right: 32px;
  font-style: italic;
  font-size: 1rem;
  color: #111;
  text-decoration: none;
  z-index: 999;
  padding: 4px 12px;
  border: 1.5px solid #111;
  border-radius: 3px;
  transition: background 0.2s ease, color 0.2s ease;
}

.site-link:hover {
  background: #111;
  color: #FFFFF8;
  border-color: #111;
}

/* ── Site Header ─────────────────────────── */

.site-header {
  max-width: 640px;
  margin: 0 auto 1.5em;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.logo {
  font-style: italic;
  font-size: 1.4rem;
  text-decoration: none;
  color: #111;
}

.logo:hover { color: #111; }

.nav {
  display: flex;
  gap: 2em;
}

.nav a {
  font-style: italic;
  font-size: 1.4rem;
  text-decoration: none;
  color: #111;
}

.nav a:hover {
  text-decoration: underline;
}

.back-link {
  color: #545454;
}

.small { font-size: 12px; }
.light { color: Gray; text-decoration: none; }

/* ── Container ───────────────────────────── */

.container {
  position: relative;
  max-width: 640px;
  min-width: 320px;
  margin: 0 auto;
}

/* ── Homepage Post List ──────────────────── */

.container.index {
  padding-top: 0;
}

.post-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0.35em 0;
}

.post-item:hover .post-title {
  text-decoration: underline;
}

.post-title {
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 2rem;
  text-decoration: none;
  display: inline;
}

.post-date {
  font-size: 1rem;
  color: Gray;
  display: inline;
  text-decoration: none;
}

.post-date::before {
  content: " – ";
  color: Gray;
}

/* Pagination */
.pagination {
  margin-top: 2.5rem;
}

.pagination a {
  font-size: 1.4rem;
  color: #111;
  text-decoration: none;
}

.pagination a:hover { text-decoration: underline; }

.pagination .meta {
  font-size: 1.4rem;
  color: #545454;
}

.pagination .meta a {
  color: #545454;
  text-decoration: none;
}

.pagination .meta a:hover { text-decoration: underline; }

/* ── Single Post ─────────────────────────── */

h1, h2, h3, h4, h5, h6 { font-size: inherit; }

h2, h3 { margin-top: 2em; }

.container h1 {
  font-size: 48px;
  line-height: 48px;
  margin-bottom: 1.5rem;
  margin-top: 0;
  font-weight: 400;
}

p.subtitle {
  font-style: italic;
  margin-top: 1rem;
  margin-bottom: 3rem;
  font-size: 1rem;
  display: block;
  line-height: 1;
}

h2 {
  font-style: italic;
  font-weight: 400;
  margin-top: 3.1rem;
  margin-bottom: 1.4rem;
  font-size: 2.2rem;
  line-height: 1;
}

h3 {
  font-style: italic;
  font-weight: 400;
  font-size: 1.7rem;
  margin-top: 2rem;
  margin-bottom: 1.4rem;
  line-height: 1;
}

/* Date spacing for entry */
h1 + .light { margin-top: -0.75em; margin-bottom: 1.5em; }

.post-meta {
  font-size: 1rem;
  color: Gray;
  margin-bottom: 2.5rem;
}

.post-meta a {
  color: Gray;
  text-decoration: none;
}

.post-meta a:hover { text-decoration: underline; }

/* ── Entry Content ───────────────────────── */

.entry {
  margin-top: 1rem;
}

p {
  margin-top: 1.4rem;
  margin-bottom: 1.4rem;
  padding-right: 0;
  vertical-align: baseline;
}

p, li, blockquote, figcaption {
  orphans: 2;
  widows: 2;
}

.entry a {
  color: #111;
  text-decoration: underline;
}

.entry a:hover {
  text-decoration: underline;
}

/* ── Margin Notes (Tufte-style) ──────────── */

.margin {
  position: absolute;
  box-sizing: border-box;
  width: 33%;
  font-size: 1.1rem;
  line-height: 1.3;
}

.margin p { font-style: italic; margin-top: 2px; }

.left.margin {
  right: 0;
  padding-right: 30px;
  text-align: right;
}

.right.margin {
  right: 0;
  padding-left: 30px;
}

.wide {
  width: 158.6666667%;
  margin-left: -29.3333333%;
  overflow: auto;
}

.wide.left, .wide.right { width: 129.3333333%; float: none; }
.wide.left { margin: 0 0 0 -29.3333333%; }
.wide.right { margin: 0 -29.3333333% 0 0; }

.margin p, .column p { margin-top: 2px; }
.margin h1, .margin h2, .margin h3 { margin-top: 0; }

/* ── Images & Figures ────────────────────── */

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

.entry-figure {
  position: relative;
  margin: 1.4rem 0;
  padding: 0;
}

.entry-figure img {
  width: 100%;
  height: auto;
}

.entry-figure figcaption {
  float: right;
  clear: right;
  width: 200px;
  margin-right: -240px;
  margin-top: 0;
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #555;
}

.caption {
  display: block;
  font-style: italic;
}

/* ── Video ───────────────────────────────── */

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin: 1.4rem 0;
}

.video-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

.entry iframe { max-width: 100%; }

/* ── Blockquotes ─────────────────────────── */

blockquote {
  color: #111;
  margin: 21px 40px;
}

blockquote p { margin: 0.5rem 0; }

/* ── Horizontal Rule ─────────────────────── */

hr {
  width: 200px;
  margin: 1.5em auto;
  border: none;
  border-top: 1px solid #111;
  display: block;
}

/* ── Tables ──────────────────────────────── */

table {
  border-collapse: collapse;
  border-spacing: 0;
  box-sizing: border-box;
  font-size: 15px;
  line-height: 24px;
  word-break: keep-all;
}

tr { box-sizing: border-box; border-top: 1px solid #111; padding: 0; }
th, td { box-sizing: border-box; border: 1px solid #111; padding: 5px 12px 6px; }

/* ── Code ────────────────────────────────── */

pre {
  padding: 0.7em 1em;
  margin: 0 -1em;
  overflow-x: auto;
}

pre, code {
  font: inherit;
}

/* Syntax — muted */
.highlight .c, .highlight .cm, .highlight .c1, .highlight .cs { color: #545454; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr { font-weight: 600; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .se { color: #444; }

/* ── KaTeX Math ──────────────────────────── */

.katex { font-size: 1.2em; }

/* ── Footnotes ───────────────────────────── */

.footnote-ref {
  font-size: 12px;
  line-height: 0.5em;
  vertical-align: baseline;
  position: relative;
  top: -0.4em;
}

/* ── Lists ───────────────────────────────── */

ul.task-list { list-style-type: none; }

/* ── Columns ─────────────────────────────── */

.column { box-sizing: border-box; float: left; }
.column.two { width: 50%; padding-right: 12px; }
.column.two + .column.two { padding: 0 0 0 12px; }
.column.three { width: 33.333333%; padding: 0 16px 0 0; }
.column.three + .column.three { padding: 0 8px; }
.column.three + .column.three + .column.three { padding: 0 0 0 16px; }
.clear { width: 100%; clear: both; }

/* ── Post Navigation ─────────────────────── */

.post-nav {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0,0,0,0.1);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.post-nav a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.post-nav a:hover .post-nav__title { text-decoration: underline; }

.post-nav__label {
  font-style: italic;
  font-size: 0.9rem;
  color: Gray;
  margin-bottom: 0.3rem;
}

.post-nav__title {
  font-size: 1.1rem;
  line-height: 1.35;
}

.post-nav .next { text-align: right; }

/* ── Archives ────────────────────────────── */

.archive-year {
  font-weight: 600;
  font-size: 48px;
  line-height: 48px;
  margin: 60px 0 20px;
}

.archive-year:first-of-type { margin-top: 1rem; }

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

.archive-list li {
  padding: 0.15rem 0;
}

.archive-list a {
  text-decoration: none;
  color: #111;
}

.archive-list a:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────── */

@media screen and (max-width: 1060px) {
  .margin,
  .margin.right,
  .margin.left {
    position: relative;
    display: block;
    top: auto; left: auto; right: auto; bottom: auto;
  }
  .margin.right { float: right; }
  .margin.left { text-align: left; float: left; }
  .wide, .wide.left, .wide.right { width: 100%; margin: 0; }
  .entry-figure figcaption {
    float: none;
    width: 100%;
    margin-right: 0;
    padding: 0.3rem 0 0;
  }
}

@media screen and (max-width: 900px) {
  .container {
    margin: 1em 0 2em;
    padding-top: 1.5em;
    border-top: 1px solid rgba(0,0,0,0.1);
    min-width: auto;
  }
  .index .margin { display: block; width: 100%; }
  .nav { float: none; display: block; margin: 0; width: 100%; }
  .nav a { margin: 0 1em 0 0; color: #111; }
  .site-header { margin-bottom: 2em; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
}

@media screen and (max-width: 600px) {
  body {
    padding: 0.4em;
    padding-top: 3.5em;
  }
  .margin { width: 40%; }
  .margin.right { padding-left: 16px; }
  .margin.left { padding-right: 16px; }
  .site-link {
    top: 12px;
    right: 12px;
    font-size: 0.85rem;
    padding: 3px 10px;
  }
  .site-header {
    flex-direction: column;
    gap: 0.5rem;
  }
  .nav { gap: 1em; }
}

/* Focus styles */
a:focus-visible {
  outline: 2px solid #7A2680;
  outline-offset: 2px;
}
