/* Festival page — templates/catalog/festival_detail.html.
   Layout only: tokens and components (date tile, badges, fact tiles, map
   panel, cards) come from site.css as they are. Order of the page is
   DESIGN.md, "Страницы": crumbs → head (poster, name, host, badges, buttons,
   facts) → description, past years, details | sponsors, map panel, claim
   and report links. */

/* 1. Head ---------------------------------------------------------------------
   Phone: the poster on top like a flyer, then the name and the rest. From
   56rem: two columns on the body's grid (.layout-split), so the poster
   stands above the sponsor panel and the facts sit beside it.
   The old head's .fest-head rules in site.css §15 are overridden here. */
.fest-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-4);
  margin-bottom: 0;
  padding-block: var(--space-4) var(--space-7);
  border-bottom: 0;
}
.fest-head__body { min-width: 0; }
.fest-head__poster { order: -1; }

@media (min-width: 56rem) {
  .fest-head {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(17rem, 1fr);
    gap: var(--space-7);
    align-items: start;
    padding-block: var(--space-5) var(--space-8);
  }
  .fest-head__poster { order: 0; }
}

.fest-head__name {
  max-width: 22ch;
  margin-bottom: var(--space-3);
  overflow-wrap: break-word;
}
.fest-head__place {
  max-width: var(--measure);
  margin: 0 0 var(--space-4);
  color: var(--color-muted);
  font-size: var(--text-base);
  line-height: 1.45;
}
@media (min-width: 30rem) { .fest-head__place { font-size: var(--text-md); line-height: 1.4; } }
.fest-head__tags { margin-bottom: var(--space-4); }
.fest-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: 0;
}
.fest-head__source { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 600; }
.fest-head__checked { color: var(--color-muted); font-size: var(--text-sm); }

/* Buttons: full width on a phone (one per row), their own width from 30rem.
   "For sponsors" (a quiet link to the sponsor panel) comes after them, as in
   the markup, at every width: the panel starts below the first screen even
   on a desktop. No reordering, so focus follows the screen. The selector
   outranks site.css §15, which pushed it right and hid it from 56rem. */
.fest-head__actions { margin: var(--space-4) 0 0; }
@media (min-width: 30rem) { .fest-head__actions { margin-top: var(--space-5); } }
.fest-head__actions .btn:not(.btn--quiet) { flex: 1 1 100%; }
@media (min-width: 30rem) { .fest-head__actions .btn:not(.btn--quiet) { flex: none; } }
.fest-head__actions .fest-head__jump { display: inline-flex; margin-left: 0; padding-inline: 0; }

.fest-head__facts { margin: var(--space-5) 0 0; }
.fest-head__note { max-width: var(--measure); margin: var(--space-3) 0 0; color: var(--color-muted); font-size: var(--text-sm); }

/* The poster: the family's picture with the poster-size date tile, the
   page's one loud element. A 16:9 strip (at most 20rem high) when it heads
   the column, short enough on a phone that the buttons and the sponsor
   link stay in the first screen; a portrait flyer beside the name from 56rem. */
.fest-head__poster {
  display: flex;
  align-items: flex-end;
  aspect-ratio: 16 / 9;
  max-height: 20rem;
  padding: var(--space-4) var(--space-5) var(--space-5);
}
@media (min-width: 56rem) {
  .fest-head__poster { aspect-ratio: 4 / 5; max-height: none; padding: var(--space-5) var(--space-6) var(--space-6); }
}
.fest-head__poster.is-not-held { filter: saturate(0.2); }   /* not held this year: the picture goes grey, as on the card */

/* The tile keeps the fest-head prefix (tests read fest-head__month…), so it
   also matches the old head's .fest-head__date plate in site.css §9 and §15.
   Undo that plate here and restate the poster sizes, which those later,
   equally specific rules would otherwise shrink. */
.fest-head__poster .fest-head__date {
  width: 100%;
  min-height: 0;
  aspect-ratio: auto;
  padding: 0;
  overflow: visible;
  isolation: auto;
  border-radius: 0;
  background: none;
  outline: 0;
}
.fest-head__poster .fest-head__date::before { -webkit-mask: none; mask: none; }
.fest-head__poster .date-tile--poster [class$="__month"] { font-size: 1.5rem; letter-spacing: -0.02em; }
.fest-head__poster .date-tile--poster.date-tile--range [class$="__month"] { font-size: 1.25rem; }
.fest-head__poster .date-tile--poster [class$="__days"],
.fest-head__poster .date-tile--poster.date-tile--usual [class$="__month"],
.fest-head__poster .date-tile--poster.date-tile--unannounced [class$="__month"] {
  font-size: clamp(3rem, 27cqi, 6.5rem);
  letter-spacing: -0.035em;
}
.fest-head__poster .date-tile--poster.date-tile--long [class$="__days"] { font-size: clamp(2.5rem, 19cqi, 5rem); }

/* 2. Body ---------------------------------------------------------------------
   Main column: description, past years, details — each under a hairline.
   Side column: sponsor panel, map panel, claim and report links. */
.fest-body { padding-bottom: var(--space-8); }
.fest-section { padding-top: var(--space-4); border-top: 1px solid var(--color-line); }
.fest-section + .fest-section { margin-top: var(--space-7); }
.fest-section > h2 { margin-bottom: var(--space-4); font-size: var(--text-lg); }
.fest-section .facts { margin-bottom: 0; }

/* The poster already shows the family's photo; the map panel's plate shows
   its plate and lattice instead (the system's own .tradition--plain look),
   so the page has one picture. */
.fest-aside .map-panel__plate { --tradition-photo: none; --tradition-photo-sm: none; --lattice: 1; --shade: 0; }

/* In the side column the map panel stacks: its two-column form needs more
   width than the column has. */
@media (min-width: 56rem) {
  .fest-aside .map-panel { grid-template-columns: minmax(0, 1fr); }
  .fest-aside .map-panel__plate { min-height: 6rem; }
}

.fest-aside .listing-actions { padding-top: var(--space-2); border-top: 1px solid var(--color-line); }
.fest-aside .listing-actions ul { padding: 0; gap: 0; }
