/* ==========================================================================
   Louisville Biz Events - site.css
   Civic print calendar. Flat surfaces, hairline rules, no gradients,
   no shadows, no centered hero. Mobile first, single stylesheet, no framework.

   Class names inside the two SSR regions (.event-card, .day-card,
   .series-entry, .chip-*) are generated by the build. js/app.js emits the same
   names on re-render, so every rule below serves both the server-rendered
   paint and the client re-render. Do not rename one without the other.

   Contrast ratios below are measured against the surface named in each comment
   (sRGB relative luminance, WCAG 2.x formula). Same convention wilmington-web-guy
   uses: the accessibility math lives next to the token, not in a separate doc.
   ========================================================================== */

:root {
  /* --- surfaces --- */
  --paper:        #FAF7F0;  /* page background (warm off-white) */
  --panel:        #F5F1E8;  /* subscribe panel / quiet day fill */
  --ink:          #1B2A4A;  /* navy. 13.29:1 on --paper. AAA all sizes */

  /* --- text --- */
  --slate:        #4A5568;  /* body copy.  7.03:1 on --paper, 6.68:1 on --panel. AAA normal */
  --slate-soft:   #5A6473;  /* meta lines. 5.60:1 on --paper, 5.31:1 on --panel. AA normal */
  --on-ink:       #FAF7F0;  /* text on navy. 13.29:1 on --ink. AAA */
  --on-ink-soft:  #D8D2C6;  /* muted text on navy. 9.45:1 on --ink. AAA */

  /* --- accents --- */
  --gold:         #C9A227;  /* 2.26:1 on --paper -> DECORATIVE ONLY on paper, never text.
                               5.88:1 on --ink  -> AA normal text when set on navy. */
  --free:         #1F5C41;  /* free chip. 7.36:1 on --paper, 6.99:1 on --panel. AAA normal */
  --flag:         #8C2F0D;  /* unconfirmed chip. 7.77:1 on --paper, 7.37:1 on --panel. AAA */

  /* --- rules --- */
  --rule:         #D8D2C6;  /* hairline between listings. 1.41:1 - decorative separator only */
  --rule-strong:  #8A8270;  /* borders that carry meaning (inputs, links, chips).
                               3.56:1 on --paper, 3.38:1 on --panel. Clears 1.4.11 (3:1) */

  --display: "Oswald", "Arial Narrow", "Helvetica Neue Condensed", sans-serif;
  --body: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --wrap: 1120px;
  --gut: 16px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--slate);
  font-family: var(--body);
  font-size: 1.0625rem;   /* 17px */
  line-height: 1.55;
  overflow-wrap: break-word;
}

h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; height: auto; }

a { color: var(--ink); }
a:hover { color: var(--flag); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------- focus + skip */
:focus-visible {
  outline: 3px solid var(--ink);   /* 13.29:1 against paper, far past the 3:1 floor */
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 18px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.skip-link:focus { left: 8px; top: 8px; }
.skip-link:focus-visible { outline-color: var(--gold); }   /* 5.88:1 on navy */

#main:focus { outline: none; }

/* ------------------------------------------------------------ masthead */
.masthead {
  border-bottom: 2px solid var(--ink);
  padding: 22px 0 0;
  background: var(--paper);
}

.masthead-kicker {
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--slate-soft);
}

.nameplate {
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.005em;
  line-height: 0.92;
  font-size: clamp(2.6rem, 11.5vw, 5.25rem);
  margin: 6px 0 8px;
  text-wrap: balance;
}

.tagline {
  font-family: var(--body);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--slate);
  margin-bottom: 12px;
}

/* Decorative tick band. Height comes from aspect-ratio, never a fixed pixel
   height with a cover background. Hard colour stops only, so no gradient blend. */
.tickband {
  width: 100%;
  aspect-ratio: 110 / 1;
  max-height: 9px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--gold) 0 2px,
    var(--paper) 2px 12px
  );
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.dateline {
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-soft);
  padding: 9px 0 12px;
}

/* ------------------------------------------------------------- sitenav */
.sitenav {
  border-bottom: 1px solid var(--rule);
  background: var(--panel);
}

.sitenav-list { display: flex; flex-wrap: wrap; gap: 0 6px; }

