/*
 * cruiseoomph/sailings, cruiseoomph/ships and cruiseoomph/ports — the
 * Widget's catalog as our own cards (richness plan, Phases A and C).
 *
 * Colours and type come from the theme's tokens, with the design-token hex
 * values as fallbacks so the blocks still read correctly under another theme.
 */

.co-cards {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	width: 100%;
}

.co-cards__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--fraunces, Fraunces, Georgia, serif);
	font-variation-settings: var(--wp--custom--font-variation--fraunces, normal);
	font-weight: 400;
	font-size: 1.75rem;
	line-height: 1.15;
	color: var(--wp--preset--color--blue, #274664);
}

.co-cards__note {
	margin: 0;
	max-width: var(--wp--custom--measure--prose, 70ch);
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
	line-height: 1.5;
	color: var(--wp--preset--color--muted, #56697A);
}

.co-cards__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.125rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.co-card {
	display: flex;
	margin: 0;
	background: var(--wp--preset--color--field, #FFFFFF);
	border: 1px solid var(--wp--preset--color--border, #CDD8E0);
	border-radius: var(--wp--custom--radius--sm, 12px);
	overflow: hidden;
}

.co-card__link {
	display: flex;
	flex-direction: column;
	width: 100%;
	color: var(--wp--preset--color--blue, #274664);
	text-decoration: none;
}

.co-card__link:hover .co-card__title,
.co-card__link:hover .co-card__action {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--champagne, #E3CAA0);
	text-underline-offset: 0.15em;
}

.co-card__link:focus-visible {
	outline: var(--wp--custom--state--button--focus-ring, 3px solid #274664);
	outline-offset: -3px;
}

.co-card__media {
	position: relative;
	display: block;
	margin: 0;
	aspect-ratio: 404 / 230;
	overflow: hidden;
	background: var(--wp--preset--color--surface-2, #E6EEF3);
}

.co-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Image credit: printed wherever the Widget supplies one. */
.co-card__credit {
	position: absolute;
	right: 0.5rem;
	bottom: 0.5rem;
	max-width: calc(100% - 1rem);
	margin: 0;
	padding: 0.125rem 0.5rem;
	border-radius: var(--wp--custom--radius--pill, 999px);
	background: rgba(39, 70, 100, 0.76);
	color: #fff;
	font-size: var(--wp--preset--font-size--caption, 0.75rem);
	line-height: 1.4;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.co-card__copy {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 0.375rem;
	padding: 1.125rem 1.25rem 1.25rem;
}

.co-card__eyebrow {
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold-text, #82623B);
}

.co-card__title {
	font-family: var(--wp--preset--font-family--fraunces, Fraunces, Georgia, serif);
	font-variation-settings: var(--wp--custom--font-variation--fraunces, normal);
	font-weight: 400;
	font-size: 1.375rem;
	line-height: 1.2;
}

.co-card__meta,
.co-card__ports {
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
	line-height: 1.5;
	color: var(--wp--preset--color--muted, #56697A);
}

.co-card__fare {
	margin-top: 0.25rem;
	font-weight: 500;
}

.co-card__action {
	margin-top: auto;
	padding-top: 0.75rem;
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
	font-weight: 500;
}

.co-cards__more {
	margin: 0;
}

.co-cards__more-link {
	color: var(--wp--preset--color--blue, #274664);
	font-weight: 500;
}

@media (max-width: 1023px) {
	.co-cards__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
	.co-cards__grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
	.co-cards__title { font-size: 1.5rem; }
}

/* ---------------------------------------------------------------- */
/* Sailings by month (Phases C and D): a row of pills under the      */
/* departure cards, printed by the guide and line patterns.           */
/* ---------------------------------------------------------------- */

.co-months { margin-top: 2rem; }

.co-months__label {
	margin: 0 0 0.75rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: var(--wp--custom--letter-spacing--eyebrow, 0.08em);
	text-transform: uppercase;
	color: var(--wp--preset--color--gold-text, #82623B);
}

.co-months__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.625rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.co-months__link {
	display: inline-flex;
	flex-direction: column;
	gap: 0.125rem;
	padding: 0.625rem 1rem;
	border: 1px solid var(--wp--preset--color--border, #CDD8E0);
	border-radius: var(--wp--custom--radius--sm, 12px);
	background: var(--wp--preset--color--field, #FFFFFF);
	color: var(--wp--preset--color--blue, #274664);
	text-decoration: none;
	line-height: 1.2;
}

.co-months__link:hover .co-months__name {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--champagne, #E3CAA0);
	text-underline-offset: 0.15em;
}

.co-months__link:focus-visible { outline: var(--wp--custom--state--button--focus-ring, 3px solid #274664); outline-offset: 2px; }
.co-months__name { font-weight: 500; }
.co-months__count { font-size: var(--wp--preset--font-size--small, 0.9375rem); color: var(--wp--preset--color--muted, #56697A); }

/* ---------------------------------------------------------------- */
/* Ports (Phase C): a card with no page behind it, and the map.      */
/* ---------------------------------------------------------------- */

.co-cards__grid--ports { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.co-card--port { flex-direction: column; }
.co-card--port .co-card__media { aspect-ratio: 4 / 3; }
.co-card--port .co-card__copy { padding: 1rem 1.125rem 1.125rem; }

.co-card__text {
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
	line-height: 1.5;
	color: var(--wp--preset--color--muted, #56697A);
}

.co-cards__note--after { margin-top: 0.25rem; }

.co-map { width: 100%; }

.co-map__plate {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	aspect-ratio: 28 / 11;
	min-height: 16rem;
	background: var(--wp--preset--color--surface-2, #E6EEF3);
	border-radius: var(--wp--custom--radius--md, 16px);
	overflow: hidden;
	color: var(--wp--preset--color--blue, #274664);
}

.co-map__plate:focus-visible { outline: var(--wp--custom--state--button--focus-ring, 3px solid #274664); outline-offset: 2px; }

/* Port labels: plain text beside the dot, no bubble. */
.leaflet-tooltip.co-map__label {
	padding: 0;
	background: none;
	border: 0;
	box-shadow: none;
	font-family: var(--wp--preset--font-family--inter, Inter, system-ui, sans-serif);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.2;
	color: var(--wp--preset--color--blue, #274664);
	text-shadow: 0 0 3px #fff, 0 0 6px #fff, 0 0 2px #fff;
}

.leaflet-tooltip.co-map__label::before { display: none; }

.leaflet-container { font-family: var(--wp--preset--font-family--inter, Inter, system-ui, sans-serif); }
.leaflet-container .leaflet-control-attribution { font-size: 0.6875rem; color: var(--wp--preset--color--muted, #56697A); }
.leaflet-container .leaflet-control-attribution a { color: var(--wp--preset--color--blue, #274664); }

@media (max-width: 1279px) {
	.co-cards__grid--ports { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
	.co-cards__grid--ports { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
	.co-cards__grid--ports { grid-template-columns: minmax(0, 1fr); }
	.co-map__plate { aspect-ratio: auto; height: 15rem; min-height: 0; }
	.leaflet-tooltip.co-map__label { display: none; } /* the cards carry the names on phones */
}

@media print {
	.co-map__plate { display: none; }
}
