/* pages.css — shared components for the inner pages (PI, Biophysicists, Projects, Gallery).
   Used together with home.css (body class="home" supplies the colour tokens). */

/* ---------------- Page hero ---------------- */
.p-hero { padding: 120px 0 28px; }
.p-title {
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: clamp(36px, 5.4vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: #fff;
  margin: 14px 0 14px;
}
.p-lead { color: #c4cfd3; font-size: clamp(16px, 1.5vw, 19px); max-width: 680px; line-height: 1.6; margin: 0; }

/* ---------------- In-page section tabs ---------------- */
.p-tabs {
  position: sticky;
  top: 78px;
  z-index: 20;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  margin: 26px 0 0;
  background: rgba(6, 8, 10, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  scrollbar-width: none;
}
.p-tabs::-webkit-scrollbar { display: none; }
.p-tabs a, .p-tabs button {
  flex: none;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: #dfe6e8;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.p-tabs a:hover, .p-tabs button:hover { border-color: var(--h-green); color: #fff; }
.p-tabs .active { background: var(--h-green); border-color: var(--h-green); color: #fff; }
@media (max-width: 1279px) { .p-tabs { top: 70px; } }

.p-section { padding: 46px 0; scroll-margin-top: 140px; }
.p-section + .p-section { border-top: 1px solid var(--h-line); }

/* ---------------- Generic panel ---------------- */
.p-card {
  background: var(--h-panel);
  border: 1px solid var(--h-line);
  border-radius: 18px;
  padding: 24px;
}
.p-card h3 { font-family: var(--font-primary); font-size: 18px; font-weight: 700; color: #fff; margin: 0 0 12px; }
.p-card h3 i { color: #7fe0b8; margin-right: 8px; }
.p-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.p-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .p-grid-2, .p-grid-3 { grid-template-columns: 1fr; } }

.p-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 2px 8px;
  background: rgba(39, 167, 118, 0.15);
  color: #7fe0b8;
  white-space: nowrap;
}
.p-badge.violet { background: rgba(139, 124, 246, 0.16); color: #c3b9ff; }
.p-badge.teal { background: rgba(43, 183, 196, 0.15); color: #8be4ec; }
.p-badge.gold { background: rgba(255, 207, 51, 0.16); color: #ffd966; }

/* ---------------- Year/entry rows ---------------- */
.p-rows { list-style: none; margin: 0; padding: 0; }
.p-rows li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--h-line);
  color: var(--h-text);
}
.p-rows li:last-child { border-bottom: 0; }
.p-rows .p-year { font-family: ui-monospace, Consolas, monospace; font-size: 14px; color: #7fe0b8; }
.p-rows .p-sub { display: block; color: var(--h-dim); font-size: 14px; margin-top: 2px; }
.p-rows a { color: var(--h-text); border-bottom: 1px dotted rgba(255, 255, 255, 0.35); }
.p-rows a:hover { color: #7fe0b8; border-color: #7fe0b8; }
@media (max-width: 560px) {
  .p-rows li { grid-template-columns: 1fr; }
  .p-rows .p-badge { justify-self: start; }
}

/* ---------------- Vertical timeline ---------------- */
.p-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.p-timeline li { position: relative; padding: 0 0 26px 30px; border-left: 1px solid rgba(39, 167, 118, 0.35); margin-left: 6px; }
.p-timeline li:last-child { padding-bottom: 0; }
.p-timeline li::before {
  content: ""; position: absolute; left: -7px; top: 3px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--h-bg); border: 2px solid var(--h-green);
}
.p-timeline li:first-child::before { background: var(--h-green); box-shadow: 0 0 0 4px rgba(39, 167, 118, 0.25); }
.p-timeline .p-when { display: block; font-size: 13px; font-weight: 600; color: #7fe0b8; margin-bottom: 3px; }
.p-timeline .p-what { font-weight: 600; color: #fff; }
.p-timeline .p-where { display: block; color: var(--h-dim); font-size: 14px; }

/* ---------------- Icon tiles (awards etc.) ---------------- */
.p-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.p-tile {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--h-panel);
  border: 1px solid var(--h-line);
  border-radius: 16px;
  padding: 16px 18px;
  color: var(--h-text);
}
.p-tile i {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 207, 51, 0.12); color: #ffd966; font-size: 18px;
}
.p-tile small { display: block; color: var(--h-dim); margin-top: 2px; }

/* ---------------- Chips (names) ---------------- */
.p-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.p-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--h-line);
  color: var(--h-text);
  font-size: 14px;
}
.p-chip small { color: var(--h-dim); margin-left: 4px; }

/* ---------------- PI profile ---------------- */
.pi-hero { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 44px; align-items: center; }
.pi-photo { margin: 0; }
.pi-photo img { width: 100%; border-radius: 22px; border: 1px solid var(--h-line); display: block; }
.pi-photo figcaption { font-size: 12px; color: var(--h-dim); margin-top: 8px; }
.pi-role { color: #c4cfd3; font-size: 18px; margin: 0 0 22px; }
.pi-contact { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.pi-contact li { display: flex; gap: 12px; align-items: flex-start; color: var(--h-text); }
.pi-contact i { color: #7fe0b8; font-size: 18px; margin-top: 1px; }
.pi-contact a { color: var(--h-text); border-bottom: 1px dotted rgba(255, 255, 255, 0.35); }
.pi-contact a:hover { color: #7fe0b8; }
@media (max-width: 900px) { .pi-hero { grid-template-columns: 1fr; gap: 28px; } }

/* ---------------- Members ---------------- */
.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.m-card {
  background: var(--h-panel);
  border: 1px solid var(--h-line);
  border-radius: 20px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
}
.m-card:hover { transform: translateY(-4px); border-color: rgba(39, 167, 118, 0.6); }
.m-photo { position: relative; aspect-ratio: 4 / 4.4; background: #11171a; overflow: hidden; }
.m-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; transition: transform 0.4s; }
.m-card:hover .m-photo img { transform: scale(1.04); }
.m-photo .p-badge { position: absolute; left: 12px; top: 12px; backdrop-filter: blur(6px); background: rgba(6, 8, 10, 0.7); }
.m-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.m-name { font-family: var(--font-primary); font-size: 19px; font-weight: 700; color: #fff; margin: 0; line-height: 1.25; }
.m-meta { font-size: 13px; color: #7fe0b8; font-weight: 600; }
.m-role { font-size: 14px; color: var(--h-dim); }
.m-project { font-size: 14px; color: var(--h-text); margin-top: 4px; }
.m-id { margin-top: auto; padding-top: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: #6d7a80; }
.m-pi { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 34px; }
.m-pi img { width: 200px; height: 200px; object-fit: cover; border-radius: 50%; border: 2px solid var(--h-green); }
.m-pi h2 { font-family: var(--font-primary); font-weight: 800; color: #fff; font-size: 30px; margin: 4px 0 6px; }
.m-pi p { color: var(--h-dim); margin: 0 0 14px; }
@media (max-width: 560px) {
  .m-pi { grid-template-columns: 1fr; text-align: left; }
  .m-pi img { width: 140px; height: 140px; }
  .m-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .m-name { font-size: 16px; }
  .m-body { padding: 12px; }
  .m-project { font-size: 13px; }
}

/* ---------------- Videos ---------------- */
.v-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.v-card { background: var(--h-panel); border: 1px solid var(--h-line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.v-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.v-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.v-play {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; padding: 0; cursor: pointer; background: #000;
}
.v-play img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: opacity 0.2s; }
.v-play:hover img { opacity: 1; }
.v-play span {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(39, 167, 118, 0.92); color: #fff; font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.v-body { padding: 16px 18px 18px; }
.v-body h3 { font-family: var(--font-primary); font-size: 17px; font-weight: 700; color: #fff; margin: 8px 0 6px; line-height: 1.35; }
.v-body p { color: var(--h-dim); font-size: 14px; margin: 0 0 10px; }
.v-body a { font-weight: 600; font-size: 14px; color: #7fe0b8; }

/* ---------------- Gallery (bento) ---------------- */
.g-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 210px;
  grid-auto-flow: dense;
  gap: 12px;
}
.g-item {
  position: relative;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: #11171a;
  border: 1px solid var(--h-line);
}
.g-item.wide { grid-column: span 2; }
.g-item.tall { grid-row: span 2; }
.g-item.big { grid-column: span 2; grid-row: span 2; }
.g-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.g-item:hover img { transform: scale(1.05); }
.g-item::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0) 55%);
  opacity: 0.85; transition: opacity 0.25s;
  pointer-events: none;
}
.g-item:not(.has-cap)::after { opacity: 0; }
.g-item:hover::after { opacity: 1; }
.g-cap {
  position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1;
  color: #fff; font-size: 14px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.g-tag {
  position: absolute; left: 12px; top: 12px; z-index: 1;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(6, 8, 10, 0.72); color: #7fe0b8;
  backdrop-filter: blur(6px);
}
.g-item:focus-visible { outline: 3px solid var(--h-green); outline-offset: 2px; }
.g-item.hidden { display: none; }
.g-count { color: var(--h-dim); font-size: 14px; margin: 8px 0 14px; }
@media (max-width: 1000px) { .g-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 160px; gap: 8px; }
  .g-cap { font-size: 12.5px; -webkit-line-clamp: 2; }
}
.p-rows .p-badge { white-space: normal; max-width: 260px; text-align: center; line-height: 1.35; padding: 3px 8px; }
@media (min-width: 901px) { .p-grid-theses { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
