/* Lehtonen Matkavaraus: matkalista, matkasivu ja varausikkuna */

.lmv, .lmv-modal {
	/* Lehtosen sininen reunuksiin ja koristeisiin; tekstiin ja valkoisen tekstin
	   taustaksi saman sävyn tummempi versio (kontrasti valkoisella 4,9:1) */
	--lmv-brand: #51a0d8;
	--lmv-brand-soft: #eaf4fb;
	--lmv-accent: #2a75ae;
	--lmv-accent-dark: #1b4f78;
	--lmv-text: #1d2733;
	--lmv-muted: #5b6673;
	--lmv-line: #dde3ea;
	--lmv-soft: #f3f6f9;
	--lmv-radius: 10px;
	--lmv-badge-bg: var(--lmv-accent);
	--lmv-badge-fg: #fff;
	color: var(--lmv-text);
	box-sizing: border-box;
}
.lmv *, .lmv-modal * { box-sizing: border-box; }

/* Painikkeet */
.lmv-btn, .lmv-modal .mybutton {
	display: inline-block;
	padding: 0.7em 1.4em;
	border: 2px solid var(--lmv-accent);
	border-radius: 999px;
	background: #fff;
	color: var(--lmv-accent);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s, color .15s;
}
.lmv-btn:hover, .lmv-btn:focus-visible { background: var(--lmv-accent); color: #fff; }
.lmv-btn--primary, .lmv-modal .mybutton { background: var(--lmv-accent); color: #fff; }
.lmv-btn--primary:hover, .lmv-modal .mybutton:hover { background: var(--lmv-accent-dark); border-color: var(--lmv-accent-dark); color: #fff; }
.lmv-btn--ghost { border-color: var(--lmv-line); color: var(--lmv-text); }
.lmv-modal .mybutton[disabled] { opacity: .5; cursor: default; }

/* Elementor-säiliö, jossa [matkat] on: iframea varten tehty 1600 px vähimmäiskorkeus ja
   pystykeskitys jättivät tyhjää listan yläpuolelle, ja keskitys kavensi listan. */
.e-con:has(> .e-con-inner > .elementor-widget-shortcode .lmv-grid),
.e-con:has(> .elementor-widget-shortcode .lmv-grid) { min-height: 0 !important; }
.e-con-inner:has(> .elementor-widget-shortcode .lmv-grid),
.e-con:has(> .elementor-widget-shortcode .lmv-grid) { justify-content: flex-start !important; padding-top: 48px; padding-bottom: 64px; }
.elementor-widget-shortcode:has(.lmv) { align-self: stretch !important; width: 100% !important; max-width: 100% !important; }

/* ---------- Etusivun esikatselu [matkat_nostot] ---------- */

.lmv-nostot { max-width: 1240px; margin: 0 auto; padding: 40px 20px 48px; }
.lmv-nostot__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.lmv-nostot__head h2 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.lmv-nostot__all { color: var(--lmv-accent); font-weight: 700; text-decoration: none; white-space: nowrap; }
.lmv-nostot__all:hover { text-decoration: underline; }
.lmv-nostot__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

/* Matalammat kortit: leveämpi kuva, ei lyhyttä kuvausta, pienempi painike */
.lmv-nostot .lmv-card__media { aspect-ratio: 2 / 1; }
.lmv-nostot .lmv-card__body { gap: 4px; padding: 12px 16px 16px; }
.lmv-nostot .lmv-card__date { font-size: .85rem; }
.lmv-nostot .lmv-card__title { font-size: 1.08rem; margin-bottom: 10px; }
.lmv-nostot .lmv-card__text { display: none; }
.lmv-nostot .lmv-btn { padding: .45em 1.1em; font-size: .9rem; }
.lmv-nostot .lmv-tag { left: 10px; bottom: 10px; padding: 4px 10px; font-size: .85rem; }

@media (max-width: 1100px) {
	.lmv-nostot__row { gap: 14px; }
	.lmv-nostot .lmv-card__title { font-size: 1rem; }
}
@media (max-width: 900px) {
	.lmv-nostot__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Mobiilissa vaakarivi, jota pyyhkäistään */
@media (max-width: 760px) {
	.lmv-nostot { padding: 32px 0 36px; }
	.lmv-nostot__head { padding: 0 16px; }
	.lmv-nostot__row {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		gap: 16px;
		padding: 4px 16px 16px;
		scroll-padding: 0 16px;
		-webkit-overflow-scrolling: touch;
	}
	.lmv-nostot__row .lmv-card { flex: 0 0 74%; scroll-snap-align: start; }
	.lmv-nostot__row .lmv-card:hover { transform: none; }
}

/* ---------- Matkalista ---------- */

.lmv-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 28px;
	margin: 0 auto;
}
.lmv-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 2px solid var(--lmv-brand);
	border-radius: var(--lmv-radius);
	box-shadow: 0 4px 14px rgba(81, 160, 216, .18);
	overflow: hidden;
	transition: box-shadow .2s, transform .2s, border-color .2s;
}
.lmv-card:hover { border-color: var(--lmv-accent); box-shadow: 0 12px 30px rgba(42, 117, 174, .28); transform: translateY(-3px); }
.lmv-card__media { border-bottom: 4px solid var(--lmv-brand); }
.lmv-card__media { position: relative; display: block; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--lmv-accent), var(--lmv-accent-dark)); }
/* .lmv-edessä: ohittaa Elementorin ".elementor img { height: auto }" */
.lmv .lmv-card__media img { width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; }
.lmv-tag {
	position: absolute;
	left: 12px;
	bottom: 12px;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--lmv-accent);
	color: #fff;
	font-weight: 700;
	font-size: .95rem;
}
.lmv-card__body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 22px; flex: 1; }
.lmv-card__date { margin: 0; color: var(--lmv-accent); font-weight: 700; font-size: .95rem; }
.lmv-card__title { margin: 0; font-size: 1.3rem; line-height: 1.3; }
.lmv-card__title a { color: var(--lmv-text); text-decoration: none; }
.lmv-card__title a:hover { color: var(--lmv-accent); }
.lmv-card__text { margin: 0; color: var(--lmv-muted); }
.lmv-card .lmv-btn { margin-top: auto; align-self: flex-start; }
.lmv-empty { text-align: center; padding: 40px 0; }

