/* GA Electrical home: the duty face six times down one board, and a margin register that keeps count. */

/* ---- the register in the right margin: light tabular figures against one hairline, no ground of its own;
        it stands only in the empty margin beyond the cable run and reads on either ground by difference ---- */
.duty-register{ display: none; }
.register-figure{
  margin: 0 0 0.3rem;
  font-family: 'Literata', Georgia, 'Times New Roman', serif;
  font-weight: 300;
  font-size: 0.9rem;
  line-height: 1.3;
  text-align: right;
  font-variant-numeric: lining-nums tabular-nums;
  opacity: 0.55;
  transition: none;
}
.register-figure:last-child{ margin-bottom: 0; }
.register-figure.gae-marked-on{ opacity: 1; }
@media (min-width: 85em){
  .duty-register{
    position: fixed;
    top: 15rem;
    right: 0.5rem;
    z-index: 40;
    display: block;
    width: 2rem;
    padding: 0.2rem 0.5rem 0.2rem 0;
    background: none;
    color: var(--colour-of-the-ground);
    border-right: 1px solid var(--colour-of-the-ground);
    mix-blend-mode: difference;
    pointer-events: none;
  }
  .duty-register.gae-quiet-on{ visibility: hidden; }
}

/* ---- the opening plate: every row ruled, the figure row included ---- */
.duty-face > .figure-bay{
  margin-top: 0.9rem;
  padding-block: 0.8rem;
  border-top: 1px solid currentColor;
}
.figure-line{ margin: 0.9rem 0 0; }
.face-fields{ margin: 0; }
.dial-line{ margin: 1.1rem 0 0; }
.dial-line a{ text-decoration-thickness: 2px; }

/* ---- a screen of the board: figure bay, reading bay, photograph bay ---- */
.duty-screen{ padding-block: var(--space-between-sections); }
.mineral-ground{ background: var(--colour-of-the-ground); color: var(--colour-of-the-ink); }
.pine-ground{ background: var(--colour-of-the-ink); color: var(--colour-of-the-ground); }
.duty-work, .duty-urgent, .duty-towns{ position: relative; }
.duty-screen-bays{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.3rem;
}
.screen-figure{
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.2rem;
}
.screen-figure .figure-bay{ margin: 0; }
.screen-heading{ margin-bottom: 0; }
.reading-bay > p{ margin: 0 0 0.9rem; }
.reading-bay > p:last-child{ margin-bottom: 0; }
.duty-screen .photograph-bay{ margin: 0; }
.duty-screen .photograph-bay img{ aspect-ratio: 16 / 10; }
.duty-screen .shallow-strip img{ aspect-ratio: 16 / 9; }
.duty-screen .wide-strip img{ aspect-ratio: 16 / 9; }
.duty-talk .photograph-bay img{ aspect-ratio: 4 / 3; }

