/*
 * Conference topic pages (/conferences/<topic>/) and the "Browse by topic" bar on /conferences/.
 * Colours and type follow the conference directory on /conferences/.
 */

.tp,
.tp-topics {
  --tp-ink: #242428;
  --tp-muted: #52565b;
  --tp-accent: #a51c22;
  --tp-accent-dark: #86161b;
  --tp-rule: #dcdde0;
  --tp-soft: #f7f7f6;
}

/* ---------- page frame ---------- */

.tp {
  display: block;
  box-sizing: border-box;
  padding: clamp(24px, 4vw, 58px) clamp(14px, 4vw, 60px);
  background: var(--tp-soft);
  color: var(--tp-ink);
  font: 400 16px/1.6 Arial, Helvetica, sans-serif;
  letter-spacing: normal;
  word-spacing: normal;
  text-align: left;
}
.tp *,
.tp *::before,
.tp *::after { box-sizing: border-box; }
.tp-inner { max-width: 1120px; margin: 0 auto; }

.tp a { color: var(--tp-accent); text-decoration: none; }
.tp a:hover { text-decoration: underline; }
.tp :focus-visible,
.tp-topics :focus-visible { outline: 3px solid #155f91; outline-offset: 2px; }

/* the site-wide heading rules (white, uppercase, red bar) are for the old layout */
.tp h1,
.tp h2,
.tp h3,
.tp h4 { text-transform: none; letter-spacing: normal; text-align: left; }
.tp h2::before,
.tp h3::before,
.tp h4::before { content: none; }

/* both sit in <nav>, which the site styles as the uppercase main menu */
.tp-breadcrumb,
.tp-topics { margin: 0; padding: 0; text-transform: none; }

/* ---------- breadcrumb, heading, introduction ---------- */

.tp-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  color: var(--tp-muted);
  font: 400 15px/1.4 'Roboto Condensed', Arial, sans-serif;
}
.tp-breadcrumb li + li::before { content: "\203A"; margin-right: 8px; color: #9a9ca0; }
.tp-breadcrumb a { color: var(--tp-muted); }

.tp h1.tp-title {
  margin: 0 0 18px;
  padding: 0 0 0 14px;
  border: 0;
  border-left: 4px solid var(--tp-accent);
  color: var(--tp-ink);
  font: 700 clamp(28px, 3.6vw, 46px)/1.18 'Merriweather', Georgia, serif;
  letter-spacing: -.03em;
}

.tp-lead {
  max-width: 860px;
  margin: 0 0 18px;
  color: var(--tp-ink);
  font: 400 clamp(16px, 1.45vw, 18px)/1.75 'Merriweather', Georgia, serif;
}

.tp-glance {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
  color: var(--tp-muted);
  font: 400 16px/1.4 'Roboto Condensed', Arial, sans-serif;
}
.tp-glance li + li::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 14px;
  margin: 0 14px;
  background: #b9bbbf;
  vertical-align: -2px;
}
.tp-glance strong { color: var(--tp-accent); font-weight: 700; }

/* ---------- topic buttons (also used on /conferences/) ---------- */

