/* ============================================================
   playlists.css — the selections index (/playlists/) and one selection
   (/playlists/<slug>/). Values follow the "eventail.bg — Селекции" design:
   desktop at 1440px, phone at 390px (<= 720px here). The page shell (.cin-*)
   comes from cinema/cinema.css, the cards from event_cards.css and the buttons
   from base.css; this file adds the rest, scoped to .pl and .pl-*.
   ============================================================ */

/* .cin-empty and others set display; [hidden] has to win (playlists.js hides cards and the empty note). */
.pl [hidden] { display: none !important; }
/* Controls that only work with playlists.js (status filter, share) stay out until it runs (.pl-js). */
.pl:not(.pl-js) [data-pl-needs-js] { display: none !important; }
/* cinema.css rings every focused link; event and selection cards have their own ring (event_cards.css). */
.pl .ev-card__link:focus-visible { outline: none; }

/* ---- Covers: a mosaic of the selection's posters ---- */

.pl-cover {
  position: relative; display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3px; overflow: hidden; border-radius: 14px; background: #ece6f5;
}
.pl-cover__img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.pl-cover__img.is-broken { visibility: hidden; }
/* Four posters fill the 2×2; with three the first takes the left column, with two each takes a
   column, one takes it all (not in design: fewer than the design's 3 or 4 posters). */
.pl-cover--n3 > .pl-cover__img:first-child,
.pl-cover--n2 > .pl-cover__img { grid-row: 1 / 3; }
.pl-cover--n1 > .pl-cover__img { grid-row: 1 / 3; grid-column: 1 / 3; }
.pl-cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(20, 10, 40, 0) 55%, rgba(20, 10, 40, 0.28) 100%);
}
.pl-cover .ev-cat { z-index: 1; }

/* The count: a purple admission ticket stuck on the cover ("Брояч 8" in the design), notched at
   both ends, a dashed rule inside, tilted. Not an event's date badge, so a selection never reads
   as one event. Hovering a card (or focusing it) flicks it once, and it settles back where it was. */
