/* PRIMER project website — style loosely based on gvidal.webs.upv.es */

body {
  font-family: "Trebuchet MS", "Lucida Sans", Arial, sans-serif;
  font-size: 100%;
  color: #000;
  background: #fff;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 30px 30px;
  line-height: 1.5;
}

a { color: rgb(7, 103, 229); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
b, strong { color: rgb(204, 0, 71); font-weight: 600; }

/* ---------- Funding banner (must stay at the top of every page) ---------- */
#funding {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 18px;
  padding: 14px 0 12px;
  border-bottom: 1px solid #ddd;
  font-size: 85%;
  color: #333;
}
#funding img { height: 68px; width: auto; max-width: 100%; }

/* ---------- Header ---------- */
#header { text-align: center; padding-top: 22px; }
#header h1 {
  font-weight: 400;
  font-size: 230%;
  letter-spacing: 0.06em;
  margin: 0;
}
#header .subtitle {
  font-family: "Times New Roman", Times, serif;
  font-style: italic;
  font-size: 118%;
  margin: 4px 0 0;
}
#header .affiliation { font-size: 90%; padding: 10px 0 18px; margin: 0; }

/* ---------- Menu ---------- */
#menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 30px;
  padding: 8px 0 4px;
  margin: 0;
  list-style: none;
}
#menu a {
  color: rgb(153, 0, 0);
  font-size: 110%;
  text-decoration: underline;
}
#menu a.current { text-decoration: none; font-weight: 700; }

/* ---------- Body ---------- */
h3 {
  font-size: 140%;
  font-weight: 400;
  text-align: center;
  margin-top: 2em;
}
h4 { font-size: 115%; font-weight: 400; margin: 1.6em 0 0.4em; }
p, ul, ol, dl, table { font-size: 92%; }
li { padding-top: 6px; }
.title { color: rgb(153, 0, 0); }
.muted { color: #666; }

.lead {
  font-size: 100%;
  text-align: justify;
}

.query {
  margin: 1.4em auto;
  max-width: 640px;
  border-left: 4px solid rgb(153, 0, 0);
  background: #faf6f2;
  padding: 10px 18px;
  font-size: 92%;
}
.query q { font-style: italic; }

/* three pillars */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 1em;
}
.pillar {
  border: 1px solid #e3e3e3;
  border-top: 3px solid rgb(153, 0, 0);
  padding: 4px 16px 10px;
}
.pillar h4 { margin-top: 0.6em; color: rgb(153, 0, 0); }
.pillar p { font-size: 88%; margin: 0.3em 0; }

/* key facts */
table.facts { border-collapse: collapse; margin: 0 auto; }
table.facts th, table.facts td {
  text-align: left;
  vertical-align: top;
  padding: 5px 14px;
  border-bottom: 1px solid #eee;
}
table.facts th { font-weight: 600; color: #444; white-space: nowrap; }

/* news */
ul.news { list-style: none; padding-left: 0; }
ul.news .date { font-family: "Courier New", monospace; font-weight: 600; margin-right: 10px; }
ul.news.full li { padding-top: 12px; }

/* home page: intro + latest-news column */
.home-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 32px;
  align-items: start;
}
.latest {
  margin-top: 2.6em;
  background: #faf6f2;
  border-top: 3px solid rgb(153, 0, 0);
  padding: 4px 16px 8px;
}
.latest h4 { margin: 0.6em 0 0.2em; color: rgb(153, 0, 0); text-align: center; }
.latest ul.news { font-size: 85%; margin: 0.4em 0; }
.latest ul.news li { padding-top: 8px; }
.latest ul.news .date { display: block; margin: 0; }
.latest .more { font-size: 85%; text-align: right; margin: 0.6em 0 0.2em; }
@media (max-width: 760px) {
  .home-top { grid-template-columns: 1fr; gap: 0; }
  .latest { margin-top: 1em; }
}

