/* Homepage layout and theme — loads after main.css */

:root {
  /* Cornell red — https://brand.cornell.edu/colors/ */
  --cornell-red: #b31b1b;
  --cornell-red-dark: #7a1212;
  --site-bg: #f9f6f6;
  --site-surface: #ffffff;
  --site-text: #0d1117;
  --site-muted: #3d444d;
  --site-accent: var(--cornell-red);
  --site-accent-dark: var(--cornell-red-dark);
  --site-border: rgba(179, 27, 27, 0.14);
  --site-radius: 10px;
  --site-shadow: 0 4px 24px rgba(60, 12, 12, 0.08);
  /* Main white column + hero title width — match legacy main.css content-holder (900px) */
  --site-max: min(900px, calc(100vw - 2rem));
  --site-section-gap: 2.75rem;
  --site-content-pad: clamp(1rem, 4vw, 1.75rem);
  /* Two text scales: main copy = main.css `p` (About, etc.); supporting = job callout, sidebar, pub. note */
  --site-copy-size: 1.15rem;
  --site-supporting-size: 0.98rem;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--site-bg);
  color: var(--site-text);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Main copy: match theme color (Bootstrap `p` is larger but inherits gray from legacy rules) */
.main-frame .content-holder p,
.main-frame .content-holder li {
  color: var(--site-text);
}

/* Hero */
.top-frame {
  height: auto;
  min-height: clamp(120px, 15vh, 175px);
  padding: 0;
  background-color: var(--site-accent-dark);
  background-image:
    linear-gradient(
      125deg,
      rgba(90, 18, 18, 0.9) 0%,
      rgba(179, 27, 27, 0.82) 42%,
      rgba(160, 35, 35, 0.72) 100%
    ),
    url("../img/palm.jpg");
  background-repeat: no-repeat, no-repeat;
  background-position: center bottom, center bottom;
  background-size: cover, cover;
}

.top-frame .transparency {
  background: transparent !important;
  min-height: inherit;
}

.top-frame .title-holder {
  width: 100%;
  max-width: var(--site-max);
  height: auto;
  min-height: clamp(120px, 15vh, 175px);
  margin: 0 auto;
  padding: clamp(0.65rem, 2vw, 1rem) var(--site-content-pad);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.top-frame .title-holder .row {
  position: static;
  transform: none;
  width: 100%;
  margin: 0;
  align-items: center;
}

.top-frame .title-holder .row .banner-title {
  position: static;
  transform: none;
  padding: 0;
  max-width: 100%;
}

.top-frame .me-name {
  font-size: clamp(1.55rem, 3.5vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Main column */
.main-frame {
  margin-bottom: 3rem;
}

.main-frame .content-holder {
  width: 900px;
  max-width: 100%;
  padding: 2rem var(--site-content-pad) 3rem;
  background: var(--site-surface);
  margin-top: -1.5rem;
  border-radius: var(--site-radius) var(--site-radius) 0 0;
  box-shadow: var(--site-shadow);
  border: 1px solid var(--site-border);
  border-bottom: none;
}

.main-frame .content-holder > .row:first-of-type {
  margin-top: 0;
}

.main-frame .content-holder h3 {
  font-size: clamp(1.45rem, 2.6vw, 1.65rem);
  font-weight: 600;
  color: var(--site-accent-dark);
  margin-top: 0;
  margin-bottom: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--site-border);
  line-height: 1.25;
}

/*
 * Section spacing: pad the row that opens each major block (col-md with h3 first).
 * Avoids uneven gaps when the previous row’s last element has different margins.
 */
.main-frame .content-holder > .row:not(:first-child):has(> .col-md > h3:first-child) {
  padding-top: var(--site-section-gap);
}

.main-frame .content-holder > .row:not(:first-child):has(> .col-md > h3:first-child) > .col-md > h3:first-child {
  margin-top: 0;
}

.main-frame .content-holder > .row:first-of-type h3 {
  margin-top: 0;
}

.main-frame .content-holder h4 {
  font-size: 1.12rem;
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
  color: var(--site-text);
}

.main-frame .content-holder h5 {
  font-size: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--site-muted);
  font-weight: 600;
}

/* Publication category titles — larger than default h4/h5 */
.main-frame .content-holder .publications-section h4 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 1.65rem;
  margin-bottom: 0.65rem;
  color: var(--site-accent-dark);
  line-height: 1.3;
}

.main-frame .content-holder .publications-section .publications-note + h4 {
  margin-top: 0.55rem;
}

.main-frame .content-holder .publications-section h5 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.55rem;
  color: var(--site-text);
  line-height: 1.35;
}