.pl-ticket {
  position: absolute; left: 12px; top: 14px; z-index: 2;
  transform: rotate(-3deg); transform-origin: 50% 50%; /* tilts and flicks about its centre: both ends move */
  filter: drop-shadow(0 3px 6px rgba(20, 10, 40, 0.3));
  pointer-events: none;
}
.pl-ticket__t {
  --notch: 7px;
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 18px; box-sizing: border-box;
  border-radius: 3px; background: #6b3bb5; color: #ffffff; white-space: nowrap;
  font: 800 12.5px/1 Montserrat, system-ui, sans-serif; letter-spacing: 0.02em;
  outline: 1.5px dashed rgba(255, 255, 255, 0.4); outline-offset: -5px;
  -webkit-mask: radial-gradient(circle at 0 50%, #0000 var(--notch), #000 calc(var(--notch) + 0.5px)) left / 51% 100% no-repeat,
                radial-gradient(circle at 100% 50%, #0000 var(--notch), #000 calc(var(--notch) + 0.5px)) right / 51% 100% no-repeat;
  mask: radial-gradient(circle at 0 50%, #0000 var(--notch), #000 calc(var(--notch) + 0.5px)) left / 51% 100% no-repeat,
        radial-gradient(circle at 100% 50%, #0000 var(--notch), #000 calc(var(--notch) + 0.5px)) right / 51% 100% no-repeat;
}
.pl-ticket__n { font: 700 18px/1 "Space Grotesk", Montserrat, system-ui, sans-serif; }
/* Bigger on the big covers: "Избор на седмицата" and a selection's own page */
.pl-cover--hero .pl-ticket, .pl-cover--feat .pl-ticket { left: 16px; top: 18px; }
.pl-cover--hero .pl-ticket__t, .pl-cover--feat .pl-ticket__t { --notch: 8px; height: 42px; padding: 0 22px; gap: 8px; font-size: 14px; }
.pl-cover--hero .pl-ticket__n, .pl-cover--feat .pl-ticket__n { font-size: 21px; }
@media (hover: hover) {
  .pl-card:hover .pl-ticket, .pl-feat:hover .pl-ticket { animation: pl-ticket-flick 0.6s ease-out; }
}
.pl-card:focus-within .pl-ticket, .pl-feat:focus-within .pl-ticket { animation: pl-ticket-flick 0.6s ease-out; }
/* A wobble about its centre that ends exactly at rest: its tilt and place */
@keyframes pl-ticket-flick {
  0%, 100% { transform: rotate(-3deg); }
  25% { transform: rotate(4deg) translateY(-3px); }
  55% { transform: rotate(-6deg) translateY(-1px); }
  80% { transform: rotate(-1.5deg); }
}
@media (prefers-reduced-motion: reduce) {
  .pl-card:hover .pl-ticket, .pl-feat:hover .pl-ticket,
  .pl-card:focus-within .pl-ticket, .pl-feat:focus-within .pl-ticket { animation: none; }
}
.pl-cover--hero { aspect-ratio: 4 / 5; border-radius: 16px; }
.pl-cover--feat { aspect-ratio: 3 / 2; border-radius: 16px; }

/* Status pill: the category pill with a coloured dot */
.pl-status-pill .ev-cat__dot { background: #1f9d6b; }
.pl-status-pill.is-soon .ev-cat__dot { background: #e89a12; }
.pl-status-pill.is-past .ev-cat__dot { background: #8a7ca2; } /* only a person's own selection shows when past */

/* ---- Index: "Избор на седмицата" ---- */

.pl-feat {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; align-items: center;
  margin-top: 24px; padding: 16px; border-radius: 24px; background: #ffffff; box-shadow: 0 18px 40px rgba(43, 31, 68, 0.08);
}
/* Stretch both ways: with only align-self the 3:2 cover grows wider than its column once the copy is taller. */
.pl-feat .pl-cover--feat { align-self: stretch; justify-self: stretch; }
.pl-cover--feat.pl-cover--n1 > .pl-cover__img { object-fit: contain; } /* a lone poster, whole rather than cropped to 3:2 */
.pl-feat__copy { min-width: 0; padding: 8px 24px 8px 0; }
.pl-feat__title { margin: 8px 0 0; font-size: 30px; line-height: 36px; font-weight: 900; letter-spacing: -0.01em; color: #1b1b24; overflow-wrap: anywhere; }
.pl-feat__desc { margin: 12px 0 0; max-width: 52ch; font-size: 15px; line-height: 23px; font-weight: 500; color: #3c3450; overflow-wrap: anywhere; }

/* ---- Meta line and actions ---- */

.pl-meta { margin: 14px 0 0; font-size: 13px; line-height: 18px; font-weight: 600; color: #6e6388; }
.pl-meta__strong { color: #6b3bb5; font-weight: 700; }
.pl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.pl-actions .primary,
.pl-actions .ghost {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; box-sizing: border-box;
  border-radius: 12px; font-family: inherit; font-size: 14px; font-weight: 700;
}
.pl-actions .ghost { border: 1px solid #e3d9f2; background: #ffffff; color: #4b2a8a; }
.pl-actions .ghost:hover { border-color: #c4afea; background: #f4effb; }
.pl-actions .ghost.is-active { border-color: #c4afea; background: #f4effb; } /* not in design: "Копирано" */
.pl-actions a.primary { text-decoration: none; } /* the owner's "Редактирай" */
.pl-own-note { margin: 10px 0 0; font-size: 12.5px; line-height: 17px; font-weight: 600; color: #6e6388; } /* not in design */
/* The save buttons' heart does what the cards' does (.ev-fav, event_cards.css): it fills, pops and
   bursts a ring when saved (playlists.js adds .is-pop). In the accent on the white "Запази"; white
   on the purple "Запази селекцията". */
.pl-heart { position: relative; display: inline-grid; place-items: center; }
.pl-heart::after {
  content: ""; position: absolute; inset: -7px; border: 2px solid currentColor; border-radius: 50%;
  opacity: 0; pointer-events: none;
}
.pl-actions .ghost .pl-heart { color: var(--ev-accent, #8f4ad8); }
.pl-actions [data-saved="true"] .pl-heart svg { fill: currentColor; }
.pl-actions [data-saved="true"].is-pop .pl-heart svg { animation: ev-pop 0.5s cubic-bezier(0.3, 1.7, 0.5, 1); }
.pl-actions [data-saved="true"].is-pop .pl-heart::after { animation: ev-burst 0.55s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .pl-actions [data-saved="true"].is-pop .pl-heart svg,
  .pl-actions [data-saved="true"].is-pop .pl-heart::after { animation: none; }
}

/* ---- Index: status segment ---- */

.pl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.pl-status .cin-radius__opt { gap: 6px; border: none; background: transparent; font-family: inherit; cursor: pointer; }
.pl-status .cin-radius__opt[aria-pressed="true"] {
  background: #ffffff; color: var(--cin-brand); box-shadow: 0 1px 3px rgba(60, 30, 110, 0.16);
}
.pl-status__n { font-family: var(--cin-num); font-size: 12px; font-weight: 600; color: var(--cin-soft); } /* design: #8a7ca2, too faint at 12px (3.4:1) */
.pl-status [aria-pressed="true"] .pl-status__n { color: var(--cin-brand); }
.pl-section { margin-top: 28px; min-width: 0; }

/* ---- Selection cards: the event card with a mosaic and a status pill ---- */

.pl-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 20px; }
.pl-card-wrap { min-width: 0; }
.pl-card__media { aspect-ratio: 3 / 2; background: transparent; }
.pl-card__media .pl-cover { position: absolute; inset: 0; border-radius: 14px; }
.pl-card__title { font-size: 17px; line-height: 22px; }
/* not in design: the selection's theme, as a small label above its title */
.pl-card__theme {
  margin: 0 0 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: 11px; line-height: 14px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cin-brand, #6b3bb5);
}
/* Up to two lines: a long curator ("Национален дворец на културата") shouldn't end in "…". */
.pl-card__curator {
  margin-top: 3px; color: #6e6388;
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.pl-card__cta { font-size: 13.5px; line-height: 18px; font-weight: 700; color: #6b3bb5; }
.pl-card .ev-cal { pointer-events: none; }
@media (hover: hover) { .pl-card:hover .ev-cal__circle { background: #6b3bb5; color: #ffffff; } }

/* ---- Detail: hero ---- */

.pl-hero {
  display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 36px; align-items: start;
  margin-top: 20px; padding: 16px; border-radius: 24px; background: #ffffff; box-shadow: 0 18px 40px rgba(43, 31, 68, 0.08);
}
.pl-hero__copy { min-width: 0; padding: 12px 24px 12px 0; }
.pl-hero--bare { grid-template-columns: minmax(0, 1fr); } /* not in design: a selection without events has no cover */
.pl-hero--bare .pl-hero__copy { padding-left: 24px; }
.pl-hero__title { margin: 6px 0 0; font-size: 38px; line-height: 44px; font-weight: 900; letter-spacing: -0.015em; color: #1b1b24; overflow-wrap: anywhere; }
.pl-hero__desc { margin: 14px 0 0; font-size: 15.5px; line-height: 24px; font-weight: 500; color: #3c3450; max-width: 60ch; white-space: pre-line; overflow-wrap: anywhere; }

.pl-next { margin-top: 26px; padding-top: 20px; border-top: 1px solid #efeaf6; }
.pl-next__list { list-style: none; display: grid; gap: 6px; margin: 8px 0 0; padding: 0; min-width: 0; }
.pl-next__item { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 8px 10px 8px 8px; border-radius: 14px; background: #f4effb; }
.pl-next__date {
  flex: none; display: flex; flex-direction: column; align-items: center; min-width: 48px; padding: 4px 0 5px;
  border-radius: 10px; background: #ffffff; box-shadow: 0 2px 8px rgba(20, 10, 40, 0.10);
}
.pl-next__band { font-size: 9.5px; line-height: 12px; font-weight: 800; letter-spacing: 0.06em; color: #6b3bb5; }
.pl-next__num { font: 700 18px/22px var(--cin-num); color: #1b1b24; }
.pl-next__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pl-next__title { font-size: 14.5px; line-height: 19px; font-weight: 800; color: #1b1b24; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-next__title:hover { color: #6b3bb5; }
.pl-next__meta { font-size: 12.5px; line-height: 17px; font-weight: 500; color: #5b5070; }
.pl-next__price { flex: none; font: 700 14px/18px var(--cin-num); color: #1b1b24; }
.pl-next__all { display: inline-block; margin-top: 10px; font-size: 13px; line-height: 18px; font-weight: 700; color: #6b3bb5; }
.pl-next__all:hover { text-decoration: underline; }

/* ---- Detail: programme by day ---- */

.pl-day + .pl-day { margin-top: 32px; }
.pl-day__title { margin: 0 0 14px; font-size: 16px; line-height: 22px; font-weight: 800; color: #2c2438; }
.pl-day__n { font-weight: 600; color: #6e6388; }
.pl .ev-card.is-past .ev-card__img { opacity: 0.85; }
.pl .ev-card.is-past .ev-card__title,
.pl .ev-card.is-past .ev-card__price { color: #6e6388; }
.pl .ev-card.is-past .ev-cal { visibility: hidden; }

/* ---- In between (not in design) ---- */

@media (max-width: 1100px) {
  .pl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-hero { grid-template-columns: 320px minmax(0, 1fr); gap: 28px; }
  .pl-hero__title { font-size: 32px; line-height: 38px; }
}
@media (max-width: 900px) {
  .pl-feat { gap: 24px; }
  .pl-feat__copy { padding-right: 8px; }
  .pl-feat__title { font-size: 26px; line-height: 32px; }
  .pl-hero { grid-template-columns: 260px minmax(0, 1fr); gap: 24px; }
  .pl-hero__copy { padding-right: 8px; }
}

/* ---- Phone ---- */

@media (max-width: 720px) {
  .pl .cin-h2__count { display: block; }
  .pl-feat { display: block; margin-top: 18px; padding: 10px; border-radius: 20px; }
  .pl-feat__copy { padding: 12px 8px 8px; }
  .pl-feat__title { font-size: 24px; line-height: 30px; }
  .pl-feat__desc { font-size: 14px; line-height: 21px; }
  .pl-dot { display: none; }
  .pl-actions .primary,
  .pl-actions .ghost { flex: 1; justify-content: center; padding: 0 12px; font-size: 13.5px; white-space: nowrap; }
  .pl-hero .pl-actions .primary { flex: 1 0 100%; }
  .pl-bar { display: block; margin-top: 22px; }
  .pl-status-wrap { margin: 0 -20px; padding: 0 20px 2px; overflow-x: auto; scrollbar-width: none; }
  .pl-status-wrap::-webkit-scrollbar { display: none; }
  .pl-status { display: flex; width: max-content; max-width: none; }
  .pl-status .cin-radius__opt { flex: none; padding: 0 12px; font-size: 12.5px; }
  .pl-status__n { display: none; }
  .pl-section { margin-top: 22px; }
  .pl-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pl-hero { display: block; margin-top: 14px; padding: 10px; border-radius: 20px; }
  .pl-cover--hero { aspect-ratio: 1; }
  .pl-hero__copy,
  .pl-hero--bare .pl-hero__copy { padding: 14px 8px 8px; }
  .pl-hero__title { font-size: 28px; line-height: 34px; }
  .pl-hero__desc { font-size: 14.5px; line-height: 22px; }
  .pl-day + .pl-day { margin-top: 26px; }
}

/* ---- Profile: saved selections (not in design) ---- */

.profile-pl { display: contents; } /* one playlists.js root around the profile's two selection sections */
.profile-card__more { margin-left: 8px; font-size: 14px; font-weight: 700; color: #6b3bb5; text-decoration: none; }
.profile-card__more:hover { text-decoration: underline; }

.profile-card .pl-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; padding-bottom: 12px; }
