/* www.plagianakos.gr: one hand-written stylesheet. Mobile first, system fonts,
   no animations, no external resources. */

:root {
  --text: #1f2328;
  --muted: #59636e;
  --bg: #fdfdfc;
  --rule: #d8dbde;
  --accent: #8a2a1e;
  --accent-hover: #5e1c14;
  --measure: 42rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e6e6e3;
    --muted: #a3a8ad;
    --bg: #17191b;
    --rule: #33373b;
    --accent: #f0a090;
    --accent-hover: #ffc4b8;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* Layout */

.site-header,
main,
.site-footer {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* A centred masthead: the name, a one-line tagline, then the nav. */

.site-header {
  padding-block: 2.25rem 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  text-align: center;
}

.site-name {
  margin: 0;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.2;
}

.tagline {
  margin: 0.25rem 0 1.25rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-name a {
  color: var(--text);
  text-decoration: none;
}

.site-header nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.site-header nav li {
  margin: 0;
}

/* The current page and hover get a 2px accent bar, sitting on the rule. */
.site-header nav a {
  display: inline-block;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

main {
  padding-block: 1.5rem 3rem;
}

.site-footer {
  padding-block: 1rem 2rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.875rem;
}

/* Content */

h1,
h2,
h3,
h4 {
  font-family: var(--sans);
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
}

h1 {
  font-size: 1.75rem;
  margin-top: 0.5rem;
}

h2 {
  font-size: 1.375rem;
  clear: both; /* sections start below the Home portrait, so lists never wrap beside it */
}

h3 {
  font-size: 1.125rem;
}

p,
ul,
ol,
dl,
blockquote,
table {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.25rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.portrait {
  display: block;
  width: 10rem;
  margin: 0 0 1rem;
  border-radius: 2px;
}

sup {
  line-height: 0;
}

/* Publications: each section has a year index, then its entries under one
   heading per year. Authors, title, venue and year each look different. */

.year-index li {
  margin: 0;
}

.year-index ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

/* A thin rule runs from each year to the right edge. */
.publications-section h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.publications-section h3::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
}

/* Entries are numbered [1], [2], … through the whole section, across years,
   in a hanging gutter. */
.publications-section {
  counter-reset: publication;
}

.publications {
  padding: 0;
  list-style: none;
}

.publications li {
  position: relative;
  padding-left: 2.75rem;
  counter-increment: publication;
}

.publications li::before {
  content: "[" counter(publication) "]";
  position: absolute;
  left: 0;
  top: 0.15em;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.publications li + li {
  margin-top: 0.75rem;
}

.citation .authors {
  color: var(--muted);
}

.citation .me {
  color: var(--text);
  font-weight: 600;
}

.citation cite {
  font-style: normal;
  font-weight: 600;
}

.citation .venue {
  font-style: italic;
}

.citation .year {
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

blockquote {
  margin-inline: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}

table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

th,
td {
  padding: 0.375rem 0.75rem 0.375rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

/* Accessibility */

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 1;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  color: var(--accent);
}

/* Wider screens */

@media (min-width: 48rem) {
  body {
    font-size: 1.125rem;
  }

  h1 {
    font-size: 2rem;
  }

  .portrait {
    float: left;
    width: 13rem;
    margin: 0.5rem 1.5rem 1rem 0;
  }
}

@media print {
  .site-header nav,
  .skip-link,
  .site-footer {
    display: none;
  }
}
