/* FullCalendar Customization for Yacht Calendar */
.yacht-fullcalendar-wrapper {
	background: #fff;
	padding: 0;
}

/* FullCalendar Custom Colors - for background events */
.fc .fc-bg-event.season-high {
	background-color: #ff9e37 !important;
}

.fc .fc-bg-event.season-mid {
	background-color: #FFCB6B !important;
}

.fc .fc-bg-event.season-low {
	background-color: #ffeca6 !important;
}

.fc .fc-bg-event.season-notavailable {
	background-color: #D3D3D3 !important;
	border: 1px solid #999999 !important;
	opacity: 0.7;
}

.fc .fc-bg-event.listing-home-base {
	background-color: #00527A !important;
}

.fc .fc-bg-event.listing-passage {
	background-color: #0AADFF !important;
}

.fc .fc-bg-event.listing-flexible {
	background-color: #0088CC !important;
}

.fc .fc-bg-event {
	opacity: 1 !important;
	border: none !important;
}

/* Hide all event text and titles from calendar */
.fc .fc-event-title,
.fc .fc-event-title-container,
.fc .fc-daygrid-event-harness,
.fc .fc-h-event,
.fc .fc-v-event {
	display: none !important;
}

/* Make background events clickable */
.fc .fc-daygrid-day.fc-day {
	cursor: pointer;
}

.fc .fc-daygrid-day.fc-day:hover {
	opacity: 0.9;
}

/* FullCalendar Styling */
.fc {
	font-family: inherit;
}

/* Make 12 months fit in one row */
.fc-multiMonthYear-view {
	display: grid !important;
	grid-template-columns: repeat(6, 1fr) !important;
	gap: 8px !important;
}

.fc-multiMonthYear-view .fc-multimonth-month {
	width: 100% !important;
	min-width: 0 !important;
}

.fc-multiMonthYear-view .fc-multimonth-title {
	font-size: 13px !important;
	padding: 6px 4px !important;
	font-weight: 600 !important;
}

.fc-multiMonthYear-view .fc-col-header-cell {
	font-size: 10px !important;
	padding: 3px !important;
}

.fc-multiMonthYear-view .fc-daygrid-day-number {
	font-size: 11px !important;
	padding: 3px !important;
}

.fc-multiMonthYear-view .fc-day-today .fc-daygrid-day-number {
	width: 22px !important;
	height: 22px !important;
	font-size: 10px !important;
}

.fc-multiMonthYear-view .fc-daygrid-day {
	min-height: 28px !important;
}

.fc .fc-toolbar-title {
	font-size: 24px;
	font-weight: 700;
	color: #333;
}

.fc .fc-button {
	background-color: #fff;
	border: 1px solid #A5A5A5;
	color: #333;
	text-transform: capitalize;
	font-weight: 600;
	transition: all 0.3s ease;
}

.fc .fc-button:hover {
	background-color: #333;
	border-color: #00527A;
}

.fc .fc-button-active {
	background-color: #76818D !important;
	border-color: #A5A5A5 !important;
	color: #fff !important;
}

.fc .fc-daygrid-day-top {
	justify-content: center;
}

.fc .fc-daygrid-day-number {
	padding: 8px;
	font-weight: 500;
}

.fc .fc-day-today {
	background-color: #fff9e6 !important;
}

.fc .fc-day-today .fc-daygrid-day-number {
	background-color: #ff7474;
	color: #333;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
}

/* ===== LISTINGS SECTION ===== */
.yacht-calendar__listings {
	padding: 0 0 40px;
	background: #fff;
}

.yacht-calendar__listings-header {
	margin-bottom: 10px;
}

.yacht-calendar__listings-header h4 {
	font-size: 24px;
	font-weight: 700;
	margin: 0;
	color: #333;
}

.yacht-calendar__listings-text {
	color: #666;
	font-size: 16px;
	margin-bottom: 30px;
	line-height: 1.5;
}

/* One grid for every card, so the date, badge and name columns line up down the
   whole list. Sized per card they never could: `max-content` measures pixels, and
   Inter's default figures are proportional, so 26.09 and 24.09 are different widths
   despite the identical character count. */
