/* =====================================================
   Academic Personal Website – Main Stylesheet
   ===================================================== */

:root {
  /* ── Official PSU Brand Colors ── */
  --psu-nittany-navy:   #001E44;   /* Nittany Navy (darkest) */
  --psu-beaver-blue:    #1E407C;   /* Beaver Blue */
  --psu-sky:            #009CDE;   /* Pennsylvania Sky (bright PSU blue) */
  --psu-pugh:           #96BEE6;   /* Pugh Blue (light) */
  --psu-limestone:      #A2AAAD;   /* Limestone */
  --psu-creek:          #3EA39E;   /* Creek (teal) */
  --psu-slate:          #314D64;

  /* Functional aliases */
  --sidebar-bg:         #b8dcf2;                  /* Same as featured card (accent-mid) */
  --sidebar-text:       var(--psu-nittany-navy);
  --sidebar-muted:      #3a5a78;
  --accent:             var(--psu-sky);            /* PA Sky for highlights */
  --accent-dark:        #007ab8;
  --accent-pale:        #e5f5fd;
  --accent-mid:         #b8dcf2;

  --teal:               var(--psu-creek);
  --crimson:            #c1121f;

  --text:               #001E44;                  /* Nittany Navy for body text */
  --text-muted:         #4a5568;
  --text-light:         #718096;

  --border:             #dde4ee;
  --page-bg:            #f8fafc;

  --sidebar-width: 290px;
  --content-max:   1100px;
  --radius:        8px;
  --radius-lg:     14px;
  --shadow:        0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  --shadow-md:     0 4px 24px rgba(0,0,0,.10);
  --transition:    0.18s ease;

  --font-display:  "Playfair Display", Georgia, serif;
  --font-ui:       "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: #c2d6e8; /* shows behind the centered container on wide screens */
}

a { color: var(--psu-beaver-blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--psu-sky); text-decoration: underline; }

ul { padding-left: 1.4em; }
li { margin-bottom: 0.25em; }

/* ══════════════════════════════════════
   LAYOUT — centered container
══════════════════════════════════════ */
body { background: #c8d8e8; } /* visible outside the container */

.site-wrapper {
  display: flex;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 40px rgba(0,30,68,.18);
}

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: sticky;
  top: 0;
  height: 100vh;
  /* overflow-y on a scroll wrapper must be on a CHILD to avoid clipping photo ring */
  overflow: visible;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #7bbde0;
}

/* Inner scroll container so sidebar nav scrolls while photo stays */
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: visible;
  display: flex;
  flex-direction: column;
  padding-bottom: 2rem;
}

/* Photo area */
.sidebar-photo-wrap {
  position: relative;
  background: linear-gradient(160deg, #9fcde8 0%, #85bfe0 100%);
  padding: 2.5rem 1.6rem 1.4rem 1.6rem;
  border-bottom: 1px solid #7bbde0;
  text-align: center;
  /* Prevent photo circle from clipping into the left accent border */
  overflow: visible;
}

.sidebar-photo {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  /* Border as outline so it doesn't affect layout or get clipped */
  border: 3px solid var(--psu-sky);
  outline: 4px solid rgba(0,156,222,.25);
  outline-offset: 2px;
  display: block;
  margin: 0 auto 1rem;
}

.sidebar-name {
  font-family: var(--font-display);
  color: var(--psu-nittany-navy);
  line-height: 1.25;
  margin-bottom: 0.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}
.sidebar-preferred-name {
  font-size: 1.1rem;
  font-weight: 700;
}
.sidebar-full-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--psu-nittany-navy);
  letter-spacing: 0.01em;
}

.sidebar-title {
  font-size: 0.8rem;
  color: var(--psu-beaver-blue);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

.sidebar-dept,
.sidebar-institution {
  font-size: 0.88rem;
  color: var(--sidebar-muted);
  line-height: 1.45;
  margin-top: 0.15rem;
}
.sidebar-institution { color: var(--psu-beaver-blue); font-weight: 700; }

.sidebar-location {
  font-size: 0.84rem;
  color: var(--sidebar-muted);
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

/* Links section */
.sidebar-section {
  padding: 1rem 1.2rem 0.5rem 1.5rem;
}
.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--psu-sky);
  margin-bottom: 0.5rem;
}

.sidebar-links { display: flex; flex-direction: column; gap: 0.2rem; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.83rem;
  color: var(--psu-beaver-blue);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.sidebar-link:hover {
  background: rgba(0,30,68,.08);
  color: var(--psu-nittany-navy);
  text-decoration: none;
}
.sidebar-link i {
  width: 15px;
  text-align: center;
  color: var(--psu-sky);
  font-size: 0.85rem;
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  filter: none;
  opacity: 0.85;
  flex-shrink: 0;
}

/* Nav */
.sidebar-nav { display: flex; flex-direction: column; gap: 0.1rem; }
.sidebar-nav a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--sidebar-muted);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  border-left: 2px solid transparent;
}
.sidebar-nav a:hover { color: var(--psu-nittany-navy); text-decoration: none; }
.sidebar-nav a.active {
  background: rgba(0,30,68,.1);
  color: var(--psu-nittany-navy);
  border-left-color: var(--psu-sky);
  font-weight: 700;
}

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
.main-content {
  flex: 1;
  padding: 3rem 4rem 5rem;
  max-width: var(--content-max);
  width: 100%;
}

