/* ==========================================================================
   petersharp.education
   One stylesheet for the whole site. Sections, in order:
     1. Fonts          4. Header         7. End mark and footer
     2. Settings       5. Navigation     8. Small screens
     3. Base           6. Sections
   Colours and sizes are set once in section 2 and used everywhere else.
   ========================================================================== */


/* 1. Fonts ------------------------------------------------------------------
   Noto Serif for headings, Noto Sans for text (PSE.41.01). Latin subset,
   served from /fonts. Licence: fonts/OFL.txt. */

@font-face { font-family: "Noto Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/noto-serif-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/noto-serif-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/noto-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/noto-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/noto-sans-latin-600-normal.woff2") format("woff2"); }


/* 2. Settings ---------------------------------------------------------------
   The light weight of the PSE palette. --rule is for lines only: it is too
   pale for text. */

:root {
  --sky:   #FAFCFE;   /* page background */
  --haze:  #EBF1FA;   /* quiet fills */
  --line:  #D2D8E3;   /* hairlines between sections */
  --rule:  #8DA0BC;   /* stronger rules and borders */
  --slate: #48597A;   /* links and secondary text */
  --navy:  #1D2940;   /* headings and the monogram */
  --ink:   #16181C;   /* running text */

  --serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --sans:  "Noto Sans", "Helvetica Neue", Arial, sans-serif;

  --text-size: 1.0625rem;   /* 17px */
  --small:     0.875rem;
  --tiny:      0.8125rem;
  --measure:   36rem;       /* longest line of running text */
  --page:      60rem;       /* widest the content gets */
  --gutter:    16px;        /* minimum space at the screen edges */

  color-scheme: light;
}


/* 3. Base ------------------------------------------------------------------- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-size);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { color: var(--navy); line-height: 1.2; text-wrap: balance; }
h1, h2 { font-family: var(--serif); font-weight: 400; }
h3 { font-family: var(--sans); font-weight: 600; font-size: var(--text-size); margin: 1.6rem 0 0.5rem; }

p { margin: 0 0 0.9rem; }
p:last-child { margin-bottom: 0; }

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

/* .wrap centres content and keeps it off the screen edges. */
.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding-left:  max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}


/* 4. Header ----------------------------------------------------------------- */

/* Downland band. The picture is cropped from the bottom as the window narrows. */
.band { height: clamp(120px, 17vw, 210px); overflow: hidden; }
.band img { width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }

.site-header { padding-block: 2.25rem 0; }

/* Photo on the left, name and introduction beside it. */
.intro {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}
.intro .photo { width: 9rem; height: 9rem; border-radius: 50%; }

h1 { font-size: 2.5rem; line-height: 1.1; margin: 0.35rem 0 0.4rem; }

/* Strapline: each part stays on one line. A middle dot follows every part
   but the last, so on a narrow screen the line breaks after the dot. */
.strapline { color: var(--slate); margin: 0 0 1.1rem; }
.strapline span { white-space: nowrap; }
.strapline span:not(:last-child)::after { content: "·"; padding: 0 0.5em; color: var(--rule); }

.lede  { max-width: var(--measure); }
.place { color: var(--slate); font-size: 0.9375rem; margin-top: 0.6rem; }


/* 5. Navigation ------------------------------------------------------------- */

.site-nav { margin-top: 1.75rem; border-block: 1px solid var(--line); }
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0.6rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}
.site-nav a { text-decoration: none; font-size: 0.9375rem; }
.site-nav a:hover { text-decoration: underline; }


/* 6. Sections ----------------------------------------------------------------
   Each section has a narrow left column (heading and key facts) and the
   text beside it. */

.section { padding-block: 2.25rem; border-bottom: 1px solid var(--line); scroll-margin-top: 1rem; }

.section > .wrap {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 1rem 2.5rem;
}

.section h2 { font-size: 1.5rem; margin: 0 0 0.75rem; }

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  color: var(--slate);
  font-size: var(--small);
  line-height: 1.45;
}

.text { max-width: var(--measure); }
.text h3:first-child { margin-top: 0; }

.email { font-size: 1.125rem; }


/* 7. End mark and footer ----------------------------------------------------
   The monogram closes the page, as it closes PSE documents. */

.endmark { padding-block: 2.5rem 1.5rem; }
.endmark img { height: 1.75rem; width: auto; }
.endmark p { color: var(--navy); font-size: var(--tiny); margin: 0.35rem 0 0; }

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 1rem 2.5rem;
  color: var(--slate);
  font-size: var(--tiny);
  line-height: 1.55;
}


/* 8. Small screens ---------------------------------------------------------- */

@media (max-width: 720px) {
  .section > .wrap { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
  .section h2 { margin-bottom: 0.5rem; }
  .facts { margin-bottom: 0.75rem; }
}

@media (max-width: 600px) {
  /* Below 600px the landscape loses its layering, so a plain block replaces it (PSE.41.01). */
  .band { height: 44px; background: var(--line); border-bottom: 6px solid var(--slate); }
  .band img { display: none; }
}

@media (max-width: 520px) {
  .intro { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .intro .photo { width: 6.5rem; height: 6.5rem; }
  h1 { font-size: 2.125rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
