
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/static/fonts/inter-v19-latin-300.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/inter-v19-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/inter-v19-latin-600.woff2') format('woff2');
}


/* ========== Base ========== */

html {
  overflow-y: scroll;
}

body {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  color: #222;
  background: #fff;
  margin: 0;
  padding: 0;
  line-height: 1.65;
  font-size: 16px;
}

h1 {
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  text-align: left;
}

.center-h1 {
  text-align: center;
}

h2 {
  font-size: 1.5rem;
  font-weight: 400;
  border-bottom: 1px solid #ccc;
  padding-bottom: 0.2rem;
  margin-top: 2.5rem;
  margin-bottom: 0.85rem; /* more space after headings */
}

h3 {
  font-size: 1.25rem;
  font-weight: 400;
}

.smallcaps {
  font-variant: small-caps;
}

table.t1 {
  border-collapse: collapse;
  width: 100%;
}

table.t1 td,
table.t1 th {
  border: 1px solid #999;
  padding: 0.5rem;
}

/* ========== Header and Navigation ========== */

.site-header {
  position: sticky;
  top: 0;
  background: white;
  z-index: 1000;
  padding: 0.5rem 0;
  border-bottom: none;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  padding: 0 2rem; /* match site-content gutters */
}

.site-title {
  font-family: Georgia, serif;
  font-weight: bold;
  letter-spacing: -0.5px;
  margin-bottom: 0.6rem;
  padding: 1.2rem 0;
  transition: font-size 0.15s ease, padding 0.15s ease;
  text-align: center;
  will-change: font-size, padding;
}

.site-header.scrolled .site-title {
  font-size: 2rem;
  padding: 0.3rem 0;
}

.site-name-main {
  font-size: 3.5rem;
  transition: font-size 0.15s ease;
  will-change: font-size;
}

.site-name-main .p {
  font-size: 1.13em;
  letter-spacing: -0.02em;
}

.site-name-main .d {
  font-size: 1.13em;
  letter-spacing: -0.05em;
}

.site-name-main .a {
  letter-spacing: -0.10em;
}

.site-name-main .nie {
  letter-spacing: -0.05em;
}

.site-name-com {
  letter-spacing: -0.03em;
  font-size: 2.5rem;
  transition: font-size 0.15s ease;
  will-change: font-size;
}

.site-header.scrolled .site-name-main {
  font-size: 2rem;
}

.site-header.scrolled .site-name-com {
  font-size: 1.5rem;
}

.site-nav {
  --nav-font-size-base: 1rem;
  --nav-font-size: var(--nav-font-size-base);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.9rem;
  margin-top: 0.3rem;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  overflow-x: auto; 
  white-space: nowrap;
  font-size: var(--nav-font-size);
}

.site-nav a {
  font-size: 1em;
  margin: 0;
  text-decoration: none;
  color: #666;
  border-bottom: 2px solid transparent;
  white-space: nowrap; 
  overflow-x: auto;   
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #000;
  text-decoration: none;
  border-bottom-color: transparent;
}

.site-nav a:visited {
  color: #666;
}

.site-nav a.current {
  color: #aaa;
  border-bottom: 2px solid #c00;
  pointer-events: none;
  cursor: default;
}

.site-nav::-webkit-scrollbar { display: none; }
.site-nav { scrollbar-width: none; }

/* Not-found page */
.not-found {
  max-width: 720px;
  margin: 3rem auto;
  text-align: center;
}

.not-found-image {
  margin: 1.5rem auto;
}

.not-found-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  border: 1px solid #e5e5e5;
}

/* Roomier desktop nav spacing without affecting mobile */
@media (min-width: 768px) and (pointer: fine) {
  .site-nav {
    gap: 1.35rem;
  }
  .site-nav a {
    padding: 0.2rem 0.6rem;
  }
}

/* ========== Content Area ========== */

.site-content {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 2rem; /* wider gutters */
}

/* ========== Publications Layout ========== */

