/**
 * PakoMielle Arvostelut — julkiset tyylit.
 * Värit ja mitat ovat muuttujia: voit ylikirjoittaa ne teeman omassa CSS:ssä,
 * esim. .pm-arv { --pm-arv-accent: #c0392b; }
 */

.pm-arv {
	--pm-arv-bg: #111111;
	--pm-arv-card: #222222;
	--pm-arv-text: #ffffff;
	--pm-arv-muted: rgba( 255, 255, 255, 0.7 );
	--pm-arv-accent: #006dff;
	--pm-arv-star: #fcbf02;
	--pm-arv-star-off: rgba( 255, 255, 255, 0.18 );
	--pm-arv-radius: 24px;
	--pm-arv-card-radius: 24px;
	--pm-arv-pad: 40px;
	--pm-arv-gap: 20px;
	--pm-arv-font: 18px;
	--pm-arv-logo-h: 16px;
	--pm-arv-arrow: 28px;
	--pm-arv-arrow-icon: 17px;
	--pm-arv-dot: 8px;
	--pm-arv-avatar: 28px;
	/* Shortcode asettaa --pm-arv-columns-desktop; media queryt johtavat tästä
	   kapeampien näyttöjen sarakemäärän. */
	--pm-arv-columns: var( --pm-arv-columns-desktop, 3 );
	--pm-arv-lines: 4;

	position: relative;
	box-sizing: border-box;
	background: var( --pm-arv-bg );
	border-radius: var( --pm-arv-radius );
	padding: var( --pm-arv-pad );
	color: var( --pm-arv-text );
}

.pm-arv--light {
	--pm-arv-bg: #ffffff;
	--pm-arv-card: #f4f4f5;
	--pm-arv-text: #111111;
	--pm-arv-muted: rgba( 17, 17, 17, 0.65 );
	--pm-arv-star-off: rgba( 17, 17, 17, 0.15 );
}

.pm-arv *,
.pm-arv *::before,
.pm-arv *::after {
	box-sizing: border-box;
}

/* ------------------------------------------------------------- Otsikkopalkki */

.pm-arv__header {
	text-align: center;
	margin-bottom: 24px;
}

.pm-arv__title {
	margin: 0 0 6px;
	color: var( --pm-arv-text );
	font-size: 24px;
	line-height: 1.25;
}

.pm-arv__caption {
	margin: 0;
	color: var( --pm-arv-muted );
	font-size: 16px;
}

.pm-arv__stats {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
	margin: 12px 0 0;
	font-size: 16px;
}

.pm-arv__stats-rating {
	font-size: 22px;
	font-weight: 700;
	line-height: 1;
}

.pm-arv__stats .pm-arv__stars {
	margin-bottom: 0;
}

.pm-arv__stats .pm-arv__star {
	width: 22px;
	height: 22px;
}

.pm-arv__stats-count {
	color: var( --pm-arv-muted );
}

.pm-arv__stats-link {
	color: var( --pm-arv-accent );
	text-decoration: none;
}

.pm-arv__stats-link:hover,
.pm-arv__stats-link:focus {
	text-decoration: underline;
}

/* ------------------------------------------------------------------ Asettelu */

.pm-arv__viewport {
	overflow: hidden;
}

.pm-arv__track {
	display: flex;
	gap: var( --pm-arv-gap );
	margin: 0;
	padding: 0;
	list-style: none;
}

