/* "All events" for a period, grouped by day (GS-REQ-008, 8.2), and the sort row of the paged list (8.1) */

/* Page head: breadcrumbs, H1 and the line with the dates and the number of events (8.2.1-8.2.3) */
.gs-period-head {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-top: 28px;
}

.gs-breadcrumb {
  --bs-breadcrumb-divider: "·";
  --bs-breadcrumb-divider-color: var(--gs-muted);
  --bs-breadcrumb-item-active-color: var(--gs-muted);
  margin: 0;
  font-size: 14px;
  color: var(--gs-muted);
}

.gs-breadcrumb a {
  color: var(--gs-muted);
}

/* events-portal.css sets ">" for all breadcrumbs; the period view uses "·" as in the mockup (8.2.1) */
.gs-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  content: var(--bs-breadcrumb-divider);
  color: var(--gs-muted);
}

.gs-period-titles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gs-period-titles .gs-h1 {
  margin: 0;
}

.gs-period-summary {
  margin: 0;
  font-size: clamp(16px, calc(16px + 2 * (100vw - 390px) / 810), 18px);
  color: var(--gs-text-2);
}

.gs-period-notice {
  margin: 0;
}

/* "When" and "Filters" rows (8.2.4, 8.2.5) */
.gs-period-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--gs-line);
}

.gs-period-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.gs-period-row-label {
  flex: 0 0 70px;
}

.gs-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Filter button: line-strong outline, radius 10px, 40px high; active: tag background with a remove button */
.gs-filter {
  display: inline-flex;
  align-items: stretch;
  min-height: 40px;
  max-width: 100%;
  border: 1px solid var(--gs-line-strong);
  border-radius: 10px;
  background: var(--gs-surface);
  color: var(--gs-ink);
}

.gs-filter.is-active {
  border-color: var(--gs-tag-bg);
  background: var(--gs-tag-bg);
  color: var(--gs-tag-text);
}

.gs-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font-family: var(--gs-font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.gs-filter-btn:hover {
  color: inherit;
}

span.gs-filter-btn {
  cursor: default;
}

.gs-filter-btn:disabled {
  color: var(--gs-muted);
  cursor: not-allowed;
}

.gs-filter-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  border-left: 1px solid var(--gs-line-strong);
  border-radius: 0 9px 9px 0;
  color: inherit;
}

.gs-filter-clear:hover {
  color: inherit;
  background: var(--gs-line);
}

.gs-filter-btn:focus-visible,
.gs-filter-clear:focus-visible {
  outline: 3px solid var(--gs-accent);
  outline-offset: 2px;
}

.gs-filter .dropdown-menu {
  max-height: 60vh;
  overflow-y: auto;
}

.gs-period-sort {
  margin: 0 0 0 auto;
  font-size: 15px;
  color: var(--gs-muted);
}

.gs-period-sort strong {
  color: var(--gs-ink);
}

/* Phones: the row label above its chips and the sort note on its own line */
@media (max-width: 575.98px) {
  .gs-period-row-label {
    flex-basis: 100%;
  }

  .gs-period-sort {
    flex-basis: 100%;
    margin-left: 0;
  }
}

/* Days, one below the other (8.2.6, 8.2.12) */
.gs-period-days {
  padding-bottom: 40px;
}

.gs-period-day {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 40px;
}

/* Day heading with a 2px line in the ink colour below it (8.2.6). Sticky at the top while the day's cards
   scroll, over them (8.2.7); the site header is not sticky, so the top is 0. */
.gs-day-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 22px 0 14px;
  border-bottom: 2px solid var(--gs-ink);
  background: var(--gs-bg);
}

.gs-day-titles {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}

.gs-day-titles .gs-h-day {
  margin: 0;
}

/* "Днес" on the accent colour, "Утре" on the tag colour (8.2.6) */
.gs-day-label {
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--gs-tag-bg);
  color: var(--gs-tag-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.gs-day-label.is-today {
  background: var(--gs-accent);
  color: var(--gs-on-accent);
}

.gs-day-count {
  font-size: 16px;
  font-weight: 700;
  color: var(--gs-text-2);
}

/* A day whose cards load on scroll (8.2.11): about one row of cards high, so the page grows less when they come */
.gs-period-deferred {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-height: 420px;
}

/* "More N events on Friday" under the day's cards, secondary style (8.2.8) */
.gs-period-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.gs-period-more .gs-btn {
  max-width: 100%;
  white-space: normal;
}

.gs-period-more-error {
  margin: 0;
  color: var(--gs-text-2);
}

.gs-period-empty {
  padding: 48px 0;
  text-align: center;
}

/* Paged list: "Sort by" label and the sort chips, which wrap instead of running off narrow screens (8.1) */
.gs-sort-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

/* Phones: no sort row; the list keeps its default order by date (requester's decision) */
@media (max-width: 767.98px) {
  .gs-sort-row {
    display: none;
  }
}
