/*
 * Styles for the [pms_current_show], [pms_upcoming_shows], and [pms_season]
 * shortcodes. All three render the same .pms-show-card markup (via render_show());
 * .pms-current-show is just a sizing wrapper so the single "now playing" card can
 * look larger/centered than the cards in the [pms_upcoming_shows]/[pms_season] grid.
 * Button color/shape intentionally left to the theme's existing .sr-alt-button class
 * (already used by [pms_showtimes]).
 */

.pms-show-card,
.pms-show-card-content {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: left;
	gap: .75rem;
	height: 100%;
}

.pms-show-card-poster {
	position: relative;
	display: block;
	margin: 0 auto;
	width: 100%;
}

/*
 * [pms_season] only -- render_show()'s optional $status ("Now Playing"/"Upcoming"/
 * "Closed") renders as this badge over the poster. Class suffix is
 * sanitize_title($status), so it maps to "now-playing"/"upcoming"/"closed" below;
 * any other label just falls back to --contrast-3 rather than going unstyled.
 */
.pms-show-status {
	position: absolute;
	top: .75rem;
	left: .75rem;
	z-index: 1;
	padding: .35rem .85rem;
	border-radius: 999px;
	background-color: var(--contrast-3);
	color: #fff;
	font-size: .8em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
}

.pms-show-status--now-playing {
	background-color: var(--accent-2);
	color: var(--contrast);
}

.pms-show-status--upcoming {
	background-color: var(--contrast-2);
}

.pms-show-status--closed {
	background-color: rgba(0, 0, 0, 0.6);
}

.pms-season .pms-show-status--closed ~ .pms-show-poster {
	opacity: .6;
}

.pms-show-poster {
	display: block;
	width: 100%;
	height: auto;
	border: 6px solid #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.pms-current-show .pms-show-card-poster {
	max-width: 100%;
}

.pms-show-card-title {
	margin: 0;
	line-height: 1.2;
}

.pms-show-card-dates {
	margin: 0;
	font-weight: 700;
}

.pms-show-card-excerpt p {
	margin: 0;
	font-weight: 600;
}

.pms-show-card-excerpt {
	margin-bottom: 1rem;
	flex-grow: 1;
}

.pms-show-card-cta {
	display: inline-block;
	margin-top: auto;
}

/*
 * The theme's .sr-alt-button defaults to accent-colored text on a light background
 * (a text-link-styled button). We repurpose it as a solid accent-filled button here,
 * so an explicit text color is required -- without it, text silently inherits the
 * theme's accent color too, landing exactly on top of this same-color background.
 */
.pms-upcoming-shows .pms-show-card .sr-alt-button {
	background-color: var(--accent);
	color: #fff !important;
}

.pms-upcoming-shows .pms-show-card .sr-alt-button:hover {
	background-color: var(--accent-2);
}

/* [pms_upcoming_shows] grid */
.pms-upcoming-shows {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
}

@media (max-width: 782px) {
	.pms-upcoming-shows {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.pms-upcoming-shows {
		grid-template-columns: 1fr;
	}
}

/*
 * [pms_season columns="N"] -- overrides the desktop column count above. Scoped to
 * min-width: 783px (just above the tablet breakpoint) so the 2-column/1-column
 * collapse rules above still win on smaller screens regardless of N -- a wide
 * desktop grid still stacks down properly on mobile.
 */
@media (min-width: 783px) {
	.pms-season-cols-1 { grid-template-columns: repeat(1, 1fr); }
	.pms-season-cols-2 { grid-template-columns: repeat(2, 1fr); }
	.pms-season-cols-3 { grid-template-columns: repeat(3, 1fr); }
	.pms-season-cols-4 { grid-template-columns: repeat(4, 1fr); }
	.pms-season-cols-5 { grid-template-columns: repeat(5, 1fr); }
	.pms-season-cols-6 { grid-template-columns: repeat(6, 1fr); }
}

/* [pms_season info="posters"] -- poster + badge only, no title/dates/excerpt/button. */
.pms-show-card--poster-only {
	display: block;
	height: auto;
}

.pms-show-card--poster-only .pms-show-card-poster {
	text-decoration: none;
}

/*
 * [pms_showtimes] grid of showtime cards. Each .pms-showtime-row is one performance:
 * date, venue/status chips, a colored time bar, price summary, and a Get Tickets (or
 * Sold Out) action.
 *
 * Column count comes from auto-fit/minmax rather than viewport-width media queries,
 * so it responds to this grid's own rendered width -- an editor narrowing the
 * GenerateBlocks container this shortcode sits in (e.g. on the Season Subscription
 * page's 2-card layout) reflows the cards accordingly, without needing a `columns`
 * attribute or a page-specific CSS override (both would still only really be
 * reacting to viewport width, not the actual box available).
 *
 * Cards alternate between --contrast-3 (odd, .pms-showtime-row--a) and --contrast-2
 * (even, .pms-showtime-row--b) with a thin white border standing in for a gap, so the
 * grid reads as a continuous bordered table rather than floating cards. The CTA uses
 * --accent-2 (a warm gold, not a darker shade of --accent/teal, despite the name) so
 * it pops against the dark card fill.
 */
.pms-showtimes-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 0;
	background-color: var(--contrast-3);
	margin-top: 0;
	padding: 2rem 3rem;
}