.publication-entry {
  margin-bottom: 2rem; /* more separation between items */
}

.publication-entry .smallcaps {
  font-variant: small-caps;
  letter-spacing: 0.01em;
}

.publication-entry .toggle-content {
  margin-left: 1.5rem;
}

/* Publication list: bullet-free, compact */
ul.publication-list,
ul.publications-list {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

/* Invisible bullet indent — make items line up as if bullets existed */
ul.publication-list li,
.cv ul li,
.teaching .simple-list li {
  position: relative;
  padding-left: 1.25rem; /* visual bullet space */
}
ul.publication-list li::before,
.cv ul li::before,
.teaching .simple-list li::before {
  content: '';
  position: absolute;
  left: 0;
  width: 0.9rem;
  height: 1px; /* invisible line just to hold space */
}

.publication-entry em,
.publication-entry span,
.publication-entry a {
  line-height: 1.5;
}

/* Publication title clarity */
.publication-entry strong { font-weight: 800; color: #111; }

.coauthors {
  font-style: italic;
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.1rem;
}

.pubmeta {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.1rem;
}

/* ========== CV Layout ========== */

.cv ul {
  list-style: none;
  margin: 0 0 0 1.6rem;
  padding: 0;
}

.cv li {
  margin-bottom: 1.6rem; /* clearer separation between items */
  line-height: 1.5;
}

.country {
  font-size: 0.9rem;
  color: #666;
  margin-left: 0.3rem;
  display: inline-block;
  position: relative;
  top: -0.05em;
}

.cv-subline {
  display: block;
  margin-left: 1.2rem;
  font-size: 0.95rem;
}

.subsection-heading {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-left: 2rem;
  color: #666;
}

/* Extra indent for Visiting Appointments list */
.cv .subsection-heading + ul {
  margin-left: 2.7rem;
}

/* Stronger emphasis where <strong>/<b> used inside CV */
.cv strong, .cv b { font-weight: 800; color: #111; }

.course-container {
  padding-left: 2.5rem;
}

.course-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  row-gap: 0.8rem;
  column-gap: 1rem;
}

.course-list dt {
  font-style: normal;
  font-weight: 800;
  color: #111;
}

.course-list dd {
  margin: 0;
}

/* ========== Toggle Sections ========== */

.collapsed .toggle-content {
  display: none;
}

.toggle-section.collapsed .h2-toggle-wrapper h2 {
  border-bottom: none;
}

.toggle-section .h2-toggle-wrapper { cursor: pointer; }

.h2-toggle-wrapper {
  display: flex;
  align-items: center;
  margin-top: 2.5rem;
  margin-bottom: 1rem; /* more space after toggle headings */
}

.h2-toggle-wrapper .triangle,
.h2-toggle-wrapper .triangle-placeholder {
  display: inline-block;
  width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}

.h2-toggle-wrapper .triangle svg {
  width: 0.8rem;
  cursor: pointer;
  height: 1.2rem;
  display: block;
  transform: rotate(0deg);  /* collapsed: right-pointing */
  transition: transform 0.2s ease;
  fill: #666;
  margin-top: -0.1rem;
}

.toggle-section:not(.collapsed) .h2-toggle-wrapper .triangle svg {
  transform: rotate(90deg);  /* expanded: down-pointing */
}

.h2-toggle-wrapper h2 {
  flex: 1;
  font-size: 1.5rem;
  font-weight: 400;
  border-bottom: 1px solid #ccc;
  padding-bottom: 0.2rem;
  margin: 0;
}

/* Inline toggles (used in publications) */

.inline-toggle .toggle-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  cursor: pointer;
}

.inline-toggle .triangle {
  display: inline-block;
  width: 0.6rem;
  height: 0.9rem;
  margin-right: 0.3rem;
}

.inline-toggle .triangle svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(0deg); /* collapsed: right-pointing */
  transition: transform 0.2s ease;
  fill: #666;
}

