/* Events page */
.ev-head { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px 32px; }
.ev-head > div:first-child { display: flex; flex-direction: column; gap: 8px; }

.views { display: flex; border: 2px solid var(--cream); }
.views button { background: transparent; color: var(--cream); border: 0; padding: 7px 14px; min-height: 36px; cursor: pointer; }
.views button[aria-pressed="true"] { background: var(--cream); color: var(--ink); }

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 18px; padding: 20px var(--gutter); border-bottom: 2px solid var(--ink); }
.tool { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 200px; max-width: 300px; position: relative; }
.tool input, .tool select, .date-btn {
  font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 0;
  min-height: 44px; padding: 9px 12px; width: 100%;
}
.tool select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23141110' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.date-btn { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; text-align: left; }
.date-btn.is-set { background: var(--orange); }
.clear-date { background: none; border: 0; padding: 10px 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Calendar (date picker + month view share the cell look) */
.cal-pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30;
  width: 300px; max-width: calc(100vw - 32px);
  background: var(--cream); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--orange);
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.cal-pop[hidden] { display: none; }
.cal-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cal-nav .h { font-size: 20px; }
.cal-nav button { width: 36px; height: 36px; border: 2px solid var(--ink); background: transparent; cursor: pointer; font-weight: 800; }
.cal-nav button:disabled { opacity: .3; cursor: default; }
.mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mini .wd { font-size: 11px; font-weight: 800; padding: 4px 0; }
.mini button { aspect-ratio: 1; border: 0; background: transparent; cursor: pointer; font-variant-numeric: tabular-nums; position: relative; }
.mini button:hover:not(:disabled) { background: rgba(20, 17, 16, .08); }
.mini button.has::after { content: ''; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; background: var(--orange); }
.mini button.today { outline: 2px solid var(--ink); outline-offset: -2px; }
.mini button.sel { background: var(--ink); color: var(--cream); }
.mini button:disabled { color: rgba(20, 17, 16, .3); cursor: default; }
.quick { display: flex; gap: 6px; flex-wrap: nowrap; }
.quick button { flex: 1 1 auto; border: 1px solid var(--ink); background: transparent; padding: 6px 4px; cursor: pointer; font-size: 10px; letter-spacing: .08em; white-space: nowrap; min-height: 32px; }
.quick button:hover { background: var(--ink); color: var(--cream); }

/* Category list (same look as the date picker) */
.cat-list {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30;
  margin: 0; padding: 6px 0; list-style: none; max-height: 340px; overflow-y: auto;
  background: var(--cream); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--orange);
}
.cat-list:focus { outline: none; }
.cat-list li { padding: 8px 14px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cat-list li.is-active { background: rgba(20, 17, 16, .08); }
.cat-list li[aria-selected="true"] { font-weight: 800; }
.cat-list li[aria-selected="true"]::after { content: ''; width: 8px; height: 8px; background: var(--orange); flex: 0 0 auto; }
.cat-list li:first-child { border-bottom: 1px solid var(--ink); margin-bottom: 4px; }
#f-cat.is-set { background: var(--orange); }

/* End block on Events: "Get the app" half in black so it doesn't blend into the cream page */
.end--dark .end-app { background: var(--ink); color: var(--cream); }
.end--dark .end-app .btn--ink { background: var(--cream); color: var(--ink); }
.end--dark + .site-footer, main:has(.end--dark) + .site-footer { border-top: 1px solid rgba(246, 239, 230, .2); }

/* Lists */
.ev-section { padding: clamp(24px, 3vw, 44px) var(--gutter) var(--section-y); display: flex; flex-direction: column; gap: 20px; }
.list-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; }
.list-head h2 { font-size: var(--fs-h2); }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 32px 24px; }
.ev-card { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.ev-poster { position: relative; }
.ev-poster img { width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; }
.ev-poster:not(:has(img)) { aspect-ratio: 2 / 1; background: var(--ink); }
.ev-poster .bug { padding: 6px 10px; }
.ev-card h3 { font-size: var(--fs-h4); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 1.8em; }
.ev-venue span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ev-line { display: flex; gap: 8px; font-size: var(--fs-small); align-items: flex-start; }
.ev-line svg { flex: 0 0 auto; margin-top: 3px; }
.ev-card .btn { align-self: flex-start; margin-top: auto; }
.ev-card .btn.is-sold { background: transparent; color: var(--ink); border-color: var(--ink); opacity: .55; cursor: default; }
.empty { border: 2px dashed var(--ink); padding: 24px; }
.empty a { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 800; }

/* Month view */
.month { padding: 20px var(--gutter) 0; display: flex; flex-direction: column; gap: 12px; }
.month .cal-nav { justify-content: flex-start; gap: 14px; }
.month .cal-nav .h { font-size: var(--fs-h3); min-width: 7.5em; }
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 2px solid var(--ink); border-left: 1px solid var(--ink); }
.mgrid .wd { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 8px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.mcell {
  min-height: 104px; padding: 8px; border: 0; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  background: transparent; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.mcell:hover:not(:disabled) { background: rgba(20, 17, 16, .05); }
.mcell.blank { cursor: default; background: rgba(20, 17, 16, .03); }
.mcell:disabled { cursor: default; color: rgba(20, 17, 16, .35); }
.mcell .n { font-weight: 800; font-stretch: 75%; font-size: 20px; line-height: 1; display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.mcell .t { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--cream); padding: 2px 5px; }
.mcell .ln { font-size: 12px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcell .ln b { margin-right: 4px; }
.mcell .more { font-size: 11px; font-weight: 800; }
.mcell.sel { background: var(--ink); color: var(--cream); }
.mcell.sel .ln b { color: var(--orange); }
.mcell.sel .t { background: var(--orange); color: var(--ink); }
.mcell .dot { display: none; width: 6px; height: 6px; background: var(--orange); }
@media (max-width: 760px) {
  .mcell { min-height: 54px; padding: 6px; align-items: center; }
  .mcell .n { font-size: 17px; }
  .mcell .ln, .mcell .more, .mcell .t { display: none; }
  .mcell.has .dot { display: block; }
  .mgrid .wd { padding: 6px 0; text-align: center; font-size: 10px; letter-spacing: .04em; }
}
@media (max-width: 640px) {
  .toolbar { gap: 12px 10px; padding-block: 16px; }
  .tool { max-width: none; flex: 1 1 140px; }
  .tool:first-child { flex-basis: 100%; }
  .tool:nth-child(3) .cal-pop { left: auto; right: 0; }
  .ev-head { align-items: center; }
}
.ev-venue { margin-bottom: 6px; }

/* Cards are links to the event page */
a.ev-card { color: inherit; text-decoration: none; }
a.ev-card:hover { text-decoration: none; }
a.ev-card:hover h3 { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.ev-poster { overflow: hidden; }
.ev-poster img { transition: transform .25s; }
a.ev-card:hover .ev-poster img { transform: scale(1.03); }
.sold-tag { position: absolute; top: 0; right: 0; z-index: 1; background: var(--ink); color: var(--cream); padding: 6px 10px; }
@media (prefers-reduced-motion: reduce) { .ev-poster img { transition: none; } }