.yacht-calendar__listings-grid {
	display: grid;
	grid-template-columns: max-content minmax(200px, .9fr) minmax(220px, 1.1fr);
	gap: 10px 20px;
}

.yacht-calendar__listing-card {
	display: grid;
	grid-column: 1 / -1;
	/* The first declaration is the pre-subgrid fallback: without it an unsupported
	   `subgrid` would leave the three named areas with a single column. */
	grid-template-columns: max-content minmax(200px, .9fr) minmax(220px, 1.1fr);
	grid-template-columns: subgrid;
	grid-template-areas:
		"dates badge name"
		"info info info";
	align-items: center;
	gap: 5px 20px;
}

.yacht-calendar__listing-badge {
	display: block;
	min-width: 0;
	padding: 12px 20px;
	border-radius: 8px;
	color: #fff;
	font-weight: 600;
	font-size: 15px;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.yacht-calendar__listing-badge:hover,
.yacht-calendar__listing-badge:focus {
	color: #fff;
	text-decoration: none;
}

.yacht-calendar__listing-badge:focus-visible {
	outline: 3px solid #fbaf00;
	outline-offset: 2px;
}

.listing-home-base {
	background: #00527A;
}

.listing-passage {
	background: #0AADFF;
}

.listing-flexible {
	background: #0088CC;
}

.yacht-calendar__listing-dates {
	grid-area: dates;
	text-align: center;
	/* Equal-width figures, so a range keeps its shape whichever digits it holds. */
	font-variant-numeric: tabular-nums;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.4;
	color: #666;
	padding: 5px 0;
}

.yacht-calendar__listing-dates .start,
.yacht-calendar__listing-dates .end {
	font-weight: 700;
	color: #333;
}

.yacht-calendar__listing-name {
	grid-area: name;
	align-self: center;
	font-size: 18px;
	font-weight: 600;
	color: #333;
	overflow-wrap: anywhere;
}

.yacht-calendar__listing-name a {
	text-decoration: underline;
}

.yacht-calendar__listing-info {
	grid-area: info;
	align-self: start;
	font-size: clamp(12px, 1.05vw, 15px);
	line-height: 1.5;
	color: #666;
	white-space: nowrap;
}

.yacht-calendar__listing-info i {
	font-style: italic;
}

/* Route details are visually grouped away from the surrounding yacht data. */
.yacht-page__item_routes {
	padding: 32px;
	background: #f5f5f5;
	border-radius: 8px;
}

/* The date range below is `nowrap` and cannot shrink, so on a narrow screen it squeezes
   the route type into a two-line sliver and still reaches past the padding. Wrapping lets
   it drop onto its own line, which is what the longer Russian and Ukrainian dates need. */
.yacht-page__item_routes .accordion__label {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 44px;
	margin: 0;
	padding: 10px 16px;
	color: #003d5b;
	background: #eef3f5;
	font-size: 18px;
	font-weight: 700;
	line-height: 24px;
}

.yacht-page__item_routes .accordion__item + .accordion__item {
	margin-top: 14px;
}

.yacht-page__item_routes .accordion__route-dates {
	flex: 0 0 auto;
	margin-left: auto;
	color: #003d5b;
	font-weight: 700;
	white-space: nowrap;
}

.yacht-page__item_routes .accordion__link,
.yacht-page__item_routes .accordion__link.active {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 48px;
	margin: 0;
	padding: 13px 40px 13px 16px;
	font-size: 18px;
	line-height: 25.6px;
	border-radius: 0;
}

.yacht-page__item_routes .cbnb-route-share-wrap {
	display: flex;
	position: relative;
	z-index: 2;
	justify-content: flex-end;
	width: 100%;
	margin: 0;
	padding: 12px 16px;
}

.yacht-page__item_routes .cbnb-route-share {
	display: inline-flex;
	flex: 0 0 44px;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0;
	color: #003d5b;
	background: #fff3d6;
	border: 1px solid rgba(0, 61, 91, .14);
	border-radius: 50%;
	box-shadow: 0 8px 20px rgba(0, 61, 91, .1);
	text-decoration: none;
}

.yacht-page__item_routes .cbnb-route-share svg {
	width: 23px;
	height: 23px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.yacht-page__item_routes .cbnb-route-share:hover,
.yacht-page__item_routes .cbnb-route-share:focus-visible {
	color: #003d5b;
	background: #fbaf00;
	outline: 0;
	box-shadow: 0 0 0 3px rgba(251, 175, 0, .28), 0 8px 20px rgba(0, 61, 91, .12);
}

.yacht-page__item_routes .accordion__plus {
	top: 50%;
	right: 16px;
	width: 16px;
	height: 16px;
	background: transparent;
	transform: translateY(-50%);
}

.yacht-page__item_routes .accordion__link.active .accordion__plus {
	transform: translateY(-50%) rotate(45deg);
}

.yacht-page__item_routes .accordion__plus:hover {
	background: transparent;
	transform: translateY(-50%);
}

.yacht-page__item_routes .accordion__link.active .accordion__plus:hover {
	transform: translateY(-50%) rotate(45deg);
}

.yacht-page__item_routes .accordion__plus .accordion__icon {
	width: 16px;
	height: 16px;
}

.yacht-page__item_routes .accordion__plus .accordion__icon::before {
	width: 8px;
}

.yacht-page__item_routes .accordion__plus .accordion__icon::after {
	height: 8px;
}

.yacht-page__item_routes .yacht-dates__text,
.yacht-page__item_routes .yacht-dates__text p,
.yacht-page__item_routes .yacht-dates__text li {
	font-size: 18px;
	line-height: 1.6;
}

.yacht-page__item_routes .yacht-dates__text h1,
.yacht-page__item_routes .yacht-dates__text h2,
.yacht-page__item_routes .yacht-dates__text h3,
.yacht-page__item_routes .yacht-dates__text h4,
.yacht-page__item_routes .yacht-dates__text h5,
.yacht-page__item_routes .yacht-dates__text h6 {
	font-size: 22px;
	line-height: 1.35;
}

/* ===== LEGEND ===== */
.yacht-calendar__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 80px;
	padding: 25px 20px;
	background: #f8f8f8;
	border-top: 1px solid #e0e0e0;
	justify-content: center;
}

.yacht-calendar__legend-item {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	color: #555;
}

.yacht-calendar__legend-box {
	width: 35px;
	height: 22px;
	border-radius: 3px;
	display: inline-block;
}

.yacht-calendar__legend-box.season-high {
	background: #ff9e37;
	border: 1px solid #ddd;
}

.yacht-calendar__legend-box.season-mid {
	background: #ffcb6b;
	border: 1px solid #ddd;
}

.yacht-calendar__legend-box.season-low {
	background: #ffeca6;
	border: 1px solid #ddd;
}

.yacht-calendar__legend-box.season-notavailable {
	background: #D3D3D3;
	border: 1px solid #999999;
}

.yacht-calendar__legend-box.listing-home-base {
	background: #00527A;
}

.yacht-calendar__legend-box.listing-passage {
	background: #0AADFF;
}

.yacht-calendar__legend-box.listing-flexible {
	background: #0088CC;
}

/* ===== MOBILE OPTIMIZATION (95% traffic) ===== */
@media (max-width: 768px) {
	.yacht-fullcalendar-wrapper {
		margin: 20px -15px;
		overflow-x: auto;
	}
	
	/* 6 months per row - better for mobile */
	.fc-multiMonthYear-view {
		grid-template-columns: repeat(3, 1fr) !important;
		gap: 6px !important;
	}
	
	.fc-multiMonthYear-view .fc-multimonth-title {
		font-size: 11px !important;
		padding: 5px 3px !important;
	}
	
	.fc-multiMonthYear-view .fc-col-header-cell {
		font-size: 8px !important;
		padding: 2px !important;
	}
	
	.fc-multiMonthYear-view .fc-daygrid-day-number {
		font-size: 9px !important;
		padding: 2px !important;
	}
	
	.fc-multiMonthYear-view .fc-day-today .fc-daygrid-day-number {
		width: 20px !important;
		height: 20px !important;
	}
	
	/* FullCalendar mobile adjustments */
	.fc .fc-toolbar {
		flex-direction: column;
		gap: 10px;
	}
	
	.fc .fc-toolbar-title {
		font-size: 18px;
	}
	
	.fc .fc-button {
		font-size: 13px;
		padding: 6px 10px;
	}
	
	.fc .fc-daygrid-day-number {
		font-size: 12px;
		padding: 4px;
	}
	
	.fc .fc-day-today .fc-daygrid-day-number {
		width: 28px;
		height: 28px;
	}
	
	/* Listings optimized for mobile */
	.yacht-calendar__listings {
		padding: 0 15px 30px;
	}

	.yacht-page__item_routes {
		padding: 20px 15px;
	}

	/* Once the label wraps, the dates read as a second line of the row header rather
	   than something pushed off to the right. Dropping `nowrap` is the last resort under
	   it: wrapping the label gives the range a line of its own, so it still prints on one
	   line in practice, but a range too long even for that now breaks instead of running
	   out past the header - a range that crosses a year prints the year twice and is five
	   characters longer than the usual one. */
	.yacht-page__item_routes .accordion__route-dates {
		margin-left: 0;
		white-space: normal;
	}

	.yacht-calendar__listings-header h4 {
		font-size: 18px;
	}
	
	.yacht-calendar__listings-text {
		font-size: 13px;
	}
	
	.yacht-calendar__listings-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 15px;
	}
	
	.yacht-calendar__listing-card {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"dates"
			"badge"
			"name"
			"info";
		gap: 5px 10px;
	}

	.yacht-calendar__listing-name,
	.yacht-calendar__listing-info {
		align-self: auto;
	}

	.yacht-calendar__listing-info {
		font-size: 14px;
		white-space: normal;
	}

	.yacht-calendar__listing-dates {
		padding: 0;
		text-align: left;
	}
	
	.yacht-calendar__listing-badge {
		font-size: 14px;
		padding: 10px 16px;
	}
	
	/* Legend stacked on mobile */
	.yacht-calendar__legend {
		justify-content: flex-start;
		gap: 15px;
		padding: 20px 15px;
	}
	
	.yacht-calendar__legend-item {
		flex: 0 0 calc(50% - 7.5px);
		font-size: 12px;
	}
}

