/**
 * Tripthis Offer Card
 *
 * A two-pane archive card for one `offers` post — a gallery slider beside an
 * info pane — recreating JetEngine listing 290119. The card fills its container
 * width, so a surrounding Query Loop grid owns the columns and gaps. On narrow
 * screens the two panes stack.
 */

.toc {
	width: 100%;
	max-width: 100%;
	min-width: 0;
}

/* Predictable box model regardless of the theme's global default, so paddings,
   radii and the image aspect ratios stay exact. */
.toc,
.toc *,
.toc *::before,
.toc *::after {
	box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Card shell + two-pane layout
   ═══════════════════════════════════════════════════════════════════════════ */

.toc-card {
	--toc-ink: #1A1C18;
	--toc-line: #E6E7E3;
	--toc-panel: #ECECEC;
	--toc-accent: #02819E;
	--toc-orange: #F2811D;
	--toc-open: #1E9E5A;
	--toc-closed: #C0392B;
	--toc-radius: 20px;

	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	grid-template-areas:
		"header header"
		"gallery info";
	gap: 14px 24px;
	align-items: stretch;
	width: 100%;
	max-height: 400px;
	/* Small padding so the card's 30px corners sit concentrically outside the
	   slider's 20px corners (30 = 10 padding + 20 inner radius). */
	padding: 15px;
	background: var(--e-global-color-06772f1);
	color: var(--e-global-color-text, var(--toc-ink));
	border: 1px solid var(--e-global-color-e6eb376);
	border-radius: 30px;
	font-family: var(--e-global-typography-primary-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
	line-height: 1.45;
}

/* The heading spans the full width above the two panes. */
.toc-card__header {
	grid-area: header;
	min-width: 0;
}

.toc-card__gallery {
	grid-area: gallery;
}

.toc-card__info {
	grid-area: info;
}

/* `gallery-right` swaps which side each pane sits on. */
.toc-card--gallery-right {
	grid-template-areas:
		"header header"
		"info gallery";
}

/* ═══════════════════════════════════════════════════════════════════════════
   Gallery pane (slider)
   ═══════════════════════════════════════════════════════════════════════════ */

.toc-card__gallery {
	min-width: 0;
	min-height: 0;
}

.toc-slider {
	display: flex;
	flex-direction: column;
	gap: 10px;
	height: 100%;
	min-height: 0;
}

/* No fixed aspect ratio: the viewport just fills the height the card gives it
   (capped by the card's max-height), and each slide covers it as a centred
   background image. */
.toc-slider__viewport {
	position: relative;
	flex: 1 1 auto;
	/* A floor so the image area never collapses when the info pane is short (or
	   when the panes stack on mobile and the row has no intrinsic height). */
	min-height: 240px;
	overflow: hidden;
	border-radius: var(--toc-radius);
	background: var(--toc-panel);
}

.toc-slider__track {
	display: flex;
	height: 100%;
	transition: transform 0.4s ease;
	will-change: transform;
}

.toc-slider__slide {
	position: relative;
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	background-color: var(--toc-panel);
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
}

.toc-slider__placeholder {
	height: 100%;
	min-height: 200px;
	border-radius: var(--toc-radius);
	background: var(--toc-panel);
}

/* Prev / next arrows — white SVG icon on a rounded secondary-colour disc.
   --e-global-color-secondary is Elementor's global secondary colour; it falls
   back to the card ink when the theme doesn't define it. */
.toc-slider__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--e-global-color-secondary, var(--toc-ink));
	color: #fff;
	font-size: 22px;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.toc-slider__nav:hover {
	opacity: 0.85;
}

.toc-slider__nav--prev {
	left: 10px;
}

.toc-slider__nav--next {
	right: 10px;
}

.toc-svg {
	display: block;
}

/* Thumbnail strip */
.toc-slider__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.toc-slider__thumb {
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 10px;
	overflow: hidden;
	background: var(--toc-panel);
	cursor: pointer;
	opacity: 0.65;
	transition: opacity 0.2s ease, border-color 0.2s ease;
}

.toc-slider__thumb:hover {
	opacity: 1;
}

.toc-slider__thumb.is-active {
	opacity: 1;
	border-color: var(--toc-accent);
}

.toc-slider__thumb-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Info pane
   ═══════════════════════════════════════════════════════════════════════════ */

.toc-card__info {
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
}

/* ── Header: category pill + icon, title ─────────────────────────────────── */

/* Title row: category icon badge, then the title. */
.toc-card__titlerow {
	display: flex;
	align-items: center;
	gap: 10px;
}

/* Category icon: a white stroke-icon on a rounded secondary-colour badge. */
.toc-card__cat-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex: 0 0 auto;
	border-radius: 10px;
	background: var(--e-global-color-secondary, var(--toc-accent));
	color: #fff;
}

/* Featured-offer badge: same shape, orange accent background. */
.toc-card__cat-icon--selected {
	background: var(--toc-orange);
}

