/* Font */
@font-face {
  font-family: 'TT2020Base';
  src: url('../fonts/TT2020Base-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Base */
html {
  font-size: 17px;
}

body {
  font-family: 'TT2020Base', serif;
  line-height: 1.5;
  color: #2E3440;
  background: white;
  margin: 0;
  padding: 0;
}

/* Layout */
main {
  max-width: 40em;
  margin: 0 auto;
  padding: 2rem 1rem;
  text-align: justify;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: 'TT2020Base', serif;
  text-align: left;
}

h1 {
  font-variant: small-caps;
  font-weight: 100;
  font-size: 1.25em;
}

h2 {
  font-variant: small-caps;
  font-weight: 900;
  font-size: 1.125em;
}

h3 {
  font-variant: small-caps;
  font-weight: 300;
  font-size: 1.125em;
}

h4 {
  font-weight: 300;
  font-size: 1em;
}

h6 {
  font-variant: small-caps;
}

/* Links */
a {
  color: #5E81AC;
  text-decoration: underline;
}

a:hover {
  color: #81A1C1;
}

/* Header */
.site-header {
  border-bottom: 1px solid #E5E9F0;
  padding: 1rem;
}

.site-nav {
  max-width: 40em;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.site-logo img {
  height: 40px;
  width: auto;
}

.site-title {
  font-family: 'TT2020Base', serif;
  font-size: 1.1rem;
  color: #2E3440;
  font-variant: small-caps;
}

/* Home page logo */
.home-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.home-logo img {
  max-width: 300px;
  height: auto;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  text-decoration: none;
  color: #2E3440;
}

.nav-links a:hover,
.nav-links a.active {
  color: #5E81AC;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #E5E9F0;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  min-width: 150px;
  z-index: 100;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu li {
  padding: 0;
}

.dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid #E5E9F0;
  padding: 2rem 1rem;
  text-align: center;
  color: #4C566A;
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

/* Person page */
.person-header {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.person-photo {
  width: 150px;
  height: auto;
  border-radius: 4px;
}

.person-title {
  color: #4C566A;
  margin: 0.5rem 0;
}

.person-downloads {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
}

.person-downloads li {
  margin: 0.25rem 0;
}

.person-links {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}

.person-links li {
  display: inline;
}

.person-links li:not(:last-child)::after {
  content: ' · ';
  color: #4C566A;
}

/* Person card (for people overview) */
.person-card {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #E5E9F0;
}

.person-card:last-child {
  border-bottom: none;
}

.person-card-photo {
  width: 100px;
  height: auto;
  border-radius: 4px;
}

.person-card h3 {
  margin: 0;
}

.person-card-title {
  color: #4C566A;
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.person-card-bio {
  margin: 0.5rem 0 0;
}

/* Blog listing */
.post-list {
  list-style: none;
  padding: 0;
}

.post-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.post-thumbnail {
  flex-shrink: 0;
}

.post-thumbnail img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.post-info {
  flex: 1;
}

.post-info h3 {
  margin: 0.25rem 0 0 0;
}

.post-description {
  margin: 0.25rem 0 0 0;
  color: #4C566A;
  font-size: 0.875rem;
}

.post-list time {
  color: #4C566A;
  font-size: 0.875rem;
}

/* Post */
.post-header time {
  display: block;
  color: #4C566A;
  margin-bottom: 1rem;
}

.post-content img {
  display: block;
  margin: 1.5rem auto;
  max-width: 100%;
  height: auto;
}

/* Footnotes and Sidenotes */
.footnotes {
  font-size: 0.875rem;
  color: #4C566A;
  border-top: 1px solid #E5E9F0;
  margin-top: 2rem;
  padding-top: 1rem;
}

.sidenote {
  float: right;
  clear: right;
  margin-right: -12em;
  width: 10em;
  font-size: 0.75em;
  color: #4C566A;
  line-height: 1.4;
  text-align: left;
}

.sidenote-number {
  color: #5E81AC;
}

/* Hide original footnotes when sidenotes are active */
body.sidenotes-active .footnotes {
  display: none;
}

/* Mobile: don't use sidenotes */
@media (max-width: 60em) {
  .sidenote {
    display: none;
  }

  body.sidenotes-active .footnotes {
    display: block;
  }
}

/* Collapsible sections */
details {
  margin: 1.5rem 0;
  border-top: 1px solid #E5E9F0;
  padding-top: 0.5rem;
}

details summary {
  cursor: pointer;
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary h2,
details summary h3 {
  display: inline;
  margin: 0;
}

details summary h2::before,
details summary h3::before {
  content: '+ ';
  color: #5E81AC;
}

details[open] summary h2::before,
details[open] summary h3::before {
  content: '− ';
}

details[open] {
  padding-bottom: 1rem;
}

details h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
