/* Pages of records: projects, research fields and groups, people (docs/plan-content-pages.md).
   The content in the middle comes from CMS plugins; the facts beside it from the record. */

.record-kind {
  margin: .2rem 0 .1rem; color: var(--iti-muted);
  font-size: .85rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.record-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1rem 3rem; align-items: start; margin-top: 1rem; }
.record-main > :first-child, .record-content > :first-child { margin-top: 0; }
/* a text starts below its picture only inside the content, not below the side column */
.record-main h2 { clear: none; }
.record-content .iti-figure ~ h2 { clear: both; }
.record-content .iti-figure + h2 { clear: none; }
.record-content::after { content: ""; display: block; clear: both; }

.record-side { padding: 1.25rem 1.4rem; border: 1px solid var(--iti-border); border-radius: 6px; background: var(--iti-bg); }
.record-side__image { display: block; max-width: 100%; max-height: 150px; width: auto; height: auto; margin: 0 auto 1.2rem; object-fit: contain; }
/* logos are drawn for white paper */
[data-bs-theme=dark] .record-side__image { padding: .6rem; border-radius: 4px; background: #fff; }
.record-facts { margin: 0; }
.record-facts dt { margin-top: .8rem; color: var(--iti-muted); font-size: .85rem; font-weight: 600; }
.record-facts dt:first-child { margin-top: 0; }
.record-facts dd { margin: 0; }
.record-side h2 { margin: 1.4rem 0 .4rem; font-size: 1.05rem; color: var(--iti-text); }
.record-links { list-style: none; margin: 0; padding: 0; }
.record-links li { margin: 0; border-top: 1px solid var(--iti-border); }
.record-links li:first-child { border-top: 0; }
.record-links a { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; color: var(--iti-text); font-weight: 600; text-decoration: none; }
.record-links a::after { content: "→"; color: var(--iti-heading); }
.record-links a:hover, .record-links a:focus-visible { color: var(--iti-heading); }

.record-note { padding: .7rem 1rem; border-left: 4px solid var(--iti-accent); background: var(--iti-card); }
.record-start { margin: 1.5rem 0; padding: 1.2rem 1.4rem; border: 1px dashed var(--iti-border); }
.record-start p { margin: 0 0 .6rem; }
.record-start .iti-button { background: none; cursor: pointer; }

.record-section { margin-top: 2.8rem; }
.record-team, .record-partners { display: flex; flex-wrap: wrap; gap: 1.4rem 1.6rem; list-style: none; margin: 1rem 0 0; padding: 0; }
.record-team li { width: 150px; margin: 0; }
.record-team a { display: block; color: var(--iti-text); text-decoration: none; }
.record-team video-preview { display: block; margin-bottom: .45rem; }
.record-team strong { display: block; line-height: 1.3; }
.record-team span { display: block; color: var(--iti-muted); font-size: .9rem; }
.record-team a:hover strong, .record-team a:focus-visible strong { color: var(--iti-link); }
.record-partners li { margin: 0; }
.record-partners a { display: flex; flex-direction: column; align-items: center; gap: .4rem; color: var(--iti-text); text-decoration: none; }
.record-partners img { height: 64px; width: auto; }
.record-publication { margin-bottom: 1.1rem; }
.record-news { list-style: none; margin: .6rem 0 0; padding: 0; }
.record-news li { margin: 0; border-top: 1px solid var(--iti-border); }
.record-news li:first-child { border-top: 0; }
.record-news a { display: block; padding: .6rem 0; color: var(--iti-heading); text-decoration: none; }
.record-news time { display: block; color: var(--iti-muted); font-size: .85rem; }
.record-news a:hover span, .record-news a:focus-visible span { color: var(--iti-link); }

@media (max-width: 991.98px) {
  .record-body { grid-template-columns: minmax(0, 1fr); }
  .record-side { order: -1; }                 /* the facts first, then the text */
  .record-side__image { margin-left: 0; max-height: 110px; }
}

/* phones: the page first, the list of its neighbours after it */
@media (max-width: 767.98px) {
  .row:has(> .record-sidebar) { flex-direction: column; }
  .record-sidebar { order: 2; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--iti-border); }
}

