/* Pablo J. Ordóñez — site styles. Change the --accent colors to retheme the site. */
:root {
  --ink: #1D2329;
  --body: #333C45;
  --muted: #4E5A66;
  --line: #DDE1E6;
  --panel: #F4F5F7;
  --accent: #1E5F74;
  --accent-dark: #12414F;
  --bg: #FFFFFF;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  display: flex;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, .site-name {
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.2;
}

/* ---------- Side menu ---------- */
.sidebar {
  flex: 0 0 250px;
  background: var(--panel);
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.site-name {
  align-self: flex-start;
  font-size: 19px;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--accent);
}
.site-name:hover { color: var(--ink); }
.menu {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.menu a {
  min-height: 46px;
  display: flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.menu a:last-child { border-bottom: 0; }
.menu a:hover, .menu a[aria-current="page"] { color: var(--accent); }
.sidebar small { margin-top: auto; font-size: 13px; color: var(--muted); }

/* ---------- Content ---------- */
main { flex: 1; min-width: 0; padding: 64px 56px 80px; }
.wrap { max-width: 900px; }
h1 { font-size: 34px; margin: 0 0 12px; }
h2 { font-size: 26px; margin: 0 0 24px; }
section { margin-bottom: 48px; }

/* Home */
.intro { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px 64px; }
.bio { flex: 999 1 380px; min-width: 0; max-width: 540px; }
.bio p { margin: 0 0 16px; }
.role { font-size: 18px; font-weight: 500; color: var(--accent); }
.card { flex: 1 1 240px; min-width: 0; max-width: 280px; }
.photo {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--panel);
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 44px;
  color: var(--muted);
}
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.contacts { list-style: none; margin: 20px 0 0; padding: 0; font-size: 15px; }
.contacts a {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  border-top: 1px solid var(--line);
}
.contacts li:last-child a { border-bottom: 1px solid var(--line); }
.contacts svg { flex: none; }

/* Research */
.paper { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 28px; margin-bottom: 32px; }
.paper > img { flex: 0 0 250px; width: 250px; max-width: 100%; height: auto; border-radius: 8px; }
.paper-body { flex: 1 1 340px; min-width: 0; font-size: 16px; line-height: 1.6; }
.paper-body h3 { margin: 0 0 2px; font-size: 17px; font-weight: 600; line-height: 1.4; }
.paper-body p { margin: 0; }
.paper-body .finding { margin-top: 6px; color: var(--body); }
.links { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 4px; font-size: 15px; font-weight: 500; }
.links a { min-height: 40px; display: inline-flex; align-items: center; }
details summary { cursor: pointer; padding: 8px 0; font-size: 15px; font-weight: 500; color: var(--accent); }
details p { font-size: 15px; line-height: 1.65; color: var(--body); }
.review { margin: 0 0 18px; font-size: 16px; line-height: 1.6; }
.review a { display: block; font-weight: 600; color: var(--ink); text-decoration: none; }
.review a:hover { color: var(--accent); text-decoration: underline; }

@media (min-width: 1000px) { .paper.text-only .paper-body { margin-left: 278px; } }

/* CV and teaching */
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 6px;
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 600;
  text-decoration: none;
}
.button:hover { background: var(--accent-dark); color: #FFFFFF; }
.row { display: flex; flex-wrap: wrap; gap: 2px 32px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:last-child { border-bottom: 1px solid var(--line); }
.row .when { flex: 0 0 150px; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row .what { flex: 1 1 340px; min-width: 0; }

/* ---------- Phones and narrow windows ---------- */
@media (max-width: 760px) {
  body { flex-direction: column; }
  .sidebar { flex: none; padding: 16px 20px 8px; gap: 6px; }
  .menu { flex-direction: row; flex-wrap: wrap; gap: 0 24px; }
  .menu a { border-bottom: 0; }
  .sidebar small { display: none; }
  main { padding: 32px 20px 56px; }
  h1 { font-size: 30px; }
}
