/**
 * WP Event Tickets frontend styles.
 */

/* Full-width single event pages (common theme patterns). */
body.wpet-event-full-width.single-wpet_event .site-content,
body.wpet-event-full-width.single-wpet_event #primary,
body.wpet-event-full-width.single-wpet_event .content-area,
body.wpet-event-full-width.single-wpet_event .entry-content,
body.wpet-event-full-width.single-wpet_event .site-main,
body.wpet-event-full-width.single-wpet_event #main-content .container,
body.wpet-event-full-width.single-wpet_event .et_pb_row,
body.wpet-event-full-width.single-wpet_event .ast-container {
	max-width: none !important;
	width: 100% !important;
}

body.wpet-event-full-width.single-wpet_event #main-content .container {
	padding-left: 2rem;
	padding-right: 2rem;
}

/* Themeco X / Pro theme (turvilleweb.com and similar). */
body.wpet-event-full-width.single-wpet_event aside.x-sidebar,
body.wpet-event-full-width.single-wpet_event .x-sidebar.right {
	display: none !important;
}

body.wpet-event-full-width.single-wpet_event .x-main.left,
body.wpet-event-full-width.single-wpet_event .x-main.right {
	width: 100% !important;
	max-width: none !important;
	float: none !important;
}

body.wpet-event-full-width.single-wpet_event .x-container.max.width,
body.wpet-event-full-width.single-wpet_event .x-container.max {
	max-width: 100% !important;
	width: 100% !important;
	box-sizing: border-box;
}

body.wpet-event-full-width.single-wpet_event .x-container.max.width.offset {
	padding-left: 2rem;
	padding-right: 2rem;
}

.wpet-wrap {
	--wpet-accent: #40d9f1;
	--wpet-border: #e0e0e0;
	--wpet-muted: #666;
	position: relative;
}

.wpet-wrap a {
	color: inherit;
}

.wpet-ticket-purchase {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--wpet-border);
}

/* Two-column layout */
.wpet-event-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 2rem;
	align-items: start;
}

.wpet-event-main {
	min-width: 0;
}

.wpet-section-title {
	margin: 1.25rem 0 0.5rem;
	font-size: 1.1rem;
	line-height: 1.35;
	letter-spacing: 0;
	text-transform: none;
	width: auto;
	max-width: none;
	float: none;
	clear: both;
}

.wpet-section-title:first-child {
	margin-top: 0;
}

#wpet-occurrence-select {
	max-width: 100%;
	margin-bottom: 0.5rem;
}

/* Ticket table (original simple style) */
.wpet-ticket-table {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem 0;
}

.wpet-ticket-table th,
.wpet-ticket-table td {
	padding: 0.75rem;
	border-bottom: 1px solid #eee;
	text-align: left;
	vertical-align: top;
}

.wpet-ticket-table input[type="number"] {
	width: 70px;
}

.wpet-availability {
	color: var(--wpet-muted);
}

.wpet-sold-out {
	color: #c00;
	font-weight: 600;
}

.wpet-donation-field {
	margin: 1rem 0;
}

.wpet-attendee-fields {
	margin: 1rem 0;
}

.wpet-attendee-help {
	margin: 0.25rem 0 0.5rem;
	color: var(--wpet-muted);
	font-size: 0.95em;
}

.wpet-purchaser-field input[type="text"],
.wpet-attendee-name-input {
	width: 100%;
	max-width: 420px;
	box-sizing: border-box;
}

.wpet-same-name-toggle {
	margin: 0.75rem 0;
}

.wpet-per-ticket-names {
	display: grid;
	gap: 0.75rem;
	margin-top: 0.75rem;
}

.wpet-is-hidden {
	display: none !important;
}

