/* ============================================================
   Silvia Milano — Academic Website
   Design: clean, polished, warm
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ── Variables ── */
:root {
  --bg:            #fafaf7;
  --bg-card:       #ffffff;
  --bg-subtle:     #f3f3ef;
  --bg-limestone:  #f0ead6;
  --text:          #2a241c;
  --text-mid:      #5a5248;
  --text-light:    #8a8278;
  --accent:        #3d6b5e;
  --accent-dark:   #2d5248;
  --accent-light:  #eaf0ed;
  --sand:          #c4aa7e;
  --border:        #e2ddd4;
  --font-serif:    'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:     'Inter', system-ui, -apple-system, sans-serif;
  --max-w:         1080px;
  --radius:        6px;
  --shadow-sm:     0 1px 4px rgba(42,36,28,0.07);
  --shadow-md:     0 4px 20px rgba(42,36,28,0.09);
  --transition:    0.2s ease;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); transition: color var(--transition); }
a:hover { color: var(--accent-dark); }

/* ── Navigation ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,250,248,0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Spiral motif — nod to snail shell geometry */
.nav-brand::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 10 m0 -3.5 a3.5 3.5 0 1 1 -0.01 0 M10 10 m0 -5.5 a5.5 5.5 0 1 1 -0.01 0 M10 10 m0 -7.5 a7.5 7.5 0 1 1 -0.01 0' fill='none' stroke='%233d6b5e' stroke-width='1.1' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='10' r='1.2' fill='%233d6b5e'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.75;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-mid);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.nav-links .nav-cta a {
  background: var(--accent);
  color: #fff;
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  font-size: 0.825rem;
}

.nav-links .nav-cta a:hover {
  background: var(--accent-dark);
  color: #fff;
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text);
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: var(--transition);
}

/* ── Hero ── */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem 4.5rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 4rem;
  align-items: center;
}

.hero-text h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 1rem;
}

.hero-meta {
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.hero-bio {
  font-size: 1.05rem;
  color: var(--text-mid);
  line-height: 1.85;
  max-width: 500px;
  margin-bottom: 2.25rem;
}

.hero-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--accent-light);
  box-shadow: var(--shadow-md);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 0.8rem;
  text-align: center;
  padding: 1.5rem;
  gap: 0.75rem;
}
.photo-placeholder svg { opacity: 0.4; }

/* ── Photo strip ── */
.photo-strip {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.photo-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
  opacity: 0.88;
}

/* ── Limestone section ── */
.section-limestone {
  background: var(--bg-limestone);
}

/* Section label — italic serif instead of caps */
.section-label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* Spiral section divider */
.section-spiral {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.section-spiral svg {
  width: 16px;
  height: 16px;
  color: var(--sand);
  flex-shrink: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.35rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

/* ── Section wrapper ── */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3.75rem 2rem;
  border-top: 1px solid var(--border);
}

.section-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.section-header .section-title { margin-bottom: 0; }

/* ── Research theme cards — editorial numbered ── */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 0.5rem;
}

.theme-card {
  background: transparent;
  border: none;
  padding: 2.75rem 2.5rem 2.75rem 0;
}

.theme-card:last-child {
  padding-right: 0;
}

.theme-card:not(:first-child) {
  padding-left: 2.5rem;
}

.theme-number {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 400;
  color: var(--sand);
  line-height: 1;
  margin-bottom: 1.75rem;
  letter-spacing: -0.02em;
}

.theme-icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
  margin-bottom: 1rem;
  opacity: 0.55;
}

.theme-icon svg {
  width: 100%;
  height: 100%;
}

.theme-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
  line-height: 1.3;
}

.theme-card p {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.7;
}

/* ── Publication list ── */
.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.pub-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 1.5rem;
}

.pub-item:first-child { padding-top: 0; }
.pub-item:last-child { border-bottom: none; }

.pub-year {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  padding-top: 0.15rem;
  min-width: 36px;
}

.pub-body {}

.pub-venue {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.pub-title {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.pub-title a {
  color: inherit;
  text-decoration: none;
}
.pub-title a:hover { color: var(--accent); }

.pub-authors {
  font-size: 0.85rem;
  color: var(--text-mid);
  font-style: italic;
}

.pub-tags {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  background: var(--accent-light);
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* ── News items ── */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.news-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1.5rem;
  align-items: start;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.news-item:last-child { border-bottom: none; }

.news-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  padding-top: 0.1rem;
  white-space: nowrap;
}

.news-type-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  background: var(--accent-light);
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.news-title {
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.2rem;
}

.news-desc {
  font-size: 0.85rem;
  color: var(--text-mid);
  line-height: 1.55;
}

.section-more {
  margin-top: 2rem;
  font-size: 0.9rem;
}
.section-more a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.section-more a:hover { text-decoration: underline; }

/* ── Teaching ── */
.course-grid {
  display: grid;
  gap: 1rem;
}

.course-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  align-items: start;
}

.course-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.course-level {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  white-space: nowrap;
}

.course-desc {
  font-size: 0.85rem;
  color: var(--text-mid);
  grid-column: 1 / -1;
  line-height: 1.55;
}

/* ── Page header (inner pages) ── */
.page-header {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 2rem 3rem;
}

.page-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.page-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.page-header p {
  font-size: 1rem;
  color: var(--text-mid);
  max-width: 580px;
  line-height: 1.7;
}

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

/* ── "Also at" affiliations ── */
.affiliations {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.affil-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-mid);
}

.affil-item a {
  color: var(--text-mid);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.affil-item a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.affil-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ── Footer ── */
footer {
  background: var(--text);
  color: rgba(255,255,255,0.5);
  padding: 2.5rem 2rem;
  margin-top: 5rem;
  position: relative;
  overflow: hidden;
}

/* Subtle photo texture behind footer — save sparkling-water.jpg to assets/img/ */
footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../img/footer-texture.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  pointer-events: none;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: rgba(255,255,255,0.8);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color var(--transition);
}

.footer-links a:hover { color: rgba(255,255,255,0.9); }

/* ── Utility ── */
.text-muted { color: var(--text-mid); }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

/* ── Responsive ── */
@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 3rem 1.5rem;
    gap: 2.5rem;
  }
  .hero-photo {
    max-width: 200px;
    margin: 0 auto;
    order: -1;
  }
  .themes-grid { grid-template-columns: 1fr; }
  .theme-card { padding: 2rem 0; }
  .theme-card:not(:first-child) { padding-left: 0; }
  .section { padding: 2.5rem 1.5rem; }
  .page-header { padding: 2.5rem 1.5rem 2rem; }
  .pub-item { grid-template-columns: 1fr; gap: 0.2rem; }
  .pub-year { min-width: auto; }
  .news-item { grid-template-columns: 1fr; gap: 0.25rem; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
    gap: 1rem;
    align-items: flex-start;
    box-shadow: var(--shadow-md);
  }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
}
