/* Camp listings: compact rows (free) and cards (paid) in one list. Colours follow Kadence palette vars. */
.kl-listing {
	--kl-accent: var(--global-palette1, #0b5cad);
	--kl-text: var(--global-palette3, #1a202c);
	--kl-muted: var(--global-palette5, #4a5568);
	--kl-border: var(--global-palette7, #e2e8f0);
	--kl-bg: var(--global-palette9, #fff);
	--kl-hover: var(--global-palette8, #f7fafc);
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 0 !important;
}
.kl-listing > .kl-item { margin: 0; }

/* Free rows */
.kl-row { border-bottom: 1px solid var(--kl-border); background: var(--kl-bg); }
.kl-listing > .kl-row:first-child { border-top: 1px solid var(--kl-border); }
.kl-row__link {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .1rem 1rem;
	min-height: 44px; /* comfortable tap target */
	padding: .55rem .9rem;
	color: var(--kl-text);
	text-decoration: none;
	font-family: var(--kl-font-ui, inherit);
}
.kl-row__link:hover { background: var(--kl-hover); }
.kl-row__link:hover .kl-row__title { color: var(--kl-accent); text-decoration: underline; }
.kl-row__link:focus-visible { outline: 3px solid var(--kl-accent); outline-offset: -3px; }
.kl-row__title { flex: 1 1 100%; font-size: 15px; font-weight: 600; line-height: 1.35; letter-spacing: -0.005em; }
.kl-row__meta { display: flex; flex-wrap: wrap; gap: .05rem .85rem; color: var(--kl-muted); font-size: 14px; line-height: 1.45; }
.kl-row__date { color: var(--kl-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kl-row__place { white-space: nowrap; }
.kl-row__org { overflow-wrap: anywhere; } /* Long organizer names wrap instead of overflowing. */
.kl-row__more { font-style: italic; }

.kl-row__years { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Wide screens: fixed columns – name | dates | locality | birth years | organizer. */
@media (min-width: 901px) {
	.kl-row__link { display: grid; grid-template-columns: minmax(0, 1fr) 8.5rem 7.5rem 7.25rem minmax(9rem, 13rem); align-items: center; gap: 0 1.25rem; padding: .5rem 1rem; }
	.kl-row__meta { display: contents; }
	.kl-row__title { grid-column: 1; }
	.kl-row__date { grid-column: 2; }
	.kl-row__place { grid-column: 3; }
	.kl-row__years { grid-column: 4; font-size: 13px; }
	.kl-row__org { grid-column: 5; }
	.kl-row__more { grid-column: 2 / -1; font-size: 13px; }
}

/* Paid cards: laaja leiriesittely in the normal list */
.kl-card { padding: .6rem 0; border-bottom: 1px solid var(--kl-border); }
.kl-card__inner { display: grid; grid-template-columns: 1fr; gap: 1rem 1.25rem; padding: 1rem 1.1rem; border: 1px solid var(--kl-border); border-left: 4px solid var(--kl-accent); border-radius: 10px; background: var(--kl-bg); overflow: hidden; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.kl-card--has-image .kl-card__inner { grid-template-columns: minmax(170px, 260px) 1fr; }
.kl-card__media { display: block; }
.kl-card__media img, .kl-card__img { display: block; width: 100%; height: 100%; max-height: 220px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.kl-card__body { min-width: 0; font-family: var(--kl-font-ui, inherit); }
.kl-card__badges { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .4rem; }
.kl-card__title { margin: 0 0 .35rem; font-family: var(--kl-font-display, inherit); font-size: 1.3rem; line-height: 1.25; }
.kl-card__title a { color: var(--kl-text); text-decoration: none; }
.kl-card__title a:hover { color: var(--kl-accent); text-decoration: underline; }
.kl-card__meta { display: flex; flex-wrap: wrap; gap: .1rem .9rem; margin: 0 0 .45rem; color: var(--kl-muted); font-size: 15px; }
.kl-card__meta time { color: var(--kl-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.kl-card__org { display: flex; align-items: center; gap: .55rem; margin: 0 0 .55rem; color: var(--kl-text); font-size: 14px; font-weight: 600; }
.kl-card__logo { flex: none; width: 36px; height: 36px; object-fit: contain; border-radius: 6px; background: #fff; box-shadow: 0 0 0 1px var(--kl-border); }
.kl-card__desc { margin: 0 0 .8rem; color: var(--kl-text); font-size: 15px; line-height: 1.55; }
.kl-card__actions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin: 0; }
.kl-card__more { font-weight: 600; }
.kl-card__cta { display: inline-block; padding: .6rem 1.2rem; min-height: 44px; border-radius: 8px; background: var(--kl-accent); color: #fff; font-weight: 600; text-decoration: none; line-height: 1.6; }
.kl-card__cta:hover, .kl-card__cta:focus { color: #fff; filter: brightness(1.1); }
.kl-card__cta:focus-visible, .kl-card__more:focus-visible { outline: 3px solid var(--kl-accent); outline-offset: 2px; }

/* Featured section ("Korostetut leirit", paid placement; the intro line states it, no per-card labels) */
.kl-featured {
	--kl-accent: var(--global-palette1, #0b5cad);
	--kl-text: var(--global-palette3, #1a202c);
	--kl-muted: var(--global-palette5, #4a5568);
	--kl-border: var(--global-palette7, #e2e8f0);
	--kl-bg: var(--global-palette9, #fff);
	box-sizing: border-box; margin: 0 0 28px; padding: 18px 18px 20px; border-radius: 14px;
	background: #eef5fc; border: 1px solid #cfe0f3; /* Fallback for browsers without color-mix(). */
	background: linear-gradient(180deg, color-mix(in srgb, var(--kl-accent) 10%, #fff), color-mix(in srgb, var(--kl-accent) 4%, #fff));
	border: 1px solid color-mix(in srgb, var(--kl-accent) 22%, #fff);
	font-family: var(--kl-font-ui, inherit);
}
.kl-featured__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem 1rem; margin: 0 0 14px; }
.kl-featured__title { margin: 0; font-family: var(--kl-font-display, inherit); font-size: 22px; line-height: 1.25; font-weight: 700; color: var(--kl-text); }
.kl-featured .kl-featured__intro { margin: 0; color: var(--kl-muted); font-size: 14px; line-height: 1.4; }
.kl-featured__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px !important; }
.kl-featured__list > .kl-item[hidden] { display: none; }
.kl-featured .kl-card { padding: 0; border: 0; }
.kl-featured .kl-card__inner { display: flex; flex-direction: column; height: 100%; gap: 0; padding: 0; border: 0; border-top: 5px solid var(--kl-accent); border-radius: 12px; box-shadow: 0 6px 18px rgba(15, 23, 42, .12), 0 1px 3px rgba(15, 23, 42, .08); }
.kl-featured .kl-card__media img, .kl-featured .kl-card__img { max-height: none; aspect-ratio: 16 / 9; border-radius: 0; }
.kl-featured .kl-card__body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.kl-featured .kl-card__title { font-size: 1.35rem; }
.kl-featured .kl-card__actions { margin-top: auto; }
.kl-featured .kl-card__cta { flex: 1 1 auto; text-align: center; }
/* Front page: same width as the upcoming list below. */
.kl-featured--etusivu { max-width: 1168px; margin: 32px auto 0; }
@media (max-width: 1200px) { .kl-featured--etusivu { margin-left: 16px; margin-right: 16px; } }

@media (max-width: 600px) {
	.kl-row__link { padding: .6rem .35rem; gap: .15rem .75rem; }
	.kl-card--has-image .kl-card__inner { grid-template-columns: 1fr; }
	.kl-card__inner { padding: .85rem; }
	.kl-card__media img, .kl-card__img { aspect-ratio: 16 / 9; }
	.kl-card__cta { display: block; width: 100%; text-align: center; }
	.kl-featured { padding: 14px 12px 16px; border-radius: 12px; }
	.kl-featured__title { font-size: 19px; }
	.kl-featured__list { grid-template-columns: 1fr; gap: 12px !important; }
	.kl-featured .kl-card__inner { padding: 0; }
}

/* Administrator preview (?kl_esikatselu=1): unpublished camps are clearly marked. */
.kl-preview-notice { margin: 0 0 1rem; padding: .75rem 1rem; border-left: 4px solid #b45309; background: #fff7ed; color: #431407; }
.kl-preview-notice a { font-weight: 600; }
.kl-item--luonnos { background: repeating-linear-gradient( -45deg, #fffbeb, #fffbeb 10px, #fef3c7 10px, #fef3c7 20px ); box-shadow: inset 4px 0 0 #b45309; }
.kl-item--luonnos .kl-row__link:hover { background: transparent; }
.kl-badge-luonnos { display: inline-block; margin-right: .35rem; padding: 0 .45rem; border-radius: 4px; background: #b45309; color: #fff; font-size: .78em; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; vertical-align: middle; }

/* Camp archive /leirit/ only (body class post-type-archive-kl_leiri; taxonomy listings and other pages untouched):
   compact Kadence title area, tighter gap above the list, slightly wider content on desktop. */
.post-type-archive-kl_leiri .entry-hero .entry-header { min-height: 110px; padding-top: 0; padding-bottom: 0; }
.post-type-archive-kl_leiri .entry-hero .entry-header h1 { margin: 0; }
.post-type-archive-kl_leiri .content-area { margin-top: 30px; }
@media (min-width: 1025px) {
	.post-type-archive-kl_leiri .content-container.site-container { max-width: 1400px; }
}

/* Upcoming camps on any page ([kiekkoleirit_tulevat], e.g. the front page): same rows, centred and compact. */
.kl-upcoming { box-sizing: border-box; max-width: 1200px; margin: 32px auto 56px; padding: 0 16px; }
.kl-upcoming__title { margin: 0 0 .75rem; font-size: 24px; line-height: 1.25; font-weight: 700; text-align: center; }
.kl-upcoming .kl-listing { background: var(--global-palette9, #fff); }
.kl-upcoming__empty { margin: 0; padding: 1rem 0; text-align: center; }
.kl-upcoming__all { margin: 1rem 0 0; text-align: center; }
.kl-upcoming__all a { display: inline-block; min-height: 44px; padding: .55rem 1.2rem; font-size: 15px; border: 2px solid var(--global-palette1, #0b5cad); border-radius: 6px; color: var(--global-palette1, #0b5cad); font-weight: 600; line-height: 1.5; text-decoration: none; }
.kl-upcoming__all a:hover, .kl-upcoming__all a:focus { background: var(--global-palette1, #0b5cad); color: #fff; }
@media (max-width: 600px) {
	.kl-upcoming { margin: 24px auto 56px; } /* Room for the next block's protruding icon. */
	.kl-upcoming__title { font-size: 21px; }
}

/* Inside page content (e.g. the front page) the theme's paragraph/heading margins must not stretch the cards. */
.kl-listing .kl-card__body > p, .kl-listing .kl-card__body > h2 { margin-top: 0; }
.kl-listing .kl-card__badges { margin-bottom: .4rem; }
.kl-listing .kl-card__title { margin-bottom: .35rem; }
.kl-listing .kl-card__meta { margin-bottom: .45rem; }
.kl-listing .kl-card__org { margin-bottom: .55rem; }
.kl-listing .kl-card__desc { margin-bottom: .8rem; }
.kl-listing .kl-card__actions { margin-bottom: 0; }
.kl-featured .kl-featured__title { margin: 0; }
@media (max-width: 600px) {
	.kl-featured--etusivu { margin-left: 0; margin-right: 0; }
	/* Compact featured cards on phones: low image strip, two-line description. */
	.kl-featured .kl-card__media img, .kl-featured .kl-card__img { aspect-ratio: 16 / 6; }
	.kl-featured .kl-card__body { padding: 12px 14px 14px; }
	.kl-featured .kl-card__title { font-size: 1.2rem; }
	.kl-featured .kl-card__desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
.entry-content ul.kl-listing, .kl-featured ul.kl-featured__list { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
/* At most three columns; a lone featured camp gets a horizontal card instead of a full-width image. */
.kl-featured .kl-featured__list { grid-template-columns: repeat(auto-fill, minmax(max(260px, calc((100% - 32px) / 3)), 1fr)); }
@media (min-width: 601px) {
	.kl-featured .kl-featured__list:has(> .kl-item:only-child) { grid-template-columns: 1fr; }
	.kl-featured .kl-item:only-child .kl-card__inner { display: grid; grid-template-columns: minmax(220px, 38%) 1fr; border-top: 0; border-left: 5px solid var(--kl-accent); }
	.kl-featured .kl-item:only-child .kl-card__media { position: relative; min-height: 220px; }
	.kl-featured .kl-item:only-child .kl-card__media img, .kl-featured .kl-item:only-child .kl-card__img { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; }
	.kl-featured .kl-item:only-child .kl-card__cta { flex: 0 0 auto; }
}