/* ---------- Matkasivu ---------- */

.lmv-trip { max-width: 1140px; margin: 0 auto; }
.lmv-back { margin: 0 0 16px; }
.lmv-back a { color: var(--lmv-accent); text-decoration: none; font-weight: 600; }
.lmv-hero { position: relative; border-radius: var(--lmv-radius); overflow: hidden; background: var(--lmv-soft); min-height: 120px; }
.lmv .lmv-hero img { display: block; width: 100%; max-width: none; max-height: 460px; object-fit: cover; }
.lmv-hero__badge {
	position: absolute;
	right: 20px;
	bottom: 20px;
	max-width: calc(100% - 40px);
	padding: 14px 20px;
	border-radius: var(--lmv-radius);
	background: var(--lmv-badge-bg);
	color: var(--lmv-badge-fg);
	text-align: right;
}
.lmv-hero__badge h1 { margin: 0; color: inherit; font-size: clamp(1.4rem, 3vw, 2.3rem); line-height: 1.15; }
.lmv-hero__badge p { margin: 4px 0 0; font-weight: 700; font-size: 1.1rem; }

/* Tekoälykuvan merkintä (varaushallinta: matkan tiedot → kuva_ai) */
.lmv-ai {
	position: absolute;
	top: 8px;
	right: 10px;
	z-index: 2;
	color: #fff;
	font-size: .75rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .05em;
	cursor: help;
}
.lmv-hero .lmv-ai { top: 12px; left: 14px; right: auto; font-size: .85rem; }

