/* ================================================================
   THE LEASEHOLD FILE — MASTER STYLESHEET
   leaseholdfile.co.uk
   Revision: 2.0 — June 2026

   Design: a maintained reference document, not a website.
   Two-column document grid — an apparatus margin carrying
   folios and file-control, a measured text column, and a
   continuous spine between them. Warm off-white, near-black
   ink, one restrained seal accent (oxblood). Monospace
   apparatus, serif text.
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,500;0,8..60,600;1,8..60,400&display=swap');

/* ----------------------------------------------------------------
   DESIGN TOKENS
   ---------------------------------------------------------------- */
:root {
  /* Colour — warm neutral paper, near-black ink */
  --paper:    #F7F5F0;   /* document background                    */
  --ink:      #1A1A16;   /* primary text                           */
  --dim:      #6F6E65;   /* metadata, labels, folios               */
  --rule:     #D8D5CC;   /* hairline dividers, spine               */
  --rule-2:   #B8B4A9;   /* stronger structural rules              */
  --mark:     #3C3B36;   /* keys, mild emphasis                    */

  /* Accent — a single muted oxblood "seal". Used only for the
     document edge, the file-tab mark, the current section, and
     the citation block. Reads as ledger/deed/record, never alarm. */
  --seal:      oklch(0.42 0.078 28);
  --seal-deep: oklch(0.36 0.072 28);
  --seal-tint: oklch(0.42 0.078 28 / 0.055);

  /* Status (reform tracker) */
  --in-force:  #2C5A3A;

  /* Typography */
  --mono:  'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  /* Document grid */
  --margin: 168px;   /* apparatus column (folios, file-control)    */
  --gut:    2.5rem;  /* gutter between margin and text             */
  --measure: 680px;  /* text column max                            */
  --pad:    clamp(1.25rem, 5vw, 2.25rem);
}

/* ----------------------------------------------------------------
   RESET
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  min-height: 100vh;
  /* The document edge — a fixed colour band at the top of every page */
  border-top: 3px solid var(--seal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ----------------------------------------------------------------
   SHARED WIDTH + DOCUMENT GRID
   Every major block aligns to the same two columns:
   [ apparatus margin | text measure ]
   ---------------------------------------------------------------- */
.wrapper {
  max-width: calc(var(--margin) + var(--gut) + var(--measure));
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* Reusable two-column document grid */
.doc-grid,
.file-header .wrapper,
.content-section,
.cross-ref {
  display: grid;
  grid-template-columns: var(--margin) minmax(0, 1fr);
  column-gap: var(--gut);
}

/* ----------------------------------------------------------------
   GLOBAL TYPOGRAPHY
   ---------------------------------------------------------------- */
h1 {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4.4vw, 2.375rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

h2 {
  font-family: var(--serif);
  font-size: clamp(1.125rem, 3vw, 1.3125rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.625rem;
}

/* Mono uppercase sub-headings */
h3 {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mark);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

h4 {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--mark);
  margin-top: 1.25rem;
  margin-bottom: 0.375rem;
}

p {
  margin-bottom: 1rem;
  max-width: 66ch;
}
p:last-child { margin-bottom: 0; }

/* Lede paragraph — first paragraph of the opening section reads larger */
.content-section:first-of-type > p:first-of-type {
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--ink);
}

a {
  color: var(--ink);
  text-underline-offset: 2.5px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-2);
  transition: text-decoration-color 0.12s, color 0.12s;
}
a:hover { text-decoration-color: var(--seal); }
a:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
  border-radius: 1px;
}

ul, ol {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
  max-width: 66ch;
}
li { margin-bottom: 0.375rem; }
li::marker { color: var(--dim); }

strong { font-weight: 600; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}
th {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--mark);
  text-align: left;
  padding: 0 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--ink);
}
td {
  padding: 0.7rem 0.75rem 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
td:first-child { white-space: nowrap; padding-right: 1.75rem; }
td:first-child a { font-weight: 600; }

/* ----------------------------------------------------------------
   ACCESSIBILITY — SKIP LINK
   ---------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus { top: 0.5rem; }

/* ----------------------------------------------------------------
   SITE MASTHEAD
   ---------------------------------------------------------------- */
.site-header {
  padding-block: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.header-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-name {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
/* The file-tab mark — a single solid seal square */
.site-name::before {
  content: "";
  width: 0.64em;
  height: 0.64em;
  background: var(--seal);
  margin-right: 0.7em;
  flex-shrink: 0;
}
.site-name:hover { color: var(--mark); }

.site-domain {
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--dim);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* Strapline — the one serif voice line in the masthead */
.site-strapline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--dim);
  margin-top: 0.4rem;
  margin-bottom: 0;
  max-width: 60ch;
}

/* ----------------------------------------------------------------
   NAVIGATION
   ---------------------------------------------------------------- */
.site-nav {
  border-top: 1px solid var(--rule);
  margin-top: 1.25rem;
  padding-top: 0.625rem;
  padding-bottom: 0.25rem;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
}

.site-nav a {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
  color: var(--dim);
  text-decoration: none;
  display: block;
  padding-block: 0.3rem;
  line-height: 1.3;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); }