nav.tp-topics { margin: 0 0 34px; letter-spacing: normal; word-spacing: normal; text-align: left; }
.tp-topics__label {
  margin: 0 0 10px;
  color: var(--tp-muted);
  font: 700 13px/1.3 'Roboto Condensed', Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tp-topics ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tp-topics li { margin: 0; padding: 0; float: none; min-width: 0; }
.tp-topics a.tp-chip,
.tp-topics a.tp-chip:hover {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid #c6c7ca;
  border-radius: 999px;
  background: #fff;
  color: var(--tp-ink);
  font: 700 15px/1.25 'Roboto Condensed', Arial, sans-serif;
  text-decoration: none;
  transition: border-color .15s, color .15s, background-color .15s;
}
.tp-topics a.tp-chip:hover { border-color: var(--tp-accent); color: var(--tp-accent); }
.tp-topics a.tp-chip[aria-current="page"] {
  border-color: var(--tp-accent);
  background: var(--tp-accent);
  color: #fff;
}

/* ---------- sections ---------- */

.tp-section { margin: 0 0 34px; }
.tp h2.tp-section-title {
  margin: 0 0 16px;
  padding: 0 0 10px;
  border: 0;
  border-bottom: 1px solid var(--tp-rule);
  color: var(--tp-ink);
  font: 700 clamp(20px, 2vw, 24px)/1.3 'Merriweather', Georgia, serif;
}
.tp-empty { margin: 0; color: var(--tp-muted); }

/* ---------- conference card ---------- */

.tp-card,
.tp-group__header {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: clamp(16px, 2.4vw, 30px);
  align-items: start;
}
.tp-card {
  margin: 0 0 16px;
  padding: clamp(16px, 2vw, 26px);
  border: 1px solid var(--tp-rule);
  border-radius: 10px;
  background: #fff;
  scroll-margin-top: 120px;
}
.tp-card__logo img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #ececee;
  border-radius: 8px;
  background: #fff;
}
.tp a.tp-card__logo { display: block; }
.tp a.tp-card__logo img { transition: border-color .15s; }
.tp a.tp-card__logo:hover img { border-color: var(--tp-accent); }
.tp-card__body { min-width: 0; }

.tp .tp-card__title {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  color: var(--tp-ink);
  font: 700 clamp(18px, 1.7vw, 22px)/1.35 'Merriweather', Georgia, serif;
}
.tp .tp-group__items .tp-card__title { font-size: clamp(17px, 1.5vw, 19px); }
.tp-card__title a { color: inherit; }
.tp-card__title sup { font-size: .6em; line-height: 0; text-transform: lowercase; }

.tp-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  color: var(--tp-muted);
  font: 400 15px/1.5 Arial, Helvetica, sans-serif;
}
.tp-facts__label { margin-right: 4px; color: var(--tp-ink); font-weight: 700; }

.tp-card__summary {
  max-width: 76ch;
  margin: 0 0 12px;
  color: var(--tp-muted);
  font: 400 15px/1.6 Arial, Helvetica, sans-serif;
}

.tp-partof {
  max-width: 76ch;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-left: 3px solid var(--tp-accent);
  border-radius: 0 6px 6px 0;
  background: #f8f3f3;
  color: var(--tp-ink);
  font: 400 14.5px/1.55 Arial, Helvetica, sans-serif;
}
.tp-partof sup { font-size: .7em; line-height: 0; }

.tp-card__actions { margin: 0; }
.tp a.tp-button {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 6px;
  background: var(--tp-accent);
  color: #fff;
  font: 700 15px/1.2 'Roboto Condensed', Arial, sans-serif;
  text-decoration: none;
  transition: background-color .15s;
}
.tp a.tp-button::after { content: " \2197"; }
.tp a.tp-button:hover { background: var(--tp-accent-dark); text-decoration: none; }

/* ---------- congress block: the congress, with its conferences as branches under it ---------- */

.tp-group {
  --tree-x: 84px;        /* centre of the congress logo column (168px / 2) */
  --tree-gap: 30px;      /* length of each branch */
  --tree-branch-y: 54px; /* where a branch meets a conference: the middle of its logo */
  --tree-line: #d8b6b8;
  margin: 0 0 20px;
  padding: clamp(16px, 2vw, 26px);
  border: 1px solid var(--tp-rule);
  border-radius: 12px;
  background: #fff;
  scroll-margin-top: 120px;
}
.tp-group__kicker {
  margin: 0 0 6px;
  color: var(--tp-accent);
  font: 700 12.5px/1.2 'Roboto Condensed', Arial, sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* the trunk starts under the congress logo ... */
.tp-group__logo { position: relative; align-self: stretch; }
.tp-group__logo .tp-card__logo { position: relative; z-index: 1; }
.tp-group__logo::after {
  content: "";
  position: absolute;
  top: 40px;
  bottom: 0;
  left: calc(50% - 1px);
  width: 2px;
  background: var(--tree-line);
}

/* ... runs past the label and every conference, and stops at the last branch */
.tp-group__items { padding-top: 16px; }
.tp-group__label,
.tp .tp-member { position: relative; margin-left: calc(var(--tree-x) + var(--tree-gap)); }
.tp-group__label {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--tp-muted);
  font: 700 12.5px/1.3 'Roboto Condensed', Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tp-group__label::before,
.tp .tp-member::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--tree-gap) - 1px);
  width: 2px;
  background: var(--tree-line);
}
.tp-group__label::before { top: -16px; bottom: -10px; }
.tp .tp-member::before { top: 0; bottom: -12px; }
.tp .tp-member:last-child::before { bottom: auto; height: calc(var(--tree-branch-y) + 1px); }
.tp .tp-member::after {
  content: "";
  position: absolute;
  top: var(--tree-branch-y);
  left: calc(-1 * var(--tree-gap));
  width: var(--tree-gap);
  height: 2px;
  background: var(--tree-line);
}

