/* ============================================================
   The Dinner Match Society: shared styles
   Society colours: Pantone 367 C (green) and Pantone 427 C (grey).
   Change a value here and every page updates.
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&family=Libre+Caslon+Text:ital,wght@0,400;0,700;1,400&family=Libre+Franklin:wght@400;500;600&display=swap");

:root {
  --green: #a4d65e;       /* Pantone 367 C */
  --grey: #d0d3d4;        /* Pantone 427 C */
  --green-text: #4a7a14;  /* darker shade of 367 C, readable as text on white */
  --white: #ffffff;
  --ink: #2a2d2e;         /* body text, matches the logo's ink */
  --muted: #5d6366;
  --soft: #f4f5f5;        /* very light grey for panels */

  --display: "IM Fell English", Georgia, serif;
  --news: "Libre Caslon Text", Georgia, serif;
  --body: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --measure: 68ch;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* The Society tie: equal diagonal stripes of 367 C and 427 C */
.tie {
  height: 18px;
  background: repeating-linear-gradient(
    -45deg,
    var(--green) 0 12px,
    var(--grey) 12px 24px
  );
}

a { color: var(--green-text); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--green-text); outline-offset: 3px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.wrap { max-width: 1320px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Header ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--grey); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 0.75rem 2rem;
  padding-top: 0.9rem; padding-bottom: 0.9rem;
}
.wordmark {
  display: flex; align-items: center; gap: 0.9rem;
  font-family: var(--display); font-size: 1.85rem; line-height: 1.1;
  color: var(--ink); text-decoration: none;
}
.wordmark img { height: 90px; width: auto; display: block; }
.wordmark:hover { color: var(--green-text); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-nav a {
  color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  padding: 0.2rem 0; border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: var(--green-text); border-bottom-color: var(--grey); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--green); }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; color: var(--ink); }
h1 { font-size: clamp(2.2rem, 5vw, 3rem); margin: 0 0 0.5rem; }
h2 { font-size: 1.9rem; margin: 0 0 0.6rem; }
h3 { font-size: 1.4rem; margin: 0 0 0.3rem; }
p { margin: 0 0 1rem; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 56ch; }
.meta { color: var(--muted); font-size: 0.92rem; margin-bottom: 1rem; }

main { padding: 2.75rem 0 4rem; }
.page-intro { margin-bottom: 2.5rem; }

/* ---------- Home: three columns ---------- */
.wrap-wide { max-width: 1320px; }
.home-columns {
  display: grid;
  gap: 3rem;
  align-items: start;
}
.home-upper { grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); }
.home-lower { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-top: 3.5rem; }
.col-title {
  font-size: 1.6rem; margin: 0 0 1.1rem; padding-bottom: 0.5rem;
  border-bottom: 4px solid var(--green);
}

/* Column 1: upcoming meetings */
.meetings { list-style: none; margin: 0; padding: 0; }
.meeting { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 0.9rem 0; border-bottom: 1px solid var(--grey); }
.meeting:first-child { padding-top: 0.2rem; }
.meeting img { width: 43px; height: 43px; flex: 0 0 43px; object-fit: contain; }
.meeting h3 { font-size: 1.3rem; margin: 0; }
.meeting .venue { margin: 0; font-weight: 500; }
.meeting .when { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Column 2: recent match reports */
.results { width: 100%; border-collapse: collapse; font-family: var(--news); font-size: 0.98rem; line-height: 1.45; }
.results th, .results td { border: 1px solid var(--grey); padding: 0.6rem 0.7rem; text-align: left; vertical-align: middle; }
.results th { font-weight: 400; color: var(--ink); }
.results td:first-child a { text-decoration: none; white-space: nowrap; }
.results td:first-child a:hover { text-decoration: underline; }
.more { margin-top: 1rem; }
.more a { font-weight: 700; font-family: var(--news); font-size: 1.05rem; }

/* Column 3: the Captain's letter, set like a newspaper column */
.newspaper { font-family: var(--news); font-size: 0.95rem; line-height: 1.55; }
.newspaper .captain { width: 100px; height: auto; float: left; margin: 0 1.1rem 0.4rem 0; }
.newspaper h4 { clear: both; }
.newspaper h3 { font-size: 1.45rem; margin: 0; }
.newspaper .dateline { font-style: italic; color: var(--muted); margin: 0.1rem 0 0.9rem; font-size: 0.9rem; }
.newspaper p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; margin: 0 0 0.8rem; }
.newspaper h4 { font-family: var(--news); font-weight: 700; font-size: 1rem; margin: 1.2rem 0 0.4rem; text-align: center; }
.newspaper h4::before, .newspaper h4::after { content: ""; display: block; height: 1px; background: var(--grey); margin: 0.35rem 0; }