.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--seal);
}

/* --- Register-of-contents variant: grouped, labelled columns --- */
.site-nav--grouped {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem 2.5rem;
  padding-bottom: 1rem;
}

.nav-group-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--mark);
  margin-bottom: 0.55rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

.site-nav--grouped ul {
  display: block;
  margin: 0;
  padding: 0;
}
.site-nav--grouped li { margin-bottom: 0.05rem; }
.site-nav--grouped a { padding-block: 0.22rem; }

@media (max-width: 760px) {
  .site-nav--grouped { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}
@media (max-width: 480px) {
  .site-nav--grouped { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------
   FILE HEADER — the document's cover block
   File-control sits in the apparatus margin; the title fills
   the text column and seats on a heavy rule.
   ---------------------------------------------------------------- */
.file-header {
  padding-block: 2.5rem 1.5rem;
  border-bottom: 2px solid var(--ink);
}

.file-header .wrapper { row-gap: 0; }

.file-meta {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  text-align: right;
  margin: 0;
  padding-top: 0.4rem;
}

.file-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-family: var(--mono);
  line-height: 1.3;
}
.file-meta-item .key {
  font-size: 0.5625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dim);
}
.file-meta-item > span:last-child {
  font-size: 0.75rem;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.file-header h1 {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
}

/* ----------------------------------------------------------------
   MAIN CONTENT — spine + apparatus columns
   ---------------------------------------------------------------- */
.main-content {
  padding-block: 2.5rem 3.5rem;
}

/* The continuous spine — a hairline drawn in the gutter, the
   full height of the content, between apparatus and text. */
.main-content .wrapper {
  background-image: linear-gradient(var(--rule), var(--rule));
  background-repeat: no-repeat;
  background-size: 1px 100%;
  background-position: calc(var(--pad) + var(--margin) + (var(--gut) / 2) - 0.5px) 0;
}

/* Content sections — folio in the margin, prose in the measure */
.content-section {
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
  row-gap: 0;
}
.content-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Everything in a section flows in the text column by default */
.content-section > * { grid-column: 2; }

/* The folio — pulled into the apparatus margin */
.content-section > .section-label {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  text-align: right;
  display: block;
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.5;
  margin: 0;
  padding-top: 0.45rem;
}

/* Opening section with no explicit folio gets an ABSTRACT mark */
.content-section:first-of-type:not(:has(.section-label))::before {
  content: "Abstract";
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 0.5rem;
}

.content-section h2 { margin-top: 0; }
.content-section h2 + p { margin-top: 0; }

/* ----------------------------------------------------------------
   CROSS-REFERENCE BLOCK
   ---------------------------------------------------------------- */
.cross-ref {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-2);
  row-gap: 0;
}
.cross-ref::before {
  content: "Cross-ref";
  grid-column: 1;
  grid-row: 1;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 0.2rem;
}
.cross-ref p {
  grid-column: 2;
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.7;
  color: var(--dim);
  letter-spacing: 0.01em;
  margin: 0;
  max-width: none;
}
.cross-ref a { color: var(--mark); font-weight: 500; text-decoration-color: var(--rule-2); }

/* ----------------------------------------------------------------
   CITE THIS FILE — credibility block for solicitors, charities,
   journalists. A formal, copyable reference string.
   ---------------------------------------------------------------- */
.cite {
  display: grid;
  grid-template-columns: var(--margin) minmax(0, 1fr);
  column-gap: var(--gut);
  margin-top: 3rem;
}
.cite::before {
  content: "Cite";
  grid-column: 1;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--seal);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 0.95rem;
}
.cite-body {
  grid-column: 2;
  border: 1px solid var(--rule-2);
  border-left: 3px solid var(--seal);
  background: var(--seal-tint);
  padding: 0.9rem 1.1rem;
}
.cite-label {
  font-family: var(--mono);
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--seal-deep);
  display: block;
  margin-bottom: 0.4rem;
}
.cite-body p {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--ink);
  margin: 0;
  max-width: none;
}