/* ── Section ── */
.section {
  padding-top: 0.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.section:last-child { border-bottom: none; }

.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--psu-nittany-navy);
  margin-bottom: 1.4rem;
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  position: relative;
  padding-bottom: 0.6rem;
}
.section-title::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 40px; height: 3px;
  background: var(--psu-sky);
  border-radius: 2px;
}
.section-title a {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal);
  letter-spacing: 0;
}

/* ── About ── */
.about-bio { font-size: 1rem; color: var(--text); }

/* ── Featured / Press Callout ── */
.about-featured { display: flex; flex-direction: column; gap: 0.8rem; }

@keyframes featured-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,156,222,0), var(--shadow); }
  50%       { box-shadow: 0 0 0 5px rgba(0,156,222,.18), var(--shadow); }
}

.featured-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--accent-mid);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--psu-sky);
  animation: featured-glow 3s ease-in-out infinite;
  text-decoration: none;
  transition: box-shadow var(--transition), transform var(--transition);
  box-shadow: var(--shadow);
}
.featured-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.featured-badge {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--psu-beaver-blue);
  white-space: nowrap;
  margin-top: 0.05rem;
  min-width: 64px;
  text-align: center;
}
.featured-badge .badge-star {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--psu-sky);
  filter: drop-shadow(0 0 4px rgba(0,156,222,.5));
}
.featured-badge .badge-label {
  background: var(--psu-beaver-blue);
  color: #fff;
  padding: 0.12rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.featured-text {
  font-size: 0.9rem;
  color: var(--psu-nittany-navy);
  line-height: 1.55;
  flex: 1;
}

.featured-arrow {
  font-size: 1.1rem;
  color: var(--psu-sky);
  flex-shrink: 0;
  align-self: center;
}

/* ── Research Interests ── */
.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  padding: 0;
}
.interest-tags li {
  background: var(--accent-pale);
  color: var(--psu-beaver-blue);
  border: 1px solid var(--accent-mid);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.32rem 0.85rem;
  border-radius: 20px;
  margin: 0;
  letter-spacing: 0.01em;
}

/* ══════════════════════════════════════
   TIMELINE (News)
══════════════════════════════════════ */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline-year-block { margin-bottom: 0.8rem; }

.timeline-year-label {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--psu-beaver-blue);
  padding: 0.2rem 1rem 0.2rem 0.8rem;
  border-radius: 20px;
  margin-bottom: 0.7rem;
  border-left: 4px solid var(--psu-sky);
  box-shadow: var(--shadow);
}

.timeline-items {
  list-style: none;
  padding: 0;
  margin: 0 0 0 1rem;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: grid;
  grid-template-columns: 46px 16px 1fr;
  align-items: flex-start;
  gap: 0 0.8rem;
  padding: 0.6rem 0;
  position: relative;
}

.timeline-month {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-light);
  text-align: right;
  padding-top: 0.25em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--text-light);
  flex-shrink: 0;
  margin-top: 0.32em;
  position: relative;
  left: -8px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.timeline-item:hover .timeline-dot {
  border-color: var(--psu-sky);
  transform: scale(1.3);
  box-shadow: 0 0 0 3px rgba(0,156,222,.2);
}

/* Personal events */
.timeline-personal .timeline-dot   { border-color: var(--crimson); background: #fff5f5; }
.timeline-personal .timeline-month { color: var(--crimson); }

/* Publication events */
.timeline-pub .timeline-dot   { border-color: var(--psu-sky); background: var(--accent-pale); }
.timeline-pub .timeline-month { color: var(--psu-beaver-blue); }

/* Career events */
.timeline-career .timeline-dot   { border-color: var(--psu-lion); background: var(--gold-pale); }
.timeline-career .timeline-month { color: #8a6020; }

.timeline-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  padding-top: 0.05em;
}

/* Tags */
.timeline-tag {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  margin-right: 0.4rem;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.tag-pub      { background: var(--blue-tag-bg);  color: var(--blue-tag); }
.tag-personal { background: var(--red-tag-bg);   color: var(--red-tag); }
.tag-career   { background: var(--green-tag-bg); color: var(--green-tag); }

.news-empty { color: var(--text-muted); font-style: italic; }

/* ══════════════════════════════════════
   PUBLICATIONS
══════════════════════════════════════ */
.pub-list { display: flex; flex-direction: column; gap: 0; padding: 0; list-style: none; }

.pub-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius-lg);
  transition: background var(--transition), box-shadow var(--transition);
  border-left: 3px solid transparent;
}
.pub-item:hover {
  background: var(--accent-pale);
  border-left-color: var(--psu-sky);
  box-shadow: var(--shadow);
}

