/* www.plagianakos.gr: one hand-written stylesheet in the look of the old
   site's Faculty theme (docs/adr/0001): a dark sidebar fixed on the left,
   pages opening with a grey header band. System fonts, no external
   resources; site.js animates on top of it. */

:root {
  --text: #333;
  --muted: #666;
  --bg: #fcfcfc;
  --band: #d8d8d8;
  --band-alt: #f3f3f3;
  --rule: #ccc;
  --accent: #428bca;
  --accent-hover: #2a6496;
  --highlight: #eadc12;
  --on-highlight: #222;
  --card: #fff;
  --sidebar: #2b2b2b;
  --sidebar-item: #303030;
  --sidebar-item-current: #363636;
  --sidebar-footer: #202020;
  --sidebar-text: #ccc;
  --sidebar-muted: #aaa;
  --sidebar-width: 15.625rem;
  --measure: 50rem;
  --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: #1c1d1f;
    --band: #2c2e31;
    --band-alt: #242528;
    --rule: #43474c;
    --accent: #7fb6ea;
    --accent-hover: #a9cff2;
    --sidebar: #1f1f1f;
    --sidebar-item: #262626;
    --sidebar-item-current: #303030;
    --sidebar-footer: #171717;
    --card: #26282b;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* A thin scrollbar, like the old site's NiceScroll rail. */
  scrollbar-width: thin;
  scrollbar-color: #8a8a8a transparent;
}

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

/* Lenis (smooth scrolling) needs these, from its lenis.css. */

html.lenis,
html.lenis body {
  height: auto;
}

.lenis:not(.lenis-autoToggle).lenis-stopped {
  overflow: clip;
}

.lenis [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/* Hidden by early.js until site.js slides it in. */
.entering main {
  opacity: 0;
}

/* Sidebar: portrait, name and tagline, the menu, then the footer links. */

.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  color: var(--sidebar-text);
  font-family: var(--sans);
  scrollbar-color: #555 var(--sidebar);
}

.profile {
  padding: 1.875rem 0.625rem;
  text-align: center;
}

.avatar {
  display: block;
  width: 7.8125rem;
  height: 7.8125rem;
  margin: 0 auto;
  border-radius: 50%;
  object-fit: cover;
}

.site-name {
  margin: 1.25rem 0 0.625rem;
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1.15;
}

.site-name a {
  color: #fff;
  text-decoration: none;
}

.tagline {
  margin: 0;
  color: var(--sidebar-muted);
  font-size: 0.8125rem;
  font-weight: 300;
  line-height: 1.4;
}

.tagline-line {
  display: block;
}

.tagline-line:first-child {
  margin-bottom: 0.25rem;
  font-size: 1.125rem;
}

.sidebar nav ul,
.social {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar nav li {
  margin: 0;
  border-top: 1px solid #373737;
  border-bottom: 1px solid var(--sidebar);
  background: var(--sidebar-item);
  transition: background-color 0.5s;
}

.sidebar nav li:hover,
.sidebar nav li:has([aria-current="page"]) {
  background: var(--sidebar-item-current);
}

.sidebar nav a {
  display: flex;
  align-items: center;
  min-height: 2.8125rem;
  color: var(--sidebar-text);
  font-size: 0.875rem;
  text-decoration: none;
}

.sidebar nav a:hover {
  color: #f7f7f7;
}

.sidebar nav a[aria-current="page"] {
  color: #fff;
  font-weight: 700;
}

/* Each item's icon sits in a 50px box, the label beyond a soft shadow. */
.sidebar nav .icon {
  flex: none;
  width: 3.125rem;
  height: 1.5rem;
}

.sidebar nav a[aria-current="page"] .icon {
  color: var(--highlight);
}

.sidebar nav span {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding-left: 0.75rem;
  box-shadow: -3px 0 5px -4px #000;
}

.sidebar-footer {
  margin-top: auto;
  padding: 0.5rem 0.625rem 0.375rem;
  border-top: 1px solid #1a1a1a;
  background: var(--sidebar-footer);
  text-align: center;
}

.social {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
}

.social a {
  display: block;
  padding: 0.3125rem 0.375rem;
  color: var(--sidebar-text);
}

.social a:hover {
  color: #fff;
}

.social .icon {
  display: block;
  width: 1rem;
  height: 1rem;
}

.sidebar-footer p {
  margin: 0.125rem 0 0;
  color: var(--sidebar-muted);
  font-size: 0.6875rem;
}

.icon {
  fill: currentColor;
}

/* The menu button, only on phones and only when site.js runs. */
.menu-toggle {
  position: fixed;
  top: 0.375rem;
  left: 0.375rem;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 3.125rem;
  height: 3.125rem;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: var(--sidebar);
  color: #fff;
  cursor: pointer;
}

.menu-toggle[hidden] {
  display: none;
}

.menu-toggle .icon {
  width: 1.75rem;
  height: 1.75rem;
}

/* Pages: a header band (title and opening paragraphs) with a notch pointing
   down into the rest. Both keep to one centred column. */

.page-header,
.page-body {
  padding-inline: max(1rem, calc((100% - var(--measure)) / 2));
}

.page-header {
  display: flow-root; /* holds the floated Home portrait */
  position: relative;
  padding-block: 4.375rem 3rem;
  background: var(--band);
}

.page-header::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 1;
  margin-left: -1.875rem;
  border: 1.875rem solid transparent;
  border-top-color: var(--band);
  border-bottom-width: 0;
}

