/* EL Theme — Events page. Uses the tokens from style.css. */

:root { --gold: #c8a96e; --meta: rgba(232,228,220,.8); --nav-h: 80px; }

/* ── Header on a page without the hero: always in its "scrolled" state ── */
.el-subpage { padding-top: var(--nav-h); }
.el-subpage .site-nav { padding-top: 1rem; padding-bottom: 1rem; }
.el-subpage .site-nav::before { opacity: 1; }
.el-subpage .site-nav .nav-logo { color: var(--text); text-shadow: none; }
.el-subpage .site-nav .nav-links a { color: var(--meta); text-shadow: none; }
.el-subpage .site-nav .nav-links a:hover,
.el-subpage .site-nav .nav-links a[aria-current="page"] { color: var(--text); }
.el-subpage .nav-toggle span { background: var(--text); box-shadow: none; }

/* ── Page frame ── */
.pe { max-width: 1180px; margin: 0 auto; padding: 5rem 3rem 6rem; }
.pe-head { max-width: 860px; margin-bottom: 3rem; }
.pe-head .section-label { margin-bottom: 1.75rem; }
.pe-title {
  font-family: var(--ff-serif);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}
.pe-intro { font-size: 1.1rem; line-height: 1.8; max-width: 600px; }

/* ── Search / filter bar ── */
.pe-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
  background: rgba(10,10,10,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 0 -3rem 1rem;
  padding: 0.9rem 3rem;
}
.pe-bar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }
.pe-search input {
  font: 400 1rem var(--ff-serif);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.5rem 0.85rem;
  width: 15rem;
  transition: border-color var(--transition);
}
.pe-search input::placeholder { color: var(--muted); }
.pe-search input:focus { outline: none; border-color: var(--gold); }
.pe-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pe-chip {
  font: 400 0.7rem var(--ff-sans);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--meta);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.pe-chip:hover { border-color: var(--muted); color: var(--text); }
.pe-chip[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); background: rgba(200,169,110,0.05); }
.pe-years {
  display: flex; gap: 1.1rem; flex-basis: 100%;
  font: 400 0.75rem var(--ff-sans); letter-spacing: 0.08em;
  overflow-x: auto; scrollbar-width: none;
}
.pe-years::-webkit-scrollbar { display: none; }
.pe-years a { color: var(--muted); transition: color var(--transition); white-space: nowrap; }
.pe-years a:hover, .pe-years a.is-current { color: var(--text); }
.pe-years a.is-hidden { display: none; }
.pe-empty { color: var(--muted); font-style: italic; padding: 3rem 0; }

/* ── Year groups ── */
.pe-year { scroll-margin-top: calc(var(--nav-h) + 4.5rem); padding-top: 3rem; }
.pe-year[hidden] { display: none; }
.pe-year-head {
  display: flex; align-items: baseline; gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem; margin-bottom: 2rem;
  font-weight: 400;
}
.pe-year-num { font-family: var(--ff-serif); font-size: clamp(2rem, 4vw, 3rem); line-height: 1; }
.pe-year-count {
  font: 400 0.7rem var(--ff-sans); letter-spacing: 0.25em; text-transform: uppercase; color: var(--muted);
}

