/*
 * custom.css — Visual theme for alessandrobrioschi.github.io
 * Place at: assets/css/custom.css
 */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;1,400&family=Source+Sans+3:wght@300;400;500;600&display=swap');

:root {
  --bg-page:      #f5f2ed;
  --bg-card:      #ffffff;
  --text-primary: #1a1a1a;
  --text-mid:     #444440;
  --text-muted:   #888882;
  --accent:       #2b5797;
  --accent-hover: #1a3a6a;
  --border:       #e2ddd7;
}

/* ─── Base ───────────────────────────────────────────────────────────── */
html, body {
  background-color: var(--bg-page) !important;
  font-family: 'Source Sans 3', 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.72;
  color: var(--text-primary);
}
h1, h2, h3, h4 {
  font-family: 'Lora', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.01em;
}
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

/* ─── Masthead ───────────────────────────────────────────────────────── */
.masthead {
  position: relative !important;
  z-index: 20 !important;
  background-color: var(--bg-page) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: none !important;
}
.masthead__inner-wrap, .greedy-nav {
  background-color: transparent !important;
}
.site-title, .greedy-nav a, .greedy-nav .visible-links a {
  font-family: 'Source Sans 3', sans-serif !important;
  font-weight: 500 !important;
  color: var(--text-primary) !important;
  font-size: 0.88rem !important;
}
.greedy-nav a:hover { color: var(--accent) !important; }
.greedy-nav .visible-links a::before { background: var(--accent) !important; }

/* ─── Hero banner ────────────────────────────────────────────────────── */
.page__hero--overlay { margin-top: 0 !important; }
.page__hero--overlay::after,
.page__hero--overlay::before { display: none !important; }
.initial-content hr { display: none !important; }

/* ─── Strip ALL backgrounds so only our targets get colour ───────────── */
body, #main, .page, .page__inner-wrap,
.page__content-wrapper, .wrapper,
article.page, section.page__content {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* ─── #main: flex row — sidebar and article side by side ─────────────── */
/* From the source: #main directly contains .sidebar and article.page    */
div#main {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 2rem !important;
  padding: 2rem !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

/* ─── SIDEBAR ─────────────────────────────────────────────────────────── */
div#main > div.sidebar {
  flex: 0 0 260px !important;
  width: 260px !important;
  min-width: 260px !important;
  position: relative !important;
  float: none !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ─── ARTICLE — white card, fills remaining width ────────────────────── */
div#main > article.page {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 2rem 2.4rem !important;
  background-color: var(--bg-card) !important;
  border-radius: 10px !important;
  border: 1px solid var(--border) !important;
}

/* ─── FIX: .page__inner-wrap must NOT have its own background/border ─── */
/* This was causing the inner darker rectangle on the homepage            */
div#main > article.page > .page__inner-wrap {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ─── OTHER PAGES (Research, Teaching etc): sidebar inside article ───── */
/*
 * On non-homepage layouts the sidebar is nested INSIDE article.page.
 * We switch article.page itself to flex so its children line up.
 */
div#main > article.page > .page__inner-wrap {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 2rem !important;
}

div#main > article.page > .page__inner-wrap > .sidebar,
div#main > article.page > .page__inner-wrap > div.sidebar {
  flex: 0 0 220px !important;
  width: 220px !important;
  min-width: 220px !important;
  float: none !important;
  position: relative !important;
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

div#main > article.page > .page__inner-wrap > section.page__content {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  float: none !important;
  width: auto !important;
}

/* ─── Avatar ─────────────────────────────────────────────────────────── */
.author__avatar {
  display: block !important;
  text-align: center !important;
  margin-bottom: 1.1rem !important;
}
.author__avatar img {
  width: 210px !important;
  height: 210px !important;
  max-width: 210px !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  border: 3px solid var(--border) !important;
  display: block !important;
  margin: 0 auto !important;
}

/* ─── Name ───────────────────────────────────────────────────────────── */
.author__name {
  font-family: 'Lora', Georgia, serif !important;
  font-size: 1.35rem !important;
  font-weight: 500 !important;
  color: var(--text-primary) !important;
  text-align: center !important;
  line-height: 1.3 !important;
  margin-bottom: 0.4rem !important;
}

/* ─── Bio ─────────────────────────────────────────────────────────────── */
.author__bio {
  font-size: 0.92rem !important;
  color: var(--text-mid) !important;
  text-align: center !important;
  line-height: 1.5 !important;
  margin-bottom: 1.2rem !important;
}

/* ─── Social link pills ───────────────────────────────────────────────── */
.author__urls-wrapper { margin-top: 0.3rem; }
.author__urls {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
}
.author__urls li {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}
.author__urls li a {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  padding: 7px 13px !important;
  border-radius: 7px !important;
  border: 1px solid var(--border) !important;
  background-color: rgba(255,255,255,0.75) !important;
  color: var(--text-mid) !important;
  font-size: 0.88rem !important;
  font-family: 'Source Sans 3', sans-serif !important;
  font-weight: 400 !important;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s, color 0.15s !important;
  box-sizing: border-box !important;
}
.author__urls li a:hover {
  background-color: #ffffff !important;
  border-color: #b8b4ae !important;
  color: var(--accent) !important;
}
.author__urls li a i,
.author__urls li a .fas,
.author__urls li a .fab,
.author__urls li a .far,
.author__urls li a .ai {
  font-size: 0.88rem !important;
  width: 16px !important;
  text-align: center !important;
  color: var(--text-muted) !important;
  flex-shrink: 0 !important;
}
/* Location line — no border */
.author__urls li:first-child {
  font-size: 0.84rem !important;
  color: var(--text-muted) !important;
  padding: 2px 3px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.author__urls li:first-child a {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
}

/* Show links without toggle on desktop */
@media (min-width: 64em) {
  .author__urls-wrapper button.btn { display: none !important; }
  .author__urls { display: flex !important; }
}

/* ─── Page title — no underline ─────────────────────────────────────── */
.page__title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 500;
  border-bottom: none !important;
  padding-bottom: 0.3rem;
  margin-bottom: 1.3rem;
}
.page__content hr, .page hr { display: none !important; }

/* ─── Bullet list ─────────────────────────────────────────────────────── */
.page__content ul { list-style: none; padding-left: 0; margin-bottom: 1.4em; }
.page__content ul li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: 0.85em;
  line-height: 1.65;
}
.page__content ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.6em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background-color: var(--accent);
  opacity: 0.6;
}

/* ─── Footer ─────────────────────────────────────────────────────────── */
.page__footer {
  background-color: transparent !important;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 2rem;
  clear: both;
}
.page__footer a { color: var(--text-muted); }
.page__footer a:hover { color: var(--accent); }

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  div#main {
    flex-direction: column !important;
    padding: 1rem !important;
  }
  div#main > div.sidebar {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  div#main > article.page > .page__inner-wrap {
    flex-direction: column !important;
  }
  .author__avatar img {
    width: 140px !important;
    height: 140px !important;
    max-width: 140px !important;
  }
  div#main > article.page {
    border-radius: 6px !important;
    padding: 1.2rem !important;
  }
}
