/* ============================================================
   Workshops — list block, tiles, single workshop header, modal.
   ============================================================ */

/* Defaults for themes that don't define these colours (a theme can set them,
   e.g. per dark / light mode). :where() keeps them weaker than any theme value. */
:where(:root) {
  --color-bg: #fafaf9; --color-surface: #fff; --color-elevated: #fff;
  --color-text: #0c0c0c; --color-text-muted: #6b6b6b; --color-text-faint: #a1a1a1;
  --color-border: rgba(0,0,0,.08); --color-hover: rgba(0,0,0,.05); --color-chip: rgba(0,0,0,.045);
  --color-btn-active: #0c0c0c; --color-btn-text-active: #fff;
  --shadow-pop: 0 12px 40px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
  --transition: .2s ease; --radius-img: 4px; --gap: 10px;
  --row-h: clamp(160px, 20vw, 280px); --admin-bar: 0px; --container-pad: 32px; --nav-height: 60px;
}

/* Workshops block: Upcoming / Past groups of tiles. */
.workshops-list > .workshops-group:first-child { margin-top: 0; }
.workshops-group { margin-top: 40px; }
.workshops-group__title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}
.workshops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.workshop-tile {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s ease;
}
.workshop-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.workshop-tile:focus-visible { outline-offset: 3px; }
.workshop-tile__image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
  background: var(--color-chip);
}
.workshop-tile__image--placeholder { background: var(--color-chip); }
/* Square also inside page text, where themes round images. */
.workshop-tile .workshop-tile__image, .workshop-article .workshop-article__cover { border-radius: 0; }
.workshop-tile__body { padding: 18px 20px 20px; }
.workshop-tile__status {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.workshop-tile__status--active,
.workshop-tile__status--permanent { background: rgba(34, 197, 94, 0.14); color: #15803d; }
[data-theme="dark"] .workshop-tile__status--active,
[data-theme="dark"] .workshop-tile__status--permanent { color: #4ade80; }
.workshop-tile__status--past { background: var(--color-chip); color: var(--color-text-muted); }
.workshop-tile__title { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 6px; }
/* Tiles inside page text: no extra space above the title from the text's h3 style. */
.workshop-tile .workshop-tile__title { margin-top: 0; }
.workshop-tile__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}
.workshop-tile__excerpt {
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Workshop article — the full workshop page, also shown inside the modal. */
.workshop-article { max-width: 760px; padding-block: 40px 72px; }
.workshop-article__back {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 28px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  transition: color var(--transition);
}
.workshop-article__back:hover { color: var(--color-text); }
.workshop-article__cover {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 0;
  margin-bottom: 32px;
  background: var(--color-chip);
}
.workshop-article__header { margin-bottom: 32px; }
.workshop-article__title {
  margin-bottom: 12px;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.workshop-article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

/* Modal: a scrollable panel (full screen on phones) holding the article. */
.workshop-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.workshop-modal__overlay {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: pp-fade 0.2s ease;
}
.workshop-modal__panel {
  position: relative;
  width: 100%;
  max-width: 820px;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--color-text-faint) transparent;
  background: var(--color-elevated);
  border-radius: 0;
  box-shadow: var(--shadow-pop);
  outline: none;
  animation: pp-pop 0.2s ease-out;
}
/* The panel takes focus when it opens (for keyboards and screen readers); no ring around the whole popup. */
.workshop-modal .workshop-modal__panel:focus-visible { outline: none; border-radius: 0; }
@keyframes pp-fade { from { opacity: 0; } }
/* Stays in the corner while the panel scrolls. */
.workshop-modal__close {
  position: sticky;
  top: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin: 12px 12px -50px auto;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background var(--transition);
}
.workshop-modal__close:hover { background: rgba(0, 0, 0, 0.75); }
.workshop-modal__body[aria-busy="true"] {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.workshop-modal__body[aria-busy="true"]::after {
  content: '';
  width: 22px; height: 22px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-text-muted);
  border-radius: 50%;
  animation: pp-spin 0.8s linear infinite;
}
.workshop-modal .workshop-article { max-width: none; padding: 0 40px 48px; }
.workshop-modal .workshop-article__back { display: none; }
.workshop-modal .workshop-article__cover { border-radius: 0; margin: 0 -40px 32px; width: calc(100% + 80px); max-width: none; }
/* No cover image: keep the title clear of the close button. */
.workshop-modal .workshop-article__back + .workshop-article__header { padding-top: 56px; }

.workshops-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}
@keyframes pp-spin { to { transform: rotate(360deg); } }
@keyframes pp-pop {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes pp-sheet { from { transform: translateY(24px); opacity: 0; } }

@media (max-width: 760px) {
  .workshop-modal { padding: 0; }
  .workshop-modal__panel { max-width: none; height: 100%; max-height: 100dvh; border-radius: 0; animation: pp-sheet 0.25s ease-out; }
  .workshop-modal .workshop-article { padding: 0 20px 40px; }
  .workshop-modal .workshop-article__cover { margin: 0 -20px 24px; width: calc(100% + 40px); }
  .workshop-article { padding-block: 24px 48px; }
}

/* Compact (block setting, less scrolling): smaller tiles, about four in a
   row on computers, no summary; on phones a list, small photo beside the text. */
.workshops-list--compact .workshops-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.workshops-list--compact .workshop-tile__image { aspect-ratio: 3 / 2; }
.workshops-list--compact .workshop-tile__body { padding: 12px 14px 14px; }
.workshops-list--compact .workshop-tile__status { margin-bottom: 6px; }
.workshops-list--compact .workshop-tile__title { font-size: 1.0625rem; margin-bottom: 4px; }
.workshops-list--compact .workshop-tile__meta { font-size: .78rem; }
.workshops-list--compact .workshop-tile__excerpt { display: none; }
@media (max-width: 600px) {
  .workshops-list--compact .workshops-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .workshops-list--compact .workshop-tile { display: flex; align-items: center; }
  .workshops-list--compact .workshop-tile__image { flex: none; width: 104px; height: 92px; aspect-ratio: auto; }
  .workshops-list--compact .workshop-tile__body { flex: 1; min-width: 0; padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; }
  .workshops-list--compact .workshop-tile__status { align-self: flex-start; }
}
