/* ============================================================
   STYLE.CSS — Giorgio Varanini Personal Website
   ============================================================

   COLOR PALETTE (edit these variables to change the whole site's colors)
   -------------------------------------------------------------------- */

:root {
  --color-bg:           #f4f6f9;   /* page background — very light blue-grey */
  --color-nav-bg:       #2b3d5c;   /* navigation bar background — dark navy   */
  --color-nav-text:     #e8eef5;   /* navigation bar text color               */
  --color-heading:      #3a5a8a;   /* section headings — medium muted blue    */
  --color-subheading:   #5a7aaa;   /* sub-headings and job titles             */
  --color-accent:       #8aa7c7;   /* divider lines and decorative accents    */
  --color-text:         #2d3748;   /* main body text — dark slate             */
  --color-text-light:   #5a6a7e;   /* secondary text — lighter slate          */
  --color-white:        #ffffff;
  --color-card-bg:      #edf1f7;   /* background for CV and research cards    */

  --max-width: 820px;              /* maximum content width — increase to widen layout */
  --font-main: Georgia, 'Times New Roman', serif;  /* body font */
  --font-ui:   'Segoe UI', Arial, sans-serif;      /* navigation and labels */
}

/* ============================================================
   GLOBAL RESET & BASE STYLES
   ============================================================ */

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

html {
  scroll-behavior: smooth;  /* smooth scrolling when clicking nav links */
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 1rem;
  line-height: 1.7;
}

/* ============================================================
   NAVIGATION BAR
   Stays fixed at the top while you scroll.
   ============================================================ */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-nav-bg);
  padding: 0 2rem;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-name {
  color: var(--color-nav-text);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--color-nav-text);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  text-decoration: none;
  letter-spacing: 0.04em;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.nav-links a:hover {
  opacity: 1;
}

/* ============================================================
   SECTIONS
   Each section (Home, CV, Research, Contact) shares these styles.
   ============================================================ */

section {
  padding: 4rem 2rem;
}

/* Alternate background on every other section for visual separation */
section:nth-child(even) {
  background-color: var(--color-white);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Section title (e.g. "Curriculum Vitae", "Research") */
.section-title {
  font-family: var(--font-ui);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

/* Decorative line under section titles */
.section-divider {
  width: 48px;
  height: 3px;
  background-color: var(--color-accent);
  margin-bottom: 2.5rem;
}

/* ============================================================
   HOME SECTION
   Two-column layout: photo on the left, bio on the right.
   ============================================================ */

.home-layout {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  flex-wrap: wrap;  /* stacks on narrow screens */
}

.home-photo img {
  width: 210px;
  height: 270px;
  object-fit: cover;       /* crops image to fit without distortion */
  object-position: top;    /* keeps the face visible */
  border-radius: 4px;
  display: block;
}

.home-bio {
  flex: 1;
  min-width: 260px;
}

.home-name {
  font-family: var(--font-ui);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 0.25rem;
}

.home-title {
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.home-bio p {
  margin-bottom: 1rem;
}

/* ============================================================
   CV SECTION
   Entries are grouped under headings (Work, Education, Teaching).
   ============================================================ */

.cv-group {
  margin-bottom: 2.5rem;
}

/* Sub-heading within CV: "Work Experience", "Education", etc. */
.cv-group-title {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-subheading);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 1.2rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--color-accent);
}

/* A single CV entry (one job, one degree, etc.) */
.cv-entry {
  margin-bottom: 1.4rem;
}

.cv-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cv-entry-role {
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.97rem;
}

.cv-entry-date {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text-light);
  white-space: nowrap;
}

.cv-entry-institution {
  font-style: italic;
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.cv-entry-detail {
  font-size: 0.93rem;
  color: var(--color-text);
}

/* ============================================================
   RESEARCH SECTION
   Organised into: journal articles, working papers, conferences.
   ============================================================ */

.research-group {
  margin-bottom: 2.5rem;
}

.research-group-title {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-subheading);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 1.2rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--color-accent);
}

/* A single publication or paper */
.research-item {
  margin-bottom: 1.2rem;
  padding-left: 1rem;
  border-left: 3px solid var(--color-accent);
}

.research-item-title {
  font-style: italic;
  color: var(--color-text);
  margin-bottom: 0.15rem;
}

.research-item-meta {
  font-family: var(--font-ui);
  font-size: 0.87rem;
  color: var(--color-text-light);
}

/* A single conference entry */
.conference-item {
  margin-bottom: 1rem;
}

.conference-item-title {
  font-style: italic;
  color: var(--color-text);
  font-size: 0.95rem;
}

.conference-item-meta {
  font-family: var(--font-ui);
  font-size: 0.87rem;
  color: var(--color-text-light);
}

/* Conference year label */
.conference-year {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--color-heading);
  margin: 1rem 0 0.5rem 0;
  font-size: 0.95rem;
}

/* ============================================================
   CONTACT SECTION
   Simple list of links.
   ============================================================ */

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.97rem;
}

.contact-label {
  color: var(--color-text-light);
  min-width: 120px;
  font-size: 0.87rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.contact-list a {
  color: var(--color-heading);
  text-decoration: none;
  border-bottom: 1px solid var(--color-accent);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}

.contact-list a:hover {
  color: var(--color-subheading);
  border-color: var(--color-subheading);
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
  background-color: var(--color-nav-bg);
  color: var(--color-nav-text);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  text-align: center;
  padding: 1.2rem;
  opacity: 0.85;
}

/* ============================================================
   RESPONSIVE: narrow screens (phones, tablets)
   ============================================================ */

@media (max-width: 600px) {
  .home-layout {
    flex-direction: column;
    align-items: center;
  }

  .home-photo img {
    width: 160px;
    height: 200px;
  }

  .nav-name {
    display: none;  /* hide name in nav on very small screens */
  }

  .nav-links {
    gap: 1.2rem;
  }
}
