/* ============================================
   Astrit Tola — Personal Site
   Classic Navy/White + Dark Mode
   ============================================ */

/* ===== Root Variables: Light ===== */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --text: #1a1a1a;
  --text-soft: #4a5568;
  --primary: #0a2540;
  --primary-hover: #163a66;
  --accent: #c8a951;
  --border: #e2e8f0;
  --card-bg: #ffffff;
  --shadow: 0 2px 8px rgba(10, 37, 64, 0.08);
  --shadow-lg: 0 8px 24px rgba(10, 37, 64, 0.12);
  --radius: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== Dark Mode ===== */
[data-theme="dark"] {
  --bg: #0d1421;
  --bg-soft: #131c2e;
  --text: #e8eaed;
  --text-soft: #a0aec0;
  --primary: #4a90e2;
  --primary-hover: #6aa9f0;
  --accent: #d4b86a;
  --border: #1f2a3f;
  --card-bg: #131c2e;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ===== Links ===== */
a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent);
}

/* Card titles that are links — make them clearly clickable, always */
.card h3 a,
.pub-title a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.card h3 a:hover,
.pub-title a:hover {
  color: var(--accent);
}

/* Only these UI elements should stay clean (no underline) — they're already styled as buttons/pills/nav */
.nav-brand,
.nav-links a,
.social-links a,
.pub-links a,
.btn-primary {
  text-decoration: none;
}

/* ===== Make in-card author/inline links subtly underlined on hover only ===== */
.card a:not(.btn-primary):hover,
.pub-item a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
img { max-width: 100%; display: block; }

/* ===== Navigation ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.nav-brand small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-soft);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-top: 2px;
}
.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: center;
}
.nav-links a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
}
.nav-links a.active,
.nav-links a:hover { color: var(--primary); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
}
.theme-toggle:hover { background: var(--bg-soft); transform: scale(1.05); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text);
  cursor: pointer;
}

/* ===== Layout ===== */
main { max-width: 1100px; margin: 0 auto; padding: 3rem 1.5rem 5rem; }
section { margin-bottom: 4rem; }
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: center;
  margin-bottom: 3.5rem;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.hero .subtitle {
  font-size: 1.1rem;
  color: var(--text-soft);
  margin-bottom: 1.25rem;
}

.hero p { margin-bottom: 1rem; color: var(--text); }

.profile-img {
  width: 300px;
  height: 360px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 4px solid var(--bg);
  box-shadow: var(--shadow-lg);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 4rem;
  font-weight: 700;
}

/* ===== Social links ===== */
.social-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}
.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--bg-soft);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
}
.social-links a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

/* ===== News / Announcements ===== */
.news-item {
  padding: 1.25rem;
  background: var(--card-bg);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.news-date {
  font-size: 0.85rem;
  color: var(--text-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.news-item h3 {
  margin: 0.4rem 0 0.5rem;
  color: var(--primary);
  font-size: 1.1rem;
}
.news-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-right: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
}

/* ===== Cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card h3 { color: var(--primary); margin-bottom: 0.5rem; font-size: 1.1rem; }
.card p { color: var(--text-soft); font-size: 0.95rem; }

/* ===== Publications ===== */
.pub-year {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin: 2rem 0 1rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}
.pub-item { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.pub-item:last-child { border-bottom: none; }
.pub-title {
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.02rem;
}
.pub-authors { font-size: 0.95rem; color: var(--text-soft); margin-bottom: 0.25rem; }
.pub-authors .me { color: var(--primary); font-weight: 600; }
.pub-venue { font-style: italic; color: var(--text-soft); font-size: 0.9rem; }
.pub-links { margin-top: 0.5rem; }
.pub-links a {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8rem;
  margin-right: 0.4rem;
  font-weight: 500;
  color: var(--text);
}
.pub-links a:hover { background: var(--primary); color: #fff; }
.note { font-size: 0.9rem; color: var(--text-soft); margin-bottom: 0.5rem; }

/* ===== Teaching table ===== */
.teaching-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}
.teaching-table th, .teaching-table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}
.teaching-table th {
  background: var(--bg-soft);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
}
.teaching-table tr:last-child td { border-bottom: none; }

/* ===== Buttons ===== */
.btn-primary {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: var(--primary);
  color: #fff !important;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* ===== CV embed ===== */
.cv-embed {
  width: 100%;
  height: 850px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 1.5rem;
  background: var(--bg-soft);
}

/* ===== Footer ===== */
footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.9rem;
}
footer p { margin: 0.25rem 0; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .profile-img { margin: 0 auto; width: 220px; height: 220px; font-size: 3rem; }
  .hero h1 { font-size: 2rem; }
  .social-links { justify-content: center; }
  .menu-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
}
@media (max-width: 500px) {
  main { padding: 2rem 1rem 4rem; }
  .section-title { font-size: 1.4rem; }
  .hero h1 { font-size: 1.7rem; }
}