.wpet-attendee-fields:has(#wpet-same-name-for-all:not(:checked)) .wpet-purchaser-field,
.wpet-attendee-fields:has(#wpet-same-name-for-all:not(:checked)) #wpet-purchaser-name,
.wpet-attendee-fields.wpet-separate-names .wpet-purchaser-field {
	display: none !important;
}

.wpet-attendee-fields:has(#wpet-same-name-for-all:not(:checked)) #wpet-per-ticket-names {
	display: grid !important;
}

.wpet-attendee-fields:has(#wpet-same-name-for-all:checked) #wpet-per-ticket-names {
	display: none !important;
}

.wpet-checkout-attendee-fields {
	margin-bottom: 1.5rem;
}

.wpet-checkout-per-ticket-names {
	margin-top: 0.5rem;
}

.wpet-attendee-name-field label {
	display: block;
	margin-bottom: 0.25rem;
	font-weight: 600;
}

.wpet-donation-help {
	margin: 0.25rem 0 0.5rem;
	color: var(--wpet-muted);
	font-size: 0.95em;
}

.wpet-booking-footer {
	margin: 1rem 0 0.5rem;
}

.wpet-form-message {
	margin-left: 1rem;
}

.wpet-form-message.error {
	color: #c00;
}

.wpet-form-message.success {
	color: #080;
}

.wpet-notice {
	color: var(--wpet-muted);
	font-style: italic;
}

/* Sidebar meta */
.wpet-event-sidebar {
	position: sticky;
	top: 1.5rem;
}

.wpet-frontbox {
	border: 1px solid var(--wpet-border);
	background: #fff;
}

.wpet-wrap .wpet-event-meta .wpet-meta-block {
	display: grid;
	grid-template-columns: minmax(6.5rem, 8.5rem) minmax(0, 1fr);
	column-gap: 1rem;
	row-gap: 0.25rem;
	align-items: start;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--wpet-border);
}

.wpet-wrap .wpet-event-meta .wpet-meta-block:last-child {
	border-bottom: 0;
}

.wpet-wrap .wpet-event-meta .wpet-meta-icon {
	grid-column: 1;
	grid-row: 1 / span 2;
	align-self: start;
	display: inline-block;
	margin: 0.15rem 0 0;
	color: var(--wpet-accent);
}

.wpet-wrap .wpet-event-meta .wpet-meta-block:has(.wpet-meta-icon) {
	grid-template-columns: auto minmax(5.5rem, 7rem) minmax(0, 1fr);
}

.wpet-wrap .wpet-event-meta .wpet-meta-block:has(.wpet-meta-icon) .wpet-meta-title {
	grid-column: 2;
}

.wpet-wrap .wpet-event-meta .wpet-meta-block:has(.wpet-meta-icon) .wpet-meta-value {
	grid-column: 3;
}

.wpet-wrap .wpet-event-meta .wpet-meta-title {
	grid-column: 1;
	grid-row: 1;
	display: block;
	margin: 0;
	width: auto;
	max-width: none;
	float: none;
	clear: none;
	font-size: 0.85rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	line-height: 1.3;
	color: var(--wpet-muted);
}

.wpet-wrap .wpet-event-meta .wpet-meta-value {
	grid-column: 2;
	grid-row: 1;
	display: block;
	margin: 0;
	width: auto;
	max-width: none;
	min-width: 0;
	float: none;
	clear: none;
	font-size: 0.95rem;
	line-height: 1.5;
	color: inherit;
	word-break: break-word;
}

/* Single event shortcode */
.wpet-single-event {
	max-width: none;
}

.wpet-single-event .wpet-event-featured-image {
	margin-bottom: 1.5rem;
	text-align: center;
}

.wpet-single-event .wpet-event-featured-image img {
	max-width: 100%;
	height: auto;
}

/* Events list */
.wpet-events-list {
	display: grid;
	gap: 1.5rem;
}

.wpet-events-list-wrap .wpet-event-card {
	border: 1px solid var(--wpet-border);
	border-radius: 8px;
	padding: 1.25rem;
	background: #fff;
}

.wpet-events-list-wrap .wpet-event-card h3 {
	margin: 0 0 0.5rem;
}

.wpet-event-date {
	color: #555;
	margin: 0.25rem 0;
}

/* Calendar */
.wpet-calendar-wrap {
	margin: 1rem 0;
}

.wpet-cal-toolbar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin-bottom: 1rem;
	flex-wrap: wrap;
}

.wpet-cal-toolbar strong {
	min-width: 160px;
	text-align: center;
}

.wpet-cal-nav {
	border: 1px solid var(--wpet-border);
	background: #fff;
	padding: 0.4rem 0.75rem;
	cursor: pointer;
}

.wpet-cal-weekdays,
.wpet-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}

.wpet-cal-weekdays {
	margin-bottom: 4px;
}

.wpet-cal-weekday {
	text-align: center;
	font-size: 12px;
	font-weight: 600;
	color: var(--wpet-muted);
}

.wpet-cal-day {
	min-height: 80px;
	border: 1px solid #eee;
	padding: 4px;
	background: #fff;
}

.wpet-cal-day.is-outside {
	opacity: 0.6;
	background: #fafafa;
}

.wpet-cal-day-num {
	font-weight: 600;
	font-size: 12px;
	margin-bottom: 4px;
}

.wpet-calendar-event {
	display: block;
	padding: 4px 8px;
	margin: 2px 0;
	background: #2271b1;
	color: #fff;
	border-radius: 4px;
	font-size: 12px;
	text-decoration: none;
}

.wpet-qr-code {
	display: block;
	margin: 0.5rem 0;
	max-width: 180px;
	height: auto;
}

.wpet-guest-tickets {
	max-width: 720px;
	margin: 2rem auto;
	padding: 0 1rem;
}

.wpet-guest-tickets-header {
	margin-bottom: 1.5rem;
}

.wpet-guest-tickets-help {
	color: var(--wpet-muted);
}

.wpet-wallet-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.wpet-wallet-links .button {
	margin: 0;
}

@media (max-width: 960px) {
	.wpet-event-layout {
		grid-template-columns: 1fr;
	}

	.wpet-event-sidebar {
		position: static;
		order: -1;
	}
}

@media (max-width: 600px) {
	.wpet-ticket-table th,
	.wpet-ticket-table td {
		padding: 0.5rem;
	}

	body.wpet-event-full-width.single-wpet_event #main-content .container,
	body.wpet-event-full-width.single-wpet_event .x-container.max.width.offset {
		padding-left: 1rem;
		padding-right: 1rem;
	}
}
