/* "This week in <Town>" on the eight town guides (25 September 2026).

   The block ships hidden and empty; netlify/edge-functions/inject-town-events.js
   fills it from the events feed and reveals it only when something is on in
   the next seven days. Server-only: no script touches it.

   One sheet for three page systems -- guide-editorial.css (the six built
   guides), /sarnia's compiled sheet and magazine.css (/brights-grove,
   /lambton-shores) -- so the tokens fall back through each system's own
   variable: the guide's accent where it has one (--ge-accent, or --color-lake
   on the lake-blue pages), then the site's soft blue. */

.lfh-town-events {
  --te-accent: var(--ge-accent, var(--color-lake, #356382));
  --te-ink: var(--ge-ink, var(--color-ink, #22312b));
  --te-muted: var(--ge-muted, var(--color-muted, #55635c));
  --te-line: var(--ge-line, var(--color-line, #cfdbe3));
  padding-top: .5rem;
  padding-bottom: 2.5rem;
  font-family: var(--ge-sans, var(--font-sans, "Inter", Arial, sans-serif));
  color: var(--te-ink);
}
.lfh-town-events[hidden] { display: none; }
.lfh-town-events *, .lfh-town-events *::before, .lfh-town-events *::after { box-sizing: border-box; }

.lfh-town-events .te-inner { border-top: 1px solid var(--te-line); padding-top: 1.5rem; }
/* On /brights-grove the block sits straight under the rail's own rule. */
.lfh-town-events.te-after-rule .te-inner { border-top: 0; padding-top: .5rem; }

.lfh-town-events .te-title {
  margin: 0 0 .75rem;
  font-family: var(--ge-serif, var(--font-serif, "Playfair", Georgia, serif));
  font-weight: 500; font-size: 26px; line-height: 1.2; letter-spacing: -.015em;
  color: var(--te-ink);
}

.lfh-town-events .te-list {
  display: grid; grid-template-columns: minmax(0, 1fr);
  margin: 0; padding: 0; list-style: none;
  border-top: 1px solid var(--te-line);
}
.lfh-town-events .te-row {
  position: relative;
  display: grid; grid-template-columns: 5.75rem minmax(0, 1fr); gap: .75rem;
  min-height: 44px; padding: .8rem 0;
  border-bottom: 1px solid var(--te-line);
}
.lfh-town-events .te-when { margin: 0; font-size: 13px; line-height: 1.4; }
.lfh-town-events .te-when time { display: block; font-weight: 600; color: var(--te-accent); }
.lfh-town-events .te-time { display: block; color: var(--te-muted); }
.lfh-town-events .te-what { margin: 0; min-width: 0; }
.lfh-town-events .te-name {
  font-weight: 600; font-size: 16px; line-height: 1.35; color: var(--te-ink);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: var(--te-line);
  overflow-wrap: anywhere;
}
/* The whole row is the tap target; the link's own box stretches over it. */
.lfh-town-events .te-name::after { content: ""; position: absolute; inset: 0; border-radius: 6px; }
.lfh-town-events .te-name:focus-visible { outline: none; }
.lfh-town-events .te-name:focus-visible::after { outline: 2px solid var(--te-accent); outline-offset: 2px; }
.lfh-town-events .te-venue { display: block; margin-top: .15rem; font-size: 14px; line-height: 1.45; color: var(--te-muted); }

.lfh-town-events .te-all {
  display: inline-block; padding: 11px 0; margin-top: .5rem;
  font-weight: 600; font-size: 15px; line-height: 22px; color: var(--te-accent);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
}
/* The arrow sits outside the underline. */
.lfh-town-events .te-all span { display: inline-block; margin-left: .35rem; }
.lfh-town-events .te-all:focus-visible { outline: 2px solid var(--te-accent); outline-offset: 2px; border-radius: 6px; }

/* One column on a phone: the date is printed once per day. The <time> stays
   in the row for screen readers and machines; only its box is hidden. Wider
   screens flow the rows across columns, so every row keeps its date there. */
@media (max-width: 767px) {
  .lfh-town-events .te-row--same-day .te-when time {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}

@media (min-width: 768px) {
  .lfh-town-events { padding-bottom: 3.5rem; }
  .lfh-town-events .te-title { font-size: 32px; }
  .lfh-town-events .te-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; }
}
@media (min-width: 1180px) {
  .lfh-town-events .te-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