/* Lisäkuvat: galleria ja suurennos (varaushallinta: matkan tiedot → Lisäkuvat) */
.lmv-gallery__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.lmv-gallery__grid li { margin: 0; }
.lmv-gallery__item { position: relative; display: block; overflow: hidden; border-radius: 8px; aspect-ratio: 4 / 3; background: var(--lmv-soft); }
.lmv-gallery__item img { display: block; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; transition: transform .25s; }
.lmv-gallery__item:hover img, .lmv-gallery__item:focus-visible img { transform: scale(1.04); }
.lmv-gallery__cap { display: block; margin-top: 4px; font-size: .82rem; line-height: 1.35; color: #5b6673; }
.lmv-lightbox { width: min(1100px, 94vw); max-width: none; max-height: 94vh; padding: 0; border: 0; border-radius: 10px; background: #111; color: #fff; overflow: visible; }
.lmv-lightbox::backdrop { background: rgba(0, 0, 0, .82); }
.lmv-lightbox figure { position: relative; margin: 0; }
.lmv-lightbox img { display: block; width: 100%; max-height: 82vh; object-fit: contain; border-radius: 10px 10px 0 0; }
.lmv-lightbox figcaption { min-height: 1.2em; padding: 10px 56px 12px 16px; font-size: .95rem; }
.lmv-lightbox .lmv-ai { top: 12px; left: 14px; right: auto; }
.lmv-lightbox button { position: absolute; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }
.lmv-lightbox button:hover, .lmv-lightbox button:focus-visible { background: rgba(0, 0, 0, .8); }
.lmv-lightbox__prev { top: calc(41vh - 22px); left: 10px; }
.lmv-lightbox__next { top: calc(41vh - 22px); right: 10px; }
.lmv-lightbox__close { top: 10px; right: 10px; font-size: 1.7rem !important; }
.lmv-lightbox__count { position: absolute; right: 16px; bottom: 12px; font-size: .85rem; opacity: .75; }
.lmv-lightbox.is-single .lmv-lightbox__prev, .lmv-lightbox.is-single .lmv-lightbox__next, .lmv-lightbox.is-single .lmv-lightbox__count { display: none; }
@media (max-width: 600px) {
	.lmv-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	.lmv-lightbox { width: 100vw; border-radius: 0; }
	.lmv-lightbox img { border-radius: 0; }
}

.lmv-trip__layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto 1fr; column-gap: 40px; row-gap: 24px; margin-top: 32px; }
.lmv-trip__content { grid-column: 1; grid-row: 1 / span 2; }
.lmv-trip__side { grid-column: 2; grid-row: 1; }
.lmv-trip__gallery { grid-column: 2; grid-row: 2; align-self: start; }
.lmv-trip__gallery h2 { font-size: 1.35rem; margin: 0 0 12px; }
.lmv-trip__gallery .lmv-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lmv-trip__content section + section { margin-top: 28px; }
.lmv-trip__content h2, .lmv-box h2 { font-size: 1.35rem; margin: 0 0 12px; }
.lmv-trip__side { display: flex; flex-direction: column; gap: 20px; }
.lmv-box { padding: 22px; border: 2px solid var(--lmv-brand); border-radius: var(--lmv-radius); background: var(--lmv-brand-soft); }
.lmv-box .lmv-btn { display: block; width: 100%; margin-top: 12px; }
.lmv-prices { list-style: none; margin: 0 0 12px; padding: 0; }
.lmv-prices li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--lmv-line); }
.lmv-prices strong { white-space: nowrap; }
.lmv-small, .lmv-small p { font-size: .9rem; color: var(--lmv-muted); }
.lmv-files { margin: 0; padding-left: 18px; }
.lmv-notfound { text-align: center; padding: 40px 0; }

@media (max-width: 860px) {
	.lmv-trip__layout { grid-template-columns: 1fr; grid-template-rows: none; row-gap: 28px; }
	.lmv-trip__content, .lmv-trip__side, .lmv-trip__gallery { grid-column: 1; grid-row: auto; }
	.lmv-trip__side { order: -1; }
	.lmv-trip__gallery { order: 1; }
	.lmv-hero__badge { position: static; max-width: none; border-radius: 0; text-align: left; }
}

/* ---------- Varausikkuna ---------- */

