/**
 * Itinerary Presets — Frontend Styles
 *
 * Hub card grid, single itinerary page, embed, clone button, modal.
 *
 * @package PhuketTripPlanner
 */

/* Hide Neve theme post meta (reading time, post views) on pages
   that contain itinerary embeds. Uses :has() for pure-CSS detection. */
body:has(.pkt-itin-embed) .nv-meta-list,
body:has(.pkt-single-itin) .nv-meta-list,
.pkt-has-itinerary .nv-meta-list { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   HUB — Card Grid  ([pkt_itineraries])
   ═══════════════════════════════════════════════════════════ */

.pkt-hub__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 24px;
	margin: 24px 0;
}

.pkt-hub__card {
	display: flex;
	flex-direction: column;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
	transition: transform 0.2s, box-shadow 0.2s;
	text-decoration: none;
	color: inherit;
	background: #fff;
}

.pkt-hub__card:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 20px rgba(0,0,0,0.12);
	text-decoration: none;
	color: inherit;
}

.pkt-hub__card-image {
	height: 200px;
	background-size: cover;
	background-position: center;
	background-color: #e8e8e8;
}

.pkt-hub__card-image--placeholder {
	background: linear-gradient(135deg, #667eea, #764ba2);
}

.pkt-hub__card-body {
	padding: 16px 20px 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.pkt-hub__card-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 8px;
	line-height: 1.3;
	color: #1a1a1a;
}

.pkt-hub__card-excerpt {
	font-size: 14px;
	color: #666;
	line-height: 1.5;
	margin: 0 0 12px;
	flex: 1;
}

.pkt-hub__card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

.pkt-hub__card-link {
	font-size: 14px;
	font-weight: 600;
	color: #2271b1;
}

.pkt-hub__card:hover .pkt-hub__card-link {
	text-decoration: underline;
}

.pkt-hub__empty {
	text-align: center;
	padding: 40px 20px;
	color: #999;
	font-size: 16px;
}

/* Badges (shared: hub + single + embed) */

.pkt-hub__badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	background: #f0f0f0;
	color: #555;
	letter-spacing: 0.02em;
}

.pkt-hub__badge--audience {
	background: #e8f4fd;
	color: #1a6fa0;
}

.pkt-hub__badge--difficulty {
	background: #fef3e2;
	color: #a06b1a;
}


/* ═══════════════════════════════════════════════════════════
   SINGLE ITINERARY PAGE
   ═══════════════════════════════════════════════════════════ */

.pkt-single-itin {
	max-width: 800px;
	margin: 0 auto;
	padding: 0 16px;
}

/* Hero */

.pkt-single-itin__hero {
	position: relative;
	border-radius: 12px;
	overflow: hidden;
	margin-bottom: 32px;
}

.pkt-single-itin__hero-img {
	width: 100%;
	height: 120px;
	object-fit: cover;
	display: block;
}

.pkt-single-itin__hero-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 12px 24px;
	background: linear-gradient(transparent, rgba(0,0,0,0.75));
	color: #fff;
}

