/* ==========================================================================
   isabelbarrio.github.io  shared stylesheet
   One file for every page, including all the pages inside the recipes folder.
   Colours and fonts live in the :root block, so you can retheme in one place.
   ========================================================================== */

:root {
  --ink: #0e2238;          /* deep blue, hero and nav */
  --ink-2: #17334f;
  --sky: #9cc4ee;          /* mesh lines */
  --paper: #f5f7fa;        /* page background */
  --white: #ffffff;
  --text: #16212e;
  --muted: #566578;
  --rule: #d8e0e9;
  --link: #1d5fbf;
  --gold: #f4b942;
  --gold-deep: #b97f06;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 1120px;
  --gutter: clamp(20px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a {
  color: var(--link);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--gold-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--white);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 4px;
}
.skip:focus { left: 8px; }

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 34, 56, 0.97);
  border-bottom: 1px solid rgba(156, 196, 238, 0.2);
}
.topbar .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 32px;
  padding-block: 10px;
}
.brand {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.005em;
}
.brand:hover { text-decoration: none; color: var(--gold); }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  display: block;
  padding: 8px 12px;
  color: #d4e2f2;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--white); border-bottom-color: rgba(244, 185, 66, 0.5); }
.nav a[aria-current="page"] { color: var(--white); border-bottom-color: var(--gold); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 13px 22px;
  border: 2px solid transparent;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-gold { background: var(--gold); color: #1a1405; }
.btn-gold:hover { background: #ffd070; }
.btn-line { border-color: rgba(255, 255, 255, 0.55); color: var(--white); }
.btn-line:hover { background: var(--white); color: var(--ink); }
.btn-ink { background: var(--ink); color: var(--white); }
.btn-ink:hover { background: var(--ink-2); }

/* --------------------------------------------------------------------------
   Hero (home page)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink);
  color: var(--white);
}
.hero canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: 100%;
}
/* keeps the left side calm so the name stays easy to read */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, var(--ink) 0%, rgba(14, 34, 56, 0.78) 40%, rgba(14, 34, 56, 0) 78%);
  pointer-events: none;
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(210px, 0.62fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: end;
  padding-block: clamp(56px, 9vw, 120px) clamp(48px, 7vw, 88px);
}
.hero h1 {
  margin: 0 0 0.35em;
  font-family: var(--serif);
  font-size: clamp(3.2rem, 9vw, 7rem);
  font-weight: 400;
  line-height: 0.93;
  letter-spacing: -0.025em;
}
.hero h1 span { display: block; }
.hero .lede {
  max-width: 34em;
  margin: 0 0 24px;
  font-size: clamp(1.1rem, 1.9vw, 1.35rem);
  line-height: 1.5;
  color: #dce8f5;
}
.status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 34em;
  margin: 0 0 30px;
  font-weight: 500;
}
.status::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 0.55em;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(244, 185, 66, 0.25);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 22px 0 0; font-weight: 600; font-size: 0.97rem; }
.hero-links a { color: #cfe0f3; }
.hero-links a:hover { color: var(--white); }

.portrait { margin: 0; }
.portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 25%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
}

/* --------------------------------------------------------------------------
   Inner page heading
   -------------------------------------------------------------------------- */
