/* ============================================================
   Farid N. Najm — Academic Website Stylesheet
   ============================================================ */

/* --- Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f4f0;
  color: #1a1a1a;
  display: flex;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Sidebar ---------------------------------------------- */
#sidebar {
  width: 260px;
  min-width: 260px;
  background: #11244a;
  color: #dde6f0;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem 1.5rem;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-identity {
  margin-bottom: 0.5rem;
  display: block;
  text-decoration: none;
  border-radius: 6px;
  padding: 0.25rem 0.4rem;
  margin-left: -0.4rem;
  transition: background 0.15s;
}

.sidebar-identity:hover {
  background: #162d52;
  text-decoration: none;
}

.sidebar-identity .name {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.sidebar-identity .title {
  font-weight: 700;
  font-size: 0.75rem;
  color: #8fa8cc;
  margin-top: 0.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --- Navigation ------------------------------------------- */
.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8fa8cc;
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
}

nav ul {
  list-style: none;
}

nav ul li a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 5px;
  font-size: 0.875rem;
  color: #b0c4de;
  transition: background 0.15s, color 0.15s;
}

nav ul li a:hover,
nav ul li a.active {
  background: #162d52;
  color: #ffffff;
  text-decoration: none;
}

/* Double the gap before DOCUMENTS label */
nav + .sidebar-section-label {
  margin-top: 3rem;
}

/* --- Sidebar Documents ------------------------------------ */
.sidebar-docs {
  margin-top: 0;
}

.sidebar-docs ul {
  list-style: none;
}

.sidebar-docs ul li a {
  display: block;
  padding: 0.35rem 0.6rem;
  border-radius: 5px;
  font-size: 0.8rem;
  color: #8fa8cc;
  transition: background 0.15s, color 0.15s;
}

.sidebar-docs ul li a:hover {
  background: #162d52;
  color: #ffffff;
  text-decoration: none;
}

/* --- Sidebar Footer --------------------------------------- */
.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #8fa8cc;
  line-height: 1.6;
}

.sidebar-footer strong {
  color: #8fa8cc;
  display: block;
}

/* --- Main Content ----------------------------------------- */
#main {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.page {
  display: none;
  padding: 3rem 4rem;
  max-width: 860px;
}

.page.active {
  display: block;
}

/* --- Page Header ------------------------------------------ */
.page-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5a7d62;
  margin-bottom: 0.5rem;
}

.page h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1c3829;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.page-lead {
  font-size: 1rem;
  color: #444;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 640px;
}

/* --- About / Home ----------------------------------------- */
.hero {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  margin-bottom: 3rem;
}

.hero-text { flex: 1; }

.hero-text h1 {
  font-size: 2.2rem;
  color: #1c3829;
  margin-bottom: 0.25rem;
}

.hero-text .subtitle {
  font-size: 1rem;
  color: #5a7d62;
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.hero-text p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #333;
  margin-bottom: 1.25rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}

.btn-primary {
  background: #1a3566;
  color: #fff;
}

.btn-primary:hover {
  background: #162d52;
  text-decoration: none;
}

.btn-outline {
  border: 1.5px solid #1c3829;
  color: #1c3829;
}

.btn-outline:hover {
  background: #1c3829;
  color: #fff;
  text-decoration: none;
}

.hero-photo {
  width: 200px;
  min-width: 200px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.hero-photo img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- Stat Cards ------------------------------------------- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: #fff;
  border: 1px solid #e5e3dc;
  border-radius: 10px;
  padding: 1.25rem 1.25rem 1rem;
}

.stat-card .stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1c3829;
  margin-bottom: 0.25rem;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: #777;
  line-height: 1.4;
}

.stat-card .stat-sub {
  font-size: 0.7rem;
  color: #aaa;
  margin-top: 0.15rem;
}

/* --- Biography Section ------------------------------------ */
.bio-section h2 {
  font-size: 1.3rem;
  color: #1c3829;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e3dc;
}

.bio-section p {
  font-size: 0.93rem;
  line-height: 1.8;
  color: #333;
  margin-bottom: 1rem;
}

.bio-section em { font-style: italic; }

/* --- Section Headings ------------------------------------- */
.section-title {
  font-size: 1.3rem;
  color: #1c3829;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e3dc;
}

/* --- Research Page ---------------------------------------- */
.research-body {
  font-size: 0.93rem;
  line-height: 1.8;
  color: #333;
  margin-bottom: 2rem;
}

.research-body strong { color: #1c3829; }

.patents-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 2rem;
}

.patent-item {
  font-size: 0.88rem;
  color: #333;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  position: relative;
}

.patent-item::before {
  content: "\2014";
  position: absolute;
  left: 0;
  color: #555;
}

.sponsors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.sponsor-item {
  background: #fff;
  border: 1px solid #e5e3dc;
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  font-size: 0.82rem;
  color: #444;
}

/* --- Teaching Page ---------------------------------------- */
.course-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.course-card {
  background: #fff;
  border: 1px solid #e5e3dc;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  transition: box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
}

.course-card:hover {
  box-shadow: 0 4px 16px rgba(28,56,41,0.1);
  text-decoration: none;
}

.course-code {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: #1c3829;
  border-radius: 5px;
  padding: 0.3rem 0.6rem;
  white-space: nowrap;
}

