/* ========================================================
   Lorenzo Rocco — Personal Academic Website
   style.css
   ======================================================== */

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.65;
  color: #1f2937;
  background: #ffffff;
}
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; color: #1e40af; }
p { margin-bottom: 0.85rem; }
p:last-child { margin-bottom: 0; }

/* === NAVIGATION === */
header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.nav-container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  height: 56px;
}
.nav-logo {
  font-size: 1rem;
  font-weight: 700;
  color: #1e3a5f;
  text-decoration: none;
  letter-spacing: -0.01em;
  margin-right: auto;
  flex-shrink: 0;
}
.nav-logo:hover { text-decoration: none; color: #1e3a5f; }

.nav-menu {
  list-style: none;
  display: flex;
  align-items: stretch;
  height: 56px;
  gap: 0;
}
.nav-menu > li {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-menu > li > a {
  display: flex;
  align-items: center;
  padding: 0 0.9rem;
  height: 56px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-menu > li > a:hover,
.nav-menu > li.active > a {
  color: #1e3a5f;
  text-decoration: none;
}
.nav-menu > li.active > a {
  border-bottom-color: #1e3a5f;
}

/* Dropdown arrow */
.dropdown > a::after {
  content: '';
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 5px;
  opacity: 0.6;
  vertical-align: middle;
}

/* Dropdown menu */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  min-width: 215px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.09);
  padding: 0.35rem 0;
  z-index: 1001;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block;
  padding: 0.48rem 1.1rem;
  font-size: 0.85rem;
  color: #374151;
  text-decoration: none;
  transition: background 0.1s;
}
.dropdown-menu a:hover {
  background: #f1f5f9;
  color: #1e3a5f;
  text-decoration: none;
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #374151;
  border-radius: 2px;
  transition: 0.25s;
}

/* === MAIN CONTENT === */
main {
  max-width: 920px;
  margin: 0 auto;
  padding: 2.75rem 1.75rem 5rem;
}

/* === PAGE TITLE === */
.page-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.page-subtitle {
  font-size: 0.95rem;
  color: #6b7280;
  margin-bottom: 2.5rem;
}

/* === SECTION HEADINGS === */
section { margin-bottom: 2.75rem; }
h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e3a5f;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.45rem;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #1e3a5f;
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
}