.pub-title  { font-weight: 700; font-size: 1rem; color: var(--navy); line-height: 1.4; }
.pub-authors{ font-size: 0.88rem; color: var(--text-muted); }
.pub-venue  { font-size: 0.86rem; font-style: italic; color: var(--psu-creek); }

.pub-links { display: flex; gap: 0.5rem; margin-top: 0.2rem; }
.pub-link {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--psu-beaver-blue);
  color: #fff;
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.pub-link:hover { background: var(--psu-sky); color: #fff; text-decoration: none; }

.erdos-note {
  margin-top: 1.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.7rem 1rem;
  background: var(--accent-pale);
  border-left: 3px solid var(--psu-sky);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ══════════════════════════════════════
   EXPERIENCE & EDUCATION
══════════════════════════════════════ */
.exp-list, .edu-list {
  display: flex; flex-direction: column; gap: 0; list-style: none; padding: 0;
}

.exp-item, .edu-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 1.5rem;
  align-items: start;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-lg);
  transition: background var(--transition);
}
.exp-item:hover, .edu-item:hover { background: #f1f5f9; }

.exp-role, .edu-degree {
  font-weight: 700; font-size: 1rem; grid-column: 1; color: var(--navy);
}
.exp-org, .edu-inst {
  font-size: 0.9rem; color: var(--text-muted); grid-column: 1;
}
.exp-org a, .edu-inst a { color: var(--psu-beaver-blue); }
.exp-period, .edu-period {
  font-size: 0.78rem;
  color: #fff;
  background: var(--psu-beaver-blue);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  grid-row: 1 / span 2;
  grid-column: 2;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  align-self: start;
  margin-top: 0.25rem;
}
.exp-desc, .edu-detail {
  font-size: 0.87rem; color: var(--text-muted); grid-column: 1 / -1; margin-top: 0.2rem;
}

/* ══════════════════════════════════════
   TEACHING
══════════════════════════════════════ */
.teaching-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.4rem;
  list-style: none;
  padding: 0;
}
.teaching-item {
  font-size: 0.88rem;
  display: flex;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  transition: background var(--transition);
  margin: 0;
}
.teaching-item:hover { background: #f1f5f9; }
.teaching-code {
  font-weight: 700;
  color: var(--psu-beaver-blue);
  min-width: 75px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   AWARDS
══════════════════════════════════════ */
.awards-list {
  list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.6rem;
}
.awards-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  font-size: 0.93rem;
  margin: 0;
  padding: 0.7rem 1rem;
  background: var(--accent-pale);
  border-radius: var(--radius);
  border-left: 3px solid var(--psu-beaver-blue);
}
.awards-list li::before { content: "🏆"; flex-shrink: 0; }

/* ── Subsection title ── */
.subsection-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* ══════════════════════════════════════
   FIXED FOOTER
══════════════════════════════════════ */
.site-footer {
  position: fixed;
  bottom: 0;
  /* Align to the main content area inside the centered container */
  left: calc(max(0px, (100vw - 1440px) / 2) + var(--sidebar-width));
  right: max(0px, (100vw - 1440px) / 2);
  height: 34px;
  background: #eef3fa;
  color: #4a6580;
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 100;
  border-top: 1px solid #c8d8e8;
}
.site-footer a { color: var(--psu-beaver-blue); }
.site-footer a:hover { color: var(--psu-sky); text-decoration: none; }
.footer-updated { color: #7a90aa; font-style: italic; }

/* push main content above fixed footer */
.main-content { padding-bottom: 5rem; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 960px) {
  .site-footer { left: 0; right: 0; padding: 0 1rem; }

  .site-wrapper { flex-direction: column; }

  .sidebar {
    width: 100%; min-width: unset; height: auto;
    position: static;
    flex-direction: row; flex-wrap: wrap;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 1rem;
    border-left: none;
    border-right: none;
    border-bottom: 4px solid var(--psu-sky);
    box-shadow: 0 2px 8px rgba(0,30,68,.08);
  }
  .sidebar-photo-wrap {
    padding: 0.5rem; background: none; border: none;
    display: flex; align-items: center; gap: 1rem;
  }
  .sidebar-photo-wrap::after { display: none; }
  .sidebar-photo { width: 70px; height: 70px; margin: 0; }
  .sidebar-name, .sidebar-title, .sidebar-dept,
  .sidebar-institution, .sidebar-location { text-align: left; }
  .sidebar-location { justify-content: flex-start; }
  .sidebar-section { padding: 0.5rem 0; }
  .sidebar-links { flex-direction: row; flex-wrap: wrap; gap: 0.3rem; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-section-label { display: none; }

  .main-content { padding: 2rem 1.5rem; }
}

@media (max-width: 600px) {
  .main-content { padding: 1.5rem 1rem; }
  .exp-item, .edu-item { grid-template-columns: 1fr; }
  .exp-period, .edu-period {
    grid-row: auto; grid-column: 1;
    text-align: left; display: inline-block; margin-top: 0;
  }
  .timeline-item { grid-template-columns: 38px 14px 1fr; }
}
