/* Centralized posts styles moved from templates */
body.posts-page {
  background-color: #f4f6f8;
  font-family:
    Inter,
    "Segoe UI",
    Roboto,
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    Arial;
  color: #23303b;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Posts listing hero + filters (chauffeur layout) */
.header-bar.posts-hero {
  background: linear-gradient(120deg, #080054 0%, #107081 45%, #20b5c4 100%);
  color: #ffffff;
  padding: 32px 0 40px;
  border-radius: 0 0 20px 20px;
}
.posts-hero .page-title {
  font-size: 1.9rem;
  font-weight: 800;
}
.posts-hero .subtitle {
  max-width: 640px;
  font-size: 0.95rem;
  opacity: 0.92;
}
.posts-hero .eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  opacity: 0.85;
}
.hero-ctas .btn-primary-gradient {
  background: linear-gradient(135deg, #ff9a3c 0%, #ff5b62 100%);
  border: none;
  color: #fff;
  font-weight: 600;
}
.hero-ctas .btn-primary-gradient:hover {
  filter: brightness(1.03);
}
.snapshot-card {
  background: rgba(6, 24, 61, 0.96);
  border-radius: 16px;
  padding: 14px 16px 16px;
  min-width: 230px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.32);
}
.snapshot-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(239, 246, 255, 0.7);
}
.snapshot-main {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f9fafb;
}
.snapshot-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
  font-size: 0.8rem;
  color: rgba(209, 213, 219, 0.95);
}

.filter-bar-wrapper {
  margin-top: -26px;
  margin-bottom: 20px;
}
.filter-bar-wrapper .container {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.12);
  padding: 14px 18px 16px;
}
.filter-bar-wrapper .form-select,
.filter-bar-wrapper .form-control {
  border-radius: 999px;
  border-color: #d1d5db;
  font-size: 0.8rem;
}
.results-meta {
  font-size: 0.78rem;
}

@media (max-width: 768px) {
  .header-bar.posts-hero {
    padding: 22px 0 26px;
    border-radius: 0 0 14px 14px;
  }
  .posts-hero .page-title {
    font-size: 1.4rem;
  }
  .filter-bar-wrapper .container {
    padding: 12px 14px 14px;
  }
}

@keyframes slideInUp {
  0% {
    transform: translateY(30px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* apply page fade-in when body has posts-page class */
body.posts-page {
  opacity: 0;
  animation: fadeIn 1.2s forwards;
}

.service-card {
  border: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.2s,
    box-shadow 0.3s;
  position: relative;
  animation: slideInUp 1s ease-out;
  margin-bottom: 20px;
  overflow: hidden;
}

.card-img-top {
  height: 200px;
  object-fit: cover;
  width: 100%;
  display: block;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: transform 0.35s ease;
}
.service-card:hover .card-img-top {
  transform: scale(1.02);
}

.card-body {
  padding: 18px 20px;
}

.card-title {
  font-weight: 700;
  margin-bottom: 10px;
  color: #102a43;
  font-size: 1.15rem;
  line-height: 1.2;
  min-height: 2.4em;
  overflow: hidden;
}

.card-text {
  color: #52606d;
  line-height: 1.6;
  margin-bottom: 14px;
  font-size: 0.95rem;
  min-height: 3.6em;
  overflow: hidden;
}

/* Post cards: status badges and meta */
.status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.75rem;
  color: #fff;
}
.status-badge.featured {
  background: linear-gradient(90deg, #ff8a00, #ff3d00);
}
.status-badge.promoted {
  background: linear-gradient(90deg, #6b5bff, #00c4ff);
}
.meta-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  color: #4b5563;
  font-size: 0.9rem;
}
.meta-price {
  color: #0b63b8;
  font-weight: 700;
}
.meta-location {
  color: #6b7280;
}
.price-inline {
  color: #0b63b8;
  font-size: 1.05rem;
}

/* Ensure line-clamp fallback */
.card-title,
.card-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.card-desc {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Post detail gallery styles */
.detail-gallery .main-image-wrap {
  width: 100%;
  display: block;
}
.detail-gallery .post-detail-image {
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.thumbs {
  margin-top: 12px;
}
.thumb-btn {
  border: none;
  background: transparent;
  padding: 0;
  display: inline-block;
}
.thumb-img {
  width: 100px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.06);
  border: 2px solid transparent;
}
.thumb-btn.active .thumb-img {
  border-color: #0b63b8;
}
.thumb-btn:focus {
  outline: 2px solid #cfe9ff;
}

.card-footer {
  background-color: transparent;
  border-top: none;
  padding: 14px 20px 20px 20px;
}

.btn-primary {
  background-color: #0b63b8;
  border-color: #0b63b8;
  padding: 10px 16px;
  font-weight: 600;
  transition: all 0.25s ease;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(11, 99, 184, 0.08);
}
.btn-primary:hover {
  transform: translateY(-1px);
}

.search-filter-section {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin: -50px auto 40px;
  max-width: 1140px;
  position: relative;
  z-index: 10;
}

@media (max-width: 768px) {
  .search-filter-section {
    padding: 18px;
    margin-top: -30px;
  }
  .card-img-top {
    height: 160px;
  }
}

/* Add post form specific tweaks */
.form-section {
  max-width: 980px;
  margin: 0 auto;
}
.form-section .form-group label {
  font-size: 0.95rem;
}
.form-section .btn-full-width {
  border-radius: 8px;
  height: 48px;
}
.image-upload {
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.image-upload.drag-over {
  border-color: #004a9f !important;
  background: #f1f8ff;
}
.img-thumbnail {
  object-fit: cover;
  width: 100px;
  height: 100px;
  border-radius: 6px;
}
.position-relative {
  position: relative;
}
#imagePreview .position-relative {
  display: inline-block;
  margin-right: 8px;
}
.form-error-list {
  color: #b02a37;
  background: #fff5f6;
  border: 1px solid #f1c0c6;
  padding: 10px;
  border-radius: 6px;
}

@media (max-width: 576px) {
  .form-section {
    padding: 18px;
  }
  .btn-full-width {
    height: 44px;
  }
}

/* Post detail styles */
.post-detail-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 28px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(16, 38, 66, 0.06);
}
.post-detail-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #0b2b40;
  margin-bottom: 12px;
  line-height: 1.15;
}
.post-detail-image {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 24px;
  box-shadow: 0 6px 20px rgba(11, 99, 184, 0.06);
}
.post-detail-content {
  font-size: 1rem;
  line-height: 1.75;
  color: #445569;
  margin-bottom: 22px;
}
.back-to-posts {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 10px 16px;
  background-color: #0b63b8;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  transition:
    background-color 0.18s ease,
    transform 0.12s ease;
  box-shadow: 0 6px 18px rgba(11, 99, 184, 0.08);
}
.back-to-posts:hover {
  background-color: #094f8f;
  transform: translateY(-2px);
}
@media (max-width: 768px) {
  .post-detail-container {
    margin: 16px;
    padding: 18px;
  }
  .post-detail-image {
    height: 240px;
  }
}