/* ----------------------------------------------------------------
   GLOSSARY ENTRIES
   ---------------------------------------------------------------- */
.term-entry {
  display: grid;
  grid-template-columns: var(--margin) minmax(0, 1fr);
  column-gap: var(--gut);
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.term-entry:last-child { border-bottom: none; }

.term-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--mark);
  text-align: right;
  padding-top: 0.2rem;
  letter-spacing: 0.02em;
}

.term-definition p {
  font-size: 0.9375rem;
  margin-bottom: 0;
}

/* ----------------------------------------------------------------
   REFORM TRACKER — status log
   ---------------------------------------------------------------- */
.tracker-entry {
  display: grid;
  grid-template-columns: var(--margin) minmax(0, 1fr);
  column-gap: var(--gut);
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.tracker-entry:last-child { border-bottom: none; }

.tracker-status {
  justify-self: end;
  font-family: var(--mono);
  font-size: 0.5625rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  border: 1px solid currentColor;
  white-space: nowrap;
  align-self: start;
}
.tracker-status--in-force { color: var(--in-force); }
.tracker-status--delayed  { color: var(--dim); }
.tracker-status--pending  { color: var(--dim); }
.tracker-status--passed   { color: var(--mark); }

.tracker-body h3 { margin-top: 0; }
.tracker-body p  { font-size: 0.9375rem; margin-top: 0.375rem; }

/* ----------------------------------------------------------------
   CONTACTS LIST
   ---------------------------------------------------------------- */
.contact-entry {
  display: grid;
  grid-template-columns: var(--margin) minmax(0, 1fr);
  column-gap: var(--gut);
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--rule);
}
.contact-entry:last-child { border-bottom: none; }

.contact-name {
  grid-column: 1;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--mark);
  padding-top: 0.15rem;
}
.contact-entry > :not(.contact-name) { grid-column: 2; }

.contact-url {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--dim);
  display: block;
  margin-bottom: 0.4rem;
  text-decoration: none;
}
.contact-url:hover { color: var(--seal); }

/* ----------------------------------------------------------------
   SITE FOOTER — colophon
   ---------------------------------------------------------------- */
.site-footer {
  border-top: 2px solid var(--rule-2);
  padding-block: 1.75rem 3rem;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  margin-bottom: 0.9rem;
}
.footer-meta span {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--dim);
  letter-spacing: 0.03em;
}
.footer-meta span:first-child { color: var(--mark); font-weight: 700; }

.footer-disclaimer {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--dim);
  letter-spacing: 0.01em;
  max-width: 78ch;
  line-height: 1.65;
  margin-bottom: 0;
}

/* ----------------------------------------------------------------
   RESPONSIVE — collapse the apparatus margin on small screens.
   Folios move inline above their content; spine is removed.
   ---------------------------------------------------------------- */
@media (max-width: 760px) {
  :root { --margin: 0px; --gut: 0px; }

  body { font-size: 1.0625rem; }

  .file-header .wrapper,
  .content-section,
  .cross-ref,
  .cite,
  .term-entry,
  .tracker-entry,
  .contact-entry {
    display: block;
  }

  .main-content .wrapper { background-image: none; }

  .file-header { padding-block: 1.75rem 1.25rem; }
  .file-meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem 1.75rem;
    text-align: left;
    margin-bottom: 1.5rem;
    padding-top: 0;
  }
  .file-meta-item { flex-direction: row; align-items: baseline; gap: 0.6rem; }

  .content-section > .section-label,
  .content-section:first-of-type:not(:has(.section-label))::before,
  .cross-ref::before,
  .cite::before {
    text-align: left;
    padding-top: 0;
    margin-bottom: 0.6rem;
  }

  .term-label,
  .contact-name { text-align: left; margin-bottom: 0.3rem; }

  .tracker-status { justify-self: start; margin-bottom: 0.6rem; }

  .cite-body { border-left-width: 3px; }
  .cite::before { color: var(--seal); margin-bottom: 0.5rem; }
}

@media (max-width: 480px) {
  .header-top { flex-direction: column; gap: 0.4rem; align-items: flex-start; }
}

/* ----------------------------------------------------------------
   PRINT
   ---------------------------------------------------------------- */
@media print {
  body { background: #fff; color: #000; border-top: 3px solid #000; }
  .site-nav, .skip-link { display: none; }
  a { color: #000; }
  .main-content .wrapper { background-image: none; }
  .file-header { border-bottom: 2px solid #000; }
  .site-footer { border-top: 1px solid #999; }
  .cite-body { background: none; border-color: #999; border-left-color: #000; }
}
