/* ============================================================
   Yi-Chia Wang — Personal Academic Website
   Dark Red Theme
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --red-dark:   #7B0000;
  --red-mid:    #9B2020;
  --bg-page:    #FFFFFF;
  --bg-tinted:  #FAF5F5;
  --text-main:  #2C2C2C;
  --text-muted: #5A5A5A;
  --border:     #E2D5D5;
  --topbar-h:   64px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-main);
  background: var(--bg-page);
}

a {
  color: var(--red-dark);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ============================================================
   TOP BAR (fixed)
   ============================================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--red-dark);
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
}

.brand-name {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
  font-family: inherit;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.nav-btn.active {
  color: #fff;
  font-weight: 600;
  border-bottom-color: #fff;
}

/* ============================================================
   MAIN + TAB SECTIONS (JS-free with :target)
   ============================================================ */
main {
  padding-top: 64px;
  min-height: 100vh;
}
.tab-section { display: none; }
.tab-section:target {
  display: block;
  padding-top: 64px;
  animation: fadeUp 0.22s ease both;
}

/* Default to #about when there is no hash */
body:not(:has(:target)) #about { display: block; }

/* Active nav highlight tied to the current :target (and default) */
body:has(#about:target)        .nav-btn[href="#about"],
body:has(#publications:target) .nav-btn[href="#publications"],
body:has(#experience:target)   .nav-btn[href="#experience"],
body:not(:has(:target))        .nav-btn[href="#about"] {
color: #fff;
font-weight: 600;
border-bottom-color: #fff;
}


/* ============================================================
   ABOUT ME
   ============================================================ */
.about-container {
  max-width: 1000px !important;
  margin: 0 auto !important;
  padding: calc(var(--topbar-h) + 1.5rem) 2.5rem 5rem !important;
  box-sizing: border-box !important;
}

.about-wrapper {
  display: flex;
  gap: 3.5rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

/* Photo column */
.about-photo-col {
  flex: 0 0 185px;
}

.photo-placeholder {
  width: 185px;
  height: 230px;
  background: var(--bg-tinted);
  border: 2px dashed var(--border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  color: #bbb;
}
.photo-icon {
  width: 70px;
  height: 70px;
  color: #ccc;
}
.photo-placeholder span {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.about-photo {
display: block;
width: 185px;
height: 230px;
object-fit: cover;
border-radius: 6px;
background: var(--bg-tinted);
}

/* Text column */
.about-header {
  flex: 1;
}

.about-name {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--red-dark);
  line-height: 1.2;
  margin-bottom: 0.45rem;
}

.about-title {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 1rem;
}

.about-contact {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.9;
}
.about-contact a {
  color: var(--red-dark);
  font-weight: 500;
}
.scholar-note {
  font-size: 0.82rem;
  color: #aaa;
}

.yc-block {
  margin-top: 0.5rem;
  box-sizing: border-box;
  width: 100%;
}

.about-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--red-dark);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

.yc-block p {
  margin-bottom: 1rem;
  color: var(--text-main);
  line-height: 1.8;
}

.keyword-box {
  background: var(--bg-tinted);
  border-left: 4px solid var(--red-dark);
  padding: 0.9rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.85;
  border-radius: 0 4px 4px 0;
}

/* Education list */
.edu-list {
  list-style: none;
  padding: 0;
}

.edu-list > li {
  display: flex;
  gap: 1.4rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #F2EAEA;
}
.edu-list > li:last-child {
  border-bottom: none;
}

.edu-year {
  flex: 0 0 36px;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--red-mid);
  text-align: right;
  padding-top: 0.15rem;
}

.edu-body {
  flex: 1;
}

.edu-degree {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
}

.edu-school {
  font-size: 0.88rem;
  color: var(--red-dark);
  font-style: italic;
  margin-top: 0.1rem;
  margin-bottom: 0.35rem;
}

.edu-details {
  list-style: disc;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.75;
}
.edu-details li {
  margin-bottom: 0.15rem;
}

/* ============================================================
   SHARED PAGE CONTAINER
   ============================================================ */
.page-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 2.5rem 5rem;
}

.page-heading {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--red-dark);
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 3px solid var(--red-dark);
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--red-dark);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   PUBLICATIONS
   ============================================================ */
.pub-list {
  list-style: none;
  padding: 0;
}

.pub-list li {
  display: flex;
  gap: 1.4rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid #F2EAEA;
}
.pub-list li:last-child {
  border-bottom: none;
}

.pub-year {
  flex: 0 0 36px;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--red-mid);
  text-align: right;
  padding-top: 0.15rem;
  line-height: 1.75;
}

.pub-text {
  flex: 1;
  font-size: 0.93rem;
  color: var(--text-main);
  line-height: 1.75;
}
.pub-text em {
  color: var(--text-muted);
}

.award-badge {
  display: inline-block;
  background: var(--red-dark);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.08rem 0.52rem;
  border-radius: 3px;
  margin-left: 0.4rem;
  vertical-align: middle;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.type-badge {
  display: inline-block;
  background: #6B6B6B;
  color: #fff;
  font-size: 0.7rem;
  padding: 0.08rem 0.52rem;
  border-radius: 3px;
  margin-left: 0.4rem;
  vertical-align: middle;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ============================================================
   EXPERIENCE
   ============================================================ */
.exp-item {
  display: flex;
  gap: 2rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--border);
}
.exp-item:last-child {
  border-bottom: none;
}

.exp-date {
  flex: 0 0 145px;
  font-size: 0.84rem;
  color: var(--text-muted);
  font-style: italic;
  padding-top: 0.2rem;
  line-height: 1.5;
}

.exp-body {
  flex: 1;
}

.exp-role {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.exp-org {
  font-size: 0.95rem;
  color: var(--red-dark);
  font-style: italic;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.exp-division {
  font-size: 0.87rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-bottom: 0.4rem;
}

.exp-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.exp-bullets {
  list-style: disc;
  padding-left: 1.3rem;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.75;
}
.exp-bullets li {
  margin-bottom: 0.3rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 740px) {
  .topbar-inner {
    padding: 0 1.2rem;
  }
  .brand-name {
    font-size: 1.1rem;
  }
  .nav-btn {
    font-size: 0.85rem;
    padding: 0.45rem 0.75rem;
  }

  .about-wrapper {
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 1.5rem;
  }
  .about-photo-col {
    flex: none;
    align-self: center;
  }

  .page-container {
    padding: 2rem 1.2rem 3rem;
  }

  .pub-list li {
    flex-direction: column;
    gap: 0.3rem;
  }
  .pub-year {
    text-align: left;
  }

  .exp-item {
    flex-direction: column;
    gap: 0.5rem;
  }
  .exp-date {
    flex: none;
  }
}
