/* ============================================================
   Marselling Kilta – etusivun tyylit (shortcodet)
   Luokkanimet: .mk-grid, .mk-item ...
   Tarkoitettu toimimaan Astra + Elementor -teemassa.
   ============================================================ */

.mk-grid {
	display: grid;
	gap: 24px;
	margin: 0 0 24px;
}

/* Sarakemäärä */
.mk-grid.mk-cols-1 { grid-template-columns: 1fr; }
.mk-grid.mk-cols-2 { grid-template-columns: repeat( 2, 1fr ); }
.mk-grid.mk-cols-3 { grid-template-columns: repeat( 3, 1fr ); }
.mk-grid.mk-cols-4 { grid-template-columns: repeat( 4, 1fr ); }
.mk-grid.mk-cols-5 { grid-template-columns: repeat( 5, 1fr ); }
.mk-grid.mk-cols-6 { grid-template-columns: repeat( 6, 1fr ); }

@media ( max-width: 1024px ) {
	.mk-grid.mk-cols-4,
	.mk-grid.mk-cols-5,
	.mk-grid.mk-cols-6 { grid-template-columns: repeat( 3, 1fr ); }
}
@media ( max-width: 782px ) {
	.mk-grid { grid-template-columns: repeat( 2, 1fr ) !important; }
}
@media ( max-width: 480px ) {
	.mk-grid { grid-template-columns: 1fr !important; }
}

