/* ==========================================================================
   The Dawson Estate · "The Gatehouse" design
   --------------------------------------------------------------------------
   1. Fonts (self-hosted, SIL Open Font Licence; see /fonts)
   2. Design tokens: change the palette and type here
   3. Base
   4. Layout helpers
   5. Header
   6. Hero and gate
   7. Sections
   9. The registers: the Terrier (table) and the Valuation Roll (chart)
   11. Footer
   12. Small screens

   Sections 8 and 10, and the navigation, buttons, links and Letters styles,
   were archived with their sections in docs/archived-sections/. The numbering
   is kept so archived rules go back where they came from.
   ========================================================================== */

/* 1. Fonts ---------------------------------------------------------------- */

@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/bodoni-moda-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Bodoni Moda";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/bodoni-moda-latin-500-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/cinzel-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/cinzel-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/eb-garamond-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/eb-garamond-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/eb-garamond-latin-500-normal.woff2") format("woff2");
}

/* 2. Design tokens -------------------------------------------------------- */

:root {
  /* Palette */
  --ground: #142219;        /* page background, deep estate green */
  --surface: #1b2c22;       /* alternate section background, stone pillars */
  --line: #3b4b40;          /* hairline rules and dividers */
  --frame-inner: #5c5638;   /* inner border of plaques and the ledger */
  --leader: #6e6440;        /* dotted leaders in the Library */
  --text: #efe7d4;          /* main text, warm cream */
  --muted: #c3baa2;         /* secondary text */
  --gold: #c9a55c;          /* the accent: seals, gate, buttons, labels */
  --gold-hover: #e2c98c;    /* hover state for gold elements */

  /* Type */
  --font-display: "Bodoni Moda", Didot, "Bodoni 72", Georgia, serif;
  --font-caps: "Cinzel", "Trajan Pro", Georgia, serif;
  --font-body: "EB Garamond", Garamond, Georgia, serif;

  /* Widths */
  --width-wide: 1120px;
  --width-text: 880px;
  --width-hero: 760px;
  --width-narrow: 640px;
  --gutter: 24px;
}

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

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

html {
  background: var(--surface); /* matches the header and footer when the page overscrolls or is shorter than the window */
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

a:hover {
  color: var(--gold-hover);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-weight: 500;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--ground);
  font-family: var(--font-caps);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  color: var(--gold);
}

/* 4. Layout helpers ------------------------------------------------------- */

.container {
  margin: 0 auto;
  padding: 0 var(--gutter);
  max-width: calc(var(--width-wide) + 2 * var(--gutter));
}

.container--hero {
  max-width: calc(var(--width-hero) + 2 * var(--gutter));
}

/* 5. Header --------------------------------------------------------------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 32px var(--gutter);
  text-align: center;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand__name {
  margin: 0;
  font-family: var(--font-caps);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.42em;
  padding-left: 0.42em; /* balances the trailing letter-spacing so the name sits centred */
  text-transform: uppercase;
}

.seal {
  color: var(--gold);
}

.seal text {
  font-family: var(--font-display);
  font-weight: 500;
}

/* 6. Hero and gate -------------------------------------------------------- */

.hero {
  padding: 72px 0 80px; /* less below than above: the gate drawing has its own space at the top */
  text-align: center;
}

.gate {
  display: block;
  width: 100%;
  height: auto;
  color: var(--gold);
}

.gate .pillar {
  fill: var(--surface);
}

.gate .medallion {
  fill: var(--ground);
}

.gate text {
  font-family: var(--font-display);
  font-weight: 500;
}

.hero .eyebrow {
  margin-top: 48px;
}

/* 7. Sections ------------------------------------------------------------- */

.section {
  padding: 96px 0;
}

.section--surface {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section__head {
  text-align: center;
  margin-bottom: 56px;
}

.section__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 4.6vw, 60px);
  line-height: 1.05;
}

.section__intro {
  margin: 18px auto 0;
  max-width: var(--width-narrow);
  color: var(--muted);
  font-size: 21px;
}

.eyebrow {
  margin: 0 0 12px;
  font-family: var(--font-caps);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.32em;
  color: var(--gold);
}

.eyebrow--centred {
  padding-left: 0.32em;
}

/* 9. The registers: the Terrier and the Valuation Roll -------------------- */

.ledger-frame {
  border: 1px solid var(--gold);
  padding: 8px;
}

.ledger-scroll {
  border: 1px solid var(--frame-inner);
  overflow-x: auto;
}

.ledger {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.ledger th {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--frame-inner);
  font-family: var(--font-caps);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--gold);
}

.ledger td {
  padding: 20px 16px;
  border-bottom: 1px solid var(--line);
}

.ledger tbody tr:last-child td {
  border-bottom: 0;
}

.ledger th:first-child,
.ledger td:first-child {
  width: 80px;
  padding-left: 20px;
}

.ledger th:last-child,
.ledger td:last-child {
  padding-right: 20px;
}

.ledger__no {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 26px;
  color: var(--gold);
}

.ledger__parcel {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
}

.tenure {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.tenure svg,
.legend svg {
  flex: none;
  color: var(--gold);
}

.ledger-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  margin-top: 24px;
}

.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-family: var(--font-caps);
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ledger-note {
  margin: 0;
  font-style: italic;
  font-size: 19px;
  color: var(--muted);
}

/* The Valuation Roll shares the Terrier's frame and foot. Its chart is an
   image made outside the page; see the README. */

.chart {
  margin: 0;
}

.chart__inner {
  border: 1px solid var(--frame-inner);
  padding: 24px;
}

.chart img {
  display: block;
  width: 100%;
  height: auto;
}

.chart .ledger-foot {
  justify-content: flex-end; /* the note sits right, as under the Terrier */
}

/* 11. Footer -------------------------------------------------------------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 40px var(--gutter) 48px;
  text-align: center;
}

.site-footer__name {
  margin: 0 0 8px;
  font-family: var(--font-caps);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.36em;
  padding-left: 0.36em;
}

.site-footer__small {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
}

/* 12. Small screens ------------------------------------------------------- */

@media (max-width: 600px) {
  body {
    font-size: 18px;
  }

  .hero {
    padding: 48px 0 44px;
  }

  .section {
    padding: 72px 0;
  }

  .section__head {
    margin-bottom: 40px;
  }

  .ledger th,
  .ledger td {
    padding-left: 10px;
    padding-right: 10px;
  }

  .ledger th:first-child,
  .ledger td:first-child {
    width: auto;
    padding-left: 16px;
  }

  .ledger th:last-child,
  .ledger td:last-child {
    padding-right: 16px;
  }

  .ledger__no {
    font-size: 22px;
  }

  .ledger__parcel {
    font-size: 20px;
  }

  .chart__inner {
    padding: 12px;
  }
}