.main-frame .content-holder .sec-passage {
  text-align: left;
  hyphens: auto;
}

/* About me: bio uses full width of the left column (col-md-8); justified lines + pretty wrapping */
.main-frame .content-holder .about-narrow {
  max-width: none;
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
}

.main-frame .content-holder .about-narrow p {
  text-wrap: pretty;
  font-size: var(--site-copy-size);
  line-height: 1.5;
}

.main-frame .content-holder .about-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  hyphens: none;
  /* Shift portrait + contact together; shared left edge */
  padding-left: clamp(1.5rem, 11vw, 3.5rem);
}

.main-frame .content-holder .about-side .me-photo {
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 1rem;
  max-width: 188px;
  width: 100%;
  height: auto;
  aspect-ratio: 235 / 315;
  background-size: contain;
  border-radius: var(--site-radius);
  border: 1px solid var(--site-border);
  box-shadow: var(--site-shadow);
}

.main-frame .content-holder .about-contact-stacked {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: var(--site-supporting-size);
  line-height: 1.55;
  font-weight: 400;
  color: var(--site-muted);
}

.main-frame .content-holder .about-contact-email {
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.main-frame .content-holder .about-contact-socials {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  max-width: 100%;
  font-size: inherit;
  line-height: inherit;
}

.main-frame .content-holder .about-contact-stacked .me-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
  font-size: inherit;
  font-weight: inherit;
  color: var(--site-accent);
  text-decoration: none;
  white-space: nowrap;
}

.main-frame .content-holder .about-contact-stacked .me-social-link:hover {
  color: var(--site-accent-dark);
  text-decoration: underline;
}

.main-frame .content-holder .about-contact-stacked .me-social-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

@media (max-width: 767.98px) {
  .main-frame .content-holder .about-side {
    margin-top: 1.25rem;
    padding-left: 0;
    align-items: center;
    text-align: center;
  }

  .main-frame .content-holder .about-side .me-photo {
    margin-left: auto;
    margin-right: auto;
  }

  .main-frame .content-holder .about-contact-stacked {
    align-items: center;
  }

  .main-frame .content-holder .about-contact-email {
    justify-content: center;
  }

  .main-frame .content-holder .about-contact-socials {
    align-items: center;
  }
}

.main-frame .content-holder .sec-passage p + p {
  margin-top: 1rem;
}

/* Research interests — same size/line-height as About me paragraphs */
.main-frame .content-holder .research-interests {
  font-family: 'K2D', 'Noto Sans TC', sans-serif;
  font-weight: 400;
  font-size: var(--site-copy-size);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.main-frame .content-holder .research-interests ul {
  margin: 0;
  padding-left: 1.2rem;
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
}

.main-frame .content-holder .research-interests li {
  margin-bottom: 0.4rem;
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  text-wrap: pretty;
}

.main-frame .content-holder .research-interests li:last-child {
  margin-bottom: 0;
}

.main-frame .content-holder a {
  color: var(--site-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.main-frame .content-holder a:hover {
  color: var(--site-accent-dark);
}

/* Job market callout */
.job-market-notice {
  margin: 1.35rem 0 0.85rem;
  padding: 1rem 1.15rem;
  background: linear-gradient(90deg, #fdf6f6 0%, #faefef 100%);
  border: 1px solid rgba(179, 27, 27, 0.22);
  border-left: 4px solid var(--cornell-red);
  border-radius: var(--site-radius);
  color: var(--site-text);
  font-size: var(--site-supporting-size);
  line-height: 1.55;
}

.job-market-notice a {
  font-weight: 500;
  color: var(--cornell-red-dark);
}

/* Photo */
.main-frame .me-photo {
  border-radius: var(--site-radius);
  border: 1px solid var(--site-border);
  box-shadow: var(--site-shadow);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Publication blocks */
.main-frame .content-holder > .row .col-md > p {
  margin-bottom: 1.1rem;
}

.main-frame .content-holder > .row .col-md > p:last-child {
  margin-bottom: 0;
}

.publications-note {
  margin-bottom: 0.85rem;
  color: var(--site-muted);
  font-size: var(--site-supporting-size);
  line-height: 1.55;
}

.main-frame .content-holder .publications-section p.paper-item {
  margin-bottom: 0;
}

.publications-section p.paper-item ~ p.paper-item {
  border-top: 1px solid var(--site-border);
  padding-top: 1rem;
  margin-top: 1rem;
}

.publications-section > p.paper-item:last-of-type {
  margin-bottom: 0.35rem;
}

/* News item */
.news-item {
  margin: 0;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--site-border);
}

.news-item:last-child {
  border-bottom: none;
}
