/* ============================================
   Madalina Patru — Academic Website Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Source+Sans+3:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap');

:root {
  --color-bg: #F7F9FC;
  --color-bg-alt: #EDF1F7;
  --color-text: #1E2A3A;
  --color-text-muted: #5A6B7F;
  --color-accent: #2B5B8A;
  --color-accent-hover: #3A74A8;
  --color-border: #D0DAE5;
  --color-nav-bg: #1B2838;
  --color-nav-text: #CBD5E1;
  --color-nav-hover: #7AAFDB;
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
  --max-width: 900px;
  --nav-width: 250px;
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
}

/* ---- SIDEBAR ---- */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  background: var(--color-nav-bg);
  color: var(--color-nav-text);
  display: flex;
  flex-direction: column;
  padding: 2.5rem 1.5rem;
  z-index: 100;
  overflow-y: auto;
}

.sidebar__name {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1.3;
  margin-bottom: 0.35rem;
}

.sidebar__title {
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--color-nav-hover);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.sidebar__dept {
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1.4;
  margin-bottom: 0;
}

.sidebar__nav {
  list-style: none;
  flex: 1;
  margin-top: 2rem;
}

.sidebar__nav li {
  margin-bottom: 0.15rem;
}

.sidebar__nav a {
  display: block;
  padding: 0.55rem 0.85rem;
  color: var(--color-nav-text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 400;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.02em;
}

.sidebar__nav a:hover,
.sidebar__nav a.active {
  background: rgba(255,255,255,0.08);
  color: var(--color-nav-hover);
}

.sidebar__nav a.active {
  font-weight: 600;
}

.sidebar__footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.78rem;
  color: #6b7f93;
  line-height: 1.7;
}

.sidebar__contact {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.sidebar__contact a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-nav-hover);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.15s;
  line-height: 1.3;
  word-break: break-all;
}

.sidebar__contact a:hover {
  color: #fff;
  text-decoration: none;
}

.sidebar__contact svg {
  flex-shrink: 0;
  opacity: 0.9;
}

/* ---- MOBILE HAMBURGER ---- */

.hamburger {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: var(--color-nav-bg);
  color: #fff;
  border: none;
  border-radius: 6px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  font-size: 1.4rem;
  align-items: center;
  justify-content: center;
}

/* ---- MAIN CONTENT ---- */

.main {
  margin-left: var(--nav-width);
  flex: 1;
  min-height: 100vh;
}

.content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 3rem 4rem;
}

/* ---- TYPOGRAPHY ---- */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-text);
  line-height: 1.25;
}

h1 {
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

h2 {
  font-size: 1.7rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--color-border);
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-accent);
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  font-weight: 300;
}

/* ---- HERO ---- */

.hero {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.hero__photo {
  width: 200px;
  min-width: 200px;
  height: 250px;
  border-radius: 6px;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.hero__text h1 {
  margin-bottom: 0.2rem;
}

/* ---- CARDS ---- */

.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.card__year {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.card__meta {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.card__description {
  font-size: 0.92rem;
  color: var(--color-text);
}

/* ---- CV TIMELINE ---- */

.cv-section {
  margin-bottom: 2rem;
}

.cv-entry {
  display: flex;
  gap: 1.5rem;
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--color-border);
}

.cv-entry:last-child {
  border-bottom: none;
}

.cv-entry__dates {
  min-width: 120px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  padding-top: 0.15rem;
  line-height: 1.5;
}

.cv-entry__details h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cv-entry__details .institution {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.cv-entry__details p {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.cv-entry__details p:last-child {
  margin-bottom: 0;
}

/* ---- PUBLICATION LIST ---- */

.pub {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--color-border);
}

.pub:last-child {
  border-bottom: none;
}

.pub__authors {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.pub__authors strong {
  color: var(--color-text);
}

.pub__title {
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0.15rem 0;
}

.pub__venue {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--color-text-muted);
}

.pub__links {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.8rem;
}

.pub__links a {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.pub__links a:hover {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}

/* ---- COURSE TABLE ---- */

.course-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.92rem;
}

.course-table th,
.course-table td {
  text-align: left;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.course-table th {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--color-bg-alt);
}

.course-table tr:hover td {
  background: rgba(0,0,0,0.015);
}

/* ---- BUTTON ---- */

.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  margin-top: 0.5rem;
}

.btn:hover {
  background: var(--color-accent-hover);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

/* ---- LARGE SCREENS ---- */

@media (min-width: 1400px) {
  :root {
    --max-width: 980px;
    --nav-width: 270px;
  }
  html { font-size: 18px; }
  .hero__photo {
    width: 220px;
    min-width: 220px;
    height: 275px;
  }
}

@media (min-width: 1800px) {
  :root {
    --max-width: 1060px;
    --nav-width: 280px;
  }
  html { font-size: 19px; }
  .hero__photo {
    width: 240px;
    min-width: 240px;
    height: 300px;
  }
}

/* ---- RESPONSIVE (MOBILE) ---- */

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .hamburger {
    display: flex;
  }
  .main {
    margin-left: 0;
  }
  .content {
    padding: 4.5rem 1.5rem 3rem;
  }
  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .cv-entry {
    flex-direction: column;
    gap: 0.3rem;
  }
  .cv-entry__dates {
    min-width: unset;
  }
}