.inline-toggle:not(.collapsed) .triangle svg {
  transform: rotate(90deg); /* expanded: down-pointing */
}

.inline-toggle .toggle-content {
  margin-left: 1.5rem;
  margin-top: 0.25rem;
}

.inline-toggle .toggle-content p {
  margin: 0.8rem 1.5rem;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #333;
  border-left: 2px solid #ddd;
  background-color: #f9f9f9;
  border-radius: 4px;
}

.inline-toggle .abstract-label {
  font-size: 0.85rem;
  color: #666;
  user-select: none;
  font-variant: small-caps;
  letter-spacing: 0.02em;
}

/* ========== Media Page ========== */

.media-list {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

.media-entry { margin: 0 0 1.4rem 2.6rem; line-height: 1.6; }
.media-channel { font-weight: 600; color: #1c2533; margin-bottom: .15rem; }
.media-body { display: flex; flex-direction: column; gap: .25rem; }
.media-program-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: .45rem; }
.media-program-line .media-program { font-style: normal; }
.media-program-line .media-program i { font-style: italic; }
.media-program-line .media-program.emphasis { font-weight: 600; }
.media-program-line .media-program strong { font-weight: 600; font-style: normal; }
.media-program-line a.media-line-link { display: flex; align-items: baseline; gap: .45rem; }
.media-program-line a.media-line-link:hover { text-decoration: underline; }
.media-date { font-size: .85rem; color: #7a8190; }
.media-description { font-size: .95rem; color: #3b404a; }

/* ========== Links ========== */

a {
  color: #6a2a2a;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Content links: standard blue, no visited color change; nav styling remains separate */
.site-content a,
.site-content a:visited { color: #0645AD; }

/* ========== Contact Form ========== */

/* Teaching outline layout */
.teaching .simple-list {
  list-style: none;
  margin: 0 0 0 1.6rem;
  padding: 0;
}
.teaching .simple-list li { margin-bottom: 0.8rem; }
.teaching h2 { margin-left: 1.5rem; }
/* tighter spacing for the General Resources list at top */
.teaching .teaching-index-simple > section:first-child .simple-list li {
  margin-bottom: 0.45rem;
}

form {
  max-width: 600px;
  margin: 2rem auto;
  padding: 1.5rem;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 5px;
}

form label {
  display: block;
  font-weight: 400;
  margin-top: 0.3rem;
  margin-bottom: 0.1rem;
}

form input[type="text"],
form input[type="email"],
form textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

form button {
  display: block;
  margin: 1rem 0 0 auto;   /* pushes it to the right */
  padding: 0.5rem 1rem;
  background: #333;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

form button:hover {
  background: #555;
}

/* ========== Fountain Pen Nibs ========== */

.nib-table {
  width: 100%;
  border-collapse: collapse;
}

.nib-table th,
.nib-table td {
  border: 1px solid #ccc;
  padding: 8px;
}

.nib-table thead th {
  background-color: #f0f0f0;
  color: #444;
  font-weight: 600;
}

/* ========== Watch Movements ========== */

#movement-table thead {
  background-color: #f0f0f0;
}

#watch-table thead {
  background-color: #f0f0f0;
}

#watch-table {
  table-layout: fixed;
  width: 100%;
}

#watch-table th:nth-child(1),
#watch-table td:nth-child(1) { width: 18%; }
#watch-table th:nth-child(2),
#watch-table td:nth-child(2) { width: 28%; }
#watch-table th:nth-child(3),
#watch-table td:nth-child(3) { width: 28%; }
#watch-table th:nth-child(4),
#watch-table td:nth-child(4) { width: 15%; }
#watch-table th:nth-child(5),
#watch-table td:nth-child(5) { width: 11%; }

#watch-table td,
#watch-table th {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#watch-table th {
  position: relative;
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 600;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  padding-right: 1.25rem;
  vertical-align: middle;
  text-align: left;
}

#watch-table th::after {
  content: "▲\A▼";
  white-space: pre;
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  line-height: 1rem;
  color: #aaa;
  pointer-events: none;
}

#watch-table th.sorted.asc::after {
  content: "▼";
  color: #c00;
}