.pkt-single-itin__title {
	font-size: 22px;
	font-weight: 800;
	margin: 0 0 6px;
	line-height: 1.2;
	text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.pkt-single-itin__badges {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.pkt-single-itin__badges .pkt-hub__badge {
	background: rgba(255,255,255,0.2);
	color: #fff;
	backdrop-filter: blur(4px);
}

/* Description */

.pkt-single-itin__desc {
	font-size: 16px;
	line-height: 1.7;
	color: #444;
	margin-bottom: 24px;
}

.pkt-single-itin__content {
	padding-bottom: 40px;
}

/* Day Sections */

.pkt-single-itin__day {
	margin-bottom: 32px;
}

.pkt-single-itin__day-title {
	font-size: 22px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 16px;
	padding-bottom: 8px;
	border-bottom: 2px solid #e2e2e2;
}

.pkt-single-itin__day-empty {
	color: #999;
	font-style: italic;
	padding: 12px 0;
}

/* Item Cards */

.pkt-single-itin__item {
	display: flex;
	gap: 16px;
	padding: 14px;
	border: 1px solid #e8e8e8;
	border-radius: 10px;
	margin-bottom: 10px;
	background: #fff;
	transition: box-shadow 0.15s;
}

.pkt-single-itin__item:hover {
	box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.pkt-single-itin__item-img-wrap {
	flex-shrink: 0;
}

.pkt-single-itin__item-img {
	width: 180px;
	height: 130px;
	object-fit: cover;
	border-radius: 6px;
}

.pkt-single-itin__item-body {
	flex: 1;
	min-width: 0;
}

.pkt-single-itin__item-title {
	font-size: 19px;
	font-weight: 600;
	color: #1a1a1a;
	text-decoration: none;
	display: block;
	margin-bottom: 4px;
}

a.pkt-single-itin__item-title:hover {
	color: #0073aa;
}

.pkt-single-itin__item-loc {
	display: block;
	font-size: 14px;
	color: #2980b9;
	margin-top: 4px;
}

.pkt-single-itin__item-desc {
	font-size: 15px;
	color: #666;
	line-height: 1.4;
	margin: 4px 0 0;
	min-height: 2.8em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Notes */

.pkt-single-itin__note,
.pkt-itin-embed__note {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 10px 14px;
	background: #fffde7;
	border: 1px solid #ffe082;
	border-radius: 8px;
	margin-bottom: 10px;
	font-size: 14px;
	color: #5d4037;
	line-height: 1.5;
}

.pkt-single-itin__note svg,
.pkt-itin-embed__note svg {
	flex-shrink: 0;
	margin-top: 2px;
	color: #f9a825;
}

/* CTA */

.pkt-single-itin__cta {
	text-align: center;
	padding: 24px 0;
}

.pkt-single-itin__cta--top {
	border-bottom: 1px solid #eee;
	margin-bottom: 24px;
}

.pkt-single-itin__cta-hint {
	font-size: 13px;
	color: #999;
	margin: 8px 0 0;
}


/* ═══════════════════════════════════════════════════════════
   EMBED  ([pkt_itinerary id="X"])
   ═══════════════════════════════════════════════════════════ */

.pkt-itin-embed {
	border: 1px solid #e8e8e8;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	margin: 24px 0;
}

.pkt-itin-embed__header {
	padding: 20px 24px 12px;
}

.pkt-itin-embed__title {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 8px;
	color: #1a1a1a;
}

.pkt-itin-embed__meta {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.pkt-itin-embed__desc {
	padding: 0 24px 12px;
	font-size: 15px;
	line-height: 1.6;
	color: #555;
}

.pkt-itin-embed__day {
	padding: 16px 24px;
	border-top: 1px solid #f0f0f0;
}

.pkt-itin-embed__day-title {
	font-size: 26px;
	font-weight: 700;
	margin: 0 0 12px;
	color: #333;
}

.pkt-itin-embed__item {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	padding: 12px 0;
	border-bottom: 1px solid #f0f0f0;
}

.pkt-itin-embed__item:last-child {
	border-bottom: none;
}

.pkt-itin-embed__item-img {
	width: 180px;
	height: 130px;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
}

.pkt-itin-embed__item-info {
	flex: 1;
	min-width: 0;
}

.pkt-itin-embed__item-title {
	font-weight: 600;
	font-size: 19px;
	color: #333;
	text-decoration: none;
	display: block;
}

a.pkt-itin-embed__item-title:hover {
	color: #0073aa;
}

.pkt-itin-embed__item-loc {
	font-size: 14px;
	color: #2980b9;
	display: block;
	margin-top: 4px;
}

.pkt-itin-embed__item-desc {
	font-size: 15px;
	color: #666;
	margin: 4px 0 0;
	line-height: 1.4;
	min-height: 2.8em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pkt-itin-embed__cta {
	padding: 16px 24px 20px;
	text-align: center;
	border-top: 1px solid #f0f0f0;
}

.pkt-itin-embed__cta--top {
	border-top: none;
	border-bottom: 1px solid #f0f0f0;
	padding: 20px 24px;
}


/* ═══════════════════════════════════════════════════════════
   CLONE BUTTON
   ═══════════════════════════════════════════════════════════ */

.pkt-clone-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 28px;
	border: none;
	border-radius: 30px;
	background: linear-gradient(135deg, #2271b1, #1a5a8f);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.15s, box-shadow 0.15s;
	box-shadow: 0 2px 8px rgba(34,113,177,0.3);
	letter-spacing: 0.01em;
}

.pkt-clone-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(34,113,177,0.4);
}

.pkt-clone-btn:active {
	transform: translateY(0);
}

.pkt-clone-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
}

.pkt-clone-btn--large {
	padding: 14px 36px;
	font-size: 17px;
}

.pkt-clone-btn--xl {
	padding: 18px 44px;
	font-size: 20px;
	gap: 10px;
	box-shadow: 0 4px 14px rgba(34,113,177,0.35);
}

.pkt-clone-btn svg {
	flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════
   CLONE MODAL
   ═══════════════════════════════════════════════════════════ */

.pkt-clone-modal {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
	padding: 20px;
	animation: pktFadeIn 0.2s ease-out;
}

@keyframes pktFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.pkt-clone-modal__box {
	background: #fff;
	border-radius: 16px;
	padding: 28px 32px;
	max-width: 420px;
	width: 100%;
	box-shadow: 0 12px 40px rgba(0,0,0,0.2);
	text-align: center;
}

.pkt-clone-modal__box h3 {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 8px;
	color: #1a1a1a;
}

.pkt-clone-modal__box p {
	font-size: 15px;
	color: #666;
	margin: 0 0 20px;
}

.pkt-clone-modal__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.pkt-clone-modal__btn {
	padding: 12px 20px;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s;
}

.pkt-clone-modal__btn--replace {
	background: #2271b1;
	color: #fff;
}

.pkt-clone-modal__btn--replace:hover {
	background: #1a5a8f;
}

.pkt-clone-modal__btn--merge {
	background: #f0f0f0;
	color: #333;
}

.pkt-clone-modal__btn--merge:hover {
	background: #e0e0e0;
}

.pkt-clone-modal__btn--cancel {
	background: transparent;
	color: #999;
}

.pkt-clone-modal__btn--cancel:hover {
	color: #333;
}

.pkt-clone-modal__hint {
	margin: 16px 0 0 !important;
	color: #999 !important;
	font-size: 13px !important;
}


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
	.pkt-hub__grid {
		grid-template-columns: 1fr;
	}

	.pkt-single-itin__hero-img {
		height: 200px;
	}

	.pkt-single-itin__title {
		font-size: 22px;
	}

	.pkt-single-itin__item {
		flex-direction: column;
		gap: 10px;
	}

	.pkt-single-itin__item-img {
		width: 100%;
		height: 180px;
	}

	.pkt-clone-btn--large {
		padding: 12px 24px;
		font-size: 15px;
	}

	.pkt-clone-btn--xl {
		padding: 14px 28px;
		font-size: 17px;
	}

	.pkt-clone-modal__box {
		padding: 20px;
	}

	.pkt-itin-embed__item-img {
		width: 100px;
		height: 75px;
	}
}

/* ═══════════════════════════════════════════════════════════
   ADMIN: Save to Preset (floating button, frontend only)
   ═══════════════════════════════════════════════════════════ */

.pkt-admin-preset {
	position: fixed;
	bottom: 80px;
	left: 24px;
	z-index: 99999;
}

.pkt-admin-preset__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border: none;
	border-radius: 50%;
	background: #1d2327;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0,0,0,0.25);
	transition: background 0.15s, transform 0.15s;
}

.pkt-admin-preset__toggle:hover {
	background: #2271b1;
	transform: scale(1.08);
}

.pkt-admin-preset__dropdown {
	position: absolute;
	bottom: 56px;
	left: 0;
	width: 320px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0,0,0,0.18);
	overflow: hidden;
	max-height: 480px;
	overflow-y: auto;
}

.pkt-admin-preset__header {
	padding: 12px 16px;
	font-size: 14px;
	font-weight: 700;
	color: #1d2327;
	border-bottom: 1px solid #eee;
	background: #f9f9f9;
}

.pkt-admin-preset__form {
	padding: 14px 16px;
}

.pkt-admin-preset__form label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #666;
	margin-bottom: 4px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.pkt-admin-preset__form select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	margin-bottom: 12px;
	background: #fff;
}

.pkt-admin-preset__add-btn {
	width: 100%;
	padding: 10px 16px;
	border: none;
	border-radius: 8px;
	background: #2271b1;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s;
}

.pkt-admin-preset__add-btn:hover {
	background: #1a5a8f;
}

.pkt-admin-preset__add-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.pkt-admin-preset__status {
	margin-top: 10px;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 13px;
	line-height: 1.4;
}

.pkt-admin-preset__status--ok {
	background: #edf7ed;
	color: #2e7d32;
}

.pkt-admin-preset__status--err {
	background: #fef2f2;
	color: #c62828;
}


/* ── Print ─────────────────────────────────────────────── */

@media print {
	.pkt-clone-btn,
	.pkt-single-itin__cta,
	.pkt-itin-embed__cta,
	.pkt-clone-modal,
	.pkt-admin-preset {
		display: none !important;
	}
}

/* ── Focus Visible (A11Y) ─────────────────────────────── */

.pkt-clone-btn:focus-visible,
.pkt-clone-modal__btn:focus-visible,
.pkt-hub__card:focus-visible,
.pkt-admin-preset__toggle:focus-visible,
.pkt-admin-preset__add-btn:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* ── Hub Card Image (A11Y-8) ─────────────────────────── */

.pkt-hub__card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ── Scoped Box Sizing (LOW-4) ────────────────────────── */

.pkt-single-itin *,
.pkt-single-itin *::before,
.pkt-single-itin *::after,
.pkt-itin-embed *,
.pkt-itin-embed *::before,
.pkt-itin-embed *::after,
.pkt-clone-modal *,
.pkt-clone-modal *::before,
.pkt-clone-modal *::after {
	box-sizing: border-box;
}

/* ── Reduced Motion ────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.pkt-hub__card,
	.pkt-clone-btn,
	.pkt-clone-modal {
		transition: none;
		animation: none;
	}
}
