/* The Big Little Ex — public styles. Mobile-first; breakpoints at 768px and 1024px.
   Brand colours live in the custom properties below: barn red is the lead colour
   (the big red barn is the heart of the grounds), with garden greens, hay gold
   and a warm cream background. */

:root {
  /* Barn */
  --barn: #9b2d20;
  --barn-dark: #74201a;
  --barn-deep: #5a1812;
  --trim: #fbf7ee; /* barn trim white */
  /* Garden */
  --green: #2f5a32;
  --green-dark: #1e3d22;
  --sage: #e6ecd9;
  --sage-border: #cfd9bd;
  --leaf: #6b8f3e;
  /* Field */
  --hay: #e2b04a;
  --bg: #f7f2e6;
  --surface: #fffdf8;
  --surface-alt: #efe7d3;
  --text: #241f1a;
  --muted: #5b5345;
  --border: #d8ccb2;
  --input-border: #8a8070;
  --heading: var(--barn-dark);
  --focus: #1f6feb;
  --success-bg: #e6f4ea;
  --success-text: #1e5631;
  --error-bg: #fdecea;
  --error-text: #8a1c1c;
  --warn-bg: #fff4d6;
  --warn-text: #6b4a00;

  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: Georgia, 'Times New Roman', serif;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 4px 12px rgb(0 0 0 / 0.06);
  --gutter: 16px;
  --max: 1120px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}
main:focus {
  outline: none;
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--heading);
  margin: 0 0 0.5em;
}
h1 {
  font-size: clamp(1.9rem, 5vw, 2.8rem);
}
h2 {
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
}
h3 {
  font-size: 1.2rem;
}
p {
  margin: 0 0 1em;
}

a {
  color: var(--barn);
  text-underline-offset: 0.15em;
}
a:hover {
  color: var(--barn-dark);
}

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

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.narrow {
  max-width: 760px;
}
.page {
  padding-top: 2rem;
  padding-bottom: 3rem;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 0.4rem;
}
.lede {
  font-size: 1.15rem;
  color: var(--muted);
}
.muted {
  color: var(--muted);
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--barn-dark);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus {
  top: 0.5rem;
  color: #fff;
}

/* Header */
.site-header {
  /* Barn boards: a faint vertical plank texture over barn red. */
  background:
    repeating-linear-gradient(90deg, rgb(0 0 0 / 0.05) 0 2px, transparent 2px 64px), var(--barn);
  color: #fff;
  /* White trim, then a strip of green like grass at the foot of the barn. */
  box-shadow: inset 0 -4px 0 var(--trim);
  border-bottom: 6px solid var(--green);
}
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}
.brand:hover {
  color: #fff;
}
.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--trim);
  box-shadow: 0 0 0 2px rgb(255 255 255 / 0.35);
}
.brand__mark svg {
  width: 1.9rem;
  height: 1.9rem;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.site-nav a:hover {
  background: rgb(255 255 255 / 0.12);
  color: #fff;
}
.site-nav a[aria-current='page'] {
  background: var(--trim);
  color: var(--barn-dark);
}
.site-nav a:focus-visible {
  outline-color: var(--hay);
}

/* Footer */
.site-footer {
  background: var(--green-dark);
  color: #e8efe0;
  border-top: 6px solid var(--leaf);
  margin-top: 2rem;
  padding: 2rem 0 1.5rem;
  font-size: 0.95rem;
}
.site-footer a {
  color: #fff;
}
.site-footer a:hover {
  color: var(--hay);
}
.site-footer__inner {
  display: grid;
  gap: 1rem;
}
.site-footer p {
  margin: 0 0 0.25rem;
}
.site-footer__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}
.site-footer__copy {
  color: #c5d3bb;
  font-size: 0.85rem;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  border: 2px solid var(--barn);
  border-radius: var(--radius-sm);
  background: var(--barn);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  margin: 0 0.4rem 0.4rem 0;
}
.button:hover {
  background: var(--barn-dark);
  border-color: var(--barn-dark);
  color: #fff;
}
.button--ghost {
  background: transparent;
  color: var(--barn);
}
.button--ghost:hover {
  background: var(--barn);
  color: #fff;
}
.button--light {
  background: var(--trim);
  border-color: var(--trim);
  color: var(--barn-dark);
}
.button--light:hover {
  background: var(--hay);
  border-color: var(--hay);
  color: var(--barn-deep);
}

.button--outline-light {
  background: transparent;
  border-color: #fff;
  color: #fff;
}
.button--outline-light:hover {
  background: var(--trim);
  border-color: var(--trim);
  color: var(--barn-dark);
}

/* Flash messages */
.flash {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  border-left: 5px solid currentColor;
  font-weight: 600;
}
.flash--success {
  background: var(--success-bg);
  color: var(--success-text);
}
.flash--error {
  background: var(--error-bg);
  color: var(--error-text);
}
.flash--info {
  background: var(--warn-bg);
  color: var(--warn-text);
}