.sitenav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-family: var(--display);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.sitenav-list a:hover,
.sitenav-list a:focus-visible {
  border-bottom-color: var(--gold);
  color: var(--ink);
}

/* ------------------------------------------------------------ sections */
.section { padding: 30px 0 34px; }
.section + .section { border-top: 1px solid var(--rule); }

.section-head { margin-bottom: 16px; }

.section-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 6vw, 2rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
  padding-bottom: 5px;
  position: relative;
}
/* second hairline under the section rule, the way a printed masthead sits */
.section-title::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -5px;
  border-bottom: 1px solid var(--ink);
}

.section-note {
  font-size: 0.95rem;
  color: var(--slate-soft);
  margin-top: 12px;
}

/* .empty is emitted by js/app.js, .empty-state by the build. Same job, and
   both need styling or an empty week renders as unstyled body text. */
.empty,
.empty-state {
  font-style: italic;
  color: var(--slate-soft);
  padding: 14px 0;
}

.stale-note {
  background: var(--panel);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--flag);          /* 7.37:1 on --panel */
  font-size: 0.95rem;
  padding: 10px var(--gut);
  text-align: center;
}

/* ==========================================================================
   THIS WEEK - build region SSR_THISWEEK. Generated class names.
   .event-card is the plain server-rendered card. js/app.js re-renders it as
   .event-card.event-card--dated with a date square in front.
   ========================================================================== */

.listings { border-bottom: 1px solid var(--rule); }

.event-card {
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}
.listings > .event-card:first-of-type { border-top: 0; }

.event-card--dated {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  column-gap: 14px;
}

.event-body { min-width: 0; }

/* date square */
.datesq {
  background: var(--ink);
  color: var(--on-ink);
  text-align: center;
  padding: 6px 2px 8px;
  align-self: start;
}
.datesq-dow {
  display: block;
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);          /* 5.88:1 on navy */
}
.datesq-day {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.95rem;
  line-height: 1.05;
}
.datesq-mon {
  display: block;
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-ink-soft);   /* 9.45:1 on navy */
}

.event-kind {
  display: block;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate-soft);
}

.event-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin: 2px 0 4px;
}

.event-org {
  font-weight: 600;
  color: var(--slate);
  font-size: 0.98rem;
}

.event-venue,
.event-when {
  color: var(--slate-soft);
  font-size: 0.95rem;
}

/* chips */
.entry-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.chip,
.event-price {
  display: inline-flex;
  align-items: center;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid var(--rule-strong);
  color: var(--slate);
  background: var(--paper);
}

/* a bare .event-price sits directly after a block sibling in the SSR markup */
.event-card > .event-price,
.event-body > .event-price { margin-top: 10px; }

.event-price.free,
.chip-free { color: var(--free); border-color: var(--free); }

.chip-paid { color: var(--slate); border-color: var(--rule-strong); }
.chip-kind { color: var(--slate-soft); border-color: var(--rule-strong); }
.chip-rsvp { color: var(--ink); border-color: var(--ink); }

/* Stands in for the venue line on a webinar. There is no room to drive to, so
   printing a placeholder address there would be a small lie. 7.03:1 on paper. */
.chip-online { color: var(--slate); border-color: var(--rule-strong); }

/* ---------------------------------------------------------------- online
   In-person first. A local calendar leads with the rooms you can walk into, so
   an online listing reads one step quieter: dotted rule instead of solid, one
   step less title weight. Text colour is untouched, so contrast stays where it
   was (--ink 13.29:1) and nothing here hides a listing. */
.event-card[data-online="true"],
.series-entry[data-online="true"],
.up-row[data-online="true"] { border-top-style: dotted; }

.event-card[data-online="true"] .event-title,
.up-row[data-online="true"] .up-title { font-weight: 600; }   /* from 700 */
.series-entry[data-online="true"] .entry-title { font-weight: 500; }  /* from 600 */

.event-venue.is-online { margin-top: 2px; }

.chip-unconfirmed {
  color: var(--flag);
  border-color: var(--flag);
  border-style: dashed;
}

/* An ended or paused series still renders in the grid so the week can say
   "no Tuesday mixer right now" honestly. Both marks read quiet, not alarming. */
.chip-ended,
.chip-paused {
  color: var(--slate-soft);
  border-color: var(--rule-strong);
  border-style: dashed;
}

