/* ============================================================
   Giovanni Fattori — shared styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,500;1,8..60,300;1,8..60,400&family=DM+Sans:wght@300;400;500&display=swap');

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

html { overflow-y: scroll; scroll-behavior: smooth; }

/* ── Tokens ── */
:root {
  --blue:       #185FA5;
  --blue-light: #E6F1FB;
  --blue-mid:   #B5D4F4;
  --blue-dark:  #0C447C;
  --gray-50:    #f9f9f8;
  --gray-100:   #f0efed;
  --gray-200:   #e2e0dc;
  --gray-400:   #9a9790;
  --gray-600:   #5f5d58;
  --gray-900:   #1a1917;
  --border:     rgba(0,0,0,0.08);
  --border-mid: rgba(0,0,0,0.13);
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --font-sans:  'DM Sans', system-ui, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
  --nav-h:      56px;
  --max-w:      860px;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--gray-900);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.container {
  width: 90%;
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ── Navbar ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
}

header .container {
  display: flex;
  align-items: center;
  width: 90%;
  max-width: var(--max-w);
}

.navbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.nav-brand img {
  height: 34px;
  width: auto;
  display: block;
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.navbar ul a {
  color: var(--gray-600);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.navbar ul a:hover,
.navbar ul a.active {
  color: var(--blue);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--gray-600);
  font-size: 1.4rem;
}

/* ── Main ── */
main {
  padding-top: var(--nav-h);
}

/* ── Page header (inner pages) ── */
.page-header {
  padding: 3rem 0 2.25rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--gray-900);
  margin-bottom: 0.4rem;
}

.page-header p {
  font-size: 0.95rem;
  color: var(--gray-600);
  max-width: 580px;
  line-height: 1.7;
}

/* ── Section label ── */
.section-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 1rem;
}

/* ── Status badges ── */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.badge-current  { background: var(--blue-light); color: var(--blue-dark); }
.badge-past     { background: var(--gray-100);   color: var(--gray-600); }
.badge-pub      { background: var(--blue-light); color: var(--blue-dark); }
.badge-teaching { background: #FAEEDA; color: #633806; }
.badge-talk     { background: #EAF5EE; color: #1a6b3a; }

/* ── Cards ── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s;
}

.card:hover { border-color: var(--border-mid); }

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ── Prose ── */
.prose p   { margin-bottom: 1rem; color: var(--gray-600); font-size: 0.95rem; line-height: 1.75; }
.prose p:last-child { margin-bottom: 0; }
.prose a   { color: var(--blue); text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose h2  { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 400; color: var(--gray-900); margin: 2rem 0 0.6rem; letter-spacing: -0.01em; }
.prose h3  { font-size: 0.95rem; font-weight: 500; color: var(--gray-900); margin: 1.5rem 0 0.4rem; }

/* ── Footer ── */
footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  background: #fff;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--gray-400);
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .container { width: 94%; }

  .navbar ul {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    z-index: 999;
  }

  .navbar ul.open { display: flex; }

  .navbar ul a {
    display: block;
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
  }

  .hamburger { display: block; }

  .page-header h1 { font-size: 1.6rem; }
}