/* Hero */
.hero {
  /* The big red barn: plank texture over barn red, grass along the bottom. */
  background:
    repeating-linear-gradient(90deg, rgb(0 0 0 / 0.06) 0 3px, transparent 3px 88px),
    linear-gradient(160deg, var(--barn) 0%, var(--barn-dark) 100%);
  border-bottom: 6px solid var(--green);
  color: #fff;
  padding: 2.5rem 0;
}
.hero h1,
.hero h2 {
  color: #fff;
}
.hero .eyebrow {
  color: var(--hay);
}
.hero__grid {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}
.hero__intro p {
  color: #f6e7df;
  font-size: 1.1rem;
}
.hero__event {
  background: rgb(0 0 0 / 0.18);
  border: 2px solid rgb(251 247 238 / 0.55);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.hero__event img {
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}
.hero__event h2 a {
  color: #fff;
  text-decoration: none;
}
.hero__event h2 a:hover {
  text-decoration: underline;
}
.hero__meta {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  color: #f6e7df;
}

/* Sections */
.section {
  padding: 2.5rem 0;
}
.section--alt {
  background: var(--sage);
  border-top: 1px solid var(--sage-border);
  border-bottom: 1px solid var(--sage-border);
}
.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.quick-links {
  display: grid;
  gap: 1rem;
}
.quick-link {
  display: block;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
}
.quick-link:hover {
  border-color: var(--barn);
  color: var(--text);
}
.quick-link strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--barn-dark);
}

/* Event cards */
.card-grid {
  display: grid;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.event-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--barn);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
}
.event-card:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.event-card__title {
  margin: 0.35rem 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.25;
}
.event-card__title a {
  color: var(--barn-dark);
  text-decoration: none;
}
/* Whole card is clickable via the title link. */
.event-card__title a::after {
  content: '';
  position: absolute;
  inset: 0;
}
.event-card__title a:hover {
  text-decoration: underline;
}
.event-card__title a:focus-visible {
  outline: none;
}
.event-card__when {
  font-weight: 700;
  color: var(--green);
  margin: 0;
}
.event-card__where {
  color: var(--muted);
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}
.event-card__summary {
  margin: 0;
  font-size: 0.95rem;
}
.event-card--cancelled .event-card__title a {
  text-decoration: line-through;
}

.tag {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--surface-alt);
  color: var(--green-dark);
  border: 1px solid var(--border);
}
/* Category colours: barn, harvest, garden, heather, meadow. */
.tag--exhibition {
  background: #f7e1dc;
  color: #74201a;
  border-color: #e6b3a9;
}
.tag--fundraiser {
  background: #f8ebcc;
  color: #6a4410;
  border-color: #e7cd8f;
}
.tag--community {
  background: #e3eedc;
  color: #2a5230;
  border-color: #bcd3b0;
}
.tag--meeting {
  background: #ece5f0;
  color: #4f3c62;
  border-color: #d0c2db;
}
.tag--volunteer {
  background: #eef0d6;
  color: #4a5a1b;
  border-color: #d3d8a6;
}
.tag--cancelled {
  background: var(--error-bg);
  color: var(--error-text);
  border-color: #f2b8b5;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Events page */
.events-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}
.filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}
.filter-form label {
  font-weight: 600;
  display: block;
  font-size: 0.9rem;
}
.filter-form select {
  min-height: 44px;
}
.filter-form .button {
  margin: 0;
}

/* Timeline */
.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline__day {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.timeline__day::before {
  content: '';
  position: absolute;
  left: 0.4rem;
  top: 0;
  bottom: -1.25rem;
  width: 3px;
  background: var(--sage-border);
}
.timeline__day:last-child::before {
  bottom: 0;
}
.timeline__date {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 0 0.6rem -1.5rem;
  padding: 0.5rem 0 0.5rem 1.5rem;
  background: var(--bg);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 800;
  color: var(--green-dark);
}
.timeline__date::before {
  content: '';
  position: absolute;
  left: 0.05rem;
  top: 50%;
  width: 0.8rem;
  height: 0.8rem;
  margin-top: -0.4rem;
  border-radius: 50%;
  background: var(--barn);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--barn);
}
.timeline__events {
  display: grid;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline__section-title {
  font-size: 1.3rem;
  margin: 1.5rem 0 0.75rem;
}
.timeline__toggle {
  margin: 1rem 0 0;
}
.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

/* Calendar (FullCalendar) — only shown when JS runs at >= 768px. */
.calendar-wrap {
  display: none;
}
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 0;
}
.fc {
  --fc-border-color: var(--border);
  --fc-today-bg-color: #f8ecc9;
  --fc-button-bg-color: var(--green);
  --fc-button-border-color: var(--green);
  --fc-button-hover-bg-color: var(--green-dark);
  --fc-button-hover-border-color: var(--green-dark);
  --fc-button-active-bg-color: var(--barn);
  --fc-button-active-border-color: var(--barn);
  --fc-event-bg-color: var(--barn);
  --fc-event-border-color: var(--barn);
  --fc-page-bg-color: var(--surface);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.fc .fc-toolbar-title {
  font-family: var(--font-display);
  color: var(--barn-dark);
}
.fc .fc-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.fc a.fc-event:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}
.fc .fc-daygrid-day-number,
.fc .fc-col-header-cell-cushion,
.fc .fc-list-day-text,
.fc .fc-list-day-side-text {
  color: var(--green-dark);
  text-decoration: none;
}
/* FullCalendar fades other-month days to 30% opacity, which fails contrast. */
.fc .fc-day-other .fc-daygrid-day-top {
  opacity: 1;
}
.fc .fc-day-other .fc-daygrid-day-number {
  color: var(--muted);
}
.fc .fc-day-other {
  background: #f8f4ea;
}
.fc .fc-list-event-title a {
  color: var(--text);
}
.fc-event.ev-exhibition {
  --fc-event-bg-color: var(--barn);
  --fc-event-border-color: var(--barn);
}
.fc-event.ev-fundraiser {
  --fc-event-bg-color: #7f5214;
  --fc-event-border-color: #7f5214;
}
.fc-event.ev-community {
  --fc-event-bg-color: var(--green);
  --fc-event-border-color: var(--green);
}
.fc-event.ev-meeting {
  --fc-event-bg-color: #5b4672;
  --fc-event-border-color: #5b4672;
}
.fc-event.ev-volunteer {
  --fc-event-bg-color: #52661f;
  --fc-event-border-color: #52661f;
}
.fc-event.ev-cancelled .fc-event-title {
  text-decoration: line-through;
}
.fc-event.ev-cancelled {
  /* Grey rather than faded, so the text keeps its contrast. */
  --fc-event-bg-color: #67605a;
  --fc-event-border-color: #67605a;
}