.pm-arv__item {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Karuselli */

.pm-arv--carousel .pm-arv__viewport {
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-ms-overflow-style: none;
	scrollbar-width: none;
}

.pm-arv--carousel .pm-arv__viewport::-webkit-scrollbar {
	display: none;
}

.pm-arv--carousel .pm-arv__item {
	flex: 0 0 calc( ( 100% - ( var( --pm-arv-columns ) - 1 ) * var( --pm-arv-gap ) ) / var( --pm-arv-columns ) );
	scroll-snap-align: start;
}

/* Ruudukko */

.pm-arv--grid .pm-arv__track {
	display: grid;
	grid-template-columns: repeat( var( --pm-arv-columns ), minmax( 0, 1fr ) );
}

/* ---------------------------------------------------------------------- Kortti */

.pm-arv__card {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	background: var( --pm-arv-card );
	border-radius: var( --pm-arv-card-radius );
	padding: 24px 26px;
}

.pm-arv__stars {
	display: flex;
	gap: 2px;
	margin-bottom: 14px;
}

.pm-arv__star {
	width: 26px;
	height: 26px;
	flex: 0 0 auto;
	fill: var( --pm-arv-star-off );
}

.pm-arv__star--on {
	fill: var( --pm-arv-star );
}

.pm-arv__text {
	color: var( --pm-arv-text );
	font-size: var( --pm-arv-font );
	line-height: 1.5;
	overflow-wrap: break-word;
}

.pm-arv__text--clamped {
	display: -webkit-box;
	-webkit-line-clamp: var( --pm-arv-lines );
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pm-arv__more {
	align-self: flex-end;
	margin-top: 8px;
	padding: 0;
	border: 0;
	background: none;
	color: var( --pm-arv-accent );
	font-size: calc( var( --pm-arv-font ) - 2px );
	font-family: inherit;
	line-height: 1.5;
	cursor: pointer;
}

.pm-arv__more:hover,
.pm-arv__more:focus-visible {
	text-decoration: underline;
}

.pm-arv__reply {
	margin-top: 16px;
	padding: 14px 16px;
	border-radius: 12px;
	background: rgba( 255, 255, 255, 0.06 );
	color: var( --pm-arv-muted );
	font-size: 15px;
	line-height: 1.5;
}

.pm-arv--light .pm-arv__reply {
	background: rgba( 17, 17, 17, 0.05 );
}

.pm-arv__reply-label {
	display: block;
	margin-bottom: 4px;
	color: var( --pm-arv-text );
	font-weight: 700;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.pm-arv__source {
	display: flex;
	justify-content: center;
	margin-top: auto;
	padding-top: 18px;
}

.pm-arv__source-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

/* Kaksi luokkaa, jotta teeman img-säännöt eivät ohita korkeutta. */
.pm-arv .pm-arv__source-logo {
	display: block;
	height: var( --pm-arv-logo-h );
	width: auto;
	max-width: 100%;
}

.pm-arv__source-text {
	color: var( --pm-arv-accent );
	font-size: 14px;
	font-weight: 700;
}

/* --------------------------------------------------------------- Nimi kortin alla */

.pm-arv__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 6px 0;
	font-size: 15px;
}

.pm-arv__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: var( --pm-arv-avatar );
	height: var( --pm-arv-avatar );
	border-radius: 50%;
	overflow: hidden;
	background: rgba( 255, 255, 255, 0.12 );
	color: var( --pm-arv-text );
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
}

.pm-arv--light .pm-arv__avatar {
	background: rgba( 17, 17, 17, 0.08 );
}

/* Kaksi luokkaa, jotta teeman img-säännöt eivät venytä kuvaa. */
.pm-arv .pm-arv__avatar-img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	border-radius: 50%;
	object-fit: cover;
}

.pm-arv__author {
	font-weight: 700;
	color: var( --pm-arv-text );
}

.pm-arv__verified {
	display: inline-flex;
	color: var( --pm-arv-accent );
}

.pm-arv__verified svg {
	width: 14px;
	height: 14px;
}

.pm-arv__date {
	color: var( --pm-arv-muted );
	font-size: 14px;
}

/* -------------------------------------------------- Selauspalkki alalaidassa */

.pm-arv__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 22px;
}

.pm-arv__nav[hidden] {
	display: none;
}

.pm-arv__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var( --pm-arv-arrow );
	height: var( --pm-arv-arrow );
	padding: 0;
	border: 1px solid rgba( 255, 255, 255, 0.2 );
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.06 );
	color: var( --pm-arv-text );
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.pm-arv__arrow:hover,
.pm-arv__arrow:focus-visible {
	background: rgba( 255, 255, 255, 0.16 );
	border-color: rgba( 255, 255, 255, 0.36 );
}

.pm-arv__arrow svg {
	width: var( --pm-arv-arrow-icon );
	height: var( --pm-arv-arrow-icon );
}

.pm-arv__arrow[hidden] {
	display: none;
}

.pm-arv--light .pm-arv__arrow {
	border-color: rgba( 17, 17, 17, 0.18 );
	background: rgba( 17, 17, 17, 0.05 );
}

.pm-arv--light .pm-arv__arrow:hover,
.pm-arv--light .pm-arv__arrow:focus-visible {
	background: rgba( 17, 17, 17, 0.12 );
	border-color: rgba( 17, 17, 17, 0.32 );
}

/* --------------------------------------------------------------------- Pallot */