.page-head {
  background: var(--ink);
  color: var(--white);
  padding-block: clamp(40px, 6vw, 72px) clamp(32px, 5vw, 56px);
}
.page-head h1 {
  max-width: 22em;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.3rem, 5.5vw, 4rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.page-head .lede {
  max-width: 40em;
  margin: 18px 0 0;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.55;
  color: #d4e2f2;
}
.crumb { margin: 0 0 14px; font-size: 0.95rem; }
.crumb a { color: #cfe0f3; }
.crumb a:hover { color: var(--white); }

/* --------------------------------------------------------------------------
   Content blocks
   -------------------------------------------------------------------------- */
.block { padding-block: clamp(44px, 6.5vw, 84px); }
.block + .block { border-top: 1px solid var(--rule); }
.block.white { background: var(--white); }

.block h2,
.split > h2 {
  margin: 0 0 0.5em;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.012em;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
  gap: clamp(20px, 5vw, 72px);
  align-items: start;
}
.split > h2 { margin: 0; position: sticky; top: 84px; }

.intro { max-width: 40em; margin: 0 0 32px; font-size: 1.15rem; color: #2a3a4d; }

.topics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px clamp(24px, 4vw, 48px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.topics li { padding-top: 16px; border-top: 2px solid var(--ink); }
.topics h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
}
.topics p { margin: 0; color: #2a3a4d; }

/* Timeline (experience) */
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline > li {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 8px 28px;
  padding-block: 22px;
  border-top: 1px solid var(--rule);
}
.timeline > li:first-child { border-top: 0; padding-top: 0; }
.when { margin: 0; font-size: 0.95rem; font-weight: 600; color: var(--muted); }
.timeline h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.25;
}
.role { margin: 2px 0 8px; color: var(--muted); }
.timeline ul { margin: 0; padding-left: 1.1em; }
.timeline ul li { margin-bottom: 4px; }

/* Publications and talks */
.items { margin: 0; padding: 0; list-style: none; }
.item {
  padding-block: 22px;
  border-top: 1px solid var(--rule);
}
.items > .item:first-child { border-top: 0; padding-top: 0; }
.item .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--muted);
}
.item h3 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
}
.item p { margin: 0 0 4px; }
.authors { color: #2a3a4d; }
.authors strong { font-weight: 700; color: var(--text); }
.venue { color: var(--muted); }
.tag {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid var(--rule);
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--white);
}
.tag.pub { background: #e6f0e4; border-color: #bcd6b6; color: #2c5a22; }
.tag.sub { background: #fdf1d6; border-color: #ecd596; color: #6b4a02; }
.links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font-weight: 600; font-size: 0.97rem; }
.links a { white-space: nowrap; }
.more { margin: 28px 0 0; font-weight: 600; }

/* Photo slot for talks (see the comment in research.html) */
.wide-photo { margin: 0 0 40px; }
.wide-photo img { display: block; width: 100%; height: auto; border-radius: 6px; }
.thesis h3 { margin: 0 0 8px; font-family: var(--serif); font-size: clamp(1.4rem, 2.4vw, 1.8rem); font-weight: 500; line-height: 1.25; }
.wide-photo figcaption { margin-top: 8px; font-size: 0.92rem; color: var(--muted); }

/* Skills and recognition */
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 6vw, 80px);
}
.facts { margin: 0; }
.facts dt {
  margin-top: 14px;
  font-weight: 700;
  font-size: 0.97rem;
}
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 2px 0 0; color: #2a3a4d; }
.plain { margin: 0; padding: 0; list-style: none; }
.plain li { padding-block: 10px; border-top: 1px solid var(--rule); }
.plain li:first-child { border-top: 0; padding-top: 0; }
.plain li { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: 2px 12px; }
.plain .yr { font-weight: 700; color: var(--muted); }

/* Spanish summary */
.es-note {
  max-width: 44em;
  margin: 0;
  padding: 4px 0 4px 22px;
  border-left: 4px solid var(--gold);
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.55;
}

.contact-list { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; list-style: none; }

/* --------------------------------------------------------------------------
   Teaching
   -------------------------------------------------------------------------- */
.terms { margin: 0; padding: 0; list-style: none; }
.terms > li {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 6px 28px;
  padding-block: 18px;
  border-top: 1px solid var(--rule);
}
.terms > li:first-child { border-top: 0; padding-top: 0; }
.terms h3 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--muted); }
.courses { margin: 0; padding: 0; list-style: none; }
.courses li { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 0 20px; padding-block: 3px; }
.courses .what { min-width: 0; }
.courses .kind { color: var(--muted); font-size: 0.95rem; }

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.story { max-width: 36em; }
.story p { margin: 0 0 1.3em; font-size: 1.1rem; line-height: 1.75; }
.wall { column-count: 2; column-gap: 12px; }
.wall img {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  border-radius: 4px;
  break-inside: avoid;
}

/* --------------------------------------------------------------------------
   Recipe index
   -------------------------------------------------------------------------- */