/* ---- Kortti ---- */
.mk-item {
	position: relative;
}
.mk-item__link {
	display: block;
	text-decoration: none;
	color: inherit;
}
.mk-item__media {
	position: relative;
	overflow: hidden;
	background: #f2f2f2;
	aspect-ratio: 4 / 3;
	border-radius: 4px;
}
.mk-item--taiteilija .mk-item__media {
	aspect-ratio: 1 / 1;
}
.mk-item__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}
.mk-item__link:hover .mk-item__img {
	transform: scale( 1.04 );
}
.mk-item__img--empty {
	display: block;
	width: 100%;
	height: 100%;
	background: repeating-linear-gradient( 45deg, #efefef, #efefef 10px, #e7e7e7 10px, #e7e7e7 20px );
}

.mk-item__title {
	margin: 12px 0 2px;
	font-size: 1.05rem;
	line-height: 1.3;
}
.mk-item__meta {
	margin: 0 0 2px;
	font-size: 0.85rem;
	color: #666;
}
.mk-item__author {
	font-weight: 600;
	color: #333;
}

/* ---- Näyttelyn tila-merkki kuvan päällä ---- */
.mk-item__media .mk-tila {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.3px;
}
/* Musta/valkoinen/harmaa (alkuvaihe) */
.mk-tila--tulevat { background: #111; color: #fff; }
.mk-tila--kaynnissa { background: #444; color: #fff; }
.mk-tila--menneet { background: #e2e2e2; color: #555; }
.mk-tila--ajoittamaton { background: #f0f0f0; color: #888; }

.mk-empty {
	color: #888;
	font-style: italic;
}

/* ============================================================
   Single-näkymät (the_content -rikastus)
   ============================================================ */
.mk-single {
	margin-top: 32px;
}
.mk-single__heading {
	margin: 0 0 16px;
	font-size: 1.4rem;
}

/* Teoksen galleria */
.mk-single__gallery {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 180px, 1fr ) );
	gap: 12px;
	margin: 0 0 20px;
}
.mk-single__gallery-item {
	display: block;
	overflow: hidden;
	border-radius: 4px;
	background: #f2f2f2;
}
.mk-single__gallery-item .mk-item__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Tieto-lista */
.mk-single__meta {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 4px 18px;
	margin: 0 0 16px;
}
.mk-single__meta dt {
	font-weight: 600;
	color: #444;
}
.mk-single__meta dd {
	margin: 0;
}

.mk-single__author {
	margin: 0 0 12px;
}
.mk-single__links {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}
.mk-single__block {
	margin-top: 24px;
}
.mk-single__block h3 {
	margin: 0 0 12px;
}
.mk-single__status {
	margin: 0 0 12px;
}
.mk-single__cv {
	margin: 0 0 16px;
}
.mk-cv-link {
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid #111;
	color: #111;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 600;
}
.mk-cv-link:hover {
	background: #111;
	color: #fff;
}

/* ============================================================
   Single-sivu: oma header + taiteilijasivu (ei blogi-ilmettä)
   ============================================================ */
/* Piilota teeman blogi-otsikko + meta ("Kirjoittaja / pvm") CPT-singleissä;
   tulostamme oman otsikon ja rakenteen. */
.single-mk_taiteilija .entry-header,
.single-mk_teos .entry-header,
.single-mk_nayttely .entry-header {
	display: none !important;
}

/* Injektoitu sivuston header (wp_body_open) */
.mk-single-header {
	width: 100%;
}

/* Oma sivuotsikko (teos / näyttely) */
.mk-single-title {
	margin: 0 0 20px;
}

/* Taiteilijasivun hero: kuva + nimi/tiedot vierekkäin */
.mk-art__head {
	display: flex;
	gap: 36px;
	align-items: flex-start;
	margin: 0 0 8px;
}
.mk-art__photo {
	flex: 0 0 220px;
}
.mk-art__img {
	width: 220px;
	height: 220px;
	object-fit: cover;
	border-radius: 50%;
	display: block;
	background: #ececec;
}
.mk-art__img--placeholder {
	background: #ececec;
}
.mk-art__intro {
	flex: 1 1 auto;
	min-width: 0;
}
.mk-art__name {
	margin: 0 0 2px;
}
.mk-art__role {
	margin: 0 0 18px;
	color: #777;
	font-size: 0.95rem;
}
.mk-art__bio {
	margin: 24px 0;
	line-height: 1.7;
}
@media ( max-width: 600px ) {
	.mk-art__head {
		flex-direction: column;
		gap: 18px;
	}
	.mk-art__photo {
		flex: none;
	}
	.mk-art__img {
		width: 160px;
		height: 160px;
	}
}

/* ============================================================
   Jäsenkortit (taiteilijaruudukko)  – musta / valkoinen
   ============================================================ */
.mk-members__search {
	width: 100%;
	max-width: 360px;
	display: block;
	margin: 0 0 24px;
	padding: 11px 16px;
	border: 1px solid #cfcfcf;
	border-radius: 999px;
	font: inherit;
}
.mk-members__search:focus {
	outline: 2px solid #111;
	outline-offset: 1px;
	border-color: #111;
}

.mk-card {
	text-align: center;
	padding: 8px;
}
.mk-card__photo {
	display: block;
	width: 130px;
	height: 130px;
	margin: 0 auto 14px;
	border-radius: 50%;
	overflow: hidden;
	background: #eee;
}
.mk-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.mk-card__img--empty {
	display: block;
	width: 100%;
	height: 100%;
	background: repeating-linear-gradient( 45deg, #efefef, #efefef 8px, #e6e6e6 8px, #e6e6e6 16px );
}
.mk-card__name {
	margin: 0 0 2px;
	font-size: 1.1rem;
	font-weight: 700;
}
.mk-card__name a {
	color: #111;
	text-decoration: none;
}
.mk-card__name a:hover {
	text-decoration: underline;
}
.mk-card__role {
	margin: 0 0 10px;
	color: #777;
	font-size: 0.9rem;
}
.mk-card__socials {
	display: flex;
	justify-content: center;
	gap: 10px;
}
.mk-card__social {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1px solid #d0d0d0;
	color: #111;
	transition: background 0.15s ease, color 0.15s ease;
}
.mk-card__social:hover {
	background: #111;
	color: #fff;
	border-color: #111;
}

/* ============================================================
   Moduuli 2: Etusivun näyttelyt – kaksi neliötä keskitettynä
   ============================================================ */
.mk-neliot-wrap {
	text-align: center;
}
.mk-neliot__year {
	text-align: center;
	margin: 0 0 24px;
	font-size: 1.6rem;
	font-weight: 700;
}
.mk-neliot {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 480px ) );
	gap: 32px;
	justify-content: center;
	margin: 0 auto;
}
.mk-nelio {
	text-align: left;
}
.mk-nelio__media {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f2f2f2;
	margin-bottom: 16px;
}
.mk-nelio__media .mk-item__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}
.mk-nelio__place {
	margin: 0 0 8px;
	font-size: 1.15rem;
	font-weight: 700;
	color: #111;
}
.mk-nelio__text { margin: 0 0 8px; color: #444; }
.mk-nelio__dates { margin: 0 0 6px; font-weight: 600; }
.mk-nelio__addr { margin: 0; color: #666; font-size: 0.9rem; }

@media ( max-width: 600px ) {
	.mk-neliot { grid-template-columns: 1fr; gap: 28px; }
}

/* ============================================================
   Moduuli 3: Näyttelyarkisto (historia)
   ============================================================ */
.mk-arkisto {
	display: flex;
	flex-direction: column;
	gap: 28px;
}
.mk-arkisto__item {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) 1.4fr;
	gap: 20px;
	align-items: start;
	padding-bottom: 28px;
	border-bottom: 1px solid #e6e6e6;
}
.mk-arkisto__item:last-child {
	border-bottom: none;
	padding-bottom: 0;
}
.mk-arkisto__images {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 6px;
}
.mk-arkisto__img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
	background: #f2f2f2;
}
.mk-arkisto__date {
	margin: 0 0 4px;
	color: #777;
	font-weight: 600;
}
.mk-arkisto__title {
	margin: 0 0 6px;
	font-size: 1.2rem;
}
.mk-arkisto__title a { color: #111; text-decoration: none; }
.mk-arkisto__title a:hover { text-decoration: underline; }
.mk-arkisto__place { margin: 0; color: #555; }

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

/* ============================================================
   Asettelu: kooste (menneet näyttelyt)
   juliste → tiedot (vuosi · paikka) → väli → lisäkuvat
   ============================================================ */
.mk-kooste-list {
	display: flex;
	flex-direction: column;
	gap: 56px;
}
.mk-kooste { text-align: center; }
.mk-kooste__poster {
	position: relative;
	display: inline-block;
	max-width: 100%;
}
.mk-kooste__posterimg {
	display: block;
	max-width: 100%;
	max-height: 80vh;
	width: auto;
	height: auto;
	border-radius: 4px;
}
.mk-kooste__posterimg--empty {
	width: 640px;
	max-width: 100%;
	height: 360px;
	background: repeating-linear-gradient( 45deg, #efefef, #efefef 10px, #e7e7e7 10px, #e7e7e7 20px );
}
/* Vuosi · paikka kuvan YLÄPUOLELLA, keskitettynä (kuvan ulkopuolella) */
.mk-kooste__info {
	margin: 0 0 14px;
	text-align: center;
	font-size: 1.1rem;
	font-weight: 600;
	color: #2d3951;
}
/* Lisäkuvat: allekkain, kaikki samankokoisia */
.mk-kooste__images {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 22px; /* "väike tühimik" info ja lisapiltide vahel */
}
.mk-kooste__imglink { display: block; }
.mk-kooste__img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	display: block;
	border-radius: 4px;
	background: #f2f2f2;
	transition: transform 0.3s ease;
}
.mk-kooste__imglink:hover .mk-kooste__img { transform: scale( 1.02 ); }

@media ( max-width: 600px ) {
	.mk-kooste-list { gap: 40px; }
	.mk-kooste__info { font-size: 1rem; }
}

/* ============================================================
   Etusivun kuvakaruselli  [kilta_galleria]
   ============================================================ */
.mk-carousel {
	position: relative;
	--mk-carousel-h: clamp( 360px, 70vh, 820px );
	margin: 0 0 24px;
}
/* Koko ruudun levyinen (full-bleed) – murtautuu ulos sisältöpalstasta */
.mk-carousel--full {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc( 50% - 50vw );
	margin-right: calc( 50% - 50vw );
}
.mk-carousel__viewport {
	overflow: hidden;
	width: 100%;
}
.mk-carousel__track {
	display: flex;
	transition: transform 0.45s ease;
	will-change: transform;
}
.mk-carousel__slide {
	position: relative;
	flex: 0 0 100%;
	min-width: 100%;
	height: var(--mk-carousel-h);
	background: #f2f2f2;
}
.mk-carousel__link {
	display: block;
	width: 100%;
	height: 100%;
}
.mk-carousel__img {
	/* !important kumoaa teeman "img { height:auto }" -säännön, joka muuten
	   jätti kuvan slaidin korkeutta lyhyemmäksi (harmaa tyhjä alue alle). */
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	display: block;
}
.mk-carousel__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 14px 18px;
	background: linear-gradient( transparent, rgba( 0, 0, 0, 0.6 ) );
	color: #fff;
	font-weight: 600;
}
.mk-carousel__nav {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	width: 52px;
	height: 52px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba( 17, 17, 17, 0.42 );
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	-webkit-backdrop-filter: blur( 4px );
	backdrop-filter: blur( 4px );
	box-shadow: 0 2px 12px rgba( 0, 0, 0, 0.28 );
	transition: background 0.18s ease, transform 0.18s ease;
	z-index: 2;
}
.mk-carousel__nav:hover { background: rgba( 17, 17, 17, 0.78 ); }
.mk-carousel__nav:active { transform: translateY( -50% ) scale( 0.94 ); }
.mk-carousel__nav svg { display: block; }
.mk-carousel__prev { left: 20px; }
.mk-carousel__next { right: 20px; }

/* Sovita: contain – koko kuva näkyy (ei rajausta), reunoille tausta */
.mk-carousel--contain .mk-carousel__slide { background: #111; }
.mk-carousel--contain .mk-carousel__img { object-fit: contain; }

/* Peek-tila: keskellä pääkuva, reunoilla edellinen/seuraava kurkistaa.
   Leveydet ja väli asettaa JS pikseleinä; nämä ovat varafallback. */
.mk-carousel--peek .mk-carousel__track { will-change: transform; }
.mk-carousel--peek .mk-carousel__slide {
	flex: 0 0 62%;
	max-width: 62%;
	min-width: 0;
	/* Reunakuvat (ei keskellä) kevyesti sumeat; keskikuva terävä. */
	filter: blur( 3px );
	transition: filter 0.4s ease;
}
.mk-carousel--peek .mk-carousel__slide.is-active {
	filter: none;
}
.mk-carousel--peek .mk-carousel__prev { left: 4%; }
.mk-carousel--peek .mk-carousel__next { right: 4%; }
.mk-carousel__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 12px;
}
.mk-carousel__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #cfcfcf;
	cursor: pointer;
}
.mk-carousel__dot.is-active { background: #111; }

@media ( max-width: 600px ) {
	.mk-carousel { --mk-carousel-h: clamp( 300px, 56vh, 460px ); }
	.mk-carousel__nav { width: 42px; height: 42px; }
	.mk-carousel__prev { left: 10px; }
	.mk-carousel__next { right: 10px; }
}
