/* Event list card: the events calendar list card, shared by /events/ and the 13 town pages (/towns/<slug>/).
   Moved here unchanged, in the same order, from public/events/index.html (2026-11-23) so there is one copy.
   Markup: /js/event-list-card.js (MLCEventListCard.render). Load after main.css and before a page's own styles. */

    /* A month's cards under its header ("February 2027"): the card shows the day, the header the month */
    .event-list-group {
      margin-bottom: var(--space-xl);
    }

    .event-list-date-header {
      font-family: var(--font-body);
      font-size: var(--text-xs);
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-muted);
      padding-bottom: var(--space-sm);
      border-bottom: 2px solid var(--border-light);
      margin-bottom: var(--space-md);
    }

    @media (max-width: 768px) {
      .event-list-group {
        margin-bottom: var(--space-md);
      }

      .event-list-date-header {
        margin-bottom: var(--space-sm);
      }
    }

    /* The pill before the label keeps the gap, so a label that wraps on a phone starts flush left. */
    .event-list-toprow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 8px; margin-bottom: 6px; min-height: 22px; }
    .event-list-toprow .event-list-category, .event-list-toprow .mlc-chamber-event { white-space: nowrap; }
    .event-list-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
    .event-list-card .event-list-toprow .event-list-category { margin: 0; }
    .event-list-card .event-list-toprow .event-list-category[style*="margin-left"] { margin-left: 0 !important; }
    .event-list-card .mlc-chamber-event.event-list-chamber { margin: 0; }

    /* Events list -- agenda row: date spine | content | square poster */
    .event-list-card {
      display: flex;
      align-items: center;
      gap: var(--space-lg);
      padding: 16px 20px;
      background: var(--white);
      border-radius: var(--radius-lg);
      border: 1px solid var(--border-light);
      margin-bottom: var(--space-sm);
      transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
      cursor: pointer;
      text-decoration: none;
      color: inherit;
    }

    .event-list-card:hover {
      box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
      border-color: var(--gold);
      transform: translateY(-1px);
      color: inherit;
    }

    /* Date spine: Playfair day numeral + gold weekday, hairline divider */
    .event-list-datecol {
      flex-shrink: 0;
      width: 52px;
      padding-right: var(--space-lg);
      border-right: 1px solid var(--border-light);
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
    }

    .event-list-day {
      font-family: var(--font-display);
      font-size: 36px;   /* larger (Kamden 2026-11-22) */
      line-height: 1;
      color: var(--navy);
    }
    .event-list-ord { font-size: 0.42em; vertical-align: super; line-height: 0; margin-left: 1px; }
    /* The number itself sits on the box's centre; a single st / nd / rd / th hangs to its right (Kamden 2026-11-22) */
    .event-list-day { position: relative; }
    .event-list-day > .event-list-ord:only-of-type { position: absolute; left: 100%; top: 0.12em; vertical-align: baseline; line-height: 1; }

    .event-list-datecol.is-multi { width: auto; min-width: 52px; }
    .event-list-datecol.is-multi .event-list-day { font-size: 20px; white-space: nowrap; }
    .event-list-datecol.is-multi .event-list-dow { white-space: nowrap; }

    .event-list-dow {
      margin-top: 4px;
      font-size: 10.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.09em;
      color: var(--gold);
    }

    .event-list-info {
      flex: 1;
      min-width: 0;
    }

    .event-list-category {
      display: inline-block;
      font-size: var(--text-xs);
      font-weight: 600;
      padding: 0.2em 0.65em;
      border-radius: var(--radius-sm);
      margin-bottom: 6px;
      line-height: 1.4;
    }

    .event-list-title {
      font-family: var(--font-display);
      font-size: 1.2rem;
      font-weight: 600;
      color: var(--navy);
      line-height: 1.25;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .event-list-meta {
      margin-top: 5px;
      display: flex;
      align-items: center;
      gap: 14px;
      font-size: 15px;                  /* easier to read (Kamden 2026-11-22: "too hard to see") */
      color: var(--text-secondary);
      white-space: nowrap;
      overflow: hidden;
    }

    .event-list-metaitem {
      display: inline-flex;
      align-items: flex-start;   /* icon on the first text line, not centred on a wrapped line (Kamden 2026-11-22) */
      gap: 5px;
      min-width: 0;
    }

    .event-list-metaitem span {
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .event-list-metaitem svg {
      width: 14px;
      height: 14px;
      margin-top: 2px;
      margin-top: calc((1lh - 14px) / 2 - 1px);   /* centred on the first line's letters (Source Sans sits high) */
      flex-shrink: 0;
      color: var(--sage);
    }

    /* Square poster, anchored right */
    /* Desktop: tags above the poster in the upper right (Kamden 2026-11-22) */
    .event-list-right { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; align-self: stretch; justify-content: center; }
    .event-list-righttags { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
    .event-list-righttags .event-list-category, .event-list-righttags .mlc-chamber-event { margin: 0; }
    /* The locked desktop card from 641px up; 641 to 900 is the same card a little smaller (Kamden 2026-11-22: resizing) */
    @media (min-width: 641px) {
      .event-list-toprow { display: none; }
      .event-list-card .event-list-right .card-thumbnail { align-self: flex-end; }
      /* Date, text and photo read as one row (Kamden 2026-11-22): the date's divider is the photo's height and centred
         with it, and the text is centred on the same line; the tags sit above the photo only. */
      /* The row sits in the middle of the card; the tags are inline after the event name (Kamden 2026-11-22). */
      .event-list-card { align-items: center; padding-top: 10px; padding-bottom: 10px; padding-right: 10px; padding-left: 0; }   /* the date sits centred between the card edge and its divider (Kamden 2026-11-22) */   /* equal space top, right and bottom around the photo (Kamden 2026-11-22) */   /* less top and bottom space now the tags are inline (Kamden 2026-11-22) */
      .event-list-righttags { display: none; }
      .event-list-titlerow { display: flex; align-items: center; gap: 10px; min-width: 0; }
      .event-list-titlerow .event-list-title { min-width: 0; }
      .event-list-inlinetags { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; white-space: nowrap; }
      .event-list-inlinetags .event-list-category, .event-list-inlinetags .mlc-chamber-event { margin: 0; }
      /* Larger event name, and the name and its details sit close together on the card's centre line (Kamden 2026-11-22) */
      .event-list-title { font-size: 1.6rem; line-height: 1.05; }
      /* Member card spacing (Kamden 2026-11-22): the name up top and big, the description, then the time and place
         with their icons at the bottom, filling the photo's height. */
      .event-list-card .event-list-info { justify-content: space-evenly; height: 84px; min-height: 84px; }   /* equal space above, between and below the three lines */
      .event-list-meta { margin-top: 0; font-size: 16px; line-height: 1.15; }   /* larger, evenly spaced lines (Kamden 2026-11-22) */
      .event-list-desc { font-size: 1.05rem; color: var(--text-secondary); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
      /* The date box is square: as wide as it is tall, its divider the photo's height (Kamden 2026-11-22) */
      .event-list-datecol { width: 84px; height: 84px; padding-right: 0; box-sizing: border-box; }
      .event-list-right { align-self: center; }
      .event-list-datecol { height: 84px; justify-content: center; align-self: center; }
      .event-list-info { min-height: 84px; display: flex; flex-direction: column; justify-content: center; align-self: center; }
    }
    @media (max-width: 640px) {
      .event-list-righttags { display: none; }
      .event-list-inlinetags { display: none; }
      .event-list-desc { display: none; }
      .event-list-right { align-self: center; }
    }
    /* Tablet (641 to 900): the locked desktop card, smaller type, town only (Kamden 2026-11-22) */
    @media (min-width: 641px) and (max-width: 900px) {
      .event-list-title { font-size: 1.3rem; }
      .event-list-desc { font-size: 0.95rem; }
      .event-list-meta { font-size: 14px; }
      .event-list-day { font-size: 30px; }
      .event-list-datecol { width: 72px; }
    }
    /* Town only wherever space is tight (tablet and phone) */
    @media (max-width: 900px) {
      .event-list-loc { display: none; }
    }
    .event-list-card .card-thumbnail {
      flex-shrink: 0;
      width: 84px;
      height: 84px;
      align-self: center;
      overflow: hidden;
      border-radius: var(--radius-lg);
      background: var(--cream-warm);
      border: 1px solid var(--border-light);
    }

    .event-list-card .card-thumbnail img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    /* An event with no image: one branded date tile everywhere (list card, pop-up, event page; Kamden 2026-11-10).
       Navy tile, the day in the display font, the month abbreviation in gold, the same look as the calendar's
       date spine. The event page (/events/_listing/) carries the same .ev-tile rules. */
    .ev-tile {
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      background: var(--navy); color: #fff; border-radius: var(--radius-lg); text-align: center;
    }
    .ev-tile-day { font-family: var(--font-display); line-height: 1; }
    .ev-tile-mo { font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--gold); }
    .event-list-card .card-thumbnail .ev-tile { width: 100%; height: 100%; border-radius: 0; }
    .event-list-card .card-thumbnail .ev-tile-day { font-size: 30px; }
    .event-list-card .card-thumbnail .ev-tile-mo { font-size: 10.5px; margin-top: 4px; }

    /* Phone card rules (were at 768px; moved to 640px so tablets keep the locked card, Kamden 2026-11-22) */
    @media (max-width: 640px) {
      .event-list-card {
        padding: 14px 16px;
        margin-bottom: var(--space-sm);
        gap: 14px;
      }

      .event-list-datecol {
        width: 42px;
        padding-right: 14px;
      }

      .event-list-day {
        font-size: 24px;
      }

      .event-list-datecol.is-multi { width: auto; min-width: 42px; }
      /* Phone: category in the card's top right corner; Chamber Event alone on the top line (Kamden 2026-11-22) */
      .event-list-card { position: relative; }
      .event-list-card .event-list-tags { position: absolute; top: 10px; right: 10px; }
      .event-list-toprow { min-height: 0; margin-bottom: 4px; }
      .event-list-toprow:not(:has(.mlc-chamber-event)) { margin-bottom: 0; }
      .event-list-info { padding-top: 22px; }
      .event-list-datecol.is-multi .event-list-day { font-size: 17px; }

      .event-list-title {
        font-size: 1.05rem;
        /* Phone: the whole event name shows, wrapping as needed, never cut to "Maine Lakes Winter ..." (2026-11-22) */
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
      }

      /* Phone: one fact per line so the time is never cut off ("10:0...") */
      .event-list-meta {
        margin-top: 4px;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        white-space: normal;
        font-size: var(--text-xs);
      }

      .event-list-metaitem span {
        overflow: visible;
        text-overflow: clip;
      }

      .event-list-card .card-thumbnail {
        width: 64px;
        height: 64px;
      }

    }

    /* PHONE (640px and below), Kamden 2026-11-22 "make it cleaner": a gold date line (with the Chamber Event mark on
       Chamber events), the name (up to two lines), one grey line of time and town, the photo on the right. No date
       box, no category tag, no icons. */
    .event-list-phonehead, .event-list-phoneline { display: none; }
    @media (max-width: 640px) {
      .event-list-card { gap: 14px; padding: 12px 12px 12px 14px; align-items: center; }
      .event-list-datecol, .event-list-toprow, .event-list-meta { display: none; }
      .event-list-info { padding-top: 0; }
      .event-list-phonehead { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
      .event-list-phonewhen { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
      .event-list-phonehead .mlc-chamber-event { font-size: 11px; padding: 0 5px; margin: 0; }
      .event-list-phonehead .mlc-chamber-event img { width: 12px; height: 12px; }
      .event-list-phonehead .event-list-category { margin: 0; }
      /* Calendar and clock icons, each centred on its line (Kamden 2026-11-22: "add back the icons for time and day") */
      .event-list-phonewhen, .event-list-phoneline { display: inline-flex; align-items: center; gap: 5px; }
      .event-list-phoneline { display: flex; }
      .event-list-phoneicon { width: 13px; height: 13px; flex-shrink: 0; }
      .event-list-phonesep { width: 8px; flex-shrink: 0; }   /* a little space before the location pin (Kamden 2026-11-22) */
      .event-list-phonetown { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
      .event-list-phoneline { flex-wrap: wrap; row-gap: 2px; overflow: visible; }   /* the town wraps below the time when the line is too narrow */
      .event-list-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 1.2rem; line-height: 1.2; }
      .event-list-phoneline { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 14px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
      .event-list-card .card-thumbnail { width: 72px; height: 72px; }
    }
