/**
 * Paikallismarkkinat-pluginin pääasiallinen tyylitiedosto.
 *
 * @package Paikallismarkkinat
 * @version 2.2
 */

/* ==========================================================================
   1. Perusasetukset ja muuttujat
   ========================================================================== */

:root {
	--pm-sininen: #2b70a3;
	--pm-harmaa: #4c4c4c;
	--pm-vaalea-harmaa: #f4f4f4;
	--pm-teksti-vari: #333333;
	--pm-border-radius: 4px;
	--pm-border-color: #e0e0e0;
}


/* ==========================================================================
   2. Yleiset tyylit ja typografia
   ========================================================================== */

.paikallismarkkinat-wrap {
	font-family: 'Montserrat', sans-serif;
	color: var(--pm-teksti-vari);
	line-height: 1.6;
	margin: 2em 0;
}

.paikallismarkkinat-wrap h1,
.paikallismarkkinat-wrap h2,
.paikallismarkkinat-wrap h3,
.paikallismarkkinat-wrap h4,
.paikallismarkkinat-wrap h5,
.paikallismarkkinat-wrap h6 {
	font-weight: 700;
	color: var(--pm-harmaa);
}

.paikallismarkkinat-wrap a {
	color: var(--pm-sininen);
	text-decoration: none;
	transition: color 0.2s ease-in-out;
}

.paikallismarkkinat-wrap a:hover,
.paikallismarkkinat-wrap a:focus {
	text-decoration: underline;
	color: var(--pm-harmaa);
}


/* ==========================================================================
   3. Arkistonäkymän Grid-asettelu
   ========================================================================== */

.paikallismarkkinat-ilmoitukset-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	margin-top: 2em;
}


/* ==========================================================================
   4. Yksittäinen ilmoituskortti (Arkistossa)
   ========================================================================== */