.event-card-footer { margin-top: 10px; }

.event-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
}
.event-link:hover { background: var(--ink); color: var(--on-ink); }

/* ==========================================================================
   COMING UP - build region SSR_COMINGUP. Generated class names.
   Everything past this week, grouped by date. Deliberately tighter than This
   Week: one is a page you read, this is a list you scan.
   ========================================================================== */

.upcoming { border-bottom: 1px solid var(--rule); }

.up-group {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  column-gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.upcoming > .up-group:first-of-type { border-top: 0; }

/* smaller sibling of the This Week date square */
.datesq-sm { padding: 4px 2px 6px; }
.datesq-sm .datesq-dow { font-size: 0.62rem; letter-spacing: 0.1em; }
.datesq-sm .datesq-day { font-size: 1.5rem; }
.datesq-sm .datesq-mon { font-size: 0.6rem; letter-spacing: 0.1em; }

.up-row {
  padding: 8px 0;
  border-top: 1px solid var(--rule);
  min-width: 0;
}
.up-rows > .up-row:first-child { border-top: 0; padding-top: 0; }
.up-rows > .up-row:last-child { padding-bottom: 0; }

.up-time {
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.up-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin: 1px 0 2px;
}
.up-title a { text-decoration: underline; text-underline-offset: 2px; }

.up-org {
  color: var(--slate);
  font-size: 0.92rem;
  font-weight: 600;
}

.up-marks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.up-venue { color: var(--slate-soft); font-size: 0.9rem; }
.up-marks .chip { font-size: 0.66rem; padding: 3px 6px; letter-spacing: 0.1em; }

/* ==========================================================================
   WEEK GRID - build region SSR_WEEKGRID. Generated class names.
   Mobile: stacked day cards. Desktop: 7 columns with printed column rules.
   ========================================================================== */

.weekgrid { display: grid; }

.day-card {
  border-top: 1px solid var(--rule);
  padding: 14px 0;
  min-width: 0;
}
.weekgrid > .day-card:first-of-type { border-top: 0; }

.day-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 8px;
}

/* a count of what is on that weekday, not a date. Kept quiet on purpose. */
.day-count {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0;
  color: var(--slate-soft);
}

/* The next date THIS entry happens. It sits on the entry, not on the column
   header, because a first-Wednesday series in the Wednesday column does not
   happen on the next Wednesday. */
.entry-next {
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 2px;
}

.day-today .day-header {
  border-bottom-color: var(--ink);
  border-bottom-width: 3px;
}
.day-today .day-count { color: var(--ink); }

.series-entry {
  padding: 8px 0;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}
.day-listings > .series-entry:first-child { border-top: 0; }

.entry-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.entry-empty .entry-title,
.entry-ended .entry-title {
  font-weight: 500;
  color: var(--slate-soft);
  font-style: italic;
}

.entry-note {
  font-style: italic;
  color: var(--slate-soft);
  font-size: 0.9rem;
}

.entry-row { display: block; }

.entry-time {
  display: block;
  font-family: var(--display);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.entry-place,
.entry-org,
.entry-cadence {
  display: block;
  color: var(--slate-soft);
  font-size: 0.9rem;
}

.entry-place a {
  color: var(--slate);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.entry-cadence { font-style: italic; }

.day-quiet .day-header { color: var(--slate-soft); }

/* the week grid runs its chips tighter than This Week does */
.series-entry .entry-chips { gap: 6px; margin-top: 8px; }
.series-entry .chip { font-size: 0.66rem; padding: 3px 6px; letter-spacing: 0.1em; }

/* ------------------------------------------------------------- panel */
.panel {
  background: var(--panel);
  border: 1px solid var(--rule-strong);
  padding: 18px 16px;
}

.panel-lead { color: var(--slate); margin-bottom: 14px; }

.panel-fine {
  color: var(--slate-soft);
  font-size: 0.92rem;
  margin-top: 12px;
}

.icslist { display: grid; gap: 10px; }

.icslink {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 56px;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--ink);
  text-decoration: none;
}
.icslink:hover { background: var(--ink); }
.icslink:hover .icslink-name { color: var(--on-ink); }
.icslink:hover .icslink-file { color: var(--on-ink-soft); }

.icslink-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}
.icslink-file {
  font-size: 0.88rem;
  color: var(--slate-soft);
  overflow-wrap: anywhere;
}

