/* Styles for ddf-listings.js. Re-theme by overriding the custom properties on
   .ddfl (or any ancestor), e.g. .ddfl { --ddfl-accent: #8a1c2b; } */

.ddfl {
  --ddfl-accent: #1f4e79;
  --ddfl-accent-contrast: #ffffff;
  --ddfl-text: #1c2329;
  --ddfl-muted: #454d55;
  --ddfl-surface: #ffffff;
  --ddfl-subtle: #f3f5f7;
  --ddfl-border: #dfe4e8;
  --ddfl-radius: 14px;
  --ddfl-shadow: 0 1px 2px rgb(16 24 32 / 0.06), 0 6px 20px rgb(16 24 32 / 0.07);
  --ddfl-shadow-hover: 0 2px 4px rgb(16 24 32 / 0.08), 0 14px 32px rgb(16 24 32 / 0.13);
  color: var(--ddfl-text);
  line-height: 1.5;
}
.ddfl *,
.ddfl *::before,
.ddfl *::after {
  box-sizing: border-box;
}
.ddfl a {
  color: var(--ddfl-accent);
}

/* ----- toolbar ----- */
.ddfl-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 1.25rem;
}
.ddfl-total {
  margin: 0;
  color: var(--ddfl-muted);
}
.ddfl-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ddfl select {
  appearance: none;
  font: inherit;
  font-size: 0.95rem;
  color: inherit;
  padding: 0.45rem 2.1rem 0.45rem 0.9rem;
  border: 1px solid var(--ddfl-border);
  border-radius: 999px;
  background: var(--ddfl-surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235a6570' stroke-width='1.6'/%3E%3C/svg%3E")
    no-repeat right 0.8rem center / 0.7rem;
  cursor: pointer;
}
.ddfl select:focus-visible {
  outline: 3px solid var(--ddfl-accent);
  outline-offset: 1px;
}

/* ----- grid + cards ----- */
.ddfl-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
}
.ddfl-card {
  display: flex;
  flex-direction: column;
  background: var(--ddfl-surface);
  border: 1px solid var(--ddfl-border);
  border-radius: var(--ddfl-radius);
  overflow: hidden;
  box-shadow: var(--ddfl-shadow);
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
.ddfl-card:hover {
  box-shadow: var(--ddfl-shadow-hover);
  transform: translateY(-2px);
}
/* A flex column, not a block: browsers centre a taller button's contents
   vertically, which pushed photos down in cards with less text. */
.ddfl-card-open {
  all: unset;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 1;
  cursor: pointer;
}
.ddfl-card-open .ddfl-body {
  flex: 1;
  align-content: start;
}
.ddfl-card-open:focus-visible {
  outline: 3px solid var(--ddfl-accent);
  outline-offset: -3px;
}
/* The photo is laid over the box rather than sizing it, so every card's photo
   area is the same shape whatever the photo's own proportions (4:3, 3:2…). */
.ddfl-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--ddfl-subtle);
}
.ddfl-media > img,
.ddfl-media > .ddfl-nophoto {
  position: absolute;
  inset: 0;
  min-height: 0;
}
.ddfl-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ddfl-nophoto {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 12rem;
  color: var(--ddfl-muted);
  background: var(--ddfl-subtle);
}
.ddfl-chips {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.ddfl-chip {
  background: rgb(255 255 255 / 0.95);
  color: #1c2329;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.18);
}
.ddfl-chip-accent {
  background: var(--ddfl-accent);
  color: var(--ddfl-accent-contrast);
}
.ddfl-count {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  background: rgb(0 0 0 / 0.62);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.ddfl-body {
  display: grid;
  gap: 0.1rem;
  padding: 1rem 1.1rem 0.95rem;
}
.ddfl-body > span {
  display: block;
}
.ddfl-price {
  margin: 0;
  color: var(--ddfl-accent);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ddfl-address {
  font-weight: 600;
}
.ddfl-place {
  margin: 0;
  color: var(--ddfl-muted);
}
.ddfl-facts {
  margin-top: 0.4rem;
}
/* Small grey lines get normal weight: host sites like Squarespace often set a
   light body weight that makes them hard to read. */
.ddfl-mls {
  margin-top: 0.2rem;
  color: var(--ddfl-muted);
  font-size: 0.8rem;
  font-weight: 400;
}
.ddfl-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 0.9rem;
  padding: 0.8rem 1.1rem;
  border-top: 1px solid var(--ddfl-border);
}
/* DDF rules: the listing brokerage must be shown clearly, not hidden or shrunk. */
.ddfl-brokerage {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ddfl-muted);
}
.ddfl-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
}
.ddfl-badge img {
  display: block;
  width: 125px;
  height: auto;
}
.ddfl-badge-text {
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--ddfl-text);
  border: 1px solid var(--ddfl-border);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
}

