/* The honourboard drawn as the club's timber boards.
   One panel per award: a shaped pediment carrying the club name, the award
   title, then gold lettering in year-and-name lines. Everything here is CSS -
   gradients, borders and clip-path - so there is no image of any text.
   Colours are derived from the existing --brown token; nothing in styles.css
   is redefined. Class names are prefixed hb- so the superseded .honour-grid
   and .honour-card rules in styles.css cannot reach these panels. */

.hb-boards {
  /* Timber, lacquer and gold leaf, derived from --brown #65342e. */
  --hb-timber-top: #4a2620;
  --hb-timber-mid: #381914;
  --hb-timber-base: #2c120e;
  --hb-crown-top: #5a3229;
  --hb-crown-base: #3b1c17;
  --hb-gold: #f6e6bd;
  --hb-gold-deep: #e8c46a;
  --hb-gold-soft: #d9b36a;
  --hb-gold-line: rgba(232, 196, 106, 0.5);
  --hb-grain-light: rgba(255, 255, 255, 0.035);
  --hb-grain-dark: rgba(0, 0, 0, 0.16);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 34px;
  margin: 0 0 14px;
}

.hb-board {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* The pediment. The gold outer element and the timber face share one shape,
   so the face sits inside the gold like an edging bead. */
.hb-crown {
  --hb-crown-shape: polygon(
    0% 100%,
    0% 47%,
    4% 47%,
    4% 31%,
    12% 31%,
    15% 23%,
    31% 23%,
    35% 9%,
    44% 2%,
    56% 2%,
    65% 9%,
    69% 23%,
    85% 23%,
    88% 31%,
    96% 31%,
    96% 47%,
    100% 47%,
    100% 100%
  );
  background: var(--hb-gold-deep);
  clip-path: var(--hb-crown-shape);
  padding: 3px 3px 0;
  min-height: 92px;
}

.hb-crown-face {
  background:
    repeating-linear-gradient(
      90deg,
      var(--hb-grain-light) 0 1px,
      transparent 1px 4px
    ),
    repeating-linear-gradient(
      90deg,
      var(--hb-grain-dark) 0 2px,
      transparent 2px 11px
    ),
    linear-gradient(180deg, var(--hb-crown-top) 0%, var(--hb-crown-base) 100%);
  clip-path: var(--hb-crown-shape);
  min-height: 89px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 18px 9px;
}

.hb-club {
  margin: 0;
  font-family: Montserrat, system-ui, sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  color: var(--hb-gold);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}

/* The board face. */
.hb-panel {
  position: relative;
  background:
    repeating-linear-gradient(
      90deg,
      var(--hb-grain-light) 0 1px,
      transparent 1px 4px
    ),
    repeating-linear-gradient(
      90deg,
      var(--hb-grain-dark) 0 2px,
      transparent 2px 13px
    ),
    linear-gradient(
      180deg,
      var(--hb-timber-top) 0%,
      var(--hb-timber-mid) 55%,
      var(--hb-timber-base) 100%
    );
  border: 3px solid var(--hb-gold-deep);
  border-top-width: 0;
  padding: 26px 26px 30px;
  box-shadow: var(--shadow-lift);
}

.hb-panel::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid var(--hb-gold-line);
  pointer-events: none;
}

.hb-title {
  margin: 4px 0 0;
  font-family: Montserrat, system-ui, sans-serif;
  font-weight: 800;
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--hb-gold);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}

.hb-subtitle {
  margin: 8px 0 0;
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hb-gold-soft);
}

.hb-rows {
  list-style: none;
  margin: 18px 0 0;
  padding: 18px 8px 0;
  border-top: 1px solid var(--hb-gold-line);
  /* The lettering keeps a readable measure even on a wide board, the way a
     signwriter centres it on the timber. */
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  /* A board with one name still reads as a board with room to grow. No blank
     line is drawn, because a ruled blank line reads as a missing record. */
  min-height: 132px;
}

.hb-board--wide .hb-rows {
  max-width: 100%;
}

.hb-row {
  display: grid;
  grid-template-columns: 5ch minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0 18px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(232, 196, 106, 0.16);
  break-inside: avoid;
}

.hb-row:last-child {
  border-bottom: 0;
}

.hb-year {
  font-family: Montserrat, system-ui, sans-serif;
  font-weight: 700;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  color: var(--hb-gold-deep);
}

.hb-name {
  font-family: Montserrat, system-ui, sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  color: var(--hb-gold);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

.hb-mark {
  margin-left: 4px;
  color: var(--hb-gold-deep);
}

.hb-meta {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--hb-gold-soft);
  white-space: nowrap;
}

