/* walltiefailure.co.uk
   Printed in two inks: slate for everything, oxide red only for the defect and for warnings. */

@font-face { font-family: "Alegreya"; font-weight: 400; font-style: normal; font-display: swap; src: url("/letterforms/alegreya-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya"; font-weight: 400; font-style: italic; font-display: swap; src: url("/letterforms/alegreya-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Alegreya"; font-weight: 700; font-style: normal; font-display: swap; src: url("/letterforms/alegreya-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("/letterforms/alegreya-sans-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url("/letterforms/alegreya-sans-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("/letterforms/alegreya-sans-700-normal.woff2") format("woff2"); }
/* stand-ins sized to the real faces so text does not jump when they arrive */
@font-face { font-family: "Alegreya standin"; src: local("Georgia"); size-adjust: 91%; }
@font-face { font-family: "Alegreya Sans standin"; src: local("Arial"), local("Helvetica"); size-adjust: 85%; }

:root {
  --limewash: #f3f4ef;
  --slate-ink: #1b2a33;
  --lead-grey: #4b5c65;
  --zinc-ground: #e3e9e8;
  --joint-rule: #b4c0c3;
  --slate-tint: #9fb0b5;
  --oxide: #a3371a;
  --oxide-tint: #d58a68;
  --book-alegreya: "Alegreya", "Alegreya standin", Georgia, serif;
  --plain-alegreya: "Alegreya Sans", "Alegreya Sans standin", Arial, sans-serif;
  --margin-col: 12rem;
  --text-col: 37rem;
  --col-gutter: 2.5rem;
  --page-edge: 1.25rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--limewash);
  color: var(--slate-ink);
  font-family: var(--book-alegreya);
  font-size: 1.1875rem;
  line-height: 1.5;
  font-variant-numeric: oldstyle-nums;
}
img { display: block; max-width: 100%; height: auto; }
p, ul, ol, dl, figure, table, aside, h1, h2, h3 { margin: 0; }
a { color: inherit; text-decoration-line: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.17em; text-decoration-color: var(--slate-tint); }
a:hover { text-decoration-color: var(--slate-ink); text-decoration-thickness: 0.1em; }
a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--slate-ink); outline-offset: 3px; }
strong, b { font-weight: 700; }

.jump-to-text { position: absolute; left: -999rem; top: 0; z-index: 5; background: var(--slate-ink); color: var(--limewash); padding: 0.6rem 1rem; font-family: var(--plain-alegreya); }
.jump-to-text:focus { left: 0.5rem; top: 0.5rem; outline-color: var(--oxide); }

/* ---------- head of the guide ---------- */
.guide-head { border-bottom: 2px solid var(--slate-ink); }
.guide-head-grid { max-width: 78rem; margin: 0 auto; padding: 1.1rem var(--page-edge) 0.55rem; }
.guide-name { display: inline-block; text-decoration: none; line-height: 1.1; }
.guide-name span { font-weight: 700; font-size: 1.45rem; letter-spacing: -0.005em; }
.guide-name small { display: block; font-size: 1.05rem; font-style: italic; color: var(--lead-grey); margin-top: 0.15rem; }
.chapter-row ul { list-style: none; margin: 0.7rem 0 0; padding: 0; display: flex; flex-wrap: wrap; column-gap: 1.25rem; row-gap: 0; }
.chapter-row a { display: inline-block; font-family: var(--plain-alegreya); font-size: 1.0625rem; text-decoration: none; padding: 0.4rem 0 0.3rem; border-bottom: 3px solid transparent; }
.chapter-row a:hover { border-bottom-color: var(--slate-tint); }
.chapter-row a[aria-current="page"] { font-weight: 700; border-bottom-color: var(--slate-ink); }

/* ---------- the page: one grid, margin / text / plate room ---------- */
main { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 42rem; margin: 0 auto; padding: 1.6rem var(--page-edge) 4rem; }
main > * + * { margin-top: 1.05rem; }

.you-are-here { font-family: var(--plain-alegreya); font-size: 1rem; color: var(--lead-grey); }
h1, h2 { font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 1.3rem + 4.6vw, 3.9rem); line-height: 1.04; letter-spacing: -0.012em; }
.you-are-here + h1 { margin-top: 0.5rem; }
h2 { font-size: 1.75rem; line-height: 1.14; letter-spacing: -0.005em; }
main > h2 { margin-top: 3.2rem; }
h3 { font-family: var(--plain-alegreya); font-weight: 700; font-size: 1.2rem; line-height: 1.25; }
main > h3 { margin-top: 1.8rem; }
main > h2 + *, main > h3 + * { margin-top: 0.7rem; }
main > h2 + h3 { margin-top: 1.1rem; }
main > h3 + p, main > h3 + ul { margin-top: 0.35rem; }
.opening { font-size: 1.3rem; line-height: 1.42; margin-top: 1.3rem; }
ul, ol { padding-left: 1.2rem; }
li + li { margin-top: 0.4rem; }
main > ul > li::marker { color: var(--lead-grey); }

/* note numbers in the text */
sup { font-family: var(--plain-alegreya); font-size: 0.7em; line-height: 0; vertical-align: super; font-variant-numeric: lining-nums; }
sup a { text-decoration: none; color: var(--lead-grey); padding: 0.25em 0.08em; }
sup a:hover { color: var(--slate-ink); text-decoration: underline; }

/* ---------- drawings and photographs ---------- */
figure img { width: 100%; }
.drawn-plate img { background: var(--zinc-ground); max-height: 34rem; object-fit: contain; }
main > figure { margin-top: 2rem; }
main > figure + * { margin-top: 2rem; }
figcaption { font-family: var(--plain-alegreya); font-size: 1rem; line-height: 1.38; color: var(--lead-grey); padding-top: 0.55rem; font-variant-numeric: lining-nums; }
figcaption b { color: var(--slate-ink); }
figcaption a { color: var(--slate-ink); }

/* look-alike entries: the drawing sits beside its description */
.drawing-beside { display: grid; gap: 1.1rem; }
.drawing-beside > div > * + * { margin-top: 0.9rem; }
.tell-apart { border-top: 2px solid var(--slate-ink); padding-top: 0.6rem; margin-top: 1.4rem; }
.tell-apart > strong:first-child { display: block; font-family: var(--plain-alegreya); font-size: 1.05rem; margin-bottom: 0.15rem; }

.photo-row { display: grid; grid-template-columns: 1fr; gap: 1.4rem 1.1rem; margin-top: 1.4rem; }

/* ---------- the key: match your wall to a drawing ---------- */
.wall-key { list-style: none; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.4rem 2rem; margin-top: 1.6rem; }
.key-entry { margin: 0; border-top: 5px solid var(--slate-ink); }
.key-entry.tie-sign { border-top-color: var(--oxide); }
.key-entry img { width: 100%; aspect-ratio: 3 / 2; object-fit: contain; background: var(--zinc-ground); }
.key-entry h3 { font-family: var(--book-alegreya); font-size: 1.4rem; line-height: 1.15; margin-top: 0.85rem; }
.key-entry p { margin-top: 0.45rem; font-size: 1.125rem; line-height: 1.42; }
.likely-cause { font-family: var(--plain-alegreya); font-weight: 700; }
.tie-sign .likely-cause { color: var(--oxide); }
.likely-cause a { font-weight: 400; color: var(--slate-ink); white-space: nowrap; }
main > .wall-key + * { margin-top: 2.4rem; }

/* ---------- notes set apart from the running text ---------- */
.surveyors-note { border-left: 3px solid var(--slate-tint); padding: 0.1rem 0 0.15rem 1.1rem; font-family: var(--plain-alegreya); font-size: 1.125rem; line-height: 1.45; }
main > .surveyors-note { margin-top: 1.9rem; }
main > .surveyors-note + * { margin-top: 1.9rem; }
.surveyors-note > * + * { margin-top: 0.6rem; }
.note-title { font-weight: 700; }
.surveyors-note.keep-clear { border-left: 6px solid var(--oxide); font-family: var(--book-alegreya); font-size: inherit; line-height: inherit; }
.keep-clear .note-title { font-family: var(--plain-alegreya); font-size: 1.2rem; color: var(--oxide); }

/* ---------- how urgent: four steps, slate to oxide ---------- */
.urgency-strip { list-style: none; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.9rem 1.4rem; font-family: var(--plain-alegreya); font-size: 1.0625rem; line-height: 1.38; }
main > .urgency-strip { margin-top: 1.5rem; }
main > .urgency-strip + * { margin-top: 1.5rem; }
.urgency-strip li { margin: 0; padding: 0.1rem 0 0.1rem 0.9rem; border-left: 0.6rem solid var(--slate-tint); }
.urgency-strip b { display: block; font-size: 1.2rem; }
.urgency-strip li:nth-child(2) { border-color: var(--lead-grey); }
.urgency-strip li:nth-child(3) { border-color: var(--oxide-tint); }
.urgency-strip li:nth-child(4) { border-color: var(--oxide); }
.urgency-strip li:nth-child(4) b { color: var(--oxide); }

/* ---------- tables ---------- */
table { border-collapse: collapse; width: 100%; font-family: var(--plain-alegreya); font-size: 1.0625rem; line-height: 1.36; font-variant-numeric: lining-nums; }
main > table, main > .table-pan { margin-top: 1.6rem; }
main > table + *, main > .table-pan + * { margin-top: 1.6rem; }
caption { text-align: left; font-weight: 700; font-size: 1.125rem; padding-bottom: 0.5rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 1.1rem 0.6rem 0; border-bottom: 1px solid var(--joint-rule); }
th:last-child, td:last-child { padding-right: 0; }
thead th { border-bottom: 2px solid var(--slate-ink); font-weight: 400; color: var(--lead-grey); padding-top: 0.2rem; padding-bottom: 0.35rem; }
tbody th { font-weight: 700; }

/* ---------- the ordered steps (a real sequence, so numbered) ---------- */
.action-steps { list-style: none; padding: 0; counter-reset: step; }
.action-steps > li { counter-increment: step; position: relative; padding-left: 2.6rem; margin: 0; }
.action-steps > li + li { margin-top: 1.5rem; }
.action-steps > li::before { content: counter(step); position: absolute; left: 0; top: -0.42rem; font-weight: 700; font-size: 2.5rem; line-height: 1; font-variant-numeric: lining-nums; }
.action-steps h3 { font-family: var(--book-alegreya); font-size: 1.4rem; line-height: 1.15; }
.action-steps li > * + * { margin-top: 0.55rem; }
:target { scroll-margin-top: 1.2rem; }

/* ---------- onward reading ---------- */
.read-next { font-family: var(--plain-alegreya); }
main > .read-next { margin-top: 3.6rem; }
.next-title { font-weight: 700; font-size: 1.0625rem; color: var(--lead-grey); }
.read-next ul { list-style: none; padding: 0; margin-top: 0.4rem; border-top: 2px solid var(--slate-ink); }
.read-next li { margin: 0; border-bottom: 1px solid var(--joint-rule); }
.read-next a { display: block; padding: 0.65rem 0; font-family: var(--book-alegreya); font-size: 1.25rem; line-height: 1.25; text-decoration: none; }
.read-next a:hover { text-decoration: underline; text-decoration-color: var(--slate-ink); }

/* ---------- footnotes ---------- */
.footnotes { font-family: var(--plain-alegreya); font-size: 1rem; line-height: 1.4; font-variant-numeric: lining-nums; }
main > .footnotes { margin-top: 3rem; }
.footnotes::before { content: ""; display: block; width: 7rem; border-top: 1px solid var(--slate-ink); margin-bottom: 0.8rem; }
.footnotes h2 { font-family: var(--plain-alegreya); font-size: 1rem; line-height: 1.3; letter-spacing: 0; }
.footnotes ol { margin-top: 0.5rem; padding-left: 1.7rem; color: var(--lead-grey); }
.footnotes li { overflow-wrap: anywhere; padding-left: 0.2rem; break-inside: avoid; }
.footnotes li + li { margin-top: 0.4rem; }
.footnotes li::marker { color: var(--slate-ink); font-weight: 700; }
.footnotes a { color: var(--slate-ink); }
.footnotes li:target { color: var(--slate-ink); background: var(--zinc-ground); box-shadow: 0 0 0 0.35rem var(--zinc-ground); }

/* ---------- foot of the guide ---------- */
.guide-foot { background: var(--zinc-ground); font-family: var(--plain-alegreya); font-size: 1.0625rem; line-height: 1.45; }
.guide-foot-grid { max-width: 78rem; margin: 0 auto; padding: 2.2rem var(--page-edge) 3rem; display: grid; gap: 1.8rem; }
.guide-foot ul { list-style: none; padding: 0; }
.guide-foot li + li { margin-top: 0; }
.guide-foot nav a { display: inline-block; padding: 0.22rem 0; }
.foot-title { font-weight: 700; margin-bottom: 0.3rem; }
.guide-foot p { max-width: 36rem; }

/* ---------- small screens: comparison tables become labelled entries ---------- */
@media (max-width: 39.99em) {
  .table-pan thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .table-pan table, .table-pan tbody, .table-pan tr, .table-pan th, .table-pan td { display: block; }
  .table-pan caption { display: block; border-bottom: 2px solid var(--slate-ink); }
  .table-pan tr { padding: 0.75rem 0 0.8rem; border-bottom: 1px solid var(--joint-rule); }
  .table-pan th, .table-pan td { border: 0; padding: 0; }
  .table-pan tbody th { font-size: 1.2rem; margin-bottom: 0.25rem; }
  .table-pan td { padding-left: 0; margin-top: 0.3rem; }
  .table-pan td::before { content: attr(data-col); display: block; color: var(--lead-grey); font-size: 0.9375rem; }
}

@media (min-width: 40em) {
  :root { --page-edge: 2rem; }
  .wall-key { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall-key:not(.lookalike-key) { grid-auto-flow: column; grid-template-rows: repeat(3, auto); }
  .drawing-beside { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1.6rem; align-items: start; }
  .photo-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .urgency-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .urgency-strip li { border-left: 0; border-top: 0.6rem solid var(--slate-tint); padding: 0.55rem 0 0; }
  .guide-foot-grid { grid-template-columns: 1fr 1fr; }
  .guide-foot-grid > :first-child { grid-column: 1 / -1; }
  .footnotes ol { columns: 2; column-gap: 2.5rem; }
}

@media (min-width: 62em) {
  main { max-width: 60rem; grid-template-columns: minmax(0, var(--text-col)) minmax(0, 1fr); column-gap: var(--col-gutter); }
  main > * { grid-column: 1; }
  main > h1, main > figure.drawn-plate, main > .wall-key, main > .urgency-strip, main > .table-pan, main > .drawing-beside, main > .photo-row, main > .footnotes { grid-column: 1 / -1; }
  .guide-head-grid, .guide-foot-grid { max-width: 60rem; }
  .photo-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wall-key:not(.lookalike-key) { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wall-key.lookalike-key { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem 1.5rem; }
  .lookalike-key .key-entry h3 { font-size: 1.25rem; }
  .lookalike-key .key-entry p { font-size: 1.0625rem; }
}

/* wide screens: captions move into a left margin, plates run out to the right */
@media (min-width: 78em) {
  body { font-size: 1.25rem; }
  .opening { font-size: 1.45rem; }
  main { max-width: 78rem; grid-template-columns: var(--margin-col) minmax(0, var(--text-col)) minmax(0, 1fr); padding-top: 2.4rem; }
  main > * { grid-column: 2; }
  main > h1 { grid-column: 2 / -1; max-width: 50rem; }
  main > .urgency-strip, main > .table-pan, main > .drawing-beside, main > .photo-row, main > .footnotes { grid-column: 2 / -1; }
  main > .wall-key { grid-column: 1 / -1; }
  main > figure { grid-column: 1 / -1; display: grid; grid-template-columns: var(--margin-col) minmax(0, var(--text-col)) minmax(0, 1fr); column-gap: var(--col-gutter); align-items: start; }
  main > figure > img { grid-column: 2 / -1; grid-row: 1; }
  main > figure.photo-plate > img { grid-column: 2; }
  main > figure > figcaption { grid-column: 1; grid-row: 1; border-top: 1px solid var(--slate-ink); padding-top: 0.5rem; }
  .drawing-beside { grid-template-columns: minmax(0, var(--text-col)) minmax(0, 1fr); column-gap: var(--col-gutter); }
  .drawing-beside > figure { grid-column: 2; grid-row: 1; }
  .drawing-beside > div { grid-column: 1; grid-row: 1; }
  .action-steps > li { padding-left: 0; }
  .action-steps > li::before { left: -3rem; width: 2rem; text-align: right; }
  .guide-head-grid, .guide-foot-grid { max-width: 78rem; display: grid; grid-template-columns: var(--margin-col) minmax(0, var(--text-col)) minmax(0, 1fr); column-gap: var(--col-gutter); }
  .guide-head-grid { align-items: end; padding-top: 1.3rem; }
  .guide-name small { font-size: 1rem; }
  .chapter-row { grid-column: 2 / -1; }
  .chapter-row ul { margin-top: 0; column-gap: 1.5rem; }
  .guide-foot-grid > :first-child { grid-column: 2; grid-row: 1; }
  .guide-foot-grid > nav { grid-column: 1; grid-row: 1; }
  .guide-foot-grid > :last-child { grid-column: 3; grid-row: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media print {
  .guide-head nav, .jump-to-text, .read-next { display: none; }
  body { background: #fff; }
  main { display: block; }
}
