/*
 * Cromarty Cinema – screening pages
 * Styles for the screening shortcodes used in the Blocksy Content Blocks,
 * plus the tweaks to Blocksy's product page on screenings only
 * (scoped to the product container, which WooCommerce marks product_cat-screenings).
 *
 * The look follows the film pages: square corners, white boxes on the yellow
 * brand colour, yellow buttons with black text, Archivo at light weights and
 * the dark grey (#424142) used for headings.
 */

div.product.product_cat-screenings {
	--ccs-ink: #000;
	--ccs-heading: var(--theme-palette-color-4, #424142);
	--ccs-muted: #5a5a5a;
	--ccs-line: var(--theme-palette-color-7, #e4e4e4);
	--ccs-soft: var(--theme-palette-color-6, #edeff2);
	--ccs-accent: var(--theme-palette-color-1, #ffce1e);
	--ccs-box-pad: 18px;
}

div.product.product_cat-screenings .ccs-icon { flex-shrink: 0; width: 20px; height: 20px; }

/* ---------------------------------------------------------------------------
 * Blocksy product page: hide what the content blocks replace
 * ------------------------------------------------------------------------ */

/* Only once the booking card content block is on the page, so a screening
   never loses its price or Book button if the block is unpublished. */
div.product.product_cat-screenings .entry-summary:has(.ccs-card) > .price,
div.product.product_cat-screenings .entry-summary:has(.ccs-card) > .showingdt,
div.product.product_cat-screenings .entry-summary:has(.ccs-card) > .ct-product-divider,
div.product.product_cat-screenings .entry-summary:has(.ccs-card) > .product_meta,
div.product.product_cat-screenings .entry-summary:has(.ccs-card) > .ct-payment-methods,
div.product.product_cat-screenings.product-type-external .entry-summary:has(.ccs-card) > .ct-product-add-to-cart,
div.product.product_cat-screenings:has(.ccs-more) .woocommerce-tabs {
	display: none !important;
}

/* Poster column narrower than Blocksy's default gallery */
div.product.product_cat-screenings .product-entry-wrapper:has(.ccs-card) { --product-gallery-width: 34%; }

/* Title: the film page's large, regular-weight dark grey heading */
div.product.product_cat-screenings .entry-summary:has(.ccs-card) .product_title {
	font-size: clamp(40px, 5.5vw, 80px);
	line-height: 1.1;
	font-weight: 400;
	color: var(--ccs-heading);
	margin-bottom: 8px;
}

/* ---------------------------------------------------------------------------
 * Title area: "15 - BBFC / 101mins / 2026" uses Blocksy's own entry-meta
 * ------------------------------------------------------------------------ */

div.product.product_cat-screenings .ccs-meta {
	margin: 0 0 6px;
	font-size: 24px;
	font-weight: 500;
	text-transform: uppercase;
	color: var(--ccs-heading);
}
div.product.product_cat-screenings .ccs-director { margin: 0 0 20px; font-size: 18px; font-weight: 300; color: var(--ccs-heading); }

div.product.product_cat-screenings .ccs-guests {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 20px;
	padding: 6px 14px;
	background: var(--ccs-accent);
	color: var(--ccs-ink);
	font-size: 17px;
	font-weight: 500;
}

/* ---------------------------------------------------------------------------
 * Booking card: a white box on the yellow brand colour, like the film page
 * showtimes and film details boxes
 * ------------------------------------------------------------------------ */

div.product.product_cat-screenings .ccs-card {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	column-gap: 24px;
	row-gap: 18px;
	margin: 8px auto 24px 0 !important; /* left-aligned, not centred by Blocksy's constrained layout */
	padding: 24px;
	border: var(--ccs-box-pad) solid var(--ccs-accent);
	border-radius: 0;
	background: #fff;
	box-shadow: none;
	scroll-margin-top: 24px;
}
div.product.product_cat-screenings .ccs-card > * { grid-column: 1 / -1; margin-top: 0 !important; margin-bottom: 0 !important; }

/* Date/time and price side by side on the top row of the card */
div.product.product_cat-screenings .ccs-card > .ccs-when { grid-column: 1; align-self: end; }
div.product.product_cat-screenings .ccs-card > .ccs-prices { grid-column: 2; align-self: end; border-top: 0; text-align: right; }
div.product.product_cat-screenings .ccs-card > .ccs-prices .ccs-price-row {
	flex-direction: column;
	align-items: flex-end;
	gap: 0;
	padding: 0;
	border-bottom: 0;
}
div.product.product_cat-screenings .ccs-card > .ccs-prices .ccs-price-row dd { font-size: 48px; font-weight: 400; line-height: 1.1; color: var(--ccs-heading); }
div.product.product_cat-screenings .ccs-card > .ccs-prices .ccs-price-row dt { display: flex; gap: 8px; align-items: baseline; font-size: 18px; font-weight: 300; }
div.product.product_cat-screenings .ccs-card > .ccs-prices .ccs-price-row dt small { display: inline; }

div.product.product_cat-screenings .ccs-alert { margin: 0; padding: 12px 14px; background: #fff4cc; font-weight: 500; font-size: 16px; }

div.product.product_cat-screenings .ccs-when { display: flex; flex-direction: column; gap: 2px; margin: 0; }
div.product.product_cat-screenings .ccs-day { font-size: 18px; font-weight: 300; color: var(--ccs-ink); }
div.product.product_cat-screenings .ccs-time { font-size: 48px; font-weight: 400; line-height: 1.1; color: var(--ccs-heading); }

div.product.product_cat-screenings .ccs-prices { margin: 0; border-top: 1px solid var(--ccs-line); }
div.product.product_cat-screenings .ccs-price-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
	padding: 12px 0;
	border-bottom: 1px solid var(--ccs-line);
}
div.product.product_cat-screenings .ccs-price-row dt { margin: 0; font-size: 17px; font-weight: 600; }
div.product.product_cat-screenings .ccs-price-row dt small { display: block; font-size: 14px; font-weight: 300; line-height: 1.4; }
div.product.product_cat-screenings .ccs-price-row dt small a { color: var(--ccs-ink); text-underline-offset: 2px; }
div.product.product_cat-screenings .ccs-price-row dd { margin: 0; font-size: 22px; font-weight: 400; }

/* Buttons: the film page's square yellow "Buy Tickets" button, made larger */
div.product.product_cat-screenings .ccs-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 58px;
	margin: 0;
	padding: 5px 24px;
	border-radius: 0;
	font-size: 24px;
	font-weight: 400;
	line-height: 1.3;
	text-align: center;
	text-decoration: none !important;
	transition: background-color 0.15s ease, color 0.15s ease;
}
div.product.product_cat-screenings a.ccs-btn-primary,
div.product.product_cat-screenings a.ccs-btn-accent { background: var(--ccs-accent); color: var(--ccs-ink) !important; }
div.product.product_cat-screenings a.ccs-btn-primary:hover,
div.product.product_cat-screenings a.ccs-btn-accent:hover { background: var(--ccs-ink); color: var(--ccs-accent) !important; }
div.product.product_cat-screenings .ccs-btn .ccs-icon { width: 22px; height: 22px; transition: transform 0.15s ease; }
div.product.product_cat-screenings a.ccs-btn:hover .ccs-icon { transform: translateX(3px); }
div.product.product_cat-screenings a.ccs-btn:focus-visible,
div.product.product_cat-screenings .ccs-other:focus-visible,
div.product.product_cat-screenings .ccs-link:focus-visible {
	outline: 3px solid var(--ccs-ink);
	outline-offset: 3px;
}
div.product.product_cat-screenings .ccs-btn-disabled { background: var(--ccs-soft); color: var(--ccs-muted); font-size: 20px; cursor: default; }

div.product.product_cat-screenings .ccs-handoff { margin: -8px 0 0 !important; font-size: 15px; font-weight: 300; color: var(--ccs-ink); text-align: center; }
div.product.product_cat-screenings .ccs-handoff-left { margin-top: 0 !important; text-align: left; }

div.product.product_cat-screenings .ccs-facts { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 16px; font-weight: 300; }
div.product.product_cat-screenings .ccs-facts li { display: flex; gap: 10px; align-items: flex-start; margin: 0; }
div.product.product_cat-screenings .ccs-facts .ccs-icon { width: 18px; height: 18px; margin-top: 4px; }

div.product.product_cat-screenings .ccs-others { display: flex; flex-direction: column; gap: 8px; }
div.product.product_cat-screenings .ccs-others-label { margin: 0; font-size: 17px; font-weight: 600; }
div.product.product_cat-screenings .ccs-other {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 48px;
	padding: 0 14px;
	border-radius: 0;
	background: var(--ccs-soft);
	color: var(--ccs-ink);
	font-size: 18px;
	font-weight: 400;
	text-decoration: none !important;
}
div.product.product_cat-screenings .ccs-other:hover { background: var(--ccs-accent); color: var(--ccs-ink); }
div.product.product_cat-screenings .ccs-other .ccs-icon { width: 18px; height: 18px; }

/* In-house screenings: style WooCommerce's own ticket button to match */
div.product.product_cat-screenings:not(.product-type-external) .single_add_to_cart_button {
	min-height: 58px;
	border-radius: 0;
	background: var(--ccs-accent) !important;
	color: var(--ccs-ink) !important;
	font-size: 24px;
	font-weight: 400;
}

/* ---------------------------------------------------------------------------
 * About the film + Your visit (the Columns block with the "ccs-more" class)
 * ------------------------------------------------------------------------ */

div.product.product_cat-screenings .ccs-more { margin-top: 64px; margin-bottom: 0; }
div.product.product_cat-screenings .ccs-more h2 { font-size: 32px; font-weight: 400; color: var(--ccs-heading); margin: 0 0 18px; }

div.product.product_cat-screenings .ccs-synopsis { font-size: 22px; font-weight: 400; line-height: 1.65; margin: 0 0 28px; }

div.product.product_cat-screenings .ccs-reviews { display: flex; flex-direction: column; gap: 18px; margin: 0 0 28px; padding: 0; list-style: none; }
div.product.product_cat-screenings .ccs-reviews li { margin: 0; padding: 18px 22px; background: var(--ccs-heading); color: #fff; }
div.product.product_cat-screenings .ccs-stars { display: block; font-size: 22px; letter-spacing: 2px; color: var(--ccs-accent); }
div.product.product_cat-screenings .ccs-reviews q { display: block; font-size: 18px; font-weight: 300; font-style: italic; }
div.product.product_cat-screenings .ccs-reviews cite { display: block; margin-top: 6px; font-style: normal; font-weight: 600; font-size: 15px; }
div.product.product_cat-screenings .ccs-reviews cite a { color: #fff; }

/* Film details: same as the film page's details table */
div.product.product_cat-screenings .ccs-details { margin: 0 0 8px; }
div.product.product_cat-screenings .ccs-details > div {
	display: grid;
	grid-template-columns: 110px minmax(0, 1fr);
	gap: 16px;
	padding: 0 0 12px;
	font-size: 17px;
}
div.product.product_cat-screenings .ccs-details dt { margin: 0; font-weight: 600; }
div.product.product_cat-screenings .ccs-details dd { margin: 0; font-weight: 300; }

div.product.product_cat-screenings .ccs-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 44px;
	margin-bottom: 28px;
	color: var(--ccs-ink);
	font-size: 17px;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 3px;
}
div.product.product_cat-screenings .ccs-link .ccs-icon { width: 16px; height: 16px; }

div.product.product_cat-screenings .ccs-video {
	position: relative;
	overflow: hidden;
	margin-top: 8px;
	background: #1e2326;
	aspect-ratio: 16 / 9;
}
div.product.product_cat-screenings .ccs-video img,
div.product.product_cat-screenings .ccs-video iframe { display: block; width: 100%; height: 100%; object-fit: cover; border: 0; }
div.product.product_cat-screenings .ccs-video-facade { display: block; width: 100%; height: 100%; }
div.product.product_cat-screenings .ccs-video-embed iframe { position: absolute; inset: 0; }

/* Your visit: white box on yellow, like the film page panels */
div.product.product_cat-screenings .ccs-visit {
	padding: 24px;
	border: var(--ccs-box-pad) solid var(--ccs-accent);
	background: #fff;
}
div.product.product_cat-screenings .ccs-visit h2 { font-size: 26px; }
div.product.product_cat-screenings .ccs-visit ul { margin: 0 0 12px; padding-left: 20px; list-style: disc outside; font-size: 17px; font-weight: 300; }
div.product.product_cat-screenings .ccs-visit li { margin: 0 0 10px; }
div.product.product_cat-screenings .ccs-visit p { font-size: 17px; }
div.product.product_cat-screenings .ccs-visit a { color: var(--ccs-ink); font-weight: 500; text-underline-offset: 3px; }

/* ---------------------------------------------------------------------------
 * Final call to action: full yellow band with the dark grey heading colour
 * ------------------------------------------------------------------------ */

div.product.product_cat-screenings .ccs-final {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin: 56px 0 0;
	padding: 32px 36px;
	background: var(--ccs-accent);
	color: var(--ccs-ink);
}
div.product.product_cat-screenings .ccs-final-when { display: flex; flex-direction: column; gap: 2px; margin: 0; }
div.product.product_cat-screenings .ccs-final-when span { font-size: 18px; font-weight: 300; }
div.product.product_cat-screenings .ccs-final-when strong { font-size: 32px; font-weight: 400; color: var(--ccs-heading); }
div.product.product_cat-screenings .ccs-final .ccs-btn { flex: 0 0 auto; min-width: 260px; }
div.product.product_cat-screenings .ccs-final a.ccs-btn-accent { background: #fff; }
div.product.product_cat-screenings .ccs-final a.ccs-btn-accent:hover { background: var(--ccs-ink); color: var(--ccs-accent) !important; }

/* Sticky bar is mobile-only */
div.product.product_cat-screenings .ccs-sticky { display: none; }

/* ---------------------------------------------------------------------------
 * Mobile: small poster beside the title, card full width underneath
 * ------------------------------------------------------------------------ */

@media (max-width: 689.98px) {
	div.product.product_cat-screenings { --ccs-box-pad: 12px; }
	div.product.product_cat-screenings .product-entry-wrapper:has(.ccs-card) { display: block; }
	div.product.product_cat-screenings .product-entry-wrapper:has(.ccs-card) .woocommerce-product-gallery {
		float: left;
		width: 112px !important;
		margin: 0 16px 12px 0 !important;
	}
	div.product.product_cat-screenings .product-entry-wrapper:has(.ccs-card) .woocommerce-product-gallery__trigger { display: none; }
	div.product.product_cat-screenings .product-entry-wrapper:has(.ccs-card) .entry-summary { display: block; }
	div.product.product_cat-screenings .entry-summary:has(.ccs-card) .product_title { font-size: 36px; line-height: 1.1; }
	div.product.product_cat-screenings .ccs-meta { font-size: 16px; }
	div.product.product_cat-screenings .ccs-director { font-size: 16px; margin-bottom: 12px; }
	div.product.product_cat-screenings .ccs-guests { font-size: 15px; padding: 4px 10px; }

	div.product.product_cat-screenings .ccs-card { clear: both; max-width: none; padding: 18px; gap: 16px; }
	div.product.product_cat-screenings .ccs-time { font-size: 38px; }
	div.product.product_cat-screenings .ccs-card { column-gap: 16px; }
	div.product.product_cat-screenings .ccs-card > .ccs-prices .ccs-price-row dd { font-size: 38px; }
	div.product.product_cat-screenings .ccs-card > .ccs-prices .ccs-price-row dt { font-size: 17px; }
	div.product.product_cat-screenings .ccs-day { font-size: 17px; }
	div.product.product_cat-screenings .ccs-btn { min-height: 54px; font-size: 22px; }
	div.product.product_cat-screenings .ccs-handoff { font-size: 14px; }
	div.product.product_cat-screenings .ccs-facts { font-size: 15px; }

	div.product.product_cat-screenings .ccs-more { margin-top: 36px; }
	div.product.product_cat-screenings .ccs-more h2 { font-size: 26px; margin-bottom: 12px; }
	div.product.product_cat-screenings .ccs-synopsis { font-size: 18px; }
	div.product.product_cat-screenings .ccs-details > div { grid-template-columns: 96px minmax(0, 1fr); font-size: 16px; }
	div.product.product_cat-screenings .ccs-visit { padding: 18px; }

	div.product.product_cat-screenings .ccs-final { flex-direction: column; align-items: stretch; margin-top: 36px; padding: 22px 20px; }
	div.product.product_cat-screenings .ccs-final-when strong { font-size: 26px; }
	div.product.product_cat-screenings .ccs-final .ccs-btn { min-width: 0; }

	div.product.product_cat-screenings .ccs-sticky:not([hidden]) {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 50;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		margin: 0;
		padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
		background: #fff;
		border-top: 4px solid var(--ccs-accent);
		box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.08);
		transform: translateY(110%);
		transition: transform 0.2s ease;
	}
	div.product.product_cat-screenings .ccs-sticky.is-visible { transform: translateY(0); }
	div.product.product_cat-screenings .ccs-sticky p { display: flex; flex-direction: column; margin: 0; line-height: 1.3; }
	div.product.product_cat-screenings .ccs-sticky strong { font-size: 17px; font-weight: 500; color: var(--ccs-ink); }
	div.product.product_cat-screenings .ccs-sticky span { font-size: 14px; font-weight: 300; }
	div.product.product_cat-screenings .ccs-sticky .ccs-btn { min-height: 46px; padding: 0 18px; font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
	div.product.product_cat-screenings .ccs-btn,
	div.product.product_cat-screenings .ccs-btn .ccs-icon,
	div.product.product_cat-screenings .ccs-sticky { transition: none !important; }
}

/* "More about this film": the theme's standard button */
div.product.product_cat-screenings .ccs-film-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 8px 0 28px;
	text-decoration: none;
}
div.product.product_cat-screenings .ccs-film-link .ccs-icon { width: 16px; height: 16px; }

/* Special offer text from the screening's "Offer text" field */
div.product.product_cat-screenings .ccs-offer {
	margin: 0;
	padding: 10px 14px;
	background: var(--ccs-accent);
	color: var(--ccs-ink);
	font-size: 17px;
	font-weight: 500;
	text-align: center;
}
