/* ---------- Layout & tema (alla sidor) ---------- */

body {
  background: linear-gradient(180deg, #f6faff 0%, #e8f1ff 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; }
footer.site-footer { flex-shrink: 0; }

:root {
  --bs-primary: #4e769a;
  --bs-primary-rgb: 78, 118, 154;
  --bs-link-color: #4e769a;
  --bs-link-color-rgb: 78, 118, 154;
  --bs-link-hover-color: #426483;
  --bs-link-hover-color-rgb: 66, 100, 131;
}

.navbar.bg-primary { background-color: #4e769a !important; }

.navbar-logo-svg {
  height: 32px;
  width: auto;
}
.navbar-logo-svg .st0 {
  fill: #fff !important;
}

.btn-primary {
  --bs-btn-bg: #4e769a;
  --bs-btn-border-color: #4e769a;
  --bs-btn-hover-bg: #426483;
  --bs-btn-hover-border-color: #35526b;
  --bs-btn-active-bg: #35526b;
  --bs-btn-active-border-color: #2e4a61;
  --bs-btn-disabled-bg: #4e769a;
  --bs-btn-disabled-border-color: #4e769a;
}
.btn-outline-primary {
  --bs-btn-color: #4e769a;
  --bs-btn-border-color: #4e769a;
  --bs-btn-hover-bg: #4e769a;
  --bs-btn-hover-border-color: #4e769a;
  --bs-btn-active-bg: #4e769a;
  --bs-btn-active-border-color: #4e769a;
}

/* ---------- Annonskort (index.php, annons.php) ---------- */

.listing-img {
  height: 180px;
  width: 100%;
  object-fit: cover;
  background: #eee;
}
.listing-card { text-decoration: none; color: inherit; }

.listing-detail-img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #eee;
  border-radius: .5rem;
}

#adGallery .carousel-control-prev-icon,
#adGallery .carousel-control-next-icon {
  background-color: rgba(0, 0, 0, .45);
  background-size: 50%;
  border-radius: 50%;
  padding: 1.1rem;
}
#adGallery .carousel-indicators [data-bs-target] {
  background-color: #4e769a;
}

/* ---------- Karta + uggle-maskot (index.php) ---------- */

.map-with-owl {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  max-width: 900px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .map-with-owl {
    flex-direction: row;
    gap: 1.5rem;
  }
}

.owl-mascot {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 220px;
}
.owl-mascot img,
.owl-mascot .owl-svg {
  width: 150px;
  height: auto;
}
.owl-bubble {
  position: relative;
  background: #fff;
  border: 2px solid #4e769a;
  border-radius: 1rem;
  padding: .6rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  color: #2e4a61;
  text-align: center;
  transition: opacity .2s ease-in-out;
  margin-bottom: .6rem;
}
.owl-bubble::before,
.owl-bubble::after {
  content: "";
  position: absolute;
  left: 20%;
  transform: translateX(-50%);
  border-style: solid;
  border-color: transparent;
}
.owl-bubble::before {
  bottom: -11px;
  border-width: 11px 9px 0 9px;
  border-top-color: #4e769a;
}
.owl-bubble::after {
  bottom: -8px;
  border-width: 8px 7px 0 7px;
  border-top-color: #fff;
}

/* Radlayout: bubbla till vänster om ugglan (lagg-upp.php) */
.owl-mascot--row {
  flex-direction: row;
  max-width: none;
}
.owl-mascot--row .owl-bubble {
  margin-bottom: 0;
  margin-right: .8rem;
  max-width: 260px;
  text-align: left;
}
.owl-bubble-title {
  display: block;
  font-size: .95rem;
  font-weight: 700;
  margin: 0 0 .2rem;
  color: #2e4a61;
}
.owl-bubble-text {
  display: block;
  font-size: .78rem;
  font-weight: 500;
}
.owl-mascot--row .owl-bubble::before,
.owl-mascot--row .owl-bubble::after {
  left: auto;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}
.owl-mascot--row .owl-bubble::before {
  right: -11px;
  border-width: 9px 0 9px 11px;
  border-color: transparent transparent transparent #4e769a;
}
.owl-mascot--row .owl-bubble::after {
  right: -8px;
  border-width: 7px 0 7px 8px;
  border-color: transparent transparent transparent #fff;
}

/* ---------- Kommunkarta (index.php) ---------- */

.kommun-map-wrap {
  max-width: 340px;
  margin: 0 auto;
}
.kommun-map-svg {
  width: 100%;
  height: auto;
  display: block;
}
.kommun-shape {
  fill: #c1cfdc !important;
  stroke: #f6faff;
  stroke-width: 1.5;
  cursor: pointer;
  transition: fill .15s ease-in-out;
}
.kommun-shape:hover,
.kommun-shape.is-hover-linked {
  fill: #7b9bb8 !important;
}
.kommun-shape.has-ads {
  fill: #4e769a !important;
}
.kommun-shape.has-ads:hover,
.kommun-shape.has-ads.is-hover-linked {
  fill: #35526b !important;
}

.map-and-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.kommun-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  font-size: .85rem;
}
.kommun-list-item {
  display: inline-block;
  color: #2e4a61;
  text-decoration: none;
  padding: .1rem .35rem;
  border-radius: .25rem;
}
.kommun-list-item.has-ads {
  font-weight: 700;
}
.kommun-list-item:hover,
.kommun-list-item.is-hover-linked {
  text-decoration: underline;
}

/* ---------- Lägg upp-formulär (lagg-upp.php) ---------- */

.preview-thumb {
  position: relative;
  width: 84px;
  height: 84px;
}
.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: .5rem;
  background: #eee;
}
.preview-thumb-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  line-height: 1;
  border: none;
  border-radius: 50%;
  background: #dc3545;
  color: #fff;
  font-size: .7rem;
  cursor: pointer;
}
#dropZone {
  border: 2px dashed #adb5bd;
  border-radius: .75rem;
  cursor: pointer;
  transition: border-color .15s ease-in-out, background-color .15s ease-in-out;
}
#dropZone.dragover {
  border-color: #4e769a;
  background-color: #eef3f8;
}

/* ---------- Admin (admin/dashboard.php) ---------- */

.thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: .25rem;
}
