/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Variables (Minimal Mistakes palette) ── */
:root {
  --bg:           #f8f7f4;
  --text:         #494e52;
  --text-dark:    #1a1a1a;
  --link:         #52adc8;
  --link-hover:   #3d8fa8;
  --border:       #f2f3f3;
  --border-mid:   #e0e0e0;
  --muted:        #6c757d;
  --masthead-h:   56px;
  --sidebar-w:    220px;
  --font:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif:   Georgia, "Times New Roman", serif;
}

html {
  scroll-padding-top: calc(var(--masthead-h) + 12px);
  font-size: 16px;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover { color: var(--link-hover); text-decoration: underline; }

/* ── Masthead ── */
.masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--masthead-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.masthead__inner-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
}

.greedy-nav {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
}

.site-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  text-decoration: none;
  margin-right: auto;
  letter-spacing: 0.01em;
}
.site-title:hover { text-decoration: none; color: var(--link); }

.visible-links {
  list-style: none;
  display: flex;
  gap: 0;
}

.visible-links li a {
  display: block;
  padding: 0 16px;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  line-height: var(--masthead-h);
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.visible-links li a:hover {
  color: var(--link);
  border-bottom-color: var(--link);
  text-decoration: none;
}

/* ── Page layout ── */
#main {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: calc(var(--masthead-h) + 32px);
  padding-bottom: 60px;
  padding-left: 16px;
  padding-right: 16px;
  display: flex;
  align-items: flex-start;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding-right: 32px;
  padding-top: 8px;
}

.sidebar.sticky {
  position: sticky;
  top: calc(var(--masthead-h) + 24px);
}

.author__avatar img {
  width: 100%;
  max-width: 160px;
  border-radius: 4px;
  display: block;
  margin-bottom: 12px;
}

.author__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.author__bio {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.6;
}
.author__bio p { margin: 0; }

.author__urls-wrapper {
  border-top: 1px solid var(--border-mid);
  padding-top: 14px;
}

.author__urls {
  list-style: none;
}

.author__urls li {
  padding: 4px 0;
}

.author__urls li a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}
.author__urls li a:hover { color: var(--link); text-decoration: none; }

.author__urls li a i {
  color: var(--muted);
  width: 16px;
  text-align: center;
  font-size: 0.9rem;
}
.author__urls li a:hover i { color: var(--link); }

/* ── Main article ── */
.page {
  flex: 1;
  min-width: 0;
}

.page__content {
  font-size: 0.9375rem;
  line-height: 1.75;
}

.page__content p {
  margin-bottom: 1em;
  color: var(--text);
}

.page__content strong { color: var(--text-dark); font-weight: 600; }

/* ── Headings ── */
.page__content h2 {
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-mid);
  padding-bottom: 8px;
  margin-top: 2em;
  margin-bottom: 1em;
}

.page__content h3 {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-top: 1.5em;
  margin-bottom: 0.6em;
}

/* ── Details / Abstract collapsible ── */
details {
  margin: 0.4em 0 0.8em 0;
  border-left: 3px solid var(--border-mid);
  padding-left: 14px;
}

summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--link);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "▶";
  font-size: 0.6rem;
  transition: transform 0.2s;
  color: var(--muted);
}
details[open] summary::before { transform: rotate(90deg); }

details[open] summary { margin-bottom: 0.5em; }

details p {
  font-size: 0.875rem;
  color: #4a4a4a;
  margin-bottom: 0.5em;
  line-height: 1.7;
}

/* ── Small text (presentation list) ── */
.page__content small {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  display: block;
  margin-top: 0.4em;
  margin-bottom: 0.8em;
}

/* ── Footer ── */
.page__footer {
  background: #f8f7f4;
  color: #aaa;
  text-align: center;
  font-size: 0.78rem;
  padding: 18px 16px;
  margin-top: 40px;
  border-top: 1px solid var(--border-mid);
}

.page__footer-copyright a {
  color: #aaa;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  #main {
    flex-direction: column;
    padding-top: calc(var(--masthead-h) + 20px);
  }
  .sidebar {
    width: 100%;
    position: static;
    padding-right: 0;
    padding-bottom: 24px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-mid);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
  }
  .author__avatar img { max-width: 80px; margin-bottom: 0; }
  .author__content { flex: 1; }
  .author__urls-wrapper { width: 100%; border-top: 1px solid var(--border-mid); padding-top: 12px; }
  .author__urls { display: flex; flex-wrap: wrap; gap: 4px 16px; }
}