/* ── Cards ── */
.pe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem 1.75rem; }
.pe-card[hidden] { display: none; }
.pe-card-btn {
  display: flex; flex-direction: column; gap: 1rem;
  width: 100%; padding: 0; text-align: left;
  background: none; border: 0; color: var(--text); cursor: pointer;
  font: inherit;
}
.pe-card-img {
  display: block; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
}
.pe-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.85) brightness(0.92);
  transition: transform 0.9s var(--transition), filter var(--transition);
}
.pe-card-btn:hover .pe-card-img img,
.pe-card-btn:focus-visible .pe-card-img img { transform: scale(1.03); filter: none; }
.pe-card-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.pe-card-body { display: flex; flex-direction: column; gap: 0.3rem; }
.pe-date {
  font: 400 0.65rem var(--ff-sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
}
.pe-series { font-family: var(--ff-serif); font-style: italic; font-size: 0.9rem; color: var(--gold); line-height: 1.3; }
.pe-card-title { font-family: var(--ff-serif); font-size: 1.25rem; line-height: 1.3; }
.pe-place { font: 400 0.75rem var(--ff-sans); color: var(--muted); line-height: 1.5; margin-top: 0.15rem; }

/* ── Detail dialog ── */
.pe-dialog {
  width: min(760px, calc(100% - 2rem));
  max-height: calc(100vh - 3rem);
  margin: auto;
  padding: 0;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: auto;
  overscroll-behavior: contain;
}
.pe-dialog::backdrop { background: rgba(10,10,10,0.82); backdrop-filter: blur(4px); }
.pe-dialog[open] { animation: pe-in 0.45s var(--transition); }
@keyframes pe-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.pe-close {
  position: sticky; top: 0.75rem; float: right; margin: 0.75rem 0.75rem -3rem 0; z-index: 2;
  width: 2.5rem; height: 2.5rem;
  font: 400 1.5rem/1 var(--ff-sans); color: var(--text);
  background: rgba(10,10,10,0.7); border: 1px solid var(--border); border-radius: 2px; cursor: pointer;
}
.pe-close:hover { border-color: var(--text); }
.pe-d-img { margin: 0; }
.pe-d-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.pe-d-img figcaption {
  font: italic 0.95rem var(--ff-serif); color: var(--meta);
  padding: 0.6rem 2.5rem 0; line-height: 1.5;
}
.pe-d-body { padding: 1.75rem 2.5rem 2.5rem; }
.pe-d-title { font-family: var(--ff-serif); font-weight: 400; font-size: clamp(1.6rem, 3.5vw, 2.25rem); line-height: 1.15; margin: 0.25rem 0 1.5rem; }
.pe-d-meta { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 1rem 0; margin-bottom: 1.75rem; display: grid; gap: 0.6rem; }
.pe-d-meta div { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem; }
.pe-d-meta dt { font: 400 0.65rem/2 var(--ff-sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.pe-d-meta dd { margin: 0; font-size: 1rem; line-height: 1.6; }
.pe-addr { color: var(--muted); font-size: 0.9rem; }
.pe-d-text { font-size: 1.05rem; line-height: 1.8; }
.pe-d-text p, .pe-d-text ul, .pe-d-text h4 { margin-bottom: 1em; }
.pe-d-text ul { padding-left: 1.25rem; }
.pe-d-text h4 { font-weight: 700; font-size: 1.05rem; }
.pe-d-text a { border-bottom: 1px solid var(--border); word-break: break-word; transition: border-color var(--transition); }
.pe-d-text a:hover { border-color: var(--text); }
.pe-d-link {
  display: inline-block; margin-top: 1rem;
  font: 400 0.7rem var(--ff-sans); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--meta); border: 1px solid var(--border); padding: 0.7rem 1.1rem; border-radius: 2px;
  transition: border-color var(--transition), color var(--transition);
}
.pe-d-link:hover { border-color: var(--text); color: var(--text); }

.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Responsive ── */
@media (max-width: 1000px) {
  .pe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .pe { padding: 3rem 1.25rem 4rem; }
  .pe-bar { position: static; margin: 0 -1.25rem 1rem; padding: 0.75rem 1.25rem; }
  .pe-year { scroll-margin-top: calc(var(--nav-h) + 1rem); }
  .pe-search, .pe-search input { width: 100%; }
  .pe-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  .pe-chip { white-space: nowrap; }
  .pe-d-body { padding: 1.5rem 1.25rem 2rem; }
  .pe-d-img figcaption { padding: 0.6rem 1.25rem 0; }
}
@media (max-width: 560px) {
  .pe-grid { grid-template-columns: minmax(0, 1fr); gap: 2.25rem; }
  .pe-dialog { width: 100%; max-height: 100%; height: 100%; max-width: 100%; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pe-dialog[open] { animation: none; }
  .pe-card-img img { transition: none; }
}

/* Logged-in admin bar sits above the fixed header */
.admin-bar.el-subpage .site-nav { top: 32px; }
.admin-bar .pe-bar { top: calc(var(--nav-h) + 32px); }
@media screen and (max-width: 782px) {
  .admin-bar.el-subpage .site-nav { top: 46px; }
  .admin-bar .pe-bar { top: calc(var(--nav-h) + 46px); }
}

.pe-art-label {
  font: normal 400 0.6rem var(--ff-sans); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); margin-right: 0.5rem; vertical-align: 0.1em;
}

/* ── Cancelled events ── */
.pe-card-img { position: relative; }
.pe-badge {
  position: absolute; top: 0.6rem; left: 0.6rem; z-index: 1;
  font: 400 0.6rem var(--ff-sans); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text); background: rgba(10,10,10,0.85);
  border: 1px solid var(--muted); border-radius: 2px; padding: 0.35rem 0.6rem;
}
.pe-card.is-cancelled .pe-card-img img { filter: grayscale(1) brightness(0.55); }
.pe-card.is-cancelled .pe-card-title { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.pe-card.is-cancelled .pe-card-btn:hover .pe-card-img img { filter: grayscale(1) brightness(0.7); }
.pe-cancel-note {
  font: 400 0.7rem var(--ff-sans); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text); border-left: 3px solid var(--muted); padding: 0.4rem 0 0.4rem 0.8rem; margin-bottom: 1.25rem;
}

/* ── Sort + filters (v1.2) ── */
.pe-tools { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.pe-more {
  font: 400 0.7rem var(--ff-sans); letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text); background: transparent;
  border: 1px solid var(--muted); border-radius: 2px;
  padding: 0.45rem 0.8rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.5rem;
  transition: border-color var(--transition), background var(--transition);
}
.pe-more:hover { border-color: var(--text); background: var(--surface); }
.pe-more[aria-expanded="true"] { border-color: var(--gold); color: var(--gold); }
.pe-more-n {
  font-size: 0.6rem; letter-spacing: 0; min-width: 1.2rem; height: 1.2rem; line-height: 1.2rem;
  text-align: center; border-radius: 1rem; background: var(--gold); color: var(--bg);
}
.pe-more-n[hidden] { display: none; }

.pe-select { display: flex; flex-direction: column; gap: 0.3rem; }
.pe-select > span {
  font: 400 0.6rem var(--ff-sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
}
.pe-select select {
  appearance: none; -webkit-appearance: none;
  font: 400 0.95rem var(--ff-serif); color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b6760' stroke-width='1.2'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
  border: 1px solid var(--border); border-radius: 2px;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  cursor: pointer; max-width: 100%;
  transition: border-color var(--transition);
}
.pe-select select:hover { border-color: var(--muted); }
.pe-select select:focus-visible { outline: none; border-color: var(--gold); }
.pe-select select option { background: var(--surface); color: var(--text); }
/* A filter that is set gets the gold edge */
.pe-select select.is-set { border-color: var(--gold); color: var(--gold); }
.pe-sort { flex-direction: row; align-items: center; gap: 0.6rem; }

.pe-panel {
  flex-basis: 100%;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 0.9rem; align-items: end;
  padding: 1rem 0 0.25rem; margin-top: 0.25rem;
  border-top: 1px solid var(--border);
}
.pe-panel[hidden] { display: none; }
.pe-panel select { width: 100%; }
.pe-clear, .pe-clear-inline {
  font: 400 0.7rem var(--ff-sans); letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--muted); background: none; border: 0; padding: 0.6rem 0.25rem; cursor: pointer;
  border-bottom: 1px solid transparent;
}
.pe-clear:hover, .pe-clear-inline:hover { color: var(--text); border-bottom-color: var(--muted); }
.pe-clear-inline { padding: 0; margin-left: 0.5rem; font-style: normal; }

.pe-bar-foot { flex-basis: 100%; display: flex; align-items: center; gap: 1rem; min-width: 0; }
.pe-bar-foot .pe-years { flex: 1 1 auto; min-width: 0; flex-basis: auto; }
.pe-years[hidden] { display: none; }
.pe-count {
  margin-left: auto; white-space: nowrap;
  font: 400 0.65rem var(--ff-sans); letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted);
}
.pe-flat { padding-top: 3rem; }
.pe-flat[hidden] { display: none; }

