/* Font: typewriter look (Menlo on Mac, Consolas on Windows).
   For a LaTeX/Overleaf look instead, uncomment the next line and swap --font below.
   @import url("https://cdn.jsdelivr.net/gh/aaaakshat/cm-web-fonts@latest/fonts.css");
   --font: "Computer Modern Serif", Georgia, serif;                                      */
:root {
  --font: "IBM Plex Mono", Menlo, Consolas, "Courier New", monospace;
  --bg: #fdfcf9;
  --ink: #000000;
  --rule: #e4e4e4;
  --soft: #f3f3f3;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.5; font-weight: 300; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, h3, p, li, a, strong, b, summary, .pub-title { font-weight: 300; }
img { max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: #000000; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--ink); }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Top bar */
.masthead { background: var(--bg); position: sticky; top: 0; z-index: 10; }
.masthead-inner { max-width: 72rem; margin: 0 auto; padding: 0.9rem 1.5rem; display: flex; justify-content: flex-end; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.8rem; }
.nav a { text-decoration: none; padding: 0.2rem 0; border-bottom: 1px solid transparent; }
.nav a:hover { border-bottom-color: #000000; }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* Layout */
.layout { max-width: 72rem; margin: 0 auto; padding: 3rem 1.5rem 2rem; display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: 3.5rem; }

/* Sidebar */
.author { position: sticky; top: 5rem; align-self: start; font-size: 0.95rem; }
.avatar { width: 17rem; height: auto; display: block; margin-bottom: 1.1rem; }
.avatar-fallback { width: 17rem; height: 21rem; background: var(--soft); display: flex; align-items: center; justify-content: center; font-size: 2.4rem; margin-bottom: 1.1rem; }
.author-name { font-size: 1.15rem; margin: 0; line-height: 1.3; }
.author-bio { margin: 0 0 1.8rem; line-height: 1.4; }
.author-links { list-style: none; padding: 0; margin: 1.2rem 0 0; font-size: 0.82rem; }
.author-links li { display: flex; align-items: center; gap: 0.6rem; padding: 0.15rem 0; }
.author-links i { width: 1.1rem; text-align: center; }
.author-links a { text-decoration: none; }
.author-links a:hover { text-decoration: underline; }
.author-links .fa-bluesky { color: #1185fe; }
.author-links .fa-graduation-cap { color: #4285f4; }

/* Content */
main { max-width: 46rem; }
h1 { font-size: 1.8rem; margin: 0 0 1.5rem; line-height: 1.25; }
h2 { font-size: 1.2rem; margin: 2.5rem 0 1rem; }
p { margin: 0 0 1.4rem; }
main p { font-size: 0.94rem; }

.pub { margin: 0 0 1.8rem; }
.pub-title { margin: 0 0 0.15rem; line-height: 1.45; font-size: 0.94rem; }
.pub-meta { font-size: 0.87rem; margin: 0 0 0.35rem; }
details summary { cursor: pointer; font-size: 0.9rem; width: fit-content; text-decoration: underline; text-decoration-color: #000000; text-underline-offset: 0.18em; }
details p { margin-top: 0.7rem; font-size: 0.93rem; padding: 0.8rem 1rem; background: var(--soft); }

.course { margin: 0 0 1rem; }
.course-meta { display: block; font-size: 0.93rem; }
.course a { color: #4a6b8a; text-decoration: none; }
.course a:hover { color: #2c4a66; text-decoration: underline; }

footer { margin-top: 3rem; }
footer div { max-width: 72rem; margin: 0 auto; padding: 1.5rem; font-size: 0.85rem; }

@media (max-width: 50rem) {
  .masthead { position: static; }
  .masthead-inner { justify-content: flex-start; }
  .nav { gap: 1.25rem; flex-wrap: wrap; }
  .layout { grid-template-columns: 1fr; gap: 2rem; padding-top: 2rem; }
  .author { position: static; display: grid; grid-template-columns: 6rem 1fr; gap: 0 1.25rem; align-items: start; padding-bottom: 0.5rem; }
  .avatar { width: 6rem; grid-row: span 3; }
  .avatar-fallback { width: 6rem; height: 7.5rem; font-size: 1.5rem; grid-row: span 3; }
  .author-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin-top: 0.75rem; }
  h1 { font-size: 1.5rem; }
}

/* Justified body text */
main p, details p { text-align: justify; hyphens: manual; -webkit-hyphens: manual; }
main .pub-title, main .pub-meta, main .course { text-align: left; hyphens: manual; }

/* Home page: photo + compact text, generous side margins */
@media (min-width: 50.01rem) {
  .page-index .layout { grid-template-columns: 18rem minmax(0, 1fr); gap: 5rem; max-width: 80rem; padding: 2.5rem 5rem 0; }
  .page-index .masthead-inner, .page-index footer div { max-width: 80rem; padding-left: 5rem; padding-right: 5rem; }
  .page-index footer { margin-top: 1rem; }
  .page-index footer div { padding-top: 0.5rem; padding-bottom: 1rem; }
  .page-index .avatar { width: 18rem; }
  .page-index .avatar-fallback { width: 19rem; height: 24rem; }
  .page-index main { max-width: 45rem; }
  .page-index h1 { margin-bottom: 1.9rem; }
  .page-index main p { font-size: 0.87rem; line-height: 1.45; margin-bottom: 1.05rem; }
}

/* Pages without the photo: single centred column */
.page-cv .layout, .page-publications .layout, .page-teaching .layout { display: block; max-width: 64rem; padding: 2.5rem 4rem 1rem; }
.page-cv main, .page-publications main, .page-teaching main { max-width: none; }
.page-cv .masthead-inner, .page-publications .masthead-inner, .page-teaching .masthead-inner,
.page-cv footer div, .page-publications footer div, .page-teaching footer div { max-width: 64rem; padding-left: 4rem; padding-right: 4rem; }

/* Publications: old-site layout, text + figure side by side, abstract shown */
.page-publications main p { line-height: 1.4; }
.pub { margin: 0 0 2.6rem; }
.pub-body { min-width: 0; }
.abstract { font-size: 0.82rem; line-height: 1.45; margin: 0.6rem 0 0; text-align: justify; hyphens: manual; }

/* Teaching: course name + small resource links */
.course-name { display: inline; padding: 0.05em 0.3em; margin-left: -0.3em; background: linear-gradient(transparent 12%, #f0ebe0 12%, #f0ebe0 88%, transparent 88%); border-radius: 0.2em 0.5em 0.3em 0.6em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.course-name + .course-meta { margin-top: 0.2rem; }
.course-links { display: block; font-size: 0.85rem; margin-top: 0.15rem; }
.course-links a { color: #4a6b8a; text-decoration: none; }
.course-links a:hover { text-decoration: underline; }

@media (max-width: 50rem) {
  .pub.has-img, .pub.has-img.img-left { grid-template-columns: 1fr; gap: 1rem; }
  .pub.has-img .pub-img { order: 2; max-width: 22rem; }
  .page-cv .layout, .page-publications .layout, .page-teaching .layout { padding: 2rem 1.25rem 1rem; }
  .page-cv .masthead-inner, .page-publications .masthead-inner, .page-teaching .masthead-inner { padding-left: 1.25rem; padding-right: 1.25rem; }
}

/* Marker highlight for headings */
.marker { padding: 0.05em 0.3em; margin-left: -0.3em; background: linear-gradient(transparent 12%, #f0ebe0 12%, #f0ebe0 88%, transparent 88%); border-radius: 0.2em 0.5em 0.3em 0.6em; }
.pub-coauthor { font-style: italic; font-size: 0.82rem; margin: 0 0 0.35rem; }
.pub details summary { margin-top: 0.4rem; }
.pub details .abstract { background: none; padding: 0; }

/* Small icon row at the bottom of pages without the sidebar */
.footer-icons { display: flex; justify-content: center; gap: 1.4rem; font-size: 1.15rem; }
.footer-icons a { text-decoration: none; }
.footer-icons .fa-bluesky { color: #000; }
.footer-icons .fa-envelope { color: #666; }
.footer-icons .fa-graduation-cap { color: #4285f4; }
.footer-icons a:hover { opacity: 0.7; }

/* Soft inline highlight for key phrases */
.hl { background: linear-gradient(transparent 15%, #f3efe6 15%, #f3efe6 85%, transparent 85%); padding: 0 0.15em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* Publications v3 */
.page-publications .layout { padding-top: 3rem; }
.pub-title { margin-bottom: 0.2rem; }
.page-publications .pub-title, .page-publications .pub-title a { text-decoration: underline; text-decoration-color: #000; text-underline-offset: 0.18em; }
.pub-cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 3rem; align-items: center; margin-top: 0.4rem; }
.pub-cols.fig-left { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
.pub-cols.no-fig { display: block; }
.pub-fig { margin: 0; }
.pub-fig img { width: 100%; height: auto; display: block; mix-blend-mode: multiply; }
.pub-fig figcaption { font-size: 0.75rem; margin-top: 0.5rem; text-align: center; }
.pub-cols .abstract { margin: 0; }
h2.wp { margin-top: 4.5rem; }
.pub details summary { text-decoration: none; color: #4a6b8a; font-size: 0.85rem; }
.pub details summary:hover { color: #2c4a66; }
.pub details[open] summary { margin-bottom: 0.3rem; }
@media (max-width: 50rem) {
  .pub-cols, .pub-cols.fig-left { grid-template-columns: 1fr; gap: 1rem; }
  .pub-cols.fig-left .pub-fig { order: 2; }
}

/* Footer icons all black on inner pages */
.footer-icons .fa-bluesky, .footer-icons .fa-envelope, .footer-icons .fa-graduation-cap { color: #000; }

/* Teaching spacing */
.page-teaching .course { margin: 0 0 2rem; line-height: 1.35; }
.page-teaching .course-name + .course-meta { margin-top: 0.15rem; }
.page-teaching .course-links { margin-top: 0.1rem; }

/* Publications: wide enough for long titles on one line */
@media (min-width: 50.01rem) {
  .page-publications .layout, .page-publications .masthead-inner, .page-publications footer div { max-width: 73rem; }
}

/* v4 tweaks */
.pub-cols { align-items: start; }
.pub-fig { width: 88%; justify-self: end; margin-top: -0.5rem; }
.pub-cols.fig-left .pub-fig { justify-self: start; margin-top: 0; }
.pub-fig figcaption { font-size: 0.62rem; margin-top: 0.3rem; }
.pub-cols.fig-left .pub-title { margin-top: 0; }
.page-publications h2.pw { margin-top: 0; }
.pub details summary, .pub details summary:hover { color: #000; }
/* Home: copyright on the right, level with the last sidebar line */
@media (min-width: 50.01rem) {
  .page-index main { display: flex; flex-direction: column; }
  .page-index .copyright { margin: auto 0 0; text-align: right; font-size: 0.8rem; }
  .page-index footer { display: none; }
}
@media (max-width: 50rem) { .page-index .copyright { display: none; } }

/* Hide the title baked into the top of the Norway map */
.crop-top { overflow: hidden; }
.crop-top img { margin-top: -14%; }

/* No word breaking anywhere */
* { hyphens: manual !important; -webkit-hyphens: manual !important; }

/* v5 tweaks */
.pub-cols { margin-top: 1.1rem; }
.pub-fig { margin-top: -1.1rem; }
.pub-cols.fig-left { margin-top: 0; }
.pub-cols.fig-left .pub-fig { margin-top: 0; }
.pub.wp-start { margin-top: 5.5rem; }
.pub.wp-start h2.wp { margin: 0 0 1rem; }
@media (min-width: 50.01rem) { .page-index .copyright { position: relative; top: 0.9rem; } }