.page-body {
  padding-block: 3.5rem 4.375rem;
}

.page-header > :last-child {
  margin-bottom: 0;
}

/* Content */

h1,
h2,
h3,
h4 {
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.2;
  margin: 2.5rem 0 1rem;
}

h1 {
  margin: 0 0 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
  font-size: 2.5rem;
}

h2 {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1.875rem;
  clear: both; /* sections start below the Home portrait, so lists never wrap beside it */
}

.page-body > h2:first-child,
.page-body > .career > section:first-child > h2,
.page-body > .publication-sections > section:first-child h2 {
  margin-top: 0;
}

h3 {
  font-size: 1.375rem;
}

p,
ul,
ol,
dl,
blockquote,
table {
  margin-top: 0;
  margin-bottom: 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);
}

/* Where links to a heading or the Publications land, clear of the menu
   button on phones. */
[id] {
  scroll-margin-top: 4rem;
}

#main {
  scroll-margin-top: 0;
}

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

.sidebar :focus-visible,
.menu-toggle:focus-visible {
  outline-color: var(--highlight);
  outline-offset: -2px;
}

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

.portrait {
  display: block;
  width: 10rem;
  margin: 0 0 1rem;
}

sup {
  line-height: 0;
}

/* Home: Employment History and Studies, each entry with its years (or
   degree and year) as yellow badges, the later one on top. */

.career section > h2 {
  text-align: center;
}

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

.dated li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.dated li + li {
  margin-top: 1.25rem;
}

.badges {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 4.75rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  text-align: center;
}

.badges span {
  padding: 0.25rem 0.5rem;
  background: var(--highlight);
  color: var(--on-highlight);
}

.entry strong {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
}

.place {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

/* Research Topics: boxed rows with a yellow bar on the left. */

.boxed-list ul {
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.9375rem;
}

.boxed-list li {
  padding: 0.5rem 1rem;
  border-left: 4px solid var(--highlight);
  background: var(--card);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}

.boxed-list li + li {
  margin-top: 0.375rem;
}

/* Publications: a filter bar over the sections (All or one section, see
   site.js); each section has a year index, then its publications under one
   heading per year. Authors, title, venue and year each look different. */

.section-index li,
.year-index li {
  margin: 0;
}

.section-index ul,
.year-index ul {
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
}

.section-index ul {
  gap: 0.5rem;
  margin: 0 0 2.5rem;
  font-size: 0.875rem;
}

.section-index a {
  display: block;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--band-alt);
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.3s;
}

.section-index a:hover {
  background: var(--band);
  color: var(--text);
}

.section-index a[aria-current] {
  border-color: var(--highlight);
  background: var(--highlight);
  color: var(--on-highlight);
}

.year-index ul {
  gap: 0.25rem 0.75rem;
  font-size: 0.875rem;
}

/* Each year as a highlighted tab, a thin rule running on to the right. */
.publications-section h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 400;
}

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

/* Each publication number, counted from the oldest in its section, hangs in
   a gutter. */
.publications {
  padding: 0;
  list-style: none;
}

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

.citation .number {
  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(--highlight);
  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: 40;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* Phones: without site.js the sidebar sits above the page; with it, the
   sidebar waits off-screen on the left for the menu button. Change the
   breakpoint together with `phone` in site.js. */

@media (max-width: 47.99rem) {
  .js .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    width: min(var(--sidebar-width), 85vw);
    overflow-y: auto;
    transform: translateX(-100%);
  }

  .menu-open .sidebar {
    box-shadow: 2px 0 12px rgb(0 0 0 / 0.4);
  }
}

/* Wider screens: the sidebar is fixed on the left, scrolling on its own when
   taller than the window. */

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

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    overflow-y: auto;
  }

  main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
  }

  .page-header,
  .page-body {
    padding-inline: max(10%, calc((100% - var(--measure)) / 2));
  }

  h1 {
    font-size: 3.125rem;
  }

  h2 {
    font-size: 2.25rem;
  }

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

/* Wide enough for Home's two dated lists side by side. */

@media (min-width: 72rem) {
  .career {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  .career h2 {
    margin-top: 0;
    clear: none;
  }
}

@media print {
  .sidebar,
  .menu-toggle,
  .skip-link,
  .section-index {
    display: none;
  }

  main {
    margin: 0;
  }

  .page-header {
    padding: 0;
    background: none;
  }

  .page-header::after {
    display: none;
  }

  .page-body {
    padding: 0;
  }

  .publications-section[hidden] {
    display: block;
  }
}
