/* Amenities Widget Styles */
.homerunner-amenities-container {
  padding: 1rem;
  box-sizing: border-box;
}

.homerunner-amenities-container * {
  box-sizing: border-box;
}

/* Amenities grid */
.amenities-grid {
  display: grid;
  gap: 1rem;
}

/* Default responsive columns */
.amenities-grid {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 780px) {
  .amenities-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .amenities-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Dynamic responsive columns using CSS custom properties. The legacy
   --aminities-* names are consulted first so customCss saved on pre-rename
   widget records keeps winning over the component-set --amenities-* values. */
.amenities-grid-responsive {
  grid-template-columns: repeat(var(--aminities-columns-sm, var(--amenities-columns-sm, 2)), 1fr);
}

@media (min-width: 780px) {
  .amenities-grid-responsive {
    grid-template-columns: repeat(var(--aminities-columns-md, var(--amenities-columns-md, 3)), 1fr);
  }
}

@media (min-width: 1200px) {
  .amenities-grid-responsive {
    grid-template-columns: repeat(var(--aminities-columns-lg, var(--amenities-columns-lg, 4)), 1fr);
  }
}

/* Amenities item */
.amenity-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Keyword-resolved / override icons (#1423). Sized to sit comfortably inside
   the 2rem icon box above, stroked like the toolkit's `amenity-icons` module
   so a WP site running that module and this widget render the same look. */
.amenity-icon-svg,
.aminity-icon-svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Items are top-aligned (items-start) so a wrapping label can't float its
   check icon between lines (#997) — the padding re-centers a single line
   against the 2rem icon box, and wrapped lines hang below. */
.amenity-name {
  font-weight: 500;
  line-height: 1.4;
  padding-top: calc((2rem - 1.4em) / 2);
}

/* Show more button */
.show-more-button-container {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

/* Dialog Size Override */
.homerunner-amenities-dialog.hr-dialog-content {
  max-width: min(1280px, 95vw);
}

/* Dialog styles */
.homerunner-amenities-dialog {
  font-family: inherit;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.homerunner-amenities-dialog::-webkit-scrollbar {
  width: 6px;
}

.homerunner-amenities-dialog::-webkit-scrollbar-track {
  background: transparent;
}

.homerunner-amenities-dialog::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 3px;
}

.homerunner-amenities-dialog.dark {
  scrollbar-color: var(--muted-foreground) transparent;
}

.homerunner-amenities-dialog.dark::-webkit-scrollbar-thumb {
  background-color: var(--muted-foreground);
}

/* Host-scoped dark scrollbar (#900): sibling rules to the `.dark` class rules
   above so the dialog scrollbar re-tints under the runtime marker
   (:host([data-hr-theme="dark"])) AND at auto FIRST PAINT (server-stamped
   data-hr-scheme="auto", no JS/cookie). Append-only — the `.dark` rules above
   are untouched and the declaration values are reused verbatim. `:host(...)`
   reaches the shadow host from inside its own stylesheet; both conditions of
   the auto selector sit INSIDE `:host(...)` — `:host([a]:not([b]))`, never
   `:host([a]):not([b])`, which silently never matches the host. */
:host([data-hr-theme="dark"]) .homerunner-amenities-dialog {
  scrollbar-color: var(--muted-foreground) transparent;
}

:host([data-hr-theme="dark"]) .homerunner-amenities-dialog::-webkit-scrollbar-thumb {
  background-color: var(--muted-foreground);
}

@media (prefers-color-scheme: dark) {
  :host([data-hr-scheme="auto"]:not([data-hr-theme])) .homerunner-amenities-dialog {
    scrollbar-color: var(--muted-foreground) transparent;
  }

  :host([data-hr-scheme="auto"]:not([data-hr-theme])) .homerunner-amenities-dialog::-webkit-scrollbar-thumb {
    background-color: var(--muted-foreground);
  }
}

.homerunner-amenities-dialog .amenities-grid-responsive {
  padding: 0.5rem 0;
}

/* ----------------------------------------------------------------------------
 * Section heading (shared across content widgets)
 * Bold title on the left + horizontal divider line filling remaining width.
 * -------------------------------------------------------------------------- */

.hr-widget-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
}

.hr-widget-section-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
  white-space: nowrap;
  flex-shrink: 0;
}

.hr-widget-section-line {
  flex: 1;
  height: 1px;
  background-color: currentColor;
  opacity: 0.18;
  display: block;
}

@media (max-width: 640px) {
  .hr-widget-section-title { font-size: 1.25rem; }
  .hr-widget-section { gap: 1rem; margin-bottom: 1.5rem; }
}