/* a conference inside a congress: lighter than a stand-alone card */
.tp .tp-member {
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 20px;
  margin-right: 0;
  margin-bottom: 12px;
  padding: 16px 18px;
  border: 0;
  border-radius: 8px;
  background: #faf6f6;
}
.tp .tp-member:last-child { margin-bottom: 0; }
.tp .tp-member .tp-card__logo img { border-color: #eee3e3; }
.tp .tp-card--no-logo { grid-template-columns: minmax(0, 1fr); }

/* ---------- about ---------- */

.tp-about {
  margin: 0 0 34px;
  padding: clamp(18px, 2.4vw, 30px);
  border: 1px solid var(--tp-rule);
  border-radius: 10px;
  background: #fff;
}
.tp-about p {
  max-width: 80ch;
  margin: 0 0 14px;
  color: var(--tp-ink);
  font: 400 15.5px/1.8 'Merriweather', Georgia, serif;
}
.tp-about p:last-child { margin-bottom: 0; }
.tp-about a,
.tp-lead a,
.tp-empty a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- helpers ---------- */

.tp-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* the slide-out menu title (was an h1) */
#slide-menu .slide-menu-title {
  margin: 0;
  padding: 1em;
  color: #fff;
  font: 500 .95em 'Roboto Condensed', sans-serif;
  text-transform: uppercase;
}

/* site search box, as on /conferences/ */
.searchbox.grid { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 16px; box-sizing: border-box; }
.searchbox.grid > .unit { width: auto; min-width: 0; }
.searchbox.grid > .unit:last-child { width: min(580px, 100%); }
.searchbox .search p.body { height: auto; padding: 0; margin: 0; }
.searchbox #___gcse_0 { padding: 0; }
.searchbox .gsc-control-searchbox-only { width: 100%; }
.searchbox form.gsc-search-box { box-sizing: border-box; width: 100%; max-width: 100%; margin: 0; }
.searchbox table.gsc-search-box { width: 100%; margin: 0; }
.searchbox td.gsc-input,
.searchbox td.gsib_a,
.searchbox td.gsib_b { padding: 0; }
.searchbox .gsc-input-box td.gsib_a { width: auto; }
.searchbox .gsc-input-box td.gsib_b { display: table-cell; width: 46px; }
.searchbox .gsc-input-box { box-sizing: border-box; max-width: 100%; }
.searchbox input.gsc-input { min-width: 0; max-width: 100%; }

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .tp-card,
  .tp-group__header,
  .tp .tp-member { grid-template-columns: 1fr; }
  .tp-card__logo { max-width: 140px; }
  .tp-group { --tree-x: 8px; --tree-gap: 18px; --tree-branch-y: 50px; }
  .tp-group__logo::after { display: none; }
  .tp .tp-member { padding: 14px; }
  .tp .tp-member .tp-card__logo { max-width: 96px; }
  .tp-glance { flex-direction: column; gap: 2px; }
  .tp-glance li + li::before { display: none; }
  .tp-topics a.tp-chip,
  .tp-topics a.tp-chip:hover { padding: 6px 12px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .tp-topics a.tp-chip,
  .tp a.tp-button { transition: none; }
}