.pm-arv__dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.pm-arv__dot {
	width: var( --pm-arv-dot );
	height: var( --pm-arv-dot );
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var( --pm-arv-text );
	opacity: 0.3;
	cursor: pointer;
}

.pm-arv__dot--active {
	opacity: 1;
}

/* ---------------------------------------------------------------- Responsiivisuus */

@media ( max-width: 1024px ) {
	.pm-arv {
		--pm-arv-columns: min( 2, var( --pm-arv-columns-desktop, 3 ) );
		--pm-arv-pad: 28px;
	}
}

@media ( max-width: 767px ) {
	.pm-arv {
		--pm-arv-columns: 1;
		--pm-arv-pad: 20px;
		--pm-arv-font: 17px;
	}

	.pm-arv__card {
		padding: 20px;
	}

}

@media ( prefers-reduced-motion: reduce ) {
	.pm-arv--carousel .pm-arv__viewport {
		scroll-behavior: auto;
	}
}

/* ------------------------------------------ Teeman nappityylien nollaus

   pakomielle.fi:n teema tyylittää kaikki button-elementit (padding, väri,
   reunat, display) niin vahvasti, että lohkon omat säännöt jäävät alle.
   Nollataan tyylit vain tämän lohkon sisällä — siksi !important. */

.pm-arv .pm-arv__source-logo {
	display: block !important;
	width: auto !important;
	height: var( --pm-arv-logo-h ) !important;
	max-width: 100% !important;
	object-fit: contain;
}

.pm-arv button {
	appearance: none;
	-webkit-appearance: none;
	box-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	font-family: inherit !important;
	min-width: 0 !important;
	transform: none !important;
}

.pm-arv .pm-arv__more {
	display: inline-block !important;
	align-self: flex-end !important;
	text-align: right !important;
	width: auto !important;
	height: auto !important;
	margin: 8px 0 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	color: var( --pm-arv-accent ) !important;
	font-size: calc( var( --pm-arv-font ) - 2px ) !important;
	line-height: 1.5 !important;
}

.pm-arv .pm-arv__arrow {
	display: inline-flex !important;
	width: var( --pm-arv-arrow ) !important;
	height: var( --pm-arv-arrow ) !important;
	padding: 0 !important;
	border: 1px solid rgba( 255, 255, 255, 0.2 ) !important;
	border-radius: 50% !important;
	background: rgba( 255, 255, 255, 0.06 ) !important;
	color: var( --pm-arv-text ) !important;
}

.pm-arv .pm-arv__arrow:hover,
.pm-arv .pm-arv__arrow:focus-visible {
	background: rgba( 255, 255, 255, 0.16 ) !important;
	border-color: rgba( 255, 255, 255, 0.36 ) !important;
}

.pm-arv .pm-arv__arrow svg {
	width: var( --pm-arv-arrow-icon ) !important;
	height: var( --pm-arv-arrow-icon ) !important;
}

.pm-arv--light .pm-arv__arrow {
	border-color: rgba( 17, 17, 17, 0.18 ) !important;
	background: rgba( 17, 17, 17, 0.05 ) !important;
}

.pm-arv--light .pm-arv__arrow:hover,
.pm-arv--light .pm-arv__arrow:focus-visible {
	background: rgba( 17, 17, 17, 0.12 ) !important;
	border-color: rgba( 17, 17, 17, 0.32 ) !important;
}

.pm-arv .pm-arv__dot {
	display: block !important;
	width: var( --pm-arv-dot ) !important;
	height: var( --pm-arv-dot ) !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var( --pm-arv-text ) !important;
	opacity: 0.3;
}

.pm-arv .pm-arv__dot--active {
	opacity: 1;
}

/* Teema värittää kaikki linkit, joten otsikkopalkin linkki varmistetaan. */
.pm-arv .pm-arv__stats-link {
	color: var( --pm-arv-accent ) !important;
	text-decoration: none !important;
}

.pm-arv .pm-arv__stats-link:hover,
.pm-arv .pm-arv__stats-link:focus {
	text-decoration: underline !important;
}

/*
 * Yllä olevat teeman ylikirjoitukset käyttävät display: !important, joka
 * voittaa selaimen oman [hidden] { display: none } -säännön. Siksi piilotus
 * varmistetaan erikseen — muuten "Lue lisää" ja nuolet näkyisivät silloinkin,
 * kun JS on merkinnyt ne piilotetuiksi.
 */
.pm-arv [hidden],
.pm-arv__nav[hidden] {
	display: none !important;
}
