/* Shared styles for the Join Us page and its sub-pages
   (hiring-students, research-vision, advising, starter-guide). */

#layout-content {
  max-width: 1080px;
}
img {
  max-width: 100%;
  height: auto;
}

/* ---------- carried over from the original hiring page ---------- */
.join-hero {
  border-bottom: 1px solid #aaaaaa;
  margin-bottom: 1.2em;
  padding-bottom: 1.0em;
}
.join-hero h1 {
  border-bottom: none;
  color: #224b8d;
  font-size: 190%;
  margin-bottom: 0.25em;
}
.lead {
  color: #222222;
  font-size: 112%;
  line-height: 1.45;
  max-width: 920px;
}
.note {
  background: #f6f8fb;
  border-left: 4px solid #527bbd;
  margin: 1.0em 0;
  padding: 0.8em 1.0em;
}
.callout {
  background: #f8fbf7;
  border-left: 4px solid #2e7d32;
  margin: 1.0em 0;
  padding: 0.8em 1.0em;
}
.research-card {
  border-top: 1px solid #dddddd;
  margin-top: 1.1em;
  padding-top: 0.8em;
}
.research-card h3 {
  color: #224b8d;
  margin-bottom: 0.2em;
}
.direction-sub {
  color: #527bbd;
  font-style: italic;
  margin-top: 0;
}
.figure {
  margin: 1.0em 0 1.2em 0;
}
.figure img {
  border: 1px solid #dddddd;
}
.caption {
  color: #666666;
  font-size: 90%;
  line-height: 1.35;
  margin-top: 0.3em;
}
.tagline {
  color: #2e7d32;
  font-weight: bold;
}
.advising-question {
  color: #224b8d;
  margin-bottom: 0.25em;
  margin-top: 1.1em;
}
.fine-print {
  color: #666666;
  font-size: 90%;
}

/* ---------- new: condensed Join Us page ---------- */
.creds {
  color: #555555;
  font-size: 92%;
  margin-top: 0.4em;
}

.openings {
  display: grid;
  gap: 0.9em;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1.0em 0 1.0em 0;
}
/* exactly three openings: one row of three (four openings: 2x2) */
@media (min-width: 761px) {
  .openings:has(> .opening:nth-child(3):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.opening {
  background: #ffffff;
  border: 1px solid #dddddd;
  border-top: 3px solid #2e7d32;
  padding: 0.6em 0.9em 0.7em 0.9em;
}
.opening-head {
  align-items: flex-start;
  display: flex;
  gap: 0.6em;
  justify-content: space-between;
  margin-bottom: 0.3em;
}
.opening-head b {
  color: #224b8d;
  font-size: 105%;
  line-height: 1.3;
}
.opening p {
  margin: 0.35em 0;
}
.opening .fit {
  color: #555555;
  font-size: 90%;
}
ul.deadlines {
  border-top: 1px dashed #dddddd;
  list-style: none;
  margin: 0.6em 0 0 0;
  padding: 0.45em 0 0 0;
}
ul.deadlines li {
  display: flex;
  font-size: 92%;
  gap: 0.5em;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}
ul.deadlines li b {
  flex-shrink: 0;
  white-space: nowrap;
}
ul.deadlines li span {
  color: #555555;
}
.status {
  background: #e8f3e8;
  border-radius: 3px;
  color: #2e7d32;
  font-size: 85%;
  padding: 0.1em 0.45em;
  white-space: nowrap;
}

.card-grid {
  display: grid;
  gap: 0.9em;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0.6em 0 1.0em 0;
}
.card {
  background: #ffffff;
  border: 1px solid #dddddd;
  border-top: 3px solid #527bbd;
  display: flex;
  flex-direction: column;
  padding: 0 0.9em 0.7em 0.9em;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  box-shadow: 0 8px 20px rgba(34, 75, 141, 0.14);
  transform: translateY(-3px);
}
.card:focus-within {
  outline: 2px solid #527bbd;
  outline-offset: 2px;
}
.card-media {
  background: #f6f8fb;
  border-bottom: 1px solid #e3e8f0;
  margin: 0 -0.9em 0.3em -0.9em;
}
.card-media img {
  display: block;
  width: 100%;
}
.card h3 {
  color: #224b8d;
  font-size: 105%;
  margin-top: 0.4em;
}
/* the title link covers the whole card, so clicking anywhere opens the section */
.card-link,
.card-link:visited {
  color: #224b8d;
  text-decoration: none;
}
.card-link::after {
  content: "";
  inset: 0;
  position: absolute;
  z-index: 1;
}
.card .example a {
  position: relative;
  z-index: 2;
}
.card p {
  margin: 0.4em 0;
}
.card h3 {
  margin-bottom: 0.15em;
}
.card .card-sub {
  color: #527bbd;
  font-size: 92%;
  font-style: italic;
  margin-top: 0;
}
.card .fit,
.card .example {
  color: #555555;
  font-size: 90%;
}
.card .more {
  color: #527bbd;
  font-size: 90%;
  margin-top: auto;
  padding-top: 0.3em;
}
.card .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}
.card:hover .arrow {
  transform: translateX(4px);
}

/* fade-in on scroll: cards stay visible by default; the page script marks
   off-screen cards "pending" and switches them to "in" when they scroll into view */
@keyframes card-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.js-reveal .card-grid .card.pending {
  opacity: 0;
}
.js-reveal .card-grid .card.in {
  animation: card-rise 0.6s ease backwards;
}
.js-reveal .card-grid .card.in:nth-child(2) { animation-delay: 0.1s; }
.js-reveal .card-grid .card.in:nth-child(3) { animation-delay: 0.2s; }
.js-reveal .card-grid .card.in:nth-child(4) { animation-delay: 0.3s; }

/* research-vision.html: flash the section a card linked to */
.research-card {
  scroll-margin-top: 12px;
}
@keyframes target-flash {
  0%, 35% { background: #fff6d5; }
  100%    { background: transparent; }
}
.research-card:target {
  animation: target-flash 2.2s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .card .arrow {
    transition: none;
  }
  .card:hover,
  .card:hover .arrow {
    transform: none;
  }
  .research-card:target {
    animation: none;
  }
}

ul.offer li {
  margin-bottom: 0.45em;
}

.subject {
  background: #f4f4f4;
  font-family: Menlo, Consolas, monospace;
  font-size: 90%;
  padding: 0.1em 0.35em;
  white-space: nowrap;
}

.more-links {
  border-top: 1px solid #dddddd;
  margin-top: 1.5em;
  padding-top: 0.8em;
}
.more-links a {
  margin-right: 1.2em;
}

/* ---------- phones: stack the jemdoc menu above the content ---------- */
@media (max-width: 760px) {
  body {
    min-width: 0;
  }
  table#tlayout,
  table#tlayout > tbody,
  table#tlayout > tbody > tr,
  table#tlayout > tr,
  table#tlayout td#layout-menu,
  table#tlayout td#layout-content {
    display: block;
    width: auto;
  }
  #layout-menu {
    padding: 0.3em 12px 0.5em 12px;
    white-space: normal;
  }
  #layout-menu .menu-item {
    display: inline-block;
  }
  #layout-menu a {
    margin-left: 0;
    margin-right: 0.8em;
  }
  #layout-content {
    padding-left: 16px;
    padding-right: 16px;
  }
  .join-hero h1 {
    font-size: 160%;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .js-reveal .card-grid .card.in:nth-child(n) {
    animation-delay: 0s;
  }
  .subject {
    white-space: normal;
  }
  .openings {
    grid-template-columns: 1fr;
  }
}