#watch-table th.sorted.desc::after {
  content: "▲";
  color: #c00;
}

#watch-table th.no-sort {
  pointer-events: none;
  color: #555;
}

#watch-table th.no-sort::after {
  content: "";
}

#watch-table .notes-row td {
  padding: 1rem;
  background: #f9f9f9;
  color: #333;
  font-size: 0.95rem;
  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
}

#watch-table a.toggle-notes {
  color: #6a2a2a;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.table-scroll table {
  width: 100%;
}

/* ========== Music ========== */

.music-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1.5rem 0 0 1rem;
}

.music-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}

.year {
  color: #777;
  font-weight: normal;
  margin-left: 0.3rem;
  font-size: 0.95rem;
}

.meta-row {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.1rem;
}

.duration {
  font-style: italic;
}

.desc {
  margin-top: 0.2rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.music-info {
  flex: 1;
  max-width: 70%;
}

.music-links {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: right;
  gap: 0.3rem;
}

.music-links a {
  color: #6a2a2a;
  text-decoration: underline;
}

.music-divider {
  margin: 1.2rem auto 0.6rem auto;
  width: 30%;
  height: 1px;
  background-color: #ccc;
  border: none;
  opacity: 0.6;
}

/* Courses Taught — stacked label + indented courses */
.course-container{
  max-width: 70ch;
}

.course-list{
  display: block;       /* no grid */
  margin: 0;
  padding: 0;
}

.course-list dt {
  font-style: normal;
  font-weight: 700;   /* bold */
  color: #111;
  margin-top: 1rem;
  margin-bottom: .25rem;
}

.course-list dd{
  margin: 0 0 0 1.5rem; /* indent courses under label */
  line-height: 1.6;
}

/* ========== Responsive ========== */

@media (max-width: 600px), (pointer: coarse) {
  body {
    font-size: 0.95rem;
  }

  h1 {
    font-size: 1.6rem;
    margin-top: 0.3rem;
  }

  h2,
  .toggle-heading-wrapper h2 {
    font-size: 1.2rem;
  }

  .site-title {
    font-size: 2.4rem;
    margin-bottom: 0.4rem;
  }

  .site-name-main {
    font-size: 2rem;
  }

  .site-name-com {
    font-size: 1.6rem;
  }

  .site-nav {
    justify-content: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.8rem;
    padding: 0 0.5rem;
    --nav-font-size-base: 0.95rem;
  }

  .site-nav a {
    font-size: 1em;
    margin: 0;
  }
}

/* iOS Safari: sticky header without jitter, no shrink effect */
@supports (-webkit-touch-callout: none) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    /* Make the box stable */
    height: 129px;                /* pick the compact height you like */
    padding: 0;                   /* avoid padding-driven reflows */
    display: flex;
    align-items: center;

    /* Stop Safari from re-anchoring/repainting during toolbar animations */
    contain: layout paint;        /* isolate header from page layout/paint */
    backface-visibility: hidden;  /* reduce compositing flicker */
    transform: translateZ(0);     /* force composited layer */
  }

  /* Keep the title sized to fit in 129px; no dynamic resizing */
  .site-title {
    margin: 0 auto;
    line-height: 1.1;
    font-size: 2.4rem;
  }
  .site-name-main { font-size: 2.2rem; }
  .site-name-com  { font-size: 1.6rem; }

  /* Avoid horizontal scrolling inside the sticky bar on iOS */
  .site-nav {
    overflow-x: auto;             /* nav text shrinks to fit; allow scroll as bailout */
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;          /* single line; JS trims font size to prevent wrapping */
    justify-content: center;
  }
}

/* ===== Teaching layout ===== */

.teaching {
  max-width: 700px;
  margin: 0 auto;
  padding: 0;
}
.teaching h1 {
  text-align: left;
  margin-bottom: .55rem;
}