.toc-card__cat-icon img {
	display: block;
	width: 22px;
	height: 22px;
	object-fit: contain;
}

/* Inline term icon (raw SVG). These are stroke-style icons with no colour of
   their own, so drive the (white) stroke from the wrapper's `color`. */
.toc-card__cat-icon svg {
	display: block;
	width: 22px;
	height: 22px;
	stroke: currentColor;
}

/* Category pill row, sitting below the title. */
.toc-card__category {
	display: flex;
	align-items: center;
	gap: 8px;
}

.toc-card__pill {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 14px;
	background: rgba(2, 129, 158, 0.1);
	color: var(--toc-accent);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	letter-spacing: 0.01em;
}

.toc-card__title {
	margin: 0;
	font-size: 19px !important;
	font-weight: 600;
	line-height: 1.25;
}

.toc-card__title a {
	color: inherit;
	text-decoration: none;
}

.toc-card__title a:hover,
.toc-card__title a:focus-visible {
	text-decoration: underline;
}

/* ── Rating: stars + review count, one line ──────────────────────────────── */

.toc-card__rating {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Precise fractional fill: a grey set of 5 stars with a coloured copy on top,
   clipped to a width of `--toc-rating` (rating / 5 as a percentage). */
.toc-card__stars {
	position: relative;
	display: inline-block;
	font-size: 16px;
	line-height: 1;
	letter-spacing: 2px;
}

.toc-card__stars-bg {
	color: #D8D8D2;
}

.toc-card__stars-fg {
	position: absolute;
	top: 0;
	left: 0;
	width: var(--toc-rating, 0%);
	overflow: hidden;
	white-space: nowrap;
	color: var(--toc-orange);
}

.toc-card__reviews {
	font-size: 14px;
}

/* ── Meta rows: address, website, hours ──────────────────────────────────── */

.toc-card__meta {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.toc-card__meta-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 15px;
}

.toc-card__meta-icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	margin-top: 1px;
	font-size: 18px;
	color: var(--toc-accent);
}

.toc-card__meta-text {
	min-width: 0;
	word-break: break-word;
}

.toc-card__www {
	color: var(--toc-accent);
	text-decoration: none;
}

.toc-card__www:hover {
	text-decoration: underline;
}

/* Working-hours status */
.toc-card__hours .toc-card__meta-text {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
}

.toc-card__status {
	font-weight: 700;
}

.toc-card__status--open {
	color: var(--toc-open);
}

.toc-card__status--closed {
	color: var(--toc-closed);
}

/* Check-in / check-out (hotels & guest houses) */
.toc-card__stay .toc-card__meta-text {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
}


.toc-card__stay-time {
	color: var(--toc-accent);
	font-weight: 600;
}


/* ── Social icons ────────────────────────────────────────────────────────── */

.toc-card__social {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.toc-card__social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: rgba(2, 129, 158, 0.1);
	color: var(--toc-accent);
	font-size: 26px;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
}

.toc-card__social-link:hover {
	background: var(--toc-accent);
	color: #fff !important;
}

/* ── Action button ───────────────────────────────────────────────────────── */

/* Push the action button to the bottom of the info pane, sized to its content. */
.toc-card__actions {
	margin-top: auto;
	align-self: flex-start;
}

.toc-card__button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 4px 0 0;
	padding: 13px 21px;
	border: 0;
	border-radius: 30px;
	background: var(--toc-ink);
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.toc-card__button:hover {
	background: var(--toc-accent);
}

/* Force the arrow icon to sit inline at its intended size, past any theme rule
   that restyles SVGs inside links/buttons (e.g. width:100%, display:block). */
.toc-card__button .toc-svg {
	display: inline-block !important;
	flex: 0 0 auto;
	width: 1em !important;
	height: 1em !important;
	font-size: 18px;
	vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Responsive: stack the two panes on narrow screens
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 782px) {
	.toc-card,
	.toc-card--gallery-right {
		grid-template-columns: minmax(0, 1fr);
		/* Heading, then gallery, then info — regardless of the desktop layout. */
		grid-template-areas:
			"header"
			"gallery"
			"info";
		gap: 14px;
		/* Stacked, the two panes need their natural height — don't cap them. */
		max-height: none;
	}
}

/* ═══════════════════════════════════════════════════════════════════════════
   Administrator debug window
   ═══════════════════════════════════════════════════════════════════════════ */

.toc-debug {
	margin: 0 0 16px;
	padding: 12px 16px;
	background: var(--c-admin-rose, #F0D5DA);
	border-radius: 10px;
	color: #5c2230;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 13px;
	line-height: 1.5;
}

.toc-debug__meta {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.toc-debug__meta code {
	padding: 1px 5px;
	border-radius: 4px;
	background: rgba(92, 34, 48, 0.1);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12px;
	word-break: break-word;
}

.toc-debug__note {
	margin: 8px 0 0;
	font-size: 11px;
	font-style: italic;
	opacity: 0.75;
}
