/**
 * PWD Tour Cards - Single tour page styles.
 *
 * Loaded on single Tour pages and wherever a section shortcode or widget is
 * used. Colours, radius and fonts come from the same custom properties as the
 * cards, compiled from the design store by PWD_Tour_Cards_Style_Compiler.
 *
 * Two layers, deliberately separate:
 *   .pwd-tour-single    the plugin's own page wrapper. It is a page, so it may
 *                       have a width and page padding.
 *   .pwd-tour-section   one block of content. Zero top margin, 16px bottom,
 *                       no horizontal margin, no outer padding and no width,
 *                       so Elementor's spacing controls take over cleanly with
 *                       nothing to fight. No !important anywhere, so any
 *                       Elementor override wins on specificity alone.
 */

.pwd-tour-single {
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px 16px 60px;
	font-family: var( --pwd-tour-font-body, inherit );
	color: var( --pwd-tour-text, #1a1a1a );
}

/* ---------- Section wrapper (the shortcode spacing rule) ---------- */
.pwd-tour-section {
	margin: 0 0 16px;
	padding: 0;
	font-family: var( --pwd-tour-font-body, inherit );
	color: var( --pwd-tour-text, #1a1a1a );
}
.pwd-tour-section-title {
	font-family: var( --pwd-tour-font-heading, inherit );
	font-size: 22px;
	line-height: 1.25;
	margin: 0 0 14px;
}

/* Cards and grids follow the same rule, so every plugin block behaves alike. */
.pwd-tour-cards-grid {
	margin: 0 0 16px;
}
.pwd-tour-cards-grid > .pwd-tour-card {
	margin-bottom: 0;
}

/* ---------- Header ---------- */
.pwd-tour-single-header {
	position: relative;
	margin-bottom: 16px;
}
.pwd-tour-single-title {
	font-family: var( --pwd-tour-font-heading, inherit );
	font-size: clamp( 24px, 3vw, 34px );
	line-height: 1.2;
	margin: 6px 0 10px;
}
.pwd-tour-single-meta-row {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-bottom: 6px;
}
.pwd-tour-single-header .pwd-tour-badge {
	position: static;
	display: inline-block;
	margin-bottom: 6px;
}

.pwd-tour-single-hero {
	border-radius: var( --pwd-tour-radius, 8px );
	overflow: hidden;
	margin-bottom: 28px;
	line-height: 0;
}
.pwd-tour-single-hero img {
	width: 100%;
	height: auto;
	display: block;
}

/* ---------- Description ---------- */
.pwd-tour-single-content {
	line-height: 1.7;
}
.pwd-tour-single-content > :first-child { margin-top: 0; }
.pwd-tour-single-content > :last-child { margin-bottom: 0; }

/* ---------- Booking button ---------- */
.pwd-tour-single-cta .pwd-tour-cta {
	display: flex;
	width: 100%;
}

/* ---------- Info blocks ---------- */
.pwd-tour-info-blocks {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.pwd-tour-info-block {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: 13.5px;
}
.pwd-tour-info-block strong { display: block; font-size: 13.5px; }
.pwd-tour-info-block p { margin: 2px 0 0; color: rgba( 0, 0, 0, 0.6 ); font-size: 12.5px; line-height: 1.4; }
.pwd-tour-info-icon { color: var( --pwd-tour-primary, #ef7d24 ); flex: 0 0 auto; }
.pwd-tour-info-icon svg { width: 20px; height: 20px; }

/* ---------- Contact ----------
 * Self-contained since 2.7.0. It used to sit inside the sidebar and borrow its
 * background and its separating border, neither of which exists now that it is
 * a block the client can place anywhere.
 */
.pwd-tour-contact-box {
	background: var( --pwd-card-band, #f6f6f6 );
	border-radius: var( --pwd-tour-radius, 8px );
	padding: 16px 18px;
	font-size: 13px;
}
.pwd-tour-contact-box p { margin: 2px 0 10px; color: rgba( 0, 0, 0, 0.6 ); }
.pwd-tour-contact-link {
	display: flex;
	align-items: center;
	gap: 8px;
	color: inherit;
	text-decoration: none;
	margin-bottom: 8px;
}
.pwd-tour-contact-link:last-child { margin-bottom: 0; }
.pwd-tour-contact-link svg { width: 16px; height: 16px; color: var( --pwd-tour-primary, #ef7d24 ); }

/* ---------- Lists (Highlights / Included / Excluded) ---------- */
.pwd-tour-single-lists {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}
@media ( max-width: 560px ) {
	.pwd-tour-single-lists { grid-template-columns: 1fr; }
}
.pwd-tour-list h3 {
	font-family: var( --pwd-tour-font-heading, inherit );
	font-size: 17px;
	margin: 0 0 10px;
}
.pwd-tour-list ul { list-style: none; margin: 0; padding: 0; }
.pwd-tour-list li {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 14px;
	padding: 5px 0;
}
.pwd-tour-list-icon svg { width: 16px; height: 16px; }
.pwd-tour-list--highlight .pwd-tour-list-icon,
.pwd-tour-list--included .pwd-tour-list-icon { color: var( --pwd-tour-primary, #ef7d24 ); }
.pwd-tour-list--excluded .pwd-tour-list-icon { color: #c0392b; }

/* ---------- Gallery ----------
 * The caption sits under a gradient that fades in on hover. Where there is no
 * hover, it is simply always visible: a tap-to-reveal would spend the visitor's
 * first tap on something they did not ask for, and nothing here is worth that.
 */
.pwd-tour-gallery {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat( var( --pwd-gallery-cols, 3 ), minmax( 0, 1fr ) );
}
.pwd-tour-gallery--cols-2 { --pwd-gallery-cols: 2; }
.pwd-tour-gallery--cols-3 { --pwd-gallery-cols: 3; }
.pwd-tour-gallery--cols-4 { --pwd-gallery-cols: 4; }

@media ( max-width: 780px ) {
	.pwd-tour-gallery { grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); }
}
@media ( max-width: 460px ) {
	.pwd-tour-gallery { grid-template-columns: minmax( 0, 1fr ); }
}

.pwd-tour-gallery-item {
	position: relative;
	margin: 0;
	overflow: hidden;
	border-radius: var( --pwd-tour-radius, 8px );
	line-height: 0;
}
.pwd-tour-gallery-item img {
	width: 100%;
	height: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}
.pwd-tour-gallery--hover-overlay .pwd-tour-gallery-item:hover img {
	transform: scale( 1.06 );
}

.pwd-tour-gallery-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 14px;
	background: linear-gradient( to top, rgba( 0, 0, 0, 0.72 ) 0%, rgba( 0, 0, 0, 0.15 ) 45%, rgba( 0, 0, 0, 0 ) 75% );
	opacity: 0;
	transition: opacity 0.25s ease;
	line-height: 1.35;
}
.pwd-tour-gallery-item:hover .pwd-tour-gallery-overlay,
.pwd-tour-gallery-item:focus-within .pwd-tour-gallery-overlay {
	opacity: 1;
}
.pwd-tour-gallery-caption {
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	text-shadow: 0 1px 2px rgba( 0, 0, 0, 0.4 );
}
.pwd-tour-gallery-icon { color: #fff; flex: 0 0 auto; }
.pwd-tour-gallery-icon svg { width: 18px; height: 18px; }

.pwd-tour-gallery-plaincap {
	font-size: 12.5px;
	line-height: 1.4;
	color: rgba( 0, 0, 0, 0.6 );
	padding: 6px 2px 0;
}

@media ( hover: none ) {
	.pwd-tour-gallery-overlay { opacity: 1; }
}
@media ( prefers-reduced-motion: reduce ) {
	.pwd-tour-gallery-item img,
	.pwd-tour-gallery-overlay { transition: none; }
	.pwd-tour-gallery--hover-overlay .pwd-tour-gallery-item:hover img { transform: none; }
}

/* ---------- Itinerary timeline ----------
 * All three styles share one renderer and differ by this wrapper class. The
 * text is clamped rather than only capped on input, because what keeps timeline
 * cards even is the number of rendered lines, not the number of characters.
 */
.pwd-tour-itinerary {
	position: relative;
	padding-left: 22px;
	border-left: 2px dashed #e2a97a;
}
.pwd-tour-stop {
	position: relative;
	display: flex;
	gap: 14px;
	padding-bottom: 22px;
}
.pwd-tour-stop:last-child { padding-bottom: 0; }
.pwd-tour-stop-marker {
	position: absolute;
	left: -28px;
	top: 4px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #cfcfcf;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px #cfcfcf;
}
.pwd-tour-stop--main .pwd-tour-stop-marker {
	background: var( --pwd-tour-primary, #ef7d24 );
	box-shadow: 0 0 0 1px var( --pwd-tour-primary, #ef7d24 );
}
.pwd-tour-stop-image {
	flex: 0 0 90px;
	width: 90px;
	height: 68px;
	border-radius: 6px;
	overflow: hidden;
}
.pwd-tour-stop-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pwd-tour-stop-body { min-width: 0; flex: 1 1 auto; }
.pwd-tour-stop-body h4 {
	margin: 0 0 4px;
	font-size: 15px;
	font-family: var( --pwd-tour-font-heading, inherit );
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.pwd-tour-stop-body p {
	margin: 0 0 6px;
	font-size: 13.5px;
	color: rgba( 0, 0, 0, 0.65 );
	line-height: 1.5;
}
.pwd-tour-stop-meta {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 12px;
	color: rgba( 0, 0, 0, 0.55 );
}
.pwd-tour-stop-badge {
	background: #f3d9c4;
	color: #8a4a1c;
	padding: 2px 8px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 11px;
}
.pwd-tour-stop-icon svg { width: 14px; height: 14px; }
.pwd-tour-stop-duration { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.pwd-tour-stop-duration svg { width: 13px; height: 13px; }

/* Stacked: the v1 look, three rendered lines of description. */
.pwd-tour-itinerary--stacked .pwd-tour-stop-body p {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Compact: no thumbnails, tighter rail, title and duration on one line, the
 * description behind a native disclosure so it needs no script at all. */
.pwd-tour-itinerary--compact {
	padding-left: 16px;
}
.pwd-tour-itinerary--compact .pwd-tour-stop {
	padding-bottom: 12px;
}
.pwd-tour-itinerary--compact .pwd-tour-stop-marker {
	left: -22px;
	top: 6px;
	width: 9px;
	height: 9px;
}
.pwd-tour-itinerary--compact .pwd-tour-stop-body {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) auto;
	align-items: baseline;
	column-gap: 12px;
	row-gap: 2px;
}
.pwd-tour-itinerary--compact .pwd-tour-stop-body h4 {
	grid-column: 1;
	grid-row: 1;
	margin: 0;
	-webkit-line-clamp: 1;
}
.pwd-tour-itinerary--compact .pwd-tour-stop-meta {
	grid-column: 2;
	grid-row: 1;
	justify-content: flex-end;
}
.pwd-tour-itinerary--compact .pwd-tour-stop-details {
	grid-column: 1 / -1;
	grid-row: 2;
}
.pwd-tour-stop-details summary {
	cursor: pointer;
	font-size: 12.5px;
	color: var( --pwd-tour-primary, #ef7d24 );
	list-style: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 0;
}
.pwd-tour-stop-details summary::-webkit-details-marker { display: none; }
.pwd-tour-stop-details summary::after {
	content: "";
	width: 6px;
	height: 6px;
	border-right: 1.6px solid currentColor;
	border-bottom: 1.6px solid currentColor;
	transform: rotate( 45deg ) translateY( -2px );
}
.pwd-tour-stop-details[open] summary::after {
	transform: rotate( -135deg ) translateY( -2px );
}
.pwd-tour-stop-details p { margin: 4px 0 0; }

/* Alternating: stops sit either side of a centre rail on desktop and collapse
 * to the single-column rail under 900px. */
@media ( min-width: 900px ) {
	.pwd-tour-itinerary--alternating {
		padding-left: 0;
		border-left: none;
	}
	.pwd-tour-itinerary--alternating::before {
		content: "";
		position: absolute;
		top: 4px;
		bottom: 4px;
		left: 50%;
		border-left: 2px dashed #e2a97a;
	}
	.pwd-tour-itinerary--alternating .pwd-tour-stop {
		width: calc( 50% - 34px );
		background: var( --pwd-card-surface, #fff );
		border: 1px solid var( --pwd-card-border, #e5e5e5 );
		border-radius: var( --pwd-tour-radius, 8px );
		padding: 14px;
		margin-bottom: 18px;
	}
	.pwd-tour-itinerary--alternating .pwd-tour-stop:nth-child( odd ) {
		margin-right: auto;
	}
	.pwd-tour-itinerary--alternating .pwd-tour-stop:nth-child( even ) {
		margin-left: auto;
	}
	.pwd-tour-itinerary--alternating .pwd-tour-stop:nth-child( odd ) .pwd-tour-stop-marker {
		left: auto;
		right: -40px;
	}
	.pwd-tour-itinerary--alternating .pwd-tour-stop:nth-child( even ) .pwd-tour-stop-marker {
		left: -40px;
	}
	.pwd-tour-itinerary--alternating .pwd-tour-stop-body p {
		display: -webkit-box;
		-webkit-line-clamp: 3;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}
}

/* ---------- Map ---------- */
.pwd-tour-map {
	width: 100%;
	height: 360px;
	border-radius: var( --pwd-tour-radius, 8px );
	background: #eee;
}
.pwd-map-pin span {
	display: block;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #1a1a1a;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px rgba( 0, 0, 0, 0.3 );
}
.pwd-map-pin--main span {
	background: var( --pwd-tour-primary, #ef7d24 );
	box-shadow: 0 0 0 1px var( --pwd-tour-primary, #ef7d24 );
}

/* ---------- Related tours ---------- */
.pwd-tour-related-list {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 220px, 1fr ) );
	gap: 16px;
}