/* ---- drafts made visible (contentpages/drafts.py): the mark at the top of a page, and the list of my drafts ---- */
.draft-mark {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.5rem;
  margin: .4rem 0 1.4rem; padding: .7rem 1rem;
  border: 1px solid var(--iti-border); border-left: 5px solid #c77700; border-radius: 4px; background: var(--iti-card);
}
.draft-mark--waiting { border-left-color: var(--iti-accent); }
.draft-mark--old { border-left-color: var(--iti-muted); }
.draft-mark p { margin: 0; flex: 1 1 22rem; }
.draft-mark__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.2rem; }
.draft-mark__actions form { margin: 0; }
.draft-mark__actions a, .draft-mark__actions button {
  padding: .3rem .8rem; border: 1px solid var(--iti-border); border-radius: 3px; background: var(--iti-bg);
  color: var(--iti-text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.draft-mark__actions a:hover, .draft-mark__actions a:focus-visible,
.draft-mark__actions button:hover, .draft-mark__actions button:focus-visible { border-color: var(--iti-heading); color: var(--iti-heading); }
.draft-mark__actions button { border-color: var(--iti-accent); background: var(--iti-accent); color: #fff; }
.draft-mark__actions button:hover, .draft-mark__actions button:focus-visible { background: var(--iti-heading); border-color: var(--iti-heading); color: #fff; }

.drafts-page__intro { max-width: 46rem; }
.drafts-table td, .drafts-table th { vertical-align: top; }
.drafts-table small { color: var(--iti-muted); }
.drafts-table__actions { white-space: nowrap; }
.drafts-table__actions a + a { margin-left: 1rem; }

/* ---- picture tiles rendered by the server, the same look as the React tiles (frontend/components/UzlDesign.tsx) ---- */
.record-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; margin: 1.2rem 0 0; }
.record-tile { position: relative; display: block; aspect-ratio: 23 / 12; overflow: hidden; color: #fff; background: var(--iti-card); text-decoration: none; }
.record-tile:hover, .record-tile:focus-visible { color: #fff; text-decoration: none; }
.record-tile:focus-visible { outline: 3px solid var(--iti-accent); outline-offset: 3px; }
.record-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.record-tile:hover img, .record-tile:focus-visible img { transform: scale(1.04); }
.record-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 32, 38, .78) 0%, rgba(0, 32, 38, .35) 38%, rgba(0, 32, 38, 0) 62%); }
.record-tile__text { position: absolute; left: 22px; right: 64px; bottom: 18px; z-index: 1; }
.record-tile__title { display: block; font-size: 24px; line-height: 1.25; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.record-tile__teaser { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; font-size: 16px; line-height: 1.35; opacity: .92; }
.record-tile__arrow { position: absolute; right: 20px; bottom: 18px; z-index: 1; }
/* only a logo: on a light field above a band in the site colour */
.record-tile--logo::after, .record-tile--plain::after { background: none; }
.record-tile--logo img.record-tile__logo { inset: 6% 12% auto; width: 76%; height: 42%; object-fit: contain; }
.record-tile--logo .record-tile__text { left: 0; right: 0; bottom: 0; padding: 12px 64px 14px 22px; background: var(--iti-band, #336f7b); }
.record-tile--plain { background: var(--iti-band, #336f7b) repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 14px); }
@media (max-width: 700px) {
  .record-tiles { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .record-tile__text { left: 16px; bottom: 14px; }
  .record-tile__title { font-size: 20px; }
  .record-tile__teaser { font-size: 15px; -webkit-line-clamp: 1; }
}
@media (prefers-reduced-motion: reduce) { .record-tile img { transition: none; } }

/* links to the neighbours of a record in its side column: the groups of a field, the fields of a group */
.record-side ul.record-related { list-style: none; margin: 0; padding: 0; }
.record-side ul.record-related li { margin: 0; }
.record-side ul.record-related a { color: var(--iti-heading); text-decoration: none; }
.record-side ul.record-related a:hover, .record-side ul.record-related a:focus-visible { color: var(--iti-link); text-decoration: underline; }

.record-facts dd a { color: var(--iti-heading); text-decoration: none; }
.record-facts dd a:hover, .record-facts dd a:focus-visible { color: var(--iti-link); text-decoration: underline; }
/* a long list of names, such as the completed projects of a field: in columns */
.record-completed { columns: 14rem 3; column-gap: 2.5rem; list-style: none; margin: .8rem 0 0; padding: 0; }
.record-completed li { margin: 0 0 .35rem; break-inside: avoid; }
.record-completed a { color: var(--iti-heading); text-decoration: none; }
.record-completed a:hover, .record-completed a:focus-visible { color: var(--iti-link); text-decoration: underline; }

/* a person's page: the portrait, what they do, and where to find them */
.record-side__image--portrait { max-height: 240px; width: 100%; object-fit: cover; object-position: 50% 20%; border-radius: 4px; }
.record-side__lead { margin: 0 0 1rem; font-weight: 600; }
.record-address p { margin: 0; }
.record-side staff-location { display: block; margin-top: 1.2rem; }
.record-side .iti-location h2 { margin-top: 0; }

/* ---- a person's page: the head is a block of the Jobs and Contact design (.iti-offer in iti.css),
   with the portrait standing out of it and a box with contact and office that reaches under it ---- */
.person-page { container-type: inline-size; }
.person-head .record-kind { color: inherit; opacity: .85; }
.person-head h1 { margin: .2rem 0 .6rem; }
.person-head__lead { margin: 0; font-size: 1.2rem; font-weight: 600; }
/* a portrait is upright: keep it so, with the face in view */
.iti-offer .person-head__portrait img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 18%; }
.person-head__box { display: grid; gap: 1.5rem 2.5rem; }
.person-head__box .record-facts dt { color: var(--iti-muted); }
.person-head__box .record-facts dd a { color: var(--iti-link); }
.person-head__box staff-location { display: block; min-width: 0; }
.person-head__box .iti-location h2 { margin: 0 0 .5rem; font-size: .85rem; font-weight: 600; color: var(--iti-muted); }
/* no portrait yet: the figure of the team tiles in its place */
.person-head__portrait--dummy { aspect-ratio: 4 / 5; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; background: var(--iti-card); }
.person-head__portrait--dummy svg { width: 78%; height: auto; fill: var(--iti-accent); }
/* an alumnus without anything to show beside the name: the band alone */
.person-head--bare { display: block; }
@media (max-width: 899.98px) {
  .person-head__portrait { max-width: 260px; }
}
@container (min-width: 900px) {
  .person-head { --offer-under: 5rem; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); column-gap: 3rem; }
  .person-head .iti-offer__text { padding-right: 0; }
  .person-head__box { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}

/* where a person works: research fields and groups as a row of links with their kind above the name */
.record-chips { display: flex; flex-wrap: wrap; gap: .8rem 1rem; list-style: none; margin: 1rem 0 0; padding: 0; }
.record-chips li { margin: 0; }
.record-chips a {
  display: block; padding: .6rem 1rem; border: 1px solid var(--iti-border); border-radius: 6px;
  color: var(--iti-text); font-weight: 600; text-decoration: none;
}
.record-chips small { display: block; color: var(--iti-muted); font-size: .8rem; font-weight: 400; }
.record-chips a:hover, .record-chips a:focus-visible { border-color: var(--iti-heading); color: var(--iti-heading); }

/* ---- overview pages: more to unfold (the completed projects), and the research structure ---- */
.record-more { margin-top: 3rem; }
.record-more > summary {
  display: inline-flex; align-items: center; gap: 1.2rem; padding: .85rem 1.2rem; cursor: pointer;
  border: 1px solid var(--iti-border); color: var(--iti-text); font-weight: 700; list-style: none;
}
.record-more > summary::-webkit-details-marker { display: none; }
.record-more > summary::after { content: "↓"; color: var(--iti-heading); font-size: 1.2rem; line-height: 1; }
.record-more[open] > summary::after { content: "↑"; }
.record-more > summary:hover, .record-more > summary:focus-visible { border-color: var(--iti-heading); }
.research-structure { padding: 2em; }
@media (max-width: 700px) { .research-structure { padding: 1em 0; } }

/* ---- the UnivIS export for the secretaries (teaching/export.py) ---- */
.univis-export__nav { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.univis-export__nav a[aria-current] { font-weight: 700; }
.univis-export__course { margin: 2rem 0; padding-top: 1rem; border-top: 1px solid var(--iti-border); }
.univis-export__course h2 small { color: var(--iti-muted); font-size: .7em; font-weight: 400; }
.univis-export__course dl { display: grid; grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr); gap: .4rem 1rem; }
.univis-export__course dd { margin: 0; }
.univis-export__course pre { white-space: pre-wrap; font: inherit; margin: 0; max-height: 14rem; overflow: auto; }
.univis-export__notes { border-left: 4px solid var(--iti-accent); padding: .3rem .8rem; margin: .6rem 0; }
.univis-export__notes ul { margin: .2rem 0 0; }
.univis-export__ok { color: var(--iti-muted); }
.univis-export__missing { display: inline-block; margin-left: .6rem; color: var(--iti-accent); }
.univis-export__copy { margin-left: .6rem; padding: 0 .5rem; border: 1px solid var(--iti-border); border-radius: 3px;
  background: var(--iti-bg); color: var(--iti-text); font-size: .85em; cursor: pointer; }
@media (max-width: 600px) { .univis-export__course dl { grid-template-columns: minmax(0, 1fr); } }

/* ---- "update now" for team members, on the teaching page and the UnivIS export (teaching/updates.py) ---- */
.course-update { clear: both; margin: 1.5rem 0; padding: .6rem .9rem; border-left: 4px solid var(--iti-border); color: var(--iti-muted); }
.course-update p { margin: 0 0 .4rem; }
.course-update form { margin: 0; }
.course-update button { padding: .3rem .8rem; border: 1px solid var(--iti-accent); border-radius: 3px; background: var(--iti-accent);
  color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.course-update button:hover, .course-update button:focus-visible { background: var(--iti-heading); border-color: var(--iti-heading); }