body.lmv-lock { overflow: hidden; }
.lmv-modal[hidden] { display: none; }
.lmv-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.lmv-modal__backdrop { position: absolute; inset: 0; background: rgba(17, 29, 45, .6); }
.lmv-modal__dialog {
	position: relative;
	width: min(900px, 100%);
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 28px 32px 32px;
	border-radius: var(--lmv-radius);
	background: #fff;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
	outline: none;
}
.lmv-modal__close {
	position: absolute; top: 10px; right: 14px;
	width: 40px; height: 40px;
	border: 0; border-radius: 50%;
	background: transparent; color: var(--lmv-muted);
	font-size: 2rem; line-height: 1; cursor: pointer;
}
.lmv-modal__close:hover { background: var(--lmv-soft); color: var(--lmv-text); }
.lmv-modal h2#lmv-modal-title { margin: 0; font-size: 1.5rem; }
.lmv-modal__trip { margin: 2px 0 14px; color: var(--lmv-muted); }
.lmv-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--lmv-line); }
.lmv-steps .crumbs { padding: 4px 12px; border-radius: 999px; background: var(--lmv-soft); color: var(--lmv-muted); font-size: .85rem; }
.lmv-steps .crumbs[style*="bold"] { background: var(--lmv-accent); color: #fff; }
.lmv-error { color: #b42318; font-weight: 600; }

/* Latausilmaisin */
.lmv-loader { display: none; position: absolute; inset: 0; background: rgba(255, 255, 255, .7); border-radius: var(--lmv-radius); }
.lmv-loader.is-on { display: block; }
.lmv-loader span {
	position: absolute; top: 50%; left: 50%;
	width: 42px; height: 42px; margin: -21px 0 0 -21px;
	border: 4px solid var(--lmv-line); border-top-color: var(--lmv-accent); border-radius: 50%;
	animation: lmv-spin .8s linear infinite;
}
@keyframes lmv-spin { to { transform: rotate(360deg); } }

/* Lomakevaiheiden HTML (vanha Foundation-ruudukko), rajattu ikkunaan */
/* Leveydet seuraavat ikkunan (ei selaimen) leveyttä */
.lmv-modal #reservation-page { container-type: inline-size; }
.lmv-modal .row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.lmv-modal .columns { flex: 0 0 auto; padding: 0 8px; width: 100%; }
/* Vanhassa HTML:ssä on rivejä suoraan rivien sisällä (sulkematon div) */
.lmv-modal .row > .row { flex: 0 0 auto; width: 100%; margin: 0; }
.lmv-modal .small-3 { width: 25%; }
.lmv-modal .small-6 { width: 50%; }
.lmv-modal .small-12 { width: 100%; }
@container (min-width: 560px) {
	.lmv-modal .medium-2 { width: 33.333%; }
	.lmv-modal .medium-3 { width: 25%; }
	.lmv-modal .medium-4, .lmv-modal .large-4 { width: 50%; }
	.lmv-modal .medium-6 { width: 50%; }
}
@container (min-width: 760px) {
	.lmv-modal .medium-4, .lmv-modal .large-4 { width: 33.333%; }
}
.lmv-modal fieldset { margin: 0 0 18px; padding: 16px 18px 6px; border: 1px solid var(--lmv-line); border-radius: var(--lmv-radius); }
.lmv-modal legend { padding: 0 6px; font-weight: 700; font-size: 1.05rem; }
.lmv-modal label { display: block; margin-bottom: 4px; font-weight: 600; font-size: .9rem; }
.lmv-modal .pakollinen { color: #b42318; }
.lmv-modal input[type="text"], .lmv-modal input[type="email"], .lmv-modal input[type="tel"],
.lmv-modal select, .lmv-modal textarea {
	width: 100%;
	margin: 0 0 14px;
	padding: 9px 11px;
	border: 1px solid #b9c3cf;
	border-radius: 6px;
	background: #fff;
	color: var(--lmv-text);
	font: inherit;
}
.lmv-modal textarea { min-height: 100px; }
.lmv-modal input:focus, .lmv-modal select:focus, .lmv-modal textarea:focus {
	outline: none; border-color: var(--lmv-accent); box-shadow: 0 0 0 3px rgba(31, 116, 208, .2);
}
.lmv-modal input[type="checkbox"] { width: auto; margin-right: 8px; }
.lmv-modal label.error { color: #b42318; font-weight: 600; font-size: .85rem; margin: -10px 0 12px; }
.lmv-modal input.error, .lmv-modal select.error { border-color: #b42318; }
.lmv-modal table { width: 100%; margin: 0 0 18px; border-collapse: collapse; }
.lmv-modal th, .lmv-modal td { padding: 8px 10px; border-bottom: 1px solid var(--lmv-line); text-align: left; }
.lmv-modal .mybutton { margin: 8px 8px 0 0; }
.lmv-modal .info_image { width: 28px; vertical-align: middle; margin-left: 8px; }

@media (max-width: 600px) {
	.lmv-modal { padding: 0; }
	.lmv-modal__dialog { max-height: 100vh; height: 100%; border-radius: 0; padding: 22px 16px 28px; }
}


/* ---------- Varausvahvistus (Valmis-vaihe) ---------- */
.lmv-modal h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 14px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: #1f3b57;
}
.lmv-modal h1 img {
  width: 24px;
  height: 24px;
  max-width: 24px;
  flex: 0 0 24px;
  margin: 0;
}
.lmv-modal .columns > p {
  max-width: 560px;
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.55;
  color: #33475b;
}
.lmv-modal .columns > p:empty { display: none; }
.lmv-modal #load-reservation,
.lmv-modal #done { margin: 4px 10px 4px 0; }
.lmv-modal #load-reservation {
  background: #fff;
  color: #1f6fb2;
  border: 1px solid #1f6fb2;
}
.lmv-modal #load-reservation:hover { background: #eef5fb; }
@media (max-width: 480px) {
  .lmv-modal h1 { font-size: 19px; }
  .lmv-modal #load-reservation,
  .lmv-modal #done { width: 100%; margin: 6px 0; }
}