/* ----- states + legal ----- */
.ddfl-status {
  margin: 0;
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--ddfl-muted);
  background: var(--ddfl-subtle);
  border-radius: var(--ddfl-radius);
}
.ddfl-legal {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ddfl-border);
  color: var(--ddfl-muted);
  font-size: 0.8rem;
}
.ddfl-legal p {
  margin: 0 0 0.6rem;
}

/* ----- detail dialog ----- */
.ddfl-dialog {
  width: min(980px, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--ddfl-radius);
  background: var(--ddfl-surface);
  color: var(--ddfl-text);
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.35);
  overflow: auto;
  overscroll-behavior: contain;
}
.ddfl-dialog::backdrop {
  background: rgb(12 18 24 / 0.62);
}
.ddfl-close-wrap {
  position: sticky;
  top: 0;
  height: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
}
.ddfl-close {
  margin: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.95);
  color: #111;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.25);
}
.ddfl-gallery {
  background: #0f1418;
}
.ddfl-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  max-height: 62vh;
  margin: 0 auto;
}
.ddfl-gallery-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ddfl-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.92);
  color: #111;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.3);
}
.ddfl-prev {
  left: 0.75rem;
}
.ddfl-next {
  right: 0.75rem;
}
.ddfl-close:focus-visible,
.ddfl-nav:focus-visible,
.ddfl-thumb:focus-visible {
  outline: 3px solid var(--ddfl-accent);
  outline-offset: 2px;
}
.ddfl-gallery-caption {
  margin: 0;
  padding: 0.55rem 1rem;
  color: #d7dde2;
  font-size: 0.85rem;
}
.ddfl-thumbs {
  position: relative;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0 1rem 1rem;
  scrollbar-width: thin;
}
.ddfl-thumb {
  flex: none;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: none;
  cursor: pointer;
  opacity: 0.65;
}
.ddfl-thumb[aria-current='true'] {
  border-color: #fff;
  opacity: 1;
}
.ddfl-thumb img {
  display: block;
  width: 88px;
  height: 66px;
  object-fit: cover;
}
.ddfl-detail-body {
  display: grid;
  gap: 1.4rem;
  padding: 1.5rem clamp(1rem, 4vw, 2rem) 2rem;
}
.ddfl-price-lg {
  font-size: 1.9rem;
}
.ddfl-title {
  margin: 0.1rem 0 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}
.ddfl .ddfl-cta {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-self: start;
  gap: 0.1rem;
  padding: 0.8rem 1.6rem;
  border-radius: 10px;
  background: var(--ddfl-accent);
  color: var(--ddfl-accent-contrast);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}
.ddfl .ddfl-cta:hover {
  background: color-mix(in srgb, var(--ddfl-accent) 85%, #000);
}
.ddfl .ddfl-cta:focus-visible {
  outline: 3px solid var(--ddfl-accent);
  outline-offset: 3px;
}
.ddfl-cta-host {
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.85;
}
.ddfl-attribution {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.8rem 1rem;
  background: var(--ddfl-subtle);
  border-radius: 10px;
}
.ddfl-detail h3 {
  margin: 0 0 0.55rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ddfl-muted);
}
.ddfl-openhouses {
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ddfl-accent) 8%, var(--ddfl-surface));
  border: 1px solid color-mix(in srgb, var(--ddfl-accent) 25%, var(--ddfl-surface));
}
.ddfl-openhouses ul,
.ddfl-links {
  margin: 0;
  padding-left: 1.1rem;
}
.ddfl-facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 0.9rem 1.25rem;
  margin: 0;
}
.ddfl-facts-grid div {
  border-left: 3px solid var(--ddfl-accent);
  padding-left: 0.7rem;
}
.ddfl-facts-grid dt {
  font-size: 0.8rem;
  color: var(--ddfl-muted);
}
.ddfl-facts-grid dd {
  margin: 0;
  font-weight: 600;
}
.ddfl-remarks {
  margin: 0;
  white-space: pre-line;
}
.ddfl-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.7rem 1.5rem;
  margin: 0;
}
.ddfl-features dt {
  font-weight: 600;
  font-size: 0.92rem;
}
.ddfl-features dd {
  margin: 0;
  color: var(--ddfl-muted);
}
.ddfl-table-wrap {
  overflow-x: auto;
}
.ddfl-rooms {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.ddfl-rooms th,
.ddfl-rooms td {
  text-align: left;
  padding: 0.5rem 0.9rem 0.5rem 0;
  border-bottom: 1px solid var(--ddfl-border);
}
.ddfl-rooms th {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ddfl-muted);
}
.ddfl-agents,
.ddfl-small {
  margin: 0;
}
.ddfl-muted {
  color: var(--ddfl-muted);
}
.ddfl-small {
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .ddfl .ddfl-cta {
    justify-self: stretch;
  }
  .ddfl-controls {
    flex: 1 1 100%;
  }
  .ddfl-controls select {
    flex: 1 1 0;
    min-width: 0;
  }
  .ddfl-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  .ddfl-price-lg {
    font-size: 1.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ddfl-card {
    transition: none;
  }
  .ddfl-card:hover {
    transform: none;
  }
}