.pms-showtime-row {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 1rem;
	padding: 1.75rem;
	border-radius: 0;
	color: #fff;
	border: solid .5px white;
}

.pms-showtime-row--a {
	background-color: var(--contrast-3);
}

.pms-showtime-row--b {
	background-color: var(--contrast-2);
}

.pms-showtime-date,
.pms-showtime-package-name {
	margin: 0;
	font-size: 1.25em;
	font-weight: 700;
}

.pms-showtime-chips {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.pms-showtime-chip {
	display: inline-block;
	padding: .25rem .75rem;
	border-radius: 999px;
	background-color: rgba(255, 255, 255, 0.18);
	font-size: .8em;
	font-weight: 600;
	white-space: nowrap;
}

.pms-showtime-timebar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	padding: .75rem 1rem;
	border-radius: .5rem;
	background-color: rgba(0, 0, 0, 0.2);
	font-weight: 700;
}

.pms-showtime-timeofday {
	font-weight: 600;
	opacity: .85;
}

.pms-showtime-price {
	margin: 0;
	font-size: .9em;
}

.pms-showtime-cta {
	display: block;
	margin-top: auto;
	padding: .85rem 1.5rem;
	border-radius: 999px;
	background-color: var(--accent-2);
	color: var(--contrast) !important;
	text-align: center;
	text-transform: uppercase;
	font-weight: 700;
	letter-spacing: .03em;
	text-decoration: none;
}

a.pms-showtime-cta:hover {
	filter: brightness(0.9);
}

.pms-showtime-cta--soldout {
	opacity: .7;
	cursor: default;
}

/*
 * text="dark" (default) inherits the surrounding page's text color -- no overrides
 * needed. text="light" is for placing the shortcode's "no upcoming performances"
 * empty state on a dark-background section; the cards themselves always sit on a
 * solid --accent/--accent-2 fill (see .pms-showtime-row above) so their own text
 * stays white regardless of this attribute.
 */
.pms-showtimes-empty.pms-showtimes-list--light {
	color: #fff;
}

.pms-showtimes-empty.pms-showtimes-list--dark {
	color: inherit;
}

/*
 * show_id="all" mode: one collapsible .pms-show-group per Show. The header (title +
 * excerpt) is always visible -- even collapsed -- so the excerpt keeps doing its job
 * of enticing someone to open the group. Only the card grid itself lives inside
 * <details>, using the browser's native disclosure widget rather than custom JS.
 */
.pms-show-groups {
	display: flex;
	flex-direction: column;
	gap: 2.5rem;
}

.pms-show-group-header {
	margin-bottom: 1rem;
}

.pms-show-group-title {
	margin: 0 0 .5rem;
}

.pms-show-group-title a {
	color: inherit;
	text-decoration: none;
}

.pms-show-group-title a:hover {
	text-decoration: underline;
}

.pms-show-group-excerpt p {
	margin: 0;
}

.pms-show-group-details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	cursor: pointer;
	padding: 1.25rem 1.75rem;
	border-radius: 0;
	background-color: var(--contrast-3);
	color: #fff;
	font-size: 1.1em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
	list-style: none;
	border: none;
}

.pms-show-group-details > summary::-webkit-details-marker {
	display: none;
}

.pms-show-group-details > summary::after {
	content: "\2304";
	font-size: 1.3em;
	line-height: 1;
	transition: transform .15s ease;
}

.pms-show-group-details[open] > summary::after {
	transform: rotate(180deg);
}

.pms-show-group-details > summary:hover {
	filter: brightness(1.15);
}