/* One board for the whole club. The award is named on every row, so the meta
   is allowed to wrap rather than squeeze the lettering column. */
.hb-boards--single {
  grid-template-columns: minmax(0, 1fr);
}

/* Award names run long ("Two-man aggregate runners-up"), so on the combined
   board the award sits under the name instead of competing with it for the
   row. Left beside it, a long award squeezed the lettering column until names
   broke mid-word. */
.hb-boards--single .hb-row {
  grid-template-columns: 5ch minmax(0, 1fr);
}

.hb-boards--single .hb-meta {
  grid-column: 2;
  margin-top: 3px;
  white-space: normal;
}

/* Only break a name where a word genuinely cannot fit. */
.hb-boards--single .hb-name {
  overflow-wrap: break-word;
}

.hb-award {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--hb-gold-deep);
}

.hb-score {
  font-variant-numeric: tabular-nums;
}

.hb-unit {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 12px;
}

/* The moulded base under the board. */
.hb-plinth {
  height: 14px;
  background: linear-gradient(
    180deg,
    var(--hb-gold-deep) 0 3px,
    var(--hb-crown-top) 3px 8px,
    var(--hb-crown-base) 8px 100%
  );
  clip-path: polygon(2% 0, 98% 0, 100% 100%, 0 100%);
  box-shadow: var(--shadow-card);
}

/* Source citation and confidence wording, one control per board, following the
   "Member copy and readability" decision. */
.hb-about {
  margin: 14px 4px 0;
  font-size: 15px;
}

.hb-about > summary {
  font-weight: 700;
  color: var(--brown);
  cursor: pointer;
  padding: 6px 0;
  min-height: 48px;
}

.hb-about-body {
  padding: 4px 0 0;
}

.hb-about-body > p {
  margin: 8px 0 12px;
  color: var(--muted);
  max-width: 62ch;
}

.hb-about-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.hb-about-list li {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
}

.hb-about-list strong {
  display: block;
  color: var(--ink);
}

.hb-about-list span {
  display: block;
  color: var(--muted);
  margin: 2px 0 6px;
}

.hb-about-list p {
  margin: 0 0 8px;
  color: var(--ink);
}

.hb-count {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
}

/* Tablet and desktop: a long board wraps its lettering into two columns. */
@media (min-width: 820px) {
  .hb-board--wide .hb-rows {
    columns: 2;
    column-gap: 46px;
    column-rule: 1px solid var(--hb-gold-line);
  }
}

@media (min-width: 1100px) {
  .hb-boards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 34px;
  }
  .hb-board--wide {
    grid-column: 1 / -1;
  }
  .hb-panel {
    padding: 30px 32px 34px;
  }
  .hb-title {
    font-size: 26px;
  }
}

/* Phone: one column of lettering, and the grade and score sit under the name
   so a long name never pushes the row sideways. */
@media (max-width: 640px) {
  .hb-boards {
    gap: 28px;
  }
  .hb-crown,
  .hb-crown-face {
    min-height: 74px;
  }
  .hb-panel {
    padding: 20px 16px 24px;
  }
  .hb-club {
    font-size: 11px;
    letter-spacing: 0.1em;
  }
  .hb-title {
    font-size: 19px;
  }
  .hb-rows {
    padding: 16px 0 0;
    min-height: 108px;
  }
  .hb-row {
    grid-template-columns: 4.5ch minmax(0, 1fr);
  }
  .hb-name {
    font-size: 16px;
  }
  .hb-meta {
    grid-column: 2;
    margin-top: 4px;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hb-about > summary {
    transition: color 0.2s var(--ease);
  }
}

/* Print: one board to a page, no shadows, and the source list opened out so a
   printed board still carries its citation. */
@media print {
  .hb-filters {
    display: none !important;
  }
  .hb-boards {
    display: block;
    gap: 0;
  }
  .hb-board {
    break-after: page;
    break-inside: avoid;
    margin: 0 0 10mm;
  }
  .hb-board:last-child {
    break-after: auto;
  }
  .hb-panel,
  .hb-plinth,
  .hb-board {
    box-shadow: none !important;
  }
  .hb-crown-face,
  .hb-panel,
  .hb-plinth {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .hb-rows {
    min-height: 0;
  }
  .hb-about > summary {
    list-style: none;
  }
  /* Chrome hides a closed disclosure through ::details-content, so a printed
     board needs both the slot and the body opened out. */
  .hb-about::details-content {
    content-visibility: visible !important;
    block-size: auto !important;
  }
  .hb-about > .hb-about-body {
    display: block !important;
  }
  .hb-about-list li {
    break-inside: avoid;
  }
  .hb-about-list a {
    display: none;
  }
}
