/* ================================================================
   Sigma Layout — Shared overrides for full-width modern pages
   These replace the per-page <style> blocks that were duplicated
   across item.php, item-post.php, main.php, user-*.php, etc.
   ================================================================ */

/* Full-width main content on modern pages */
body.item #main,
body.item-post #main,
body.item-edit #main,
body.home #main,
body.user.user-dashboard #main,
body.user.items #main,
body.user.favorites #main,
body.user.user-profile #main,
body.login #main,
body.page #main {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: block !important;
  clear: both !important;
}

/* Hide legacy sidebar on modern pages */
body.item #sidebar,
body.item-post #sidebar,
body.item-edit #sidebar,
body.home #sidebar,
body.user.user-dashboard #sidebar,
body.user.items #sidebar,
body.user.favorites #sidebar,
body.user.user-profile #sidebar,
body.login #sidebar {
  display: none !important;
}

/* Hide breadcrumb on modern pages */
body.item .breadcrumb,
body.item-post .breadcrumb,
body.item-edit .breadcrumb,
body.home .breadcrumb,
body.user.user-dashboard .breadcrumb,
body.user.items .breadcrumb,
body.user.favorites .breadcrumb,
body.user.user-profile .breadcrumb,
body.login .breadcrumb,
body.search .breadcrumb {
  display: none !important;
}

/* Center shell helper for forms */
body.item-post #main .center-shell,
body.item-edit #main .center-shell,
body.user.items #main .center-shell,
body.user.favorites #main .center-shell {
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
  float: none !important;
}

/* Pagination styling (shared by search, user-items, user-favorites) */
.paginate {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2rem;
}
.paginate a,
.paginate span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}
.paginate a {
  background: white;
  border: 1px solid #e7e5e4;
  color: #44403c;
}
.paginate a:hover {
  border-color: #f97316;
  color: #ea580c;
}
.paginate span {
  background: #f97316;
  color: white;
  border: 1px solid #f97316;
}
.paginate span.prev,
.paginate span.next {
  background: #f5f5f4;
  color: #a8a29e;
  border-color: #e7e5e4;
}

/* Hide legacy trade_request.php buttons (replaced by modal) */
a.btn[href*="trade_request.php"] { display: none !important; }

/* Card hover effect (shared by main.php, loop files) */
.card-hover {
  transition: all 0.3s ease;
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.12);
}

/* Line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Contact form input styling */
.contact-form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #e7e5e4;
  background: #fafaf9;
  font-size: 0.875rem;
  color: #1c1917;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
}
.contact-form-input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.15);
}

/* Error list styling */
#error_list {
  color: #ef4444;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
#error_list li {
  margin-bottom: 0.25rem;
}

/* ================================================================
   Public profile: neutralize Osclass core float styles on the
   search toolbar so the Tailwind grid controls the layout
   (core style.css targets form[name="user-public-profile-search"])
   ================================================================ */
form[name="user-public-profile-search"] { display: block !important; margin: 0 0 2rem 0 !important; }
form[name="user-public-profile-search"] label { float: none !important; width: auto !important; clear: none !important; margin: 0 0 6px 0 !important; text-align: left !important; }
form[name="user-public-profile-search"] input[type="text"],
form[name="user-public-profile-search"] select,
form[name="user-public-profile-search"] button { float: none !important; height: auto !important; margin: 0 !important; }
form[name="user-public-profile-search"] input[type="text"],
form[name="user-public-profile-search"] select { border-width: 1px !important; border-color: #e7e5e4; line-height: 1.4 !important; }

/* Listings header: keep title + count badge on one clean line */
#user-listings h2 { width: auto !important; }
#user-listings > div > span { white-space: nowrap; flex-shrink: 0; }
