/* One navigation level across the site. */
.nav-section { max-width: 1120px; width: calc(100% - 80px); flex-wrap: nowrap; gap: 2px; }
nav a { font-size: .9rem; padding: 10px 12px; }
/* Link indicators inherit the current theme rather than disappearing in dark mode. */
a[target="_blank"]::after {
    background-image: none;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 19H5V5h7V3H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 19H5V5h7V3H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: .8;
}
/* Figures retain their original proportions and can be inspected at full size. */
.academic-publications .publication-card { display: flex; flex-direction: column; gap: 20px; padding: 24px; opacity: 1; transform: none; transition: border-color .2s; }
.academic-publications .publication-content { width: 100%; order: 0; }
.academic-publications .publication-image { display: block; width: 100%; margin: 0; order: 1; border: 1px solid var(--color-cream-dark); border-radius: 10px; }
.figure-trigger { display: block; position: relative; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.academic-publications .publication-photo { width: 100%; height: auto; aspect-ratio: 1200 / 420; max-height: none; object-fit: contain; opacity: 1; animation: none; transform: none; }
.academic-publications .publication-card:hover .publication-photo { transform: none; }
.figure-hint { display: flex; width: 100%; justify-content: flex-end; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface); border-top: 1px solid var(--color-cream-dark); color: var(--color-burgundy); font-size: .75rem; font-family: var(--font-body); }
.figure-dialog { width: min(1240px, calc(100vw - 40px)); max-width: none; max-height: calc(100vh - 40px); padding: 20px; border: 1px solid var(--color-cream-dark); border-radius: 14px; background: var(--surface); color: var(--color-ink); margin: auto; }
.figure-dialog::backdrop { background: rgba(0,0,0,.7); }
.figure-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.figure-dialog-heading p { margin: 0; font-size: 1rem; font-weight: 600; }
.figure-close { width: 44px; height: 44px; flex: 0 0 44px; font-size: 1.8rem; background: var(--color-cream-dark); color: var(--color-ink); border: 0; border-radius: 50%; cursor: pointer; }
.figure-dialog > img { display: block; width: 100%; max-height: calc(100vh - 160px); object-fit: contain; border-radius: 8px; }
.citation-toggle { cursor: pointer; font-family: inherit; }
.citation-toggle[aria-expanded="true"] { background: var(--color-cream-dark); }
.citation-panel { order: 2; width: 100%; min-width: 0; padding: 16px; border: 1px solid var(--color-cream-dark); border-radius: 8px; background: var(--color-cream); }
.citation-panel[hidden] { display: none !important; }
.citation-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: .82rem; color: var(--color-ink-light); }
.citation-copy { display: inline-flex; gap: 7px; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--color-cream-dark); border-radius: 6px; background: var(--surface); color: var(--color-burgundy); font: inherit; cursor: pointer; }
.citation-panel pre { margin: 0; max-height: 340px; overflow: auto; padding: 12px; background: var(--surface); border-radius: 6px; font-family: Consolas, monospace; font-size: .78rem; line-height: 1.65; color: var(--color-ink); white-space: pre; }
.citation-feedback { margin: 8px 0 0; font-size: .8rem; color: var(--color-ink-light); }
@media (max-width: 1024px) {
    nav { min-height: 60px; }
    .nav-toggle { display: flex; }
    .nav-section { position: absolute; top: 100%; left: 0; right: 0; width: 100%; max-width: none; flex-direction: column; padding: 0; max-height: 0; overflow: hidden; opacity: 0; transform: translateY(-10px); background: var(--surface); box-shadow: var(--shadow-md); }
    .nav-section.active { max-height: 80vh; padding: 16px; overflow-y: auto; opacity: 1; transform: none; }
    .nav-section a { width: 100%; justify-content: flex-start; padding: 10px 16px; }
}
@media (max-width: 480px) {
    .academic-publications .publication-card { padding: 16px; }
    .figure-hint { position: static; width: 100%; justify-content: center; border: 0; border-radius: 0; padding: 8px; }
    .figure-dialog { width: calc(100vw - 20px); padding: 12px; }
}
