/*
 * Editorial polish — sits on top of poole.css + hyde.css.
 * Keeps existing fonts (PT Sans, Abril Fatface, Menlo) and layout.
 */

:root {
  --text: #2b2b2b;
  --text-soft: #5a5a5a;
  --text-muted: #8a8a8a;
  --heading: #1a1a1a;
  --rule: #eceae6;
  --paper: #fdfcfa;
  --code-bg: #f5f2ec;
  --code-fg: #8a3a3a;
  --link: #1f6f9f;
  --link-hover: #0f4a70;
  --sidebar-bg: #1e1e1e;
  --sidebar-bg-2: #2a2a2a;
}

::selection { background: #f4e3b8; color: #1a1a1a; }

/* ---------- Body ---------- */
body {
  color: var(--text);
  background-color: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 38em) {
  html { font-size: 19px; }
}
@media (min-width: 58em) {
  html { font-size: 20px; }
}

/* ---------- Headings ---------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--heading);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
h1 { font-size: 2.25rem; margin-top: 0; }
h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}
h3 {
  font-size: 1.2rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: #2a2a2a;
}

/* ---------- Paragraphs ---------- */
p {
  margin-bottom: 1.15rem;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Editorial drop-cap-ish first paragraph on individual posts */
.post > .post-date + p:first-of-type::first-letter,
.post > h1 + .post-date + p:first-of-type::first-letter,
.post > h1 + p:first-of-type::first-letter {
  font-family: "Abril Fatface", serif;
  font-size: 3.4rem;
  line-height: 0.85;
  float: left;
  padding: 0.35rem 0.6rem 0 0;
  color: var(--heading);
}

/* ---------- Links ---------- */
.content a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(31, 111, 159, 0.25);
  transition: border-color 120ms ease, color 120ms ease;
}
.content a:hover,
.content a:focus {
  color: var(--link-hover);
  border-bottom-color: var(--link-hover);
  text-decoration: none;
}

/* ---------- Blockquotes — magazine pull-quote feel ---------- */
blockquote {
  border-left: 3px solid #c9b78a;
  background: linear-gradient(to right, rgba(201, 183, 138, 0.08), transparent 70%);
  color: #3a3a3a;
  font-style: italic;
  padding: 0.9rem 1.25rem;
  margin: 1.75rem 0;
}
blockquote p {
  font-size: 1.08rem;
  line-height: 1.55;
}
blockquote p:last-child { margin-bottom: 0; }
blockquote a {
  color: #6a4a1f !important;
  border-bottom-color: rgba(106, 74, 31, 0.3) !important;
}

/* ---------- Horizontal rule ---------- */
hr {
  border: 0;
  margin: 2.5rem auto;
  width: 40%;
  border-top: 1px solid var(--rule);
}

/* ---------- Code ---------- */
code {
  background-color: var(--code-bg);
  color: var(--code-fg);
  font-size: 0.85em;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}
pre {
  background-color: #f7f4ee;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.1rem;
  line-height: 1.5;
  overflow-x: auto;
}
pre code {
  background: none;
  border: none;
  color: #2b2b2b;
  padding: 0;
}

/* ---------- Images ---------- */
img {
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06),
              0 6px 18px rgba(0, 0, 0, 0.06);
  margin: 1.5rem auto;
}

/* ---------- Lists ---------- */
ul, ol { padding-left: 1.4rem; }
li { margin-bottom: 0.35rem; }
li::marker { color: var(--text-muted); }

/* ---------- Tables ---------- */
table {
  border: none;
  border-top: 2px solid var(--heading);
  border-bottom: 2px solid var(--heading);
  font-size: 0.95rem;
}
th {
  border: none;
  border-bottom: 1px solid var(--text);
  text-align: left;
  font-weight: 700;
  padding: 0.5rem 0.6rem;
}
td {
  border: none;
  padding: 0.45rem 0.6rem;
}
tbody tr:nth-child(odd) td,
tbody tr:nth-child(odd) th {
  background-color: rgba(0, 0, 0, 0.02);
}

/* ---------- Post list (home) ---------- */
.posts .post {
  margin-bottom: 3.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}
.posts .post:last-child {
  border-bottom: none;
}

.post-title {
  font-size: 1.85rem;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}
.post-title a {
  color: var(--heading);
  border-bottom: none;
}
.post-title a:hover {
  color: var(--link);
  border-bottom: none;
}

.post-date {
  display: block;
  margin-top: 0;
  margin-bottom: 1.1rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Drop-cap should not apply on the home/list view (excerpts) */
.posts .post p:first-of-type::first-letter {
  font-family: inherit;
  font-size: inherit;
  float: none;
  padding: 0;
  color: inherit;
}

/* ---------- Read more ---------- */
.read-more-link {
  margin-top: 0.5rem;
}
.read-more-link a {
  display: inline-block;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
  border-bottom: 1px solid var(--text-muted);
  padding-bottom: 1px;
}
.read-more-link a:hover {
  color: var(--heading);
  border-bottom-color: var(--heading);
}

/* ---------- Signature ---------- */
.signature {
  margin-top: 3rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}

/* ---------- Content width — a touch wider for editorial feel ---------- */
@media (min-width: 48em) {
  .content { max-width: 40rem; }
}
@media (min-width: 64em) {
  .content { max-width: 42rem; }
}

/* ---------- Sidebar — refined, still dark grey ---------- */
.sidebar {
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: rgba(255, 255, 255, 0.55);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-about h1 {
  font-size: 2.85rem;
  line-height: 1;
  letter-spacing: -0.01em;
}
.sidebar-about a {
  border-bottom: none;
}
.sidebar-about .lead {
  font-size: 1.02rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.5rem;
  font-style: italic;
}

.sidebar a {
  border-bottom: none;
  transition: color 120ms ease;
}
.sidebar-nav {
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
}
.sidebar-nav-item {
  padding: 0.15rem 0;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.7);
}
a.sidebar-nav-item:hover,
a.sidebar-nav-item:focus {
  color: #fff;
  text-decoration: none;
}

.sidebar-sticky p:last-child {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.04em;
}
.sidebar-sticky p:last-child a {
  color: rgba(255, 255, 255, 0.55);
}
.sidebar-sticky p:last-child a:hover {
  color: #fff;
}

/* ---------- Focus states ---------- */
a:focus-visible {
  outline: 2px solid #c9b78a;
  outline-offset: 2px;
  border-radius: 2px;
}
