/* ===== Reset / Base ===== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html, body {
	height: 100%;
}

body {
	font-family: Arial, sans-serif;
	background-color: #f9f9f9;
	color: #000000;
	line-height: 1.6;
	display: flex;
	flex-direction: column;
	flex: 1;
}

/* ===== Header ===== */
header {
	background-color: #50312c;
	color: white;
	padding: 15px;
	display: flex;
	align-items: center;
	position: fixed;       /* fiksē header augšā */
	top: 0;
	left: 0;
	width: 100%;
	z-index: 1000;
}

header a, #addAdLinkHeader {
	color: white;
	text-decoration: none;
	margin-right: 20px;
	font-weight: bold;     /* visas header saites treknas */
	cursor: pointer;
}

/* ===== Footer ===== */
footer {
	background-color: #50312c;
	margin-top: auto;
	width: 100%;
}

footer .footer-content {
	color: white;
	padding: 15px;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 5px;
}

/* Footer teksts un saites */
footer .footer-content p,
footer .footer-content a {
	margin: 0;
	padding: 0;
	color: inherit;
	text-decoration: none;
	font-weight: normal;
	cursor: pointer;
}

/* ===== Main / Saturs ===== */
main {
	padding: 70px;  /* vieta header zemāk */
}

h1, h2, h3 {
	margin-bottom: 10px;
}

p {
	margin-bottom: 15px;
}


/* ===== Pogas ===== */
button, .btn {
	background-color: #5a4209;
	color: white;
	border: 1px solid #012d19;
	padding: 8px 12px;
	border-radius: 5px;
	cursor: pointer;
	font-size: 14px;
}

button:hover, .btn:hover {
	background-color: #025530;
}

/* ===== Attēlu dzēšanas pogas ===== */
.img-btn {
	background-color: rgba(249, 68, 68, 0.7);
	color: white;
	border: none;
	border-radius: 50%;
	width: 20px;
	height: 40px;
	text-align: center;
	line-height: 18px;
	cursor: pointer;
}

/* ===== Sludinājumi / Kartītes ===== */
.ads {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* automātiski vairākas kolonnas */
	gap: 15px;
	margin-top: 20px;
}
.section-ads {
	display: grid;
	grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); /* automātiski vairākas kolonnas */
	gap: 15px;
	margin-bottom: 20px;
}

/* Sludinājumi */
.ad {
	background-color: #7e6b687d;
	border: 1px solid #012d19;
	border-radius: 5px;
	padding: 10px;
	display: flex;
	flex-direction: column;
	max-height: 350px;
	overflow: hidden;
}

a {/*a .ad DOES NOT WORK*/
  text-decoration: none !important;
}

.ad img {
	width: 100%;
	height: 150px;
	object-fit: cover;
	border-radius: 5px;
	margin-bottom: 10px;
}

.ad h3 {
	font-size: 18px;
	margin: 0 0 5px 0;
}

/* Ierobežo aprakstu rindas kartītēs */
.ad-text {
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	margin-bottom: 5px;
}

.ad p, .ad-text, .ad-detail p, .company-info p {
	margin-bottom: 10px;
	white-space: pre-wrap; /* saglabā jaunās rindas */
}

/* Sludinājumu saites */
.ad a {
	color: #b2685d;
	text-decoration: none;
}

.ad a:hover {
	text-decoration: underline;
}

.ad-images img {
  width: 480px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  display: inline-block;
  margin: 4px;
}

/* Full-screen style when toggled */
.ad-images img.full {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;              /* let natural size scale */
  height: auto;
  max-width: 95vw;
  max-height: 95vh;
  z-index: 10000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  background: #fff;
  border-radius: 4px;
}

/* telefonu ekrāniem lai rādās pa 1 sludinājumam */
@media (max-width: 600px) {
	.ads {
		grid-template-columns: 1fr; /* viena kolonna mazākos ekrānos */
	}
}