/* Event detail */
.event-detail__header {
  margin-bottom: 1.25rem;
}
.event-detail__image {
  border-radius: var(--radius);
  margin: 0 0 1.5rem;
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}
.event-facts {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  margin: 0 0 1.5rem;
  background: var(--sage);
  border: 1px solid var(--sage-border);
  border-radius: var(--radius);
}
.event-facts dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--muted);
}
.event-facts dd {
  margin: 0;
  font-weight: 600;
}
.banner-cancelled {
  padding: 1rem 1.1rem;
  margin: 0 0 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--error-bg);
  color: var(--error-text);
  border-left: 6px solid var(--error-text);
  font-weight: 700;
}
.prose {
  max-width: 70ch;
}
.prose h2 {
  margin-top: 1.5em;
}
.prose ul,
.prose ol {
  padding-left: 1.25rem;
}
.prose blockquote {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 4px solid var(--leaf);
  background: var(--surface);
}
.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-weight: 600;
}

/* Forms */
.form {
  display: grid;
  gap: 1rem;
  max-width: 640px;
}
.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.field .hint {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
input[type='text'],
input[type='email'],
input[type='password'],
input[type='url'],
input[type='date'],
input[type='time'],
input[type='search'],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--input-border);
  border-radius: var(--radius-sm);
}
textarea {
  min-height: 10rem;
  resize: vertical;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--focus);
}
.field--error input,
.field--error textarea,
.field--error select {
  border-color: var(--error-text);
}
.field-error {
  display: block;
  color: var(--error-text);
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: 0.25rem;
}
.error-summary {
  padding: 1rem 1.1rem;
  border: 2px solid var(--error-text);
  border-radius: var(--radius-sm);
  background: var(--error-bg);
  color: var(--error-text);
}
.error-summary h2 {
  font-family: var(--font);
  font-size: 1.05rem;
  color: var(--error-text);
  margin: 0 0 0.4rem;
}
.error-summary ul {
  margin: 0;
  padding-left: 1.2rem;
}
.error-summary a {
  color: var(--error-text);
}
/* Honeypot: hidden from people, visible to naive bots. */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-grid {
  display: grid;
  gap: 2rem;
}
.contact-card {
  padding: 1.25rem;
  background: var(--sage);
  border: 1px solid var(--sage-border);
  border-radius: var(--radius);
  align-self: start;
}
.contact-card address {
  font-style: normal;
  margin-bottom: 1rem;
}

.dev-stack pre {
  overflow: auto;
  font-size: 0.8rem;
  background: #111;
  color: #eee;
  padding: 1rem;
  border-radius: var(--radius-sm);
}

/* ---------- Tablet and up ---------- */
@media (min-width: 768px) {
  :root {
    --gutter: 24px;
  }
  .hero {
    padding: 3.5rem 0;
  }
  .hero__grid {
    grid-template-columns: 1.1fr 1fr;
    gap: 2.5rem;
  }
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-links {
    grid-template-columns: repeat(3, 1fr);
  }
  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
  }
  .site-footer__copy {
    grid-column: 1 / -1;
  }
  .event-facts {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-grid {
    grid-template-columns: 1.6fr 1fr;
  }

  /* With JS, the calendar replaces the timeline at this width. */
  .js .calendar-wrap {
    display: block;
  }
  .js .timeline-wrap {
    display: none;
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