/* ---- the work: three entries as ruled rows, each led by its numeral, nothing boxed ---- */
.job-shelf{
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid currentColor;
}
.job-entry{ border-bottom: 1px solid currentColor; }
.job-link{
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.3rem 0.8rem;
  min-height: 2.75rem;
  padding-block: 0.9rem;
  color: inherit;
  text-decoration: none;
}
.job-number{
  grid-row: span 2;
  font-size: var(--size-of-a-label);
  font-variant-numeric: lining-nums tabular-nums;
  opacity: 0.72;
}
.job-name{
  font-family: 'Forum', 'Times New Roman', serif;
  font-weight: 400;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 1.85rem);
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.job-line{ font-size: var(--size-of-the-reading); line-height: 1.5; }
.job-link:hover .job-name,
.job-link:focus-visible .job-name{ text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

/* ---- the two settings: each entry with its own photograph, its caption against it ---- */
.setting-pair{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.6rem;
}
.setting-name{
  margin: 0;
  font-family: 'Forum', 'Times New Roman', serif;
  font-weight: 400;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 1.85rem);
  line-height: 1.18;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.setting-name a{ text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.setting-line{ margin: 0.5rem 0 0.75rem; font-size: var(--size-of-the-reading); }
.setting-entry .photograph-bay img{ aspect-ratio: 4 / 3; }

/* ---- the towns: one large-type column of names ---- */
.town-column{
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid currentColor;
}
.named-town{
  padding-block: 0.5rem;
  border-bottom: 1px solid currentColor;
  font-family: 'Forum', 'Times New Roman', serif;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- the last screen sits against the pine timetable, so it closes on a pale rule ---- */
.duty-talk{ border-bottom: 1px solid var(--colour-of-the-ground); }
.duty-talk .reading-bay{ padding-bottom: 0.2rem; }

/* ---- wider windows ---- */
@media (min-width: 40em){
  .setting-pair{ grid-template-columns: 1fr 1fr; align-items: start; }
  .named-town{ font-size: 1.9rem; }
}

@media (min-width: 60em){
  /* the first window: the photograph shares the plate's top and bottom edges */
  .page-opening{ align-items: stretch; }
  .page-opening .photograph-bay{ min-height: 100%; }
  .page-opening .photograph-bay img{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }
  .page-opening .photograph-bay .corner-tick{ z-index: 1; }

  /* the catalogue rows run the width of the grid: numeral, name at display scale, its line */
  .job-link{
    grid-template-columns: 3rem minmax(0, 1.1fr) minmax(0, 1fr);
    column-gap: 1.5rem;
    align-items: baseline;
    padding-block: 1.1rem;
  }
  .job-number{ grid-row: auto; }

  .duty-urgent .photograph-bay img{ aspect-ratio: 1 / 1; }
  .duty-towns .wide-strip img{ aspect-ratio: 5 / 2; }
}

/* ---- middle windows: the figure across the top, then each screen takes its own split ---- */
@media (min-width: 60em) and (max-width: 74.99em){
  .duty-screen-bays{
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
    column-gap: 1.9rem;
    align-items: start;
  }
  .duty-screen-bays > .screen-figure{ grid-column: 1 / -1; grid-row: 1; }
  .duty-screen-bays > .reading-bay{ grid-column: 1; grid-row: 2; }
  .duty-screen-bays > .photograph-bay{ grid-column: 2; grid-row: 2; }

  .duty-work .duty-screen-bays > .job-shelf{ grid-column: 1 / -1; grid-row: 3; }

  .duty-urgent .duty-screen-bays{ grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }

  .duty-towns .duty-screen-bays > .reading-bay{ grid-row: 2 / span 2; }
  .duty-towns .duty-screen-bays > .town-column{ grid-column: 2; grid-row: 2; }
  .duty-towns .duty-screen-bays > .figure-line{ grid-column: 2; grid-row: 3; margin-top: 0; }
  .duty-towns .duty-screen-bays > .photograph-bay{ grid-column: 1 / -1; grid-row: 4; }

  .duty-talk .duty-screen-bays{ grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); }
  .duty-talk .duty-screen-bays > .photograph-bay{ grid-column: 1; }
  .duty-talk .duty-screen-bays > .reading-bay{ grid-column: 2; }

  .duty-settings .duty-screen-bays{ grid-template-columns: minmax(0, 1fr); }
  .duty-settings .duty-screen-bays > .setting-pair{ grid-column: 1 / -1; grid-row: 3; }
}

/* ---- desk windows: the figure holds the left bay; the other bays differ screen by screen ---- */
@media (min-width: 75em){
  .duty-screen-bays{
    grid-template-columns: 16rem minmax(0, 20rem) minmax(0, 1fr);
    column-gap: 2rem;
    align-items: start;
  }
  .screen-figure{ display: block; }
  .screen-figure .figure-bay{ margin-bottom: 0.9rem; }
  .duty-screen-bays > .screen-figure{ grid-column: 1; grid-row: 1; }
  .duty-screen-bays > .reading-bay{ grid-column: 2; grid-row: 1; }
  .duty-screen-bays > .photograph-bay{ grid-column: 3; grid-row: 1; }

  /* 03: narrow note, wide shallow photograph, the catalogue full width beneath */
  .duty-work .duty-screen-bays > .job-shelf{ grid-column: 1 / -1; grid-row: 2; margin-top: 0.7rem; }

  /* 07: the words take the room, a square photograph in a narrower bay */
  .duty-urgent .duty-screen-bays{ grid-template-columns: 16rem minmax(0, 1fr) 26rem; }

  /* 04: note and town names side by side, the street as one strip across the foot */
  .duty-towns .duty-screen-bays{
    grid-template-columns: 16rem minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
  }
  .duty-towns .duty-screen-bays > .screen-figure{ grid-row: 1 / span 2; }
  .duty-towns .duty-screen-bays > .reading-bay{ grid-row: 1 / span 2; }
  .duty-towns .duty-screen-bays > .town-column{ grid-column: 3; grid-row: 1; }
  .duty-towns .duty-screen-bays > .figure-line{ grid-column: 3; grid-row: 2; margin-top: 0; }
  .duty-towns .duty-screen-bays > .photograph-bay{ grid-column: 1 / -1; grid-row: 3; }
  .duty-towns .named-town{ font-size: 2.25rem; }

  /* 01: the photograph moves to the middle, the words close the row */
  .duty-talk .duty-screen-bays{ grid-template-columns: 16rem minmax(0, 1.1fr) minmax(0, 1fr); }
  .duty-talk .duty-screen-bays > .photograph-bay{ grid-column: 2; }
  .duty-talk .duty-screen-bays > .reading-bay{ grid-column: 3; }

  /* 02: the figure runs down the left beside both the intro and the pair */
  .duty-settings .duty-screen-bays{
    grid-template-columns: 16rem minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }
  .duty-settings .duty-screen-bays > .screen-figure{ grid-row: 1 / span 2; }
  .duty-settings .duty-screen-bays > .setting-pair{ grid-column: 2; grid-row: 2; }
}

/* ---- with motion unwanted the register simply changes at once ---- */
@media (prefers-reduced-motion: reduce){
  .register-figure{ transition: none; }
}
