/* =====================================================================
   style.css — shared look for every page of ignaciotomas.net

   Every page links to this one file, so a change here changes the
   whole site. Colours and fonts are defined once, in :root below.
   ===================================================================== */

/* ---------- Colours and fonts (edit these to restyle the site) ------ */
:root {
  --paper:   #ffffff;   /* page background                           */
  --ink:     #1b2430;   /* main text                                 */
  --muted:   #5a6472;   /* secondary text: captions, notes, dates    */
  --blue:    #0b3c8c;   /* links and accents (the schlieren blue)    */
  --wash:    #eef3fa;   /* pale blue for subtle boxes                */
  --rule:    #d5dbe3;   /* thin lines and borders                    */

  --font: "STIX Two Text", "STIX Two", Georgia, "Times New Roman", serif;

  --text-width: 44rem;  /* comfortable reading width                 */
  --page-width: 68rem;  /* width for images, videos, tables          */
}

/* ---------- Basics -------------------------------------------------- */
* { box-sizing: border-box; }

html { font-size: 112.5%; }          /* 18px base */

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

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

a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { line-height: 1.2; font-weight: 600; }
h1 { font-size: 2.2rem; margin: 0 0 1.5rem; letter-spacing: -0.01em; }
h2 { font-size: 1.45rem; margin: 2.75rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 2rem 0 0.4rem; }
p  { margin: 0 0 1rem; }
ul { padding-left: 1.25rem; }
li { margin-bottom: 0.4rem; }

/* ---------- Site header and navigation ------------------------------ */
.site-header {
  border-bottom: 1px solid var(--rule);
}
.site-header .inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 1.1rem 1.5rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}
.site-name {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 0.9rem;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.4rem;
}
.site-nav li { margin: 0; }
.site-nav a {
  display: block;
  padding: 0.2rem 0 0.8rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: var(--blue); }
/* The page you are on is marked with aria-current="page" in the HTML */
.site-nav a[aria-current="page"] {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* ---------- Main content area --------------------------------------- */
main {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
/* Text stays at a readable width even on wide screens */
main > p, main > ul, main > h2, main > h3, .prose { max-width: var(--text-width); }

.note { color: var(--muted); font-size: 0.9rem; }

/* ---------- Home page ----------------------------------------------- */
/* Wide simulation image under the header */
.hero-image {
  display: block;
  width: 100%;
  height: clamp(150px, 24vw, 320px);
  object-fit: cover;
  object-position: center 60%;
  border-bottom: 1px solid var(--rule);
}
.intro {
  display: grid;
  grid-template-columns: 1fr 15rem;
  gap: 2.5rem;
  align-items: start;
}
.intro .lead { font-size: 1.2rem; max-width: var(--text-width); }
.portrait { width: 100%; border-radius: 3px; }
.contact {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.5rem;
  margin: 1.5rem 0 0;
}
.contact dt { color: var(--muted); }
.contact dd { margin: 0; }
.disclaimer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  max-width: var(--text-width);
}

/* ---------- Research page: three paper thumbnails ------------------- */
.papers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 50rem;
  margin: 1.5rem 0 2rem;
}
.papers a { text-decoration: none; color: var(--ink); }
.papers img { border: 1px solid var(--rule); aspect-ratio: 3 / 4; object-fit: cover; object-position: top; width: 100%; }
.papers a:hover img { border-color: var(--blue); }
.papers span { display: block; margin-top: 0.5rem; font-size: 0.9rem; }

.agencies { width: 100%; max-width: 30rem; margin: 1rem 0 2rem; }

/* ---------- Seminar page: table of semesters ------------------------ */
.seminar-table {
  border-collapse: collapse;
  width: 100%;
  max-width: var(--text-width);
  margin: 1.5rem 0;
}
.seminar-table th, .seminar-table td {
  text-align: left;
  padding: 0.65rem 1rem 0.65rem 0;
  border-bottom: 1px solid var(--rule);
}
.seminar-table th { font-weight: 600; color: var(--muted); font-size: 0.9rem; }

/* ---------- Teaching page ------------------------------------------- */
.semester { border-top: 1px solid var(--rule); max-width: var(--text-width); }
.semester h3 { margin-top: 1.5rem; }
.flyers { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 1rem 0; }
.flyers a { text-decoration: none; }
.flyers img { width: 11rem; border: 1px solid var(--rule); }
.flyers span { display: block; margin-top: 0.4rem; font-size: 0.9rem; }

/* ---------- Movies page --------------------------------------------- */
.movie {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 2rem;
  align-items: start;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}
.movie h2 { margin-top: 0; font-size: 1.2rem; }
.video { width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.video.square { aspect-ratio: 1 / 1; }
.video.wide   { aspect-ratio: 12 / 7; }
.video.photo  { aspect-ratio: 3 / 2; }

/* ---------- Picture galleries --------------------------------------- */
.albums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 2rem;
  max-width: 44rem;
}
.albums a { text-decoration: none; color: var(--ink); }
.albums img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; border: 1px solid var(--rule); }
.albums a:hover img { border-color: var(--blue); }
.albums span { display: block; margin-top: 0.5rem; font-size: 1.1rem; }

.gallery { display: grid; gap: 1.5rem; margin: 0 0 2rem; }
.gallery.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery.two   { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 44rem; }
figure { margin: 0; }
figure img { width: 100%; border: 1px solid var(--rule); }
figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }
.gallery + .note { margin-top: -1rem; }  /* caption under a whole row of pictures */

/* ---------- Small screens (phones) ---------------------------------- */
@media (max-width: 760px) {
  html { font-size: 106.25%; }       /* 17px */
  h1 { font-size: 1.8rem; }
  .intro { grid-template-columns: 1fr; }
  .portrait { max-width: 12rem; }
  .intro aside { order: -1; }
  .movie { grid-template-columns: 1fr; gap: 1rem; }
  .gallery.three { grid-template-columns: 1fr; }
  .gallery.two   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .papers { gap: 0.75rem; }
  .contact { grid-template-columns: 1fr; gap: 0.1rem; }
  .contact dd { margin-bottom: 0.6rem; }
}
