/* Prof. Dr. Youssef Ben Hatit
   Layout: the name over a dark blue rule, then the opening paragraph beside the portrait, then one section per
   subject, each with its heading in a left column and dates in a narrow column beside the entries.
   Below about 40rem everything is one column, and the dates sit above their entries.
   Type and colours follow the European Laser Academy's site. */

@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/eb-garamond-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/eb-garamond-italic-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("../fonts/libre-franklin-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #1d2230;
  --navy: #1b2d5b;
  --muted: #5a6073;
  --rule: #d9dce4;
  --beam: #fb031e;    /* the red of the Academy's logo, for link underlines */
  --red: #b3112a;     /* darker red for text and focus, AA on white */
  --display: "EB Garamond", Garamond, "Times New Roman", serif;
  --text: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --wrap: 72rem;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-end: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
h1, h2, p, ul, ol, figure { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
strong { font-weight: 600; }
cite { font-style: italic; }
sub { line-height: 0; }
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--beam);
}
a:hover { color: var(--red); }
a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--paper); padding: 0.5rem 1rem; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-end);
}

/* Masthead: the name and degrees over the rule, then the opening paragraph and the portrait */
.masthead { padding-top: clamp(2rem, 1.25rem + 3vw, 3.5rem); }
.masthead-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--navy);
}
.name {
  font: 500 clamp(2.125rem, 1.5rem + 2.6vw, 3.375rem)/1.08 var(--display);
  color: var(--navy);
  text-wrap: balance;
}
.name a { text-decoration: none; }
.degrees { font-size: 1.125rem; letter-spacing: 0.12em; color: var(--muted); }

.intro {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem 4rem;
  padding-block: clamp(1.75rem, 1rem + 3vw, 3rem) clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
}
.lead {
  flex: 999 1 22rem;
  min-width: 0;
  max-width: 36em;
  font: 400 clamp(1.3125rem, 1.15rem + 0.7vw, 1.625rem)/1.4 var(--display);
}
.portrait { flex: 0 1 17.5rem; min-width: 0; }
.portrait img { width: 100%; }

/* Sections */
.section {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 3rem;
  padding-block: clamp(2rem, 1.5rem + 2vw, 2.5rem);
  border-top: 1px solid var(--rule);
}
.section-head { flex: 1 1 12.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.section-head h2 { font: 500 clamp(1.5rem, 1.35rem + 0.6vw, 1.75rem)/1.2 var(--display); color: var(--navy); }
.section-note { font-size: 0.9375rem; color: var(--muted); }
.section-body { flex: 999 1 35rem; min-width: 0; }

/* Entries with a date column. An undated entry has no .when and keeps to the text column. */
.entries { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.875rem; }
.entries > li { display: grid; grid-template-columns: 8rem minmax(0, 1fr); column-gap: 1.5rem; }
.entries .what { grid-column: 2; }
.when { color: var(--muted); font-variant-numeric: lining-nums; }
.entries--spaced { gap: 1.125rem; }
.entries--pubs { gap: 1.375rem; }

.pub-title { display: block; font: 400 1.3125rem/1.35 var(--display); }
.pub-source { display: block; margin-top: 0.125rem; font-size: 0.9375rem; color: var(--muted); }

.nowrap { white-space: nowrap; }

.plain { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.875rem; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.75rem;
  padding-bottom: max(3.5rem, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--muted);
}

/* Phones: one column, dates above their entries */
@media (max-width: 40rem) {
  .entries > li { grid-template-columns: minmax(0, 1fr); }
  .entries .what { grid-column: 1; }
  .when { font-size: 0.9375rem; }
  .portrait { flex-basis: 13rem; }
}

/* 404 page */
.not-found { padding-block: 2.5rem 4rem; display: flex; flex-direction: column; gap: 1rem; }
.not-found h1 { font: 500 1.75rem/1.2 var(--display); color: var(--navy); }

@media print {
  .skip { display: none; }
  a { text-decoration: none; }
}