/* New members */
.new-members { list-style: none; margin: 0; padding: 0; }
.new-member { display: flex; align-items: center; gap: 1.5rem; padding: 0.75rem 0; border-bottom: 1px solid var(--grey); }
.new-member img { width: 100px; height: auto; flex: 0 0 100px; }
.new-member h3 { font-size: 1.6rem; margin: 0; }

@media (max-width: 900px) {
  .home-upper, .home-lower { grid-template-columns: 1fr; }
}

/* ---------- Reports and communications ---------- */
.contents { list-style: none; padding: 0; margin: 0 0 3rem; border-top: 1px solid var(--grey); }
.contents li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--grey); }
.contents a { font-family: var(--display); font-size: 1.25rem; text-decoration: none; }
.contents a:hover { text-decoration: underline; }
.contents span { color: var(--muted); font-size: 0.92rem; }

.entry {
  padding: 0.5rem 0 2.25rem 1.75rem;
  margin-bottom: 2.25rem;
  border-left: 4px solid var(--green);
  scroll-margin-top: 1.5rem;
}
.entry + .entry { padding-top: 0.5rem; }
.entry p, .entry ul { max-width: var(--measure); }
.result {
  display: inline-block; font-family: var(--display); font-size: 1.2rem;
  background: var(--soft); border: 1px solid var(--grey); padding: 0.2rem 0.75rem; margin-bottom: 1.25rem;
}
.signoff { font-family: var(--display); font-style: italic; font-size: 1.2rem; margin-top: 1.5rem; }
.entry figure { margin: 1.5rem 0; max-width: var(--measure); }
.entry figure img { width: 100%; height: auto; display: block; }
.entry figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.4rem; }
.back { font-size: 0.92rem; }

/* ---------- Member Directory ---------- */
.dir-search { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.25rem; margin: 0 0 2rem; }
.field label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.35rem; }
.field input {
  font: inherit; width: 16rem; max-width: 100%; padding: 0.55rem 0.75rem;
  border: 1px solid #9ca2a5; background: var(--white); color: var(--ink);
}
.btn {
  font: inherit; font-weight: 600; padding: 0.6rem 1.4rem; cursor: pointer;
  background: var(--ink); color: var(--white); border: 1px solid var(--ink);
}
.btn:hover { background: var(--green-text); border-color: var(--green-text); }
.btn-link {
  font: inherit; font-weight: 600; padding: 0.6rem 0; cursor: pointer;
  background: none; border: 0; color: var(--green-text); text-decoration: underline; text-underline-offset: 0.18em;
}
.btn-link:hover { color: var(--ink); }

.alphabet ul {
  list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(26, 1fr);
  border-top: 1px solid var(--grey); border-bottom: 1px solid var(--grey);
}
.alphabet button {
  font-family: var(--display); font-size: 1.2rem; width: 100%; padding: 0.45rem 0;
  background: none; border: 0; color: var(--green-text); cursor: pointer;
}
.alphabet button:hover:not(:disabled) { background: var(--soft); }
.alphabet button[aria-pressed="true"] { background: var(--green); color: var(--ink); }
.alphabet button:disabled { color: #b4b9bb; cursor: default; }
.dir-status { color: var(--muted); font-size: 0.95rem; margin: 0.75rem 0 0; min-height: 0.5rem; }
.directory { margin-top: 1rem; }
.page-title-small { font-size: 1.85rem; }

.directory { width: 100%; border-collapse: collapse; }
.directory th {
  text-align: left; font-weight: 600; font-size: 0.95rem; padding: 0.6rem 1rem;
  border-bottom: 3px solid var(--green);
}
.directory td { padding: 0.9rem 1rem; vertical-align: top; border-bottom: 1px solid var(--grey); }
.directory tbody tr:nth-child(odd) { background: var(--soft); }
.directory td:first-child a { font-family: var(--display); font-size: 1.2rem; text-decoration: none; }
.directory td:first-child a:hover { text-decoration: underline; }
.directory td { overflow-wrap: anywhere; }

/* ---------- Member Profile ---------- */
.back-link { font-size: 0.95rem; margin: 0 0 1.75rem; }
.profile { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 3rem; align-items: start; max-width: 1000px; }
.profile h1 { margin: 0; padding-bottom: 0.4rem; border-bottom: 4px solid var(--green); }
.profile-status { font-family: var(--display); font-style: italic; font-size: 1.3rem; color: var(--green-text); margin: 0.6rem 0 1.5rem; min-height: 1.6em; }
.profile-facts { margin: 0; }
.profile-facts > div { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--grey); }
.profile-facts dt { font-weight: 600; color: var(--muted); }
.profile-facts dd { margin: 0; }
.profile-drawing img { width: 100%; height: auto; display: block; }
.drawing-placeholder {
  aspect-ratio: 3 / 4; border-radius: 50%; background: var(--soft);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 4rem; color: var(--muted);
}
.no-match { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--soft); color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { padding-top: 1.5rem; padding-bottom: 1.75rem; }
.site-footer p { margin: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  .alphabet ul { grid-template-columns: repeat(13, 1fr); }
  .directory thead { display: none; }
  .directory, .directory tbody, .directory tr, .directory td { display: block; }
  .directory tr { padding: 0.75rem 0.75rem; border-bottom: 1px solid var(--grey); }
  .directory td { padding: 0.15rem 0; border: 0; }
  .profile { grid-template-columns: 1fr; gap: 1.5rem; }
  .profile-drawing { order: -1; max-width: 150px; }
  .profile-facts > div { grid-template-columns: 1fr; gap: 0.2rem; }
  .wordmark { font-size: 1.45rem; }
  .wordmark img { height: 68px; }
  .results thead { display: none; }
  .results, .results tbody, .results tr, .results td { display: block; border: 0; }
  .results tr { border-bottom: 1px solid var(--grey); padding: 0.6rem 0; }
  .results td { padding: 0.1rem 0; }
  .results td:nth-child(2)::before { content: "Match "; }
  .results td:last-child { color: var(--muted); }
  .entry { padding-left: 1.1rem; }
}