@media (max-width: 1000px) {
  .pe-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .pe-tools { width: 100%; margin-left: 0; justify-content: space-between; }
  .pe-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pe-sort > span { display: none; }
}
@media (max-width: 420px) {
  .pe-panel { grid-template-columns: minmax(0, 1fr); }
}

/* ── Upcoming (v1.3) ── */
.pe-up { margin-bottom: 5rem; }
.pe-up .section-label, .pe-past-head .section-label { margin-bottom: 1.75rem; }
.pe-past-head { max-width: 860px; margin-bottom: 2rem; padding-top: 1rem; }
.pe-up-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.pe-up-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), background var(--transition);
}
.pe-up-card:hover, .pe-up-card:focus-visible { border-color: var(--gold); }
.pe-up-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.pe-up-img { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg); }
.pe-up-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--transition); }
.pe-up-card:hover .pe-up-img img { transform: scale(1.03); }
.pe-up-noimg {
  display: grid; place-items: center; width: 100%; height: 100%;
  font: 700 3rem var(--ff-serif); letter-spacing: 0.15em; color: var(--border);
}
.pe-up-body { display: flex; flex-direction: column; gap: 0.35rem; padding: 1.5rem 1.75rem 1.75rem; flex: 1; }
.pe-up-when {
  display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.4rem;
  font-family: var(--ff-sans); text-transform: uppercase; letter-spacing: 0.2em;
}
.pe-up-day { font-size: 0.7rem; color: var(--gold); }
.pe-up-date { font-size: 0.95rem; color: var(--text); letter-spacing: 0.12em; }
.pe-up-time { font-size: 0.7rem; color: var(--muted); }
.pe-up-title { font-family: var(--ff-serif); font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; margin-bottom: 0.35rem; }
.pe-up-meta { display: flex; flex-direction: column; gap: 0.15rem; font: 400 0.75rem/1.5 var(--ff-sans); color: var(--meta); margin-top: 0.4rem; }
.pe-up-credit { font: italic 0.85rem/1.5 var(--ff-serif); color: var(--muted); margin-top: 0.4rem; }
.pe-up-cta {
  align-self: flex-start; margin-top: auto; padding-top: 1.25rem;
  font: 400 0.7rem var(--ff-sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text);
}
.pe-up-cta { border-bottom: 1px solid var(--gold); padding-bottom: 0.3rem; }
.pe-up-card.is-cancelled .pe-up-img img { filter: grayscale(1) brightness(0.55); }
.pe-up-card.is-cancelled .pe-up-title { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }

