/* Frontend layout & homepage — based on Palawan Classifieds reference */
/* Uses theme.css vars: --pc-orange, --pc-blue, --pc-blue-dark */

/* Page wrapper: max-width 1020px, centered, white, shadow */
.front-page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* Header: fixed at top, logo + search bar + post button */
.front-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1200px;
  z-index: 1030;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 12px;
  background: #fff;
  border-bottom: 1px solid var(--pc-gray-200);
  flex-wrap: wrap;
}
.front-header .front-logo-wrap { flex-shrink: 0; }
/* City block: left of search, not inside form */
.front-city-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.front-city-wrap .location-select {
  min-width: 140px;
  max-width: 180px;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
}
.front-search-bar {
  flex: 1;
  min-width: 200px;
  display: flex;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
}
.front-search-bar input {
  flex: 1;
  padding: 8px 12px;
  border: none;
  outline: none;
  font-size: 14px;
}
.front-search-bar .search-btn {
  background: var(--pc-blue);
  color: #fff;
  border: none;
  padding: 0 18px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}
.front-search-bar .search-btn:hover { background: var(--pc-blue-dark); color: #fff; }
.front-post-btn {
  background: var(--pc-orange);
  color: #fff;
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.front-post-btn:hover { background: var(--pc-orange-dark); color: #fff; }

/* Content area: main + sidebar (padding-top for fixed header) */
.front-content-area {
  padding-top: 100px;
  display: flex;
  gap: 0;
  flex: 1;
}
.front-main-content {
  flex: 1;
  min-width: 0;
  padding-bottom: 1rem;
}
.front-sidebar {
  width: 200px;
  flex-shrink: 0;
  padding: 10px;
  background: #f9f9f9;
  border-left: 1px solid #e0e0e0;
}
@media (max-width: 991.98px) {
  .front-sidebar { width: 100%; border-left: none; border-top: 1px solid #e0e0e0; order: 1; }
  .front-content-area { flex-wrap: wrap; }
  .front-header .front-logo-wrap { width: 100%; }
  .front-city-wrap { order: 2; width: 100%; }
  .front-search-bar { order: 3; width: 100%; }
}

/* Ad detail: WYSIWYG description (HTML from admin) */
.ad-description {
  font-size: 15px;
  line-height: 1.5;
}
.ad-description p { margin-bottom: 0.75em; }
.ad-description p:last-child { margin-bottom: 0; }
.ad-description ul, .ad-description ol { margin: 0.5em 0 1em 1.25em; padding: 0; }
.ad-description a { color: var(--pc-blue); text-decoration: none; }
.ad-description a:hover { text-decoration: underline; }
.ad-description strong { font-weight: 600; }
.ad-description h1, .ad-description h2, .ad-description h3 { margin: 0.75em 0 0.35em; font-size: 1.1em; }

/* Ad placeholders — gradient style from reference */
.front-ad-leaderboard {
  background: linear-gradient(135deg, #b8cfe8 0%, #d6e8f5 40%, #c5d9ec 60%, #a8c4dc 100%);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a6fa5;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 1px solid #9ab3cc;
  margin: 0;
}
.front-ad-billboard {
  background: linear-gradient(135deg, #b8cfe8 0%, #d6e8f5 40%, #c5d9ec 60%, #a8c4dc 100%);
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a6fa5;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 1px solid #9ab3cc;
  margin: 10px 0;
}
.front-ad-banner-728 {
  background: linear-gradient(135deg, #b8cfe8 0%, #d6e8f5 40%, #c5d9ec 60%, #a8c4dc 100%);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a6fa5;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid #9ab3cc;
  margin: 6px 0 2px;
}
.front-ad-300 {
  background: linear-gradient(160deg, #b8cfe8, #d6e8f5, #a8c4dc);
  min-height: 188px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a6fa5;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  border: 1px solid #9ab3cc;
  margin-bottom: 10px;
}
.front-ad-label { color: #999; font-size: 11px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Hero */
.front-hero {
  text-align: center;
  padding: 22px 20px 16px;
  background: #f0f6fb;
  border-bottom: 1px solid #dde8f0;
}
.front-hero h1 { font-size: 26px; font-weight: 700; color: var(--pc-blue-dark); margin-bottom: 6px; }
.front-hero h1 span { color: var(--pc-blue); }
.front-hero p { font-size: 14px; color: #555; margin-bottom: 0; }
.front-hero p span { color: var(--pc-blue); font-weight: 600; }

/* Category section & grid */
.front-category-section {
  padding: 12px 10px 10px;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}
.front-category-section2 { padding: 10px; background: #f8f8f8; border-bottom: 1px solid #e5e5e5; }
.front-category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
@media (max-width: 991.98px) {
  .front-category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
  .front-category-grid { grid-template-columns: 1fr; }
}

/* Category card — reference style */
.front-category-card {
  border: 1px solid #d5e5f0;
  border-radius: 4px;
  padding: 12px 8px 10px;
  background: #fff;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.front-category-card:hover {
  background: #f0f7fd;
  border-color: var(--pc-blue);
}
.front-category-card .cat-icon {
  font-size: 28px;
  margin-bottom: 6px;
  color: var(--pc-blue);
}
.front-category-card .cat-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--pc-blue-dark);
  margin-bottom: 8px;
  line-height: 1.2;
}
.front-category-card .cat-title a { color: inherit; text-decoration: none; }
.front-category-card .cat-title a:hover { color: var(--pc-blue); }
.front-category-card .cat-title .sub { font-size: 11px; font-weight: 400; color: #555; }
.front-category-card .cat-links {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}
.front-category-card .cat-links li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  border-bottom: 1px dotted #e0e0e0;
}
.front-category-card .cat-links li:last-child { border-bottom: none; }
.front-category-card .cat-links a {
  color: var(--pc-blue);
  font-size: 12px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.front-category-card .cat-links a:hover { text-decoration: underline; }
.front-category-card .cat-links .arrow { color: #aaa; font-size: 10px; }

/* Sidebar */
.front-sidebar .sidebar-ad-label { font-size: 10px; color: #999; text-align: right; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.front-sidebar .sidebar-turnover { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--pc-blue-dark); margin: 8px 0 4px; }
.front-sidebar .sidebar-turnover .count { color: #555; font-size: 11px; }
.front-sidebar .sidebar-map-label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--pc-blue-dark); margin: 6px 0 4px; }
.front-sidebar .sidebar-map {
  height: 130px;
  background: #d0dde8;
  border: 1px solid #9ab3cc;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a6fa5;
  font-size: 12px;
}
.front-sidebar .sidebar-social { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.front-sidebar .social-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  text-decoration: none;
  transition: opacity 0.15s;
}
.front-sidebar .social-icon:hover { opacity: 0.9; color: #fff; }
.front-sidebar .social-fb { background: #3b5998; }
.front-sidebar .social-tw { background: #1da1f2; }
.front-sidebar .social-ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743); }

/* Footer */
.front-footer {
  background: #f5f5f5;
  border-top: 1px solid #ddd;
  padding: 12px 14px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.front-footer a { color: #555; font-size: 12px; text-decoration: none; }
.front-footer a:hover { text-decoration: underline; color: var(--pc-blue); }

/* Ad detail page: image carousel (16:9, all images, primary first) */
.ad-detail-carousel-wrap { position: relative; background: #111; }
.ad-detail-carousel-wrap .carousel { position: absolute; inset: 0; }
.ad-detail-carousel-wrap .carousel-inner { height: 100%; }
.ad-detail-carousel-wrap .carousel-item { height: 100%; display: flex; align-items: center; justify-content: center; background: #111; }
.ad-detail-carousel-wrap .ad-carousel-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ad-detail-carousel-wrap .carousel-control-prev-icon,
.ad-detail-carousel-wrap .carousel-control-next-icon { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8)); }
/* Ad detail: thumbnail strip below main carousel */
.ad-carousel-thumbs { min-height: 56px; }
.ad-carousel-thumb {
  width: 64px;
  height: 48px;
  flex-shrink: 0;
  background: #eee;
  border: 2px solid transparent !important;
  cursor: pointer;
  transition: border-color 0.2s, opacity 0.2s;
}
.ad-carousel-thumb:hover { opacity: 0.9; }
.ad-carousel-thumb.active { border-color: var(--pc-orange, #e85d04) !important; }
.ad-carousel-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
