/* ============================================
   SEARCH BOHOMES (Spain)

   Context: .page-search-bohomes-bostad on <body>
   Requires: tokens.css (loaded first via base_bohomes.html)
   Structure: Reset → Page → Layout → Title → Results → Card → Pagination → Focus → Responsive

   Design decisions:
   - Page namespace includes -bostad suffix for WordPress embedding
   - Uses semantic HTML: article, figure, header, data, footer
   - Card link wrapper uses .card-link-bostad class for specificity
   - Results grid class .results-bostad kept for clarity
   ============================================ */

/* --- CSS Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
}

/* --- Page Body --- */
.page-search-bohomes-bostad {
  background: var(--surface);
  font-family: var(--font-family);
  margin: 0;
  padding: 0;
}

/* --- Layout --- */
/* Note: Filter form layout handled by search_form_bohomes.css */
/* Note: Widget styles (sliders, selects) in form_widgets_bohomes.css */
.page-search-bohomes-bostad #content-bostad {
  max-width: var(--width-page);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.page-search-bohomes-bostad #realties-bostad {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-10);
  padding-top: var(--space-6);
}

/* --- Page Title (semantic h1, no class needed) --- */
/* Note: Bohomes uses larger H1 than BoFi (2.5rem vs 1.875rem) */
.page-search-bohomes-bostad h1 {
  width: 100%;
  padding-top: var(--space-10);
  font-size: var(--font-size-h1-bohomes);
  line-height: 1;
  font-weight: var(--font-weight-medium);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.125rem;
  color: var(--ink);
}

/* --- Sorting Container (realty_filter_bofi.html, used by bofi_realty_list_spain) --- */
.page-search-bohomes-bostad #sorting-bostad {
  width: 100%;
}

.page-search-bohomes-bostad #sorting-bostad > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.page-search-bohomes-bostad details.sort-dropdown-bostad {
  position: relative;
}

.page-search-bohomes-bostad details.sort-dropdown-bostad summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 12.5rem;
  height: var(--space-9);
  border: 1px solid var(--border-input);
  padding: 0 var(--space-2) 0 var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.page-search-bohomes-bostad details.sort-dropdown-bostad summary::-webkit-details-marker {
  display: none;
}

.page-search-bohomes-bostad details.sort-dropdown-bostad[open] menu {
  position: absolute;
  right: 0;
  top: 100%;
  width: 12.5rem;
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-top: 0;
  z-index: 50;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-search-bohomes-bostad details.sort-dropdown-bostad menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
  background: transparent;
  border: none;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  min-width: 0;
}

.page-search-bohomes-bostad details.sort-dropdown-bostad menu button:hover {
  background: var(--canvas);
}

.page-search-bohomes-bostad details.sort-dropdown-bostad menu button[aria-selected="true"] {
  background: var(--ink-light);
  color: var(--surface);
}

.page-search-bohomes-bostad .results-count-bostad {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink);
}

/* --- Results Grid --- */
.page-search-bohomes-bostad #results-bostad,
.page-search-bohomes-bostad #paging-bostad {
  width: 100%;
}

.page-search-bohomes-bostad .results-bostad {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  justify-items: center;
}

/* --- Realty Card (semantic HTML structure) --- */
.page-search-bohomes-bostad .card-link-bostad {
  display: block;
  width: 100%;
  max-width: 35rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition-medium), transform var(--transition-medium);
}

.page-search-bohomes-bostad .card-link-bostad:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-0.125rem);
}

.page-search-bohomes-bostad .results-bostad article {
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.page-search-bohomes-bostad .results-bostad article figure {
  width: 100%;
  aspect-ratio: var(--ratio-3-2) !important;
  overflow: hidden;
  margin: 0;
}

.page-search-bohomes-bostad .results-bostad article figure img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.page-search-bohomes-bostad .results-bostad article.no-image-bostad figcaption {
  width: 100%;
  height: 100%;
  background: var(--canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
}

/* Card content area (unified with BoFi) */
.page-search-bohomes-bostad .results-bostad article header,
.page-search-bohomes-bostad .results-bostad article data,
.page-search-bohomes-bostad .results-bostad article footer {
  margin-inline: var(--space-2);
}

.page-search-bohomes-bostad .results-bostad article header h3 {
  margin: 0;
  padding: var(--space-2) 0;
  font-size: var(--font-size-base);
  line-height: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.07em;
  color: var(--ink);
  text-transform: capitalize;
}

.page-search-bohomes-bostad .results-bostad article data {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-top: 1px solid var(--ink-light);
}

.page-search-bohomes-bostad .results-bostad article data span {
  font-size: var(--font-size-base);
  line-height: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.07em;
  color: var(--ink-light);
  text-transform: uppercase;
}

.page-search-bohomes-bostad .results-bostad article footer {
  padding-bottom: var(--space-3);
}

/* --- Pagination (semantic nav, unified with BoFi) --- */
.page-search-bohomes-bostad nav[aria-label="pagination"] {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-10);
  margin-bottom: var(--space-6);
}

.page-search-bohomes-bostad nav[aria-label="pagination"] a {
  color: var(--ink);
  text-decoration: none;
  padding: var(--space-2);
}

.page-search-bohomes-bostad nav[aria-label="pagination"] a:hover {
  text-decoration: underline;
}

.page-search-bohomes-bostad nav[aria-label="pagination"] a[aria-current="page"] {
  font-weight: var(--font-weight-bold);
}

/* --- Focus States (unified with BoFi) --- */
.page-search-bohomes-bostad input:focus-visible,
.page-search-bohomes-bostad select:focus-visible,
.page-search-bohomes-bostad button:focus-visible,
.page-search-bohomes-bostad a:focus-visible,
.page-search-bohomes-bostad summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* --- Responsive: Mobile (max-width: 47.9975rem) --- */
/* Note: Bohomes mobile H1 is 1.75rem (28px), smaller than desktop 2.5rem (40px) */
@media (max-width: 47.9975rem) {
  .page-search-bohomes-bostad h1 {
    font-size: var(--font-size-h1-bohomes-mobile);
    padding-top: var(--space-6);
  }
}

/* --- Responsive: Tablet+ (48rem / 768px) --- */
@media (min-width: 48rem) {
  .page-search-bohomes-bostad #realties-bostad {
    gap: var(--space-10);
    padding-top: 0;
  }

  .page-search-bohomes-bostad .results-bostad {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-10);
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .page-search-bohomes-bostad * {
    transition: none !important;
  }
}