/* -------------------------------------------------------------- form */
.eventform { max-width: 34rem; }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-family: var(--display);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 5px;
}

.field input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--slate);
  background: var(--paper);
  border: 1px solid var(--rule-strong);   /* 3.56:1, clears non-text contrast */
  border-radius: 0;
}
.field input:hover { border-color: var(--ink); }

.hint {
  font-size: 0.88rem;
  color: var(--slate-soft);
  margin-top: 5px;
}

.hp { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 22px;
  background: var(--ink);
  color: var(--on-ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn:hover { background: var(--paper); color: var(--ink); }
.btn:focus-visible { outline-color: var(--gold); }   /* 5.88:1 against the navy fill */

/* ------------------------------------------------------------ footer */
.sitefoot {
  border-top: 2px solid var(--ink);
  padding: 20px 0 30px;
  margin-top: 8px;
}

.byline {
  font-family: var(--display);
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-soft);
}
.byline a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* -------------------------------------------------- thanks page bits */
.plainmain { padding: 34px 0 40px; }
.plainmain p { font-size: 1.1rem; color: var(--slate); }

/* padded so the inline link still clears a 44px touch target */
.plainmain a {
  display: inline-block;
  padding: 10px 0;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Breakpoints. Everything above is the 375px layout.
   ========================================================================== */

@media (min-width: 560px) {
  :root { --gut: 24px; }

  .event-card { padding: 20px 0; }
  .event-card--dated {
    grid-template-columns: 74px minmax(0, 1fr);
    column-gap: 18px;
  }
  .datesq-day { font-size: 2.5rem; }
  .datesq-dow { font-size: 0.76rem; }
  .event-title { font-size: 1.3rem; }

  .icslist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn { width: auto; }

  .up-group { grid-template-columns: 56px minmax(0, 1fr); column-gap: 18px; }
  .datesq-sm .datesq-day { font-size: 1.75rem; }
}

@media (min-width: 900px) {
  :root { --gut: 32px; }

  body { font-size: 1.125rem; }

  .masthead { padding-top: 28px; }
  .section { padding: 40px 0 44px; }

  .event-card--dated { grid-template-columns: 88px minmax(0, 1fr); column-gap: 24px; }
  .datesq-day { font-size: 3rem; }

  /* 7 columns, one per weekday, with printed column rules between them */
  .weekgrid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 2px solid var(--ink);
    border-bottom: 1px solid var(--rule);
  }
  .day-card {
    border-top: 0;
    border-left: 1px solid var(--rule);
    padding: 12px 10px 18px;
  }
  .weekgrid > .day-card:first-of-type { border-left: 0; padding-left: 0; }
  .weekgrid > .day-card:last-of-type { padding-right: 0; }

  .day-header {
    font-size: 0.86rem;
    letter-spacing: 0.1em;
    gap: 6px;
  }
  .day-count { font-size: 0.76rem; }

  .series-entry { font-size: 0.92rem; }
  .entry-place, .entry-org, .entry-cadence { font-size: 0.86rem; }

  /* On a wide screen a Coming Up row reads as one line: time, then the title
     and organizer, then the marks. It stays stacked below 900px. */
  .up-group { grid-template-columns: 64px minmax(0, 1fr); column-gap: 24px; }
  .up-row {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) auto;
    column-gap: 18px;
    align-items: baseline;
  }
  .up-title { grid-column: 2; margin: 0; }
  .up-org { grid-column: 2; }
  .up-time { grid-row: 1 / span 2; }
  .up-marks { grid-column: 3; grid-row: 1 / span 2; margin-top: 0; justify-content: flex-end; }

  .panel { padding: 24px; }
}

/* --------------------------------------------------------------- print */
@media print {
  .sitenav, .eventform, #submit .section-note, .skip-link, .tickband { display: none; }
  body { background: #FFFFFF; color: #000000; font-size: 11pt; }
  .datesq { background: #FFFFFF; color: #000000; border: 1pt solid #000000; }
  .datesq-dow, .datesq-mon { color: #000000; }
  .event-card { break-inside: avoid; }
  .day-card { break-inside: avoid; }
}