@media (max-width: 580px) {
	.fc .fc-toolbar-title {
		font-size: 16px;
	}
	
	.fc .fc-button {
		font-size: 12px;
		padding: 5px 8px;
	}

	.yacht-calendar__legend-item {
		flex: 0 0 calc(100% - 7.5px);
		font-size: 12px;
	}
	
	.yacht-calendar__listing-badge {
		font-size: 13px;
		padding: 8px 14px;
	}
}

/* ===== MODAL STYLES ===== */
.yacht-modal {
	display: none;
	position: fixed;
	z-index: 10000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.7);
	align-items: center;
	justify-content: center;
}

.yacht-modal-content {
	background-color: #fff;
	padding: 30px;
	border-radius: 12px;
	max-width: 500px;
	width: 90%;
	position: relative;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
	from {
		opacity: 0;
		transform: translateY(-50px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.yacht-modal-close {
	position: absolute;
	right: 15px;
	top: 15px;
	font-size: 32px;
	font-weight: 700;
	color: #999;
	cursor: pointer;
	transition: color 0.2s;
	line-height: 1;
}

.yacht-modal-close:hover,
.yacht-modal-close:focus {
	color: #333;
}

.yacht-modal-content h3 {
	margin: 0 0 15px 0;
	font-size: 24px;
	font-weight: 700;
	color: #00527A;
}

.yacht-modal-content p {
	margin: 10px 0;
	font-size: 16px;
	color: #555;
	line-height: 1.6;
}

.yacht-modal-content #yacht-modal-price {
	font-size: 18px;
	font-weight: 600;
	color: #333;
	margin-top: 20px;
	padding-top: 15px;
	border-top: 1px solid #eee;
}

@media (max-width: 480px) {
	.yacht-modal-content {
		padding: 20px;
		width: 95%;
	}
	
	.yacht-modal-content h3 {
		font-size: 20px;
		margin-bottom: 12px;
	}
	
	.yacht-modal-content p {
		font-size: 14px;
	}
	
	.yacht-modal-close {
		font-size: 28px;
		right: 10px;
		top: 10px;
	}
}