/* Results table on the Match reports page, and letters on Communications */
.results-page { max-width: 1000px; }
.results tr:target td { background: #eef7e0; }
.entry h4 { font-family: var(--body); font-weight: 600; font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }

/* =====================================================================
   Added for the Eleventy site: report and letter pages, year lists,
   Communications tabs, and small helpers.
   ===================================================================== */
.kicker { font-family: var(--body); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green-text); margin: 0 0 0.35rem; }
.entry h1 { margin-bottom: 0.3rem; }
.prose { font-family: var(--news); font-size: 1.02rem; line-height: 1.7; }
.prose p, .prose ul, .prose ol, .prose blockquote { max-width: var(--measure); }
.prose img { display: block; max-width: min(100%, 720px); height: auto; margin: 1.5rem 0; border: 1px solid var(--grey); }
.prose p:has(> img) { max-width: none; }
.prose h2, .prose h3 { margin-top: 1.75rem; }
.prose blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 3px solid var(--grey); color: var(--muted); }
.note { color: var(--muted); font-size: 0.9rem; font-style: italic; margin-top: 2rem; }
.tag { display: inline-block; font-family: var(--body); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: var(--soft); border: 1px solid var(--grey); padding: 0 0.4rem; margin-left: 0.35rem; vertical-align: 0.1em; white-space: nowrap; }

.pager { display: flex; justify-content: space-between; gap: 1rem; max-width: var(--measure); margin: 0 0 1rem; padding-top: 1rem; border-top: 1px solid var(--grey); font-family: var(--display); font-size: 1.15rem; }
.pager a { text-decoration: none; }
.pager a:hover { text-decoration: underline; }

.year-jump ul { list-style: none; margin: 0 0 2.5rem; padding: 0.6rem 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; border-top: 1px solid var(--grey); border-bottom: 1px solid var(--grey); }
.year-jump a { font-family: var(--display); font-size: 1.15rem; text-decoration: none; }
.year-jump a:hover { text-decoration: underline; }
.year-group { margin-bottom: 2.5rem; scroll-margin-top: 1rem; }
.year-group h2 { border-bottom: 4px solid var(--green); padding-bottom: 0.35rem; max-width: 1000px; }
.year-group .count { font-family: var(--body); font-size: 0.95rem; color: var(--muted); margin-left: 0.5rem; }

.subnav ul { list-style: none; margin: -1rem 0 2rem; padding: 0; display: flex; gap: 0 1.75rem; border-bottom: 1px solid var(--grey); }
.subnav a { display: inline-block; padding: 0.4rem 0; color: var(--ink); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--green-text); }
.subnav a[aria-current="page"] { border-bottom-color: var(--green); }
.contents-year { font-size: 1.5rem; margin: 1.75rem 0 0.5rem; }
.contents-year + .contents { margin-bottom: 1rem; }

.newspaper .letter-body img { max-width: 100%; height: auto; display: block; margin: 0.75rem 0; }
.new-member h3 a { color: var(--ink); text-decoration: none; }
.new-member h3 a:hover { color: var(--green-text); text-decoration: underline; }
.drawing-placeholder.small { width: 100px; flex: 0 0 100px; font-size: 2rem; }
#dir-rows tr[hidden] { display: none; }
.directory.filtered tbody tr { background: none; }
.directory.filtered tbody tr.alt { background: var(--soft); }