.pm-ilmoitus-kortti {
	background-color: #ffffff;
	border: 1px solid var(--pm-border-color);
	border-radius: var(--pm-border-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.pm-ilmoitus-kortti:hover {
	box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
	transform: translateY(-5px);
}

.pm-kortti-kuva-wrap {
	position: relative;
	width: 100%;
	padding-top: 66.66%;
	background-color: var(--pm-vaalea-harmaa);
}

.pm-kortti-kuva-wrap a { display: block; }

.pm-kortti-kuva-wrap img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pm-kortti-sisalto {
	padding: 15px;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
}

.pm-kortti-meta {
	display: flex;
	justify-content: space-between;
	font-size: 0.8em;
	color: #777;
	margin-bottom: 10px;
	font-weight: 500;
}

.pm-kortti-kategoria {
	background-color: var(--pm-vaalea-harmaa);
	padding: 2px 8px;
	border-radius: var(--pm-border-radius);
	color: var(--pm-harmaa);
}

.pm-ilmoitus-kortti .entry-title {
	font-size: 1.2rem;
	margin: 0 0 10px 0;
	line-height: 1.3;
}

.pm-ilmoitus-kortti .entry-title a { color: var(--pm-harmaa); }
.pm-ilmoitus-kortti .entry-title a:hover { color: var(--pm-sininen); text-decoration: none; }

.pm-kortti-hinta {
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--pm-sininen);
	margin-top: auto;
}


/* ==========================================================================
   5. Yksittäisen ilmoituksen sivu (Mata)
   ========================================================================== */

.pm-single-ilmoitus .entry-header {
	margin-bottom: 2em;
	border-bottom: 1px solid var(--pm-border-color);
	padding-bottom: 1em;
}

.pm-single-meta {
	font-size: 0.9em;
	color: #777;
}

.pm-single-meta span {
	margin-right: 1.5em;
}

.pm-single-content-wrap {
	display: grid;
	grid-template-columns: 1fr;
	gap: 30px;
}

.pm-sidebar-box {
	background-color: #ffffff;
	padding: 20px;
	border: 1px solid var(--pm-border-color);
	border-radius: var(--pm-border-radius);
}

.pm-sidebar-hinta {
	font-size: 2rem;
	font-weight: 700;
	color: var(--pm-sininen);
	margin-bottom: 20px;
	text-align: center;
}

.pm-sidebar-details .detail-item {
	margin-bottom: 15px;
	padding-bottom: 15px;
	border-bottom: 1px dotted #ccc;
}
.pm-sidebar-details .detail-item:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.pm-sidebar-section {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid var(--pm-border-color);
}
.pm-sidebar-details + .pm-sidebar-section {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}

.pm-ominaisuudet-lista {
	list-style: none;
	padding: 0;
	margin: 0;
}
.pm-ominaisuudet-lista li {
	padding-left: 25px;
	position: relative;
	margin-bottom: 5px;
}
.pm-ominaisuudet-lista li::before {
	content: '✓';
	color: var(--pm-sininen);
	font-weight: bold;
	position: absolute;
	left: 0;
}

.pm-linkit a {
	display: block;
	margin-bottom: 10px;
}

.pm-yhteydenotto-wrap {
	margin-top: 25px;
	border-top: 1px solid var(--pm-border-color);
	padding-top: 20px;
}

.pm-button {
	display: block;
	width: 100%;
	background-color: var(--pm-sininen);
	color: #ffffff;
	padding: 12px 20px;
	border: none;
	border-radius: var(--pm-border-radius);
	font-family: 'Montserrat', sans-serif;
	font-size: 1rem;
	font-weight: 700;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.2s ease-in-out;
}

.pm-button:hover {
	background-color: var(--pm-harmaa);
	color: #ffffff;
}

.pm-login-prompt {
	text-align: center;
	font-size: 0.9em;
}

@media (min-width: 768px) {
	.pm-single-content-wrap {
		grid-template-columns: 2fr 1fr;
	}
}


/* ==========================================================================
   6. Yksittäisen ilmoituksen sivu (Elpo)
   ========================================================================== */

.pm-single-elpo {
	max-width: 700px;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.pm-single-elpo .elpo-header .entry-title {
	font-size: 2.5rem;
	margin-bottom: 0.2em;
}

.pm-single-elpo .pm-elpo-dates {
	font-size: 1.2rem;
	color: #777;
	margin-bottom: 2em;
}

.pm-single-elpo .pm-elpo-dates span {
	margin: 0 0.5em;
}

.pm-single-elpo .pm-elpo-featured-image {
	margin-bottom: 2em;
}

.pm-single-elpo .elpo-content {
	font-size: 1.1rem;
	line-height: 1.7;
}

/* ==========================================================================
   7. Yksittäisen TAPAHTUMAN sivu (Tama) - LOPULLINEN ULKOASU
   ========================================================================== */

.pm-single-tapahtuma .paikallismarkkinat-wrap {
	max-width: 1100px;
	margin-left: auto;
	margin-right: auto;
}

.pm-single-tapahtuma .entry-header {
	text-align: left;
	margin-bottom: 1em;
	border-bottom: none;
}

.pm-single-tapahtuma .entry-header .entry-title {
	font-size: 2.8rem;
}

/* KORJATTU: Uusi asettelu kuvalle ja tärkeimmille tiedoille */
.pm-tapahtuma-pääalue {
	display: grid;
	grid-template-columns: 1fr; /* Oletus mobiilille */
	gap: 30px;
	margin-bottom: 2em;
}

.pm-tapahtuma-kuva img {
	max-width: 100%;
	height: auto;
	display: block;
	border-radius: var(--pm-border-radius);
}

@media (min-width: 992px) {
	.pm-tapahtuma-pääalue {
		grid-template-columns: 400px 1fr; /* Kuva kiinteä leveys, tiedot vie loput */
		align-items: start;
	}
}

.pm-tapahtuma-details-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 20px;
}

.pm-tapahtuma-content-wrap {
	padding-top: 2em;
	border-top: 1px solid var(--pm-border-color);
}

.pm-tapahtuma-details-grid .detail-box,
.pm-tapahtuma-content-wrap .detail-box {
	background-color: #ffffff;
	border: 1px solid var(--pm-border-color);
	padding: 25px;
	border-radius: var(--pm-border-radius);
	box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.pm-tapahtuma-details-grid .detail-box h4,
.pm-tapahtuma-content-wrap .detail-box h4 {
	display: flex;
	align-items: center;
	font-size: 1.1rem;
	margin-top: 0;
	margin-bottom: 1em;
	border-bottom: 1px solid var(--pm-border-color);
	padding-bottom: 0.7em;
}

.pm-tapahtuma-details-grid .detail-box h4::before,
.pm-tapahtuma-content-wrap .detail-box h4::before {
	content: '';
	display: inline-block;
	width: 24px;
	height: 24px;
	margin-right: 12px;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	opacity: 0.7;
}

/* SVG-ikonit upotettuna suoraan CSS:ään */
.pm-single-tapahtuma .detail-box:nth-of-type(1) h4::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234c4c4c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E"); } /* Milloin */
.pm-single-tapahtuma .detail-box:nth-of-type(2) h4::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234c4c4c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3E%3C/path%3E%3Ccircle cx='12' cy='10' r='3'%3E%3C/circle%3E%3C/svg%3E"); } /* Missä */
.pm-single-tapahtuma .detail-box:nth-of-type(3) h4::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234c4c4c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z'%3E%3C/path%3E%3Cpath d='M13 5v2'%3E%3C/path%3E%3Cpath d='M13 17v2'%3E%3C/path%3E%3Cpath d='M13 11v2'%3E%3C/path%3E%3C/svg%3E"); } /* Pääsymaksu */
.pm-single-tapahtuma .detail-box:nth-of-type(4) h4::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234c4c4c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'%3E%3C/path%3E%3C/svg%3E"); } /* Lisätiedot */
.pm-single-tapahtuma .detail-box.pysakointi h4::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234c4c4c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2'%3E%3C/path%3E%3Ccircle cx='7' cy='17' r='2'%3E%3C/circle%3E%3Cpath d='M9 17h6'%3E%3C/path%3E%3Ccircle cx='17' cy='17' r='2'%3E%3C/circle%3E%3C/svg%3E"); } /* Pysäköinti */
.pm-single-tapahtuma .detail-box.linkit h4::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234c4c4c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.72'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.72-1.72'%3E%3C/path%3E%3C/svg%3E"); } /* Linkit */

.pm-tapahtuma-details-grid .detail-box-full {
	grid-column: 1 / -1;
}

.pm-button-small {
	display: inline-block;
	background-color: var(--pm-sininen);
	color: #ffffff;
	padding: 8px 15px;
	border-radius: var(--pm-border-radius);
	font-size: 0.9rem;
	font-weight: 700;
	text-align: center;
	margin-top: 0.5em;
}
.pm-button-small:hover {
	background-color: var(--pm-harmaa);
	color: #ffffff;
	text-decoration: none;
}