/* One upcoming event: wide card, photo beside the text */
.pe-up-list.is-single { grid-template-columns: minmax(0, 1fr); }
.pe-up-list.is-single .pe-up-card { flex-direction: row; }
.pe-up-list.is-single .pe-up-img { flex: 0 0 58%; aspect-ratio: auto; min-height: 340px; }
.pe-up-list.is-single .pe-up-body { padding: 2.25rem 2.5rem; justify-content: center; }
.pe-up-list.is-single .pe-up-cta { margin-top: 1.25rem; }

.pe-up-none {
  border: 1px solid var(--border); background: var(--surface);
  padding: 2rem 2.25rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem;
}
.pe-up-none p { font-size: 1.15rem; line-height: 1.6; color: var(--text); margin: 0; }
.pe-up-btn {
  font: 400 0.75rem var(--ff-sans); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text); border: 1px solid var(--gold); border-radius: 2px; padding: 0.85rem 1.3rem;
  transition: background var(--transition), color var(--transition);
}
.pe-up-btn:hover { background: rgba(200,169,110,0.08); color: var(--gold); }
.pe-up-stale {
  font: 400 0.8rem/1.6 var(--ff-sans); color: var(--meta);
  border-left: 3px solid var(--gold); padding: 0.35rem 0 0.35rem 0.9rem; margin-bottom: 1.5rem;
}
.pe-up-stale a { color: var(--text); border-bottom: 1px solid var(--gold); }

@media (max-width: 900px) {
  .pe-up-list { grid-template-columns: minmax(0, 1fr); }
  .pe-up-list.is-single .pe-up-card { flex-direction: column; }
  .pe-up-list.is-single .pe-up-img { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
  .pe-up-list.is-single .pe-up-body { padding: 1.5rem 1.5rem 1.75rem; }
}

.pe-up-all { margin-top: 1.25rem; text-align: right; }
.pe-up-all a {
  font: 400 0.7rem var(--ff-sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--meta);
  border-bottom: 1px solid var(--border); padding-bottom: 0.25rem; transition: color var(--transition), border-color var(--transition);
}
.pe-up-all a:hover { color: var(--text); border-color: var(--gold); }

/* ── Slim header on pages other than the home page (v1.3.4) ── */
.el-subpage .site-nav,
.el-subpage .site-nav.scrolled { padding: 0.85rem 3rem; }
.el-subpage .site-nav .nav-logo { font-size: 1.85rem; line-height: 1; letter-spacing: 0.15em; }
.el-subpage .nav-links { gap: 2.25rem; font-size: 0.75rem; letter-spacing: 0.16em; }
.el-subpage .site-nav .nav-links a { position: relative; padding: 0.35rem 0; transition: color var(--transition); }
.el-subpage .site-nav .nav-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: left;
  transition: transform var(--transition);
}
.el-subpage .site-nav .nav-links a:hover::after,
.el-subpage .site-nav .nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.el-subpage .site-nav .nav-links a[aria-current="page"] { color: var(--text); }
.el-subpage .pe { padding-top: 4rem; }

@media (max-width: 768px) {
  .el-subpage .site-nav,
  .el-subpage .site-nav.scrolled { padding: 0.7rem 1.25rem; }
  .el-subpage .site-nav .nav-logo { font-size: 1.6rem; }
  /* Full-screen phone menu keeps its large links */
  .el-subpage .nav-links { font-size: 1.5rem; gap: 2.5rem; }
  .el-subpage .site-nav .nav-links a::after { display: none; }
  .el-subpage .pe { padding-top: 2.5rem; }
}