.filter { padding-block: 28px 0; }
.filter label { display: block; margin-bottom: 6px; font-weight: 600; }
.filter input {
  width: min(100%, 28rem);
  padding: 12px 14px;
  border: 2px solid var(--rule);
  border-radius: 6px;
  font: inherit;
  background: var(--white);
}
.filter input:focus { border-color: var(--ink-2); outline: none; box-shadow: 0 0 0 3px rgba(156, 196, 238, 0.6); }
.filter .count { margin: 8px 0 0; font-size: 0.95rem; color: var(--muted); }

.recipe-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 36px clamp(24px, 4vw, 56px);
  padding-block: 32px 72px;
}
.recipe-index section h2 {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.2;
}
.recipe-index ul { margin: 0; padding: 0; list-style: none; }
.recipe-index li a {
  display: block;
  padding: 6px 0;
  text-decoration: none;
  line-height: 1.4;
}
.recipe-index li a:hover { text-decoration: underline; }
.recipe-index [hidden] { display: none; }

/* --------------------------------------------------------------------------
   Recipe pages (inside the recipes folder)
   -------------------------------------------------------------------------- */
body.recipe .page-head { background: #3d2430; }  /* warm wine tone for the kitchen */
body.recipe .page-head h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); }

.recipe .row {
  display: grid;
  grid-template-columns: minmax(230px, 320px) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
  padding-block: 44px 72px;
}
.recipe .side {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 20px 22px;
  background: var(--white);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  line-height: 1.7;
}
.recipe .side img { display: block; width: auto; max-width: 100%; max-height: 150px; margin-top: 12px; object-fit: cover; border-radius: 4px; }
.recipe .side b { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.recipe .main { min-width: 0; }
.recipe .main b { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }

.steps { margin: 0; padding-left: 1.5em; list-style: decimal; }
.steps > br { display: none; }
.steps > b { display: block; margin: 22px 0 8px; }
.steps > b:first-child { margin-top: 0; }
.steps > li { margin: 0 0 8px; padding-left: 0.3em; font-size: 1.07rem; }
.steps > li::marker { font-family: var(--serif); font-weight: 600; color: var(--muted); }
.recipe .main img {
  display: inline-block;
  width: auto;
  height: 200px;
  max-width: 100%;
  margin: 4px 8px 12px 0;
  vertical-align: top;
  object-fit: cover;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--ink);
  color: #b9cbe0;
  font-size: 0.97rem;
}
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px 48px;
  padding-block: 40px;
}
.footer p { margin: 0 0 4px; }
.footer .footer-name { font-family: var(--serif); font-size: 1.25rem; color: var(--white); }
.footer ul { margin: 0; padding: 0; list-style: none; }
.footer li { margin-bottom: 4px; }
.footer a { color: #d9e7f6; }
.footer a:hover { color: var(--white); }

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .portrait { order: -1; max-width: 220px; }
  .hero::after { background: linear-gradient(180deg, rgba(14, 34, 56, 0.55), rgba(14, 34, 56, 0.85)); }
  .split { grid-template-columns: 1fr; }
  .split > h2 { position: static; margin-bottom: 18px; }
  .two-col, .about { grid-template-columns: 1fr; }
  .recipe .row { grid-template-columns: 1fr; }
  .recipe .side { position: static; max-height: none; }
}

@media (max-width: 620px) {
  .topics { grid-template-columns: 1fr; }
  .timeline > li, .terms > li { grid-template-columns: 1fr; gap: 2px; }
  .courses li { grid-template-columns: 1fr; padding-block: 5px; }
  .wall { column-count: 2; }
  .recipe .main img { height: 150px; }
  .nav { gap: 0; }
  .nav a { padding: 8px 7px; font-size: 0.88rem; }
}

/* --------------------------------------------------------------------------
   Motion and print
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  .topbar, .footer, .filter, .skip, .hero canvas, .hero::after { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .page-head, .hero { background: none !important; color: #000 !important; padding-block: 12px; }
  .page-head h1, .hero h1 { color: #000; font-size: 24pt; }
  .recipe .row { display: block; padding-block: 12px; }
  .recipe .side { position: static; max-height: none; border: 1px solid #999; margin-bottom: 16px; }
  .recipe .main img { height: 80px; }
  a { color: #000; text-decoration: none; }
}