/* work packages */
.wp { margin-top: 1.8em; }
.wp h4 { margin-bottom: 0.2em; }
.wp .meta { font-size: 85%; color: #555; margin: 0 0 0.4em; }
.wp ul { margin-top: 0.3em; }
.task { font-family: "Courier New", monospace; font-weight: 600; }
.months { color: #666; font-size: 90%; }

/* Gantt chart */
.gantt-wrap { overflow-x: auto; margin-top: 1em; }
.gantt {
  display: grid;
  grid-template-columns: 52px repeat(36, minmax(15px, 1fr));
  min-width: 640px;
  font-size: 78%;
  row-gap: 3px;
}
.gantt .hdr { text-align: center; background: #f0ebe6; border-left: 1px solid #fff; padding: 2px 0; }
.gantt .lbl { font-family: "Courier New", monospace; font-weight: 600; padding-right: 6px; text-align: right; }
.gantt .wpname {
  grid-column: 1 / -1;
  font-weight: 600;
  color: rgb(153, 0, 0);
  padding-top: 6px;
  border-bottom: 1px solid #eee;
}
.gantt .bar {
  background: rgb(7, 103, 229);
  opacity: 0.8;
  border-radius: 3px;
  height: 14px;
  align-self: center;
  position: relative;
}
.gantt .bar.ms::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 2px;
  width: 9px;
  height: 9px;
  background: rgb(204, 0, 71);
  transform: rotate(45deg);
}
.legend { font-size: 82%; color: #555; text-align: center; margin-top: 0.8em; }
.legend .dia {
  display: inline-block; width: 9px; height: 9px; background: rgb(204, 0, 71);
  transform: rotate(45deg); margin: 0 4px 0 2px;
}

/* team */
.people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px 24px;
  margin-top: 1em;
}
.person { border-left: 3px solid #e3d7cc; padding: 2px 0 2px 12px; font-size: 92%; }
.person .name { font-size: 108%; font-weight: 600; }
.person .role { color: rgb(153, 0, 0); }
.person .aff, .person .area { color: #444; }

.empty {
  text-align: center;
  color: #666;
  font-style: italic;
  border: 1px dashed #ccc;
  padding: 24px;
  margin: 1.5em 0;
}

/* publications (as in gvidal.webs.upv.es) */
.year { font-family: "Courier New", monospace; font-weight: 600; }
.noitems { list-style-type: square; }
.noitems li { padding-top: 10px; }
.copyright { font-size: 60%; padding: 5px; background-color: #F0FDE4; }

/* ---------- Footer ---------- */
#footer {
  margin-top: 3.5em;
  padding-top: 12px;
  border-top: 1px solid #ddd;
  font-size: 80%;
  color: #555;
  text-align: center;
}
#footer p { margin: 0.3em 0; }

@media (max-width: 600px) {
  body { padding: 0 14px 20px; }
  #funding img { height: 42px; }
  #menu { gap: 4px 16px; }
  .lead { text-align: left; }
}

/* ===================== MiST group site additions ===================== */
#header .logo { height: 96px; width: auto; display: block; margin: 0 auto 6px; }
#header.mist { padding-top: 26px; }

.highlight {
  margin: 1.6em auto 0;
  max-width: 700px;
  border: 1px solid #e3e3e3;
  border-top: 3px solid rgb(153, 0, 0);
  background: #faf6f2;
  padding: 6px 20px 10px;
  font-size: 92%;
}
.highlight h4 { margin: 0.5em 0 0.2em; color: rgb(153, 0, 0); }
.highlight p { margin: 0.4em 0; }

ul.interests li { padding-top: 10px; text-align: justify; }

ul.names {
  list-style: square;
  columns: 3 200px;
  column-gap: 30px;
  margin-top: 1em;
}
ul.names li { break-inside: avoid; padding-top: 6px; }

.project { margin-top: 1.4em; font-size: 92%; }
.project .pname { font-size: 112%; font-weight: 600; color: rgb(153, 0, 0); }
.project .ptitle { font-style: italic; }
.project p { margin: 0.25em 0; font-size: 100%; }
.project .meta { color: #555; }

.back { margin-top: 2em; font-size: 90%; }