/* === HOME HERO === */
.home-hero {
  display: grid;
  grid-template-columns: 195px 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 3rem;
  padding-bottom: 2.75rem;
  border-bottom: 1px solid #e5e7eb;
}
.home-photo {
  width: 195px;
  height: 245px;
  object-fit: cover;
  object-position: top;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.11);
  display: block;
}
.photo-placeholder {
  width: 195px;
  height: 245px;
  background: #e5e7eb;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 0.8rem;
  text-align: center;
  gap: 0.4rem;
}
.photo-placeholder .initials {
  font-size: 2.5rem;
  font-weight: 700;
  color: #d1d5db;
}
.home-bio h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1e3a5f;
  letter-spacing: -0.03em;
  margin-bottom: 0.2rem;
  line-height: 1.2;
}
.home-bio .bio-position {
  font-size: 1rem;
  color: #374151;
  margin-bottom: 0.1rem;
  font-weight: 500;
}
.home-bio .bio-dept {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 1rem;
}
.bio-roles {
  font-size: 0.88rem;
  color: #6b7280;
  font-style: italic;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.contact-block {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  font-size: 0.88rem;
  color: #374151;
  line-height: 2;
}
.contact-block a { color: #1d4ed8; }
.btn-cv {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.1rem;
  padding: 0.5rem 1.2rem;
  background: #1e3a5f;
  color: #fff !important;
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.2s;
  letter-spacing: 0.01em;
}
.btn-cv:hover { background: #1d4ed8; text-decoration: none !important; }

/* === EDUCATION LIST === */
.edu-list {
  list-style: none;
  counter-reset: edu-counter;
  font-size: 0.91rem;
}
.edu-list li {
  counter-increment: edu-counter;
  padding: 0.5rem 0 0.5rem 2rem;
  border-bottom: 1px solid #f3f4f6;
  position: relative;
}
.edu-list li::before {
  content: counter(edu-counter) ".";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: #1e3a5f;
}

/* === PUBLICATION LIST === */
.pub-list {
  list-style: none;
  font-size: 0.9rem;
}
.pub-list li {
  display: flex;
  gap: 0.7rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #f3f4f6;
  line-height: 1.5;
}
.pub-year {
  font-weight: 700;
  color: #1e3a5f;
  min-width: 40px;
  flex-shrink: 0;
  font-size: 0.85rem;
  padding-top: 0.05rem;
}
.pub-text em { font-style: italic; color: #4b5563; }
.pub-text a em { color: inherit; }

/* === WORKING PAPERS LIST === */
.wp-list {
  list-style: none;
  font-size: 0.9rem;
}
.wp-list li {
  padding: 0.8rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.wp-title { line-height: 1.5; margin-bottom: 0.2rem; }
.wp-meta { font-size: 0.82rem; color: #6b7280; }
.wp-year { font-weight: 700; color: #1e3a5f; }

/* === CONSULTING LIST === */
.consult-list {
  list-style: none;
  font-size: 0.9rem;
}
.consult-list li {
  display: flex;
  gap: 0.7rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #f3f4f6;
  line-height: 1.5;
  align-items: baseline;
}
.consult-year {
  font-weight: 700;
  color: #1e3a5f;
  min-width: 40px;
  flex-shrink: 0;
  font-size: 0.85rem;
}
.consult-org {
  font-weight: 600;
  color: #374151;
}

/* === HUB CARDS === */
.hub-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
  margin-top: 0.5rem;
}
.hub-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.3rem 1.4rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.hub-card:hover {
  border-color: #1e3a5f;
  box-shadow: 0 4px 14px rgba(30,58,95,0.09);
  text-decoration: none;
}
.hub-card h3 {
  color: #1e3a5f;
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}
.hub-card p {
  font-size: 0.83rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.45;
}

/* === BOOKS LIST === */
.books-list {
  list-style: none;
  font-size: 0.9rem;
}
.books-list li {
  display: flex;
  gap: 0.65rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #f3f4f6;
  align-items: baseline;
}
.book-num {
  font-weight: 700;
  color: #1e3a5f;
  min-width: 26px;
  flex-shrink: 0;
}
.book-body .book-genre {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 0.1rem;
  display: block;
}

/* === TEACHING MATERIAL === */
.material-section { margin-bottom: 1.5rem; }
.material-list {
  list-style: none;
  font-size: 0.88rem;
  margin-top: 0.4rem;
}
.material-list li {
  padding: 0.28rem 0 0.28rem 1.1rem;
  position: relative;
  color: #374151;
}
.material-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: #9ca3af;
  font-weight: 700;
}

/* === RECENT PUBLICATIONS (home page teaser) === */
.recent-pubs {
  list-style: none;
  font-size: 0.88rem;
}
.recent-pubs li {
  padding: 0.55rem 0;
  border-bottom: 1px solid #f3f4f6;
  line-height: 1.5;
  color: #374151;
}
.recent-pubs .rp-year {
  font-weight: 700;
  color: #1e3a5f;
  margin-right: 0.4rem;
}
.see-all {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1d4ed8;
}

/* === TAG BADGE === */
.badge {
  display: inline-block;
  background: #eff6ff;
  color: #1e3a5f;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* === BOOK FEATURE BOX === */
.book-feature {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  background: #f8fafc;
  margin-bottom: 2rem;
}
.book-feature h2 {
  border: none;
  padding: 0;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}
.book-meta { font-size: 0.88rem; color: #6b7280; line-height: 1.8; margin-bottom: 1rem; }
.book-meta strong { color: #374151; }

/* === REVIEW BLOCK === */
.review {
  border-left: 3px solid #d1d5db;
  padding: 0.75rem 1.1rem;
  margin-bottom: 1.1rem;
  background: #fafafa;
  border-radius: 0 4px 4px 0;
}
.review p { font-size: 0.88rem; color: #374151; font-style: italic; margin-bottom: 0.3rem; }
.review .reviewer { font-size: 0.82rem; color: #6b7280; font-style: normal; font-weight: 600; }

/* === FOOTER === */
footer {
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  padding: 2rem 1.75rem;
  text-align: center;
  font-size: 0.82rem;
  color: #9ca3af;
  line-height: 1.7;
}
footer a { color: #6b7280; }
footer a:hover { color: #1e3a5f; }

/* === RESPONSIVE === */
@media (max-width: 720px) {
  .home-hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .home-photo, .photo-placeholder {
    width: 140px;
    height: 175px;
    margin: 0 auto;
  }
  .home-bio h1 { font-size: 1.6rem; }
  .hub-cards { grid-template-columns: 1fr 1fr; }
  main { padding: 2rem 1.25rem 3.5rem; }
  .pub-list li { flex-direction: column; gap: 0.2rem; }
  .consult-list li { flex-direction: column; gap: 0.15rem; }
  .nav-menu { display: none; }
  .nav-toggle { display: flex; }
  .nav-menu.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.5rem 0;
    z-index: 1000;
    height: auto;
    align-items: stretch;
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
  }
  .nav-menu.open > li { height: auto; display: block; }
  .nav-menu.open > li > a { height: auto; padding: 0.6rem 1.5rem; border-bottom: none; }
  .dropdown > a::after { float: right; margin-top: 0.5rem; }
  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-left: 3px solid #e5e7eb;
    margin-left: 1.5rem;
    border-radius: 0;
    display: none;
    padding: 0;
  }
  .dropdown.open .dropdown-menu { display: block; }
  .dropdown:hover .dropdown-menu { display: none; }
  .dropdown.open .dropdown-menu { display: block; }
}
@media (max-width: 480px) {
  .hub-cards { grid-template-columns: 1fr; }
}