.course-info .course-name {
  font-weight: 700;
  font-size: 1rem;
  color: #1c3829;
  margin-bottom: 0.2rem;
}

.course-info .course-level {
  font-size: 0.75rem;
  color: #8fa8cc;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.course-info p {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.6;
}

.textbook-box {
  background: #fff;
  border: 1px solid #e5e3dc;
  border-radius: 10px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.textbook-box p {
  font-size: 0.9rem;
  color: #444;
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* --- Awards Page ------------------------------------------ */
.awards-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 4rem;
}

.award-item {
  display: flex;
  gap: 0.375rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid #e5e3dc;
  align-items: flex-start;
}

.award-year {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1c3829;
  min-width: 70px;
  padding-top: 0.1rem;
}

.award-body .award-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.2rem;
}

.award-body .award-org {
  font-size: 0.8rem;
  color: #777;
}

/* --- Service Page ----------------------------------------- */
.service-group {
  margin-bottom: 2.5rem;
}

.service-group h2 {
  font-size: 1.1rem;
  color: #1c3829;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #e5e3dc;
}

.service-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid #f0ede6;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.service-years {
  font-size: 0.78rem;
  color: #8fa8cc;
  min-width: 90px;
  padding-top: 0.15rem;
}

.service-body .service-role {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1a1a1a;
}

.service-body .service-org {
  font-size: 0.82rem;
  color: #666;
  margin-top: 0.1rem;
}

.service-body .service-detail {
  font-size: 0.82rem;
  color: #555;
  margin-top: 0.35rem;
  line-height: 1.5;
}

/* --- TPC List --------------------------------------------- */
.tpc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.tpc-list li {
  display: flex;
  gap: 1.5rem;
  font-size: 0.88rem;
  color: #444;
  align-items: flex-start;
}

.tpc-list .tpc-years {
  font-size: 0.78rem;
  color: #8fa8cc;
  min-width: 90px;
  padding-top: 0.1rem;
}

/* --- Contact Page ----------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.contact-card {
  background: #fff;
  border: 1px solid #e5e3dc;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}

.contact-card .contact-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #8fa8cc;
  margin-bottom: 0.4rem;
}

.contact-card .contact-value {
  font-size: 0.93rem;
  font-weight: 600;
  color: #1c3829;
}

.contact-card .contact-value a {
  color: #1c3829;
}

.contact-card .contact-value a:hover {
  text-decoration: underline;
}

.address-box {
  background: #fff;
  border: 1px solid #e5e3dc;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #444;
  line-height: 1.8;
}

.address-box .contact-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #8fa8cc;
  margin-bottom: 0.5rem;
}

.pgp-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: #5a7d62;
  padding: 0.4rem 0.8rem;
  border: 1px solid #c5d9c9;
  border-radius: 5px;
  margin-top: 0.5rem;
}

/* --- Graduate Supervision Table --------------------------- */
.grad-table {
  width: auto;
  min-width: 360px;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin-bottom: 2rem;
}

.grad-table th:nth-child(1),
.grad-table td:nth-child(1) {
  width: 260px;
}

.grad-table th:nth-child(2),
.grad-table td:nth-child(2) {
  width: 80px;
}

.grad-table th:nth-child(3),
.grad-table td:nth-child(3) {
  width: 100px;
}

.grad-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #777;
  border-bottom: 2px solid #ddd;
}

.grad-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}

.grad-table tbody tr:last-child td {
  border-bottom: none;
}

.grad-table tbody tr:hover td {
  background: #f7f9f8;
}

.grad-table td:nth-child(2) {
  color: #555;
  font-size: 0.85rem;
}

.grad-table td:nth-child(3) {
  color: #777;
  font-size: 0.85rem;
  white-space: nowrap;
}

.pgp-link:hover {
  background: #f0f7f2;
  text-decoration: none;
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 768px) {
  #sidebar {
    position: relative;
    width: 100%;
    min-width: unset;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 1rem;
    gap: 1rem;
  }

  #main {
    margin-left: 0;
  }

  .page {
    padding: 1.5rem 1.25rem;
  }

  .hero {
    flex-direction: column-reverse;
    gap: 1.5rem;
  }

  .hero-photo {
    width: 120px;
  }

  body {
    flex-direction: column;
  }
}

/* ---- Selected Papers ------------------------------------ */
.selected-papers-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
}
.sp-entry {
  padding: 0.85rem 0;
  border-bottom: 1px solid #f0ede6;
}
.sp-entry:first-child {
  padding-top: 0.4rem;
}
.sp-body {
  font-size: 0.9rem;
  color: #222;
  line-height: 1.6;
  margin-bottom: 0.3rem;
}
.sp-ref {
  font-size: 0.8rem;
  color: #777;
  line-height: 1.5;
}
.sp-ref em { font-style: italic; }
.sp-ref a {
  margin-left: 0.4rem;
  font-size: 0.75rem;
  padding: 0.08rem 0.45rem;
  border: 1px solid #c5d9c9;
  border-radius: 4px;
  color: #2d6e45;
  text-decoration: none;
  white-space: nowrap;
}
.sp-ref a:hover { background: #eef7f1; }
.sp-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.3rem;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
  vertical-align: middle;
}
