/* Andrea Coladangelo — a small, self-contained academic website. */
:root {
  color-scheme: light;
  --page: #fafaf7;
  --surface: #ffffff;
  --ink: #202d31;
  --muted: #57666a;
  --link: #176676;
  --link-hover: #104753;
  --line: #dbe2df;
  --wash: #edf2ee;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --content-width: 1056px;
}

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

html {
  scroll-padding-top: 2rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #cce4e3;
  color: #102e34;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

a:focus-visible,
button:focus-visible,
iframe:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  transform: translateY(-200%);
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: white;
  border-radius: 4px;
}

.skip-link:focus {
  transform: translateY(0);
  color: white;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.header-inner {
  width: min(var(--content-width), calc(100% - 5rem));
  min-height: 110px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}

.site-name {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}

.site-name:hover {
  color: var(--link);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.3rem 1.45rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.site-nav a {
  display: inline-block;
  padding-block: 0.4rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--link);
  border-bottom-color: var(--line);
}

.site-nav a[aria-current="page"],
.site-nav a.active {
  border-bottom-color: var(--link);
  color: var(--ink);
}

.content {
  width: min(var(--content-width), calc(100% - 5rem));
  margin: 0 auto;
  padding-block: 3.5rem 4.75rem;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 500;
  text-wrap: balance;
}

h1 {
  margin: 0 0 1.65rem;
  font-size: clamp(2.15rem, 4.4vw, 3.05rem);
  letter-spacing: -0.045em;
  line-height: 1.18;
}

h2 {
  margin: 2.7rem 0 1.1rem;
  font-size: 1.9rem;
  letter-spacing: -0.035em;
  line-height: 1.3;
}

h3 {
  margin: 2rem 0 0.8rem;
  font-size: 1.4rem;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

h4 {
  margin: 1.7rem 0 0.7rem;
  font-size: 1.18rem;
  line-height: 1.4;
}

p {
  margin: 0 0 1rem;
}

strong,
b {
  font-weight: 600;
}

ul,
ol {
  margin: 0.65rem 0 1.45rem;
  padding-left: 1.55rem;
}

li {
  padding-left: 0.18rem;
  margin-block: 0.4rem;
}

li::marker {
  color: var(--muted);
}

li > ul,
li > ol {
  margin-block: 0.4rem 0.75rem;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

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

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

.source-section {
  margin-bottom: 1.5rem;
}

.source-section > :first-child,
.text-block > :first-child {
  margin-top: 0;
}

.source-section > :last-child,
.text-block > :last-child {
  margin-bottom: 0;
}

.text-block {
  min-width: 0;
}

.text-block + .text-block {
  margin-top: 1.3rem;
}

.source-section + .source-section {
  margin-top: 2rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: start;
  gap: 2.5rem 4.5rem;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.profile-copy {
  min-width: 0;
}

.profile-copy h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: 1.75rem;
}

.profile-copy p {
  margin-bottom: 1.2rem;
}

.profile-aside {
  min-width: 0;
}

.portrait {
  display: block;
  width: 100%;
  border-radius: 3px;
  background: var(--wash);
}

.contact {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.contact p {
  margin-bottom: 0.8rem;
}

.contact h2,
.contact h3 {
  margin-block: 1rem 0.55rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}

.publication-list,
.news-list,
.course-list {
  margin-top: 1rem;
}

.publication-list li {
  margin-bottom: 1.2rem;
}

.course-list li {
  margin-bottom: 0.75rem;
}

.news-list li {
  margin-block: 0.45rem;
}

.news-list > ul {
  margin-block: 0.45rem;
}

.page-publications .text-block p {
  margin-bottom: 1.25rem;
}

.course-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.65rem;
  margin: -0.5rem 0 2.5rem;
  padding: 0.9rem 0;
  border-block: 1px solid var(--line);
  font-size: 0.94rem;
  line-height: 1.45;
}

.course-nav a {
  padding-block: 0.4rem;
  text-decoration: none;
}

.course-nav a:hover {
  text-decoration: underline;
}

.course-nav a[aria-current="page"],
.course-nav a.active {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--link);
  text-underline-offset: 0.3em;
}

.staff-card {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 1.5rem 2rem;
  align-items: start;
  margin-block: 1.5rem 2.25rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--line);
}

.staff-card > img,
.staff-card .media-image {
  display: block;
  width: 160px;
  max-height: 220px;
  object-fit: contain;
  object-position: top left;
  border-radius: 3px;
}

.staff-card h2,
.staff-card h3 {
  margin-top: 0;
}

.media-image {
  display: block;
  max-width: 100%;
  margin: 1.5rem 0;
}

iframe {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
}

.video-frame {
  display: block;
  width: min(100%, 480px);
  min-height: 200px;
  height: auto;
  aspect-ratio: 16 / 9;
  margin-block: 1.5rem;
}

.video-player {
  width: min(100%, 480px);
}

.video-fallback {
  margin: 0;
  font-size: 0.9rem;
}

.video-player:not(.is-embedded) .video-fallback a {
  position: relative;
  display: flex;
  min-height: 200px;
  aspect-ratio: 16 / 9;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.video-thumbnail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play-icon {
  position: relative;
  padding: 0.8rem 1.1rem;
  border-radius: 0.6rem;
  background: #c00;
  color: white;
  font-size: 1.5rem;
  line-height: 1;
}

.video-player:not(.is-embedded) .video-watch-label {
  position: absolute;
  bottom: 0.8rem;
  right: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  color: white;
  background: #202020;
}

.is-embedded .video-thumbnail,
.is-embedded .video-play-icon {
  display: none;
}

.calendar-embed {
  display: block;
  width: 100%;
  min-height: 600px;
  margin-block: 1.5rem;
}

table {
  width: 100%;
  margin-block: 1.5rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--wash);
  font-weight: 600;
}

pre,
code,
kbd,
samp {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

pre {
  overflow-x: auto;
  padding: 1.25rem;
  background: var(--wash);
  border-radius: 3px;
}



@media (min-width: 1300px) {
  .content {
    padding-top: 4.25rem;
  }
}

@media (max-width: 900px) {
  .header-inner {
    min-height: 130px;
    padding-block: 1.5rem 1rem;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 0.8rem;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .profile-grid {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15.5px;
    line-height: 1.7;
  }

  .header-inner,
  .content {
    width: calc(100% - 2.5rem);
  }

  .header-inner {
    min-height: 124px;
    padding-block: 1.35rem 0.9rem;
  }

  .site-name {
    font-size: 1.4rem;
  }

  .site-nav {
    gap: 0.1rem 1.1rem;
    font-size: 0.88rem;
  }

  .site-nav a {
    padding-block: 0.45rem;
  }

  .content {
    padding-block: 2.4rem 3rem;
  }

  h1 {
    font-size: 2.2rem;
  }

  h2 {
    margin-top: 2.2rem;
    font-size: 1.7rem;
  }

  h3 {
    font-size: 1.35rem;
  }

  .profile-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    padding-bottom: 2rem;
  }

  .profile-aside {
    display: grid;
    grid-template-columns: minmax(100px, 155px) minmax(0, 1fr);
    align-items: start;
    gap: 1.2rem;
  }

  .contact {
    margin-top: 0;
    font-size: 0.82rem;
  }

  .course-nav {
    gap: 0.2rem 1.25rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
  }

  .staff-card {
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 1.1rem;
  }

  .staff-card > img,
  .staff-card .media-image {
    width: 105px;
  }

  th,
  td {
    padding: 0.6rem 0.4rem;
  }

  .calendar-embed {
    min-height: 500px;
  }
}

@media (max-width: 380px) {
  .profile-aside {
    grid-template-columns: 1fr;
  }

  .portrait {
    width: 190px;
  }

  .contact {
    font-size: 0.88rem;
  }

  .staff-card {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  body {
    background: white;
    color: black;
    font-size: 11pt;
  }

  .site-header {
    border-top: 0;
    background: none;
  }

  .header-inner,
  .content {
    width: 100%;
  }

  .header-inner {
    min-height: 0;
    padding-bottom: 1rem;
  }

  .site-nav,
  .course-nav,
  .skip-link {
    display: none;
  }

  .content {
    padding-block: 1.5rem;
  }

  a {
    color: inherit;
  }

  h1,
  h2,
  h3 {
    break-after: avoid;
  }

  img,
  .staff-card {
    break-inside: avoid;
  }
}

/* Preserve source line breaks while giving publication metadata a hierarchy. */
.detail-line {
  display: block;
}

.publication-list > .detail-line {
  margin-left: 1.73rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.publication-list > .publication-venue {
  color: var(--muted);
  font-weight: 400;
}

.publication-venue .venue-name {
  color: #202020;
}

.publication-honor {
  color: #1e6040;
  font-weight: 700;
}

.publication-list > ul {
  margin-top: 1.6rem;
  margin-bottom: 0.25rem;
}

.home .publication-list > .detail-line + ul {
  margin-top: 1.2rem;
}

.publication-list li {
  margin-bottom: 0;
}

.publication-list li .detail-line {
  color: var(--ink);
  font-size: 1rem;
}

.news-list li .detail-line {
  font-size: 0.95rem;
}

.news-list li .detail-line,
.program-committees {
  max-inline-size: 90ch;
}


.home .contact p:nth-child(-n + 3) {
  margin-bottom: 0;
}

.home .contact p:nth-child(4) {
  margin-top: 1rem;
}

/* Progressive enhancement: panels are ordinary linked sections without JS. */
.course-nav[role="tablist"] {
  gap: 0.25rem 0.35rem;
  margin-bottom: 2rem;
  padding-block: 0.65rem;
}

.course-nav [role="tab"] {
  padding: 0.65rem 0.8rem;
  border-radius: 3px;
  line-height: 1.45;
  text-decoration: none;
}

.course-nav [role="tab"]:hover {
  background: var(--wash);
  text-decoration: none;
}

.course-tabs-enhanced .course-nav [aria-selected="true"] {
  background: var(--link);
  color: white;
  font-weight: 600;
}

.course-panel {
  scroll-margin-top: 1.5rem;
  margin-top: 2rem;
}

.course-panel:focus:not(:focus-visible) {
  outline: none;
}

.course-panel[hidden] {
  display: none;
}

.course-panel > .source-section:first-child {
  margin-top: 0;
}

.course-panel > .source-section:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .course-nav[role="tablist"] {
    gap: 0.2rem;
  }

  .course-nav [role="tab"] {
    padding: 0.55rem 0.65rem;
  }
}

@media print {
  .course-panel[hidden] {
    display: block;
  }

  .course-panel + .course-panel {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
  }
}
