/* Driftwood listings + quick search widgets. Uses the kit's global colors/fonts. */

.dwr-listings { --dwr-card-bg: #fff; }

/* ---------- Shared form controls ---------- */
.dwr-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dwr-field__label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--dwr-muted, #4F4A45);
}
html body .dwr-field__control {
	width: 100%;
	min-height: 48px;
	padding: 10px 40px 10px 14px;
	border: 1px solid var(--dwr-line, #DDD4C7);
	border-radius: 999px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230B3A4A' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 16px center;
	color: var(--dwr-ink, #1B1B1B);
	font: inherit;
	font-size: 15px;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
}
html body .dwr-field__control:hover { border-color: var(--dwr-ocean, #0B3A4A); }

/* ---------- Buttons ---------- */
html body .dwr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 12px 26px;
	border: 1px solid transparent;
	border-radius: 999px;
	font-family: var(--e-global-typography-secondary-font-family, "DM Sans"), system-ui, sans-serif;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
html body .dwr-btn:hover { transform: translateY(-1px); }
html body .dwr-btn--primary { background: var(--dwr-ocean, #0B3A4A); color: #fff; }
html body .dwr-btn--primary:hover { background: var(--e-global-color-dwroceandeep, #072833); color: #fff; }
html body .dwr-btn--accent { background: var(--dwr-cta, #AE5237); color: #fff; }
html body .dwr-btn--accent:hover { background: var(--dwr-cta-dark, #96462F); color: #fff; }
html body .dwr-btn--ghost { background: transparent; color: var(--dwr-ocean, #0B3A4A); border-color: var(--dwr-ocean, #0B3A4A); }
html body .dwr-btn--ghost:hover { background: var(--dwr-ocean, #0B3A4A); color: #fff; }

/* ---------- Quick search (home hero) ---------- */
.dwr-quick-search {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
	padding: 18px;
	background: #fff;
	border-radius: 22px;
	box-shadow: 0 18px 50px rgba(7, 40, 51, .22);
}
html body .dwr-quick-search__submit { width: 100%; }
@media (min-width: 768px) {
	.dwr-quick-search { grid-template-columns: 1.3fr 1fr 1fr auto; align-items: end; padding: 16px 16px 16px 24px; border-radius: 999px; }
	.dwr-quick-search .dwr-field__control { border-color: transparent; background-color: var(--dwr-sand, #F4EFE8); }
	html body .dwr-quick-search__submit { width: auto; }
}

/* ---------- Filters ---------- */
.dwr-filters {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	padding: 20px;
	margin-bottom: 18px;
	background: #fff;
	border: 1px solid var(--dwr-line, #DDD4C7);
	border-radius: 22px;
}
.dwr-filters__actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; }
.dwr-filters__reset { color: var(--dwr-ocean, #0B3A4A); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
/* With JS, filters apply live; the submit button stays for keyboard users who expect it. */
@media (min-width: 768px) {
	.dwr-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
	.dwr-filters { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.dwr-results { margin: 0 0 18px; font-size: 15px; color: var(--dwr-muted, #4F4A45); }
.dwr-results:focus { outline: none; }

/* ---------- Grid + cards ---------- */
.dwr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 1024px) { .dwr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .dwr-grid { grid-template-columns: 1fr; } }

.dwr-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--dwr-card-bg);
	border: 1px solid var(--dwr-line, #DDD4C7);
	border-radius: var(--dwr-radius, 14px);
	transition: box-shadow .3s, transform .3s;
}
.dwr-card[hidden] { display: none; }
.dwr-card:hover,
.dwr-card:focus-within { box-shadow: 0 18px 40px rgba(7, 40, 51, .12); transform: translateY(-2px); }
.dwr-card__media { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--dwr-line, #DDD4C7); }
.dwr-card__img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.dwr-card:hover .dwr-card__img,
.dwr-card:focus-within .dwr-card__img { transform: scale(1.05); }
.dwr-card__body { display: flex; flex-direction: column; gap: 6px; padding: 20px 22px 22px; }
.dwr-card__price {
	margin: 0;
	font-family: var(--e-global-typography-primary-font-family, "DM Serif Display"), Georgia, serif;
	font-size: 26px;
	line-height: 1.1;
	color: var(--dwr-ocean, #0B3A4A);
}
html body .dwr-card__title {
	margin: 0;
	font-family: var(--e-global-typography-secondary-font-family, "DM Sans"), system-ui, sans-serif;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--dwr-ink, #1B1B1B);
}
.dwr-card__link { color: inherit; text-decoration: none; }
.dwr-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.dwr-card__link:focus-visible { outline: none; }
.dwr-card:has(.dwr-card__link:focus-visible) { outline: 3px solid var(--dwr-terracotta, #C8674A); outline-offset: 3px; }
.dwr-card__address { margin: 0; font-size: 14px; color: var(--dwr-muted, #4F4A45); }
.dwr-card__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 10px 0 0;
	padding: 12px 0 0;
	list-style: none;
	border-top: 1px solid var(--dwr-line, #DDD4C7);
	font-size: 14px;
	color: var(--dwr-muted, #4F4A45);
}
.dwr-card__facts strong { color: var(--dwr-ink, #1B1B1B); }

.dwr-badge {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 2;
	padding: 6px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	background: #fff;
	color: var(--dwr-ocean, #0B3A4A);
}
.dwr-badge--pending { background: var(--dwr-sand, #F4EFE8); color: var(--dwr-cta-dark, #96462F); }
.dwr-badge--sold { background: var(--dwr-ink, #1B1B1B); color: #fff; }

/* ---------- Empty state ---------- */
.dwr-empty {
	padding: 48px 24px;
	text-align: center;
	border: 1px dashed var(--dwr-line, #DDD4C7);
	border-radius: 22px;
	background: #fff;
}
.dwr-empty[hidden] { display: none; }
.dwr-empty__title {
	margin: 0 0 8px;
	font-family: var(--e-global-typography-primary-font-family, "DM Serif Display"), Georgia, serif;
	font-size: 28px;
	color: var(--dwr-ocean, #0B3A4A);
}
.dwr-empty p { max-width: 46ch; margin-inline: auto; }

/* ---------- Modal ---------- */
.dwr-modal-open { overflow: hidden; }
.dwr-modal {
	width: min(1080px, calc(100% - 32px));
	max-height: calc(100dvh - 32px);
	padding: 0;
	border: 0;
	border-radius: 22px;
	background: #fff;
	color: var(--dwr-ink, #1B1B1B);
	box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
	overflow: auto;
}
.dwr-modal::backdrop { background: rgba(7, 40, 51, .72); }
.dwr-modal[open] { animation: dwr-modal-in .25s cubic-bezier(.2, .7, .2, 1); }
@keyframes dwr-modal-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.dwr-modal__inner { position: relative; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .dwr-modal__inner { grid-template-columns: 1.25fr 1fr; } }
html body .dwr-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--dwr-ocean, #0B3A4A);
	box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
	cursor: pointer;
}
.dwr-gallery { background: var(--dwr-ink, #1B1B1B); }
.dwr-gallery__stage { position: relative; aspect-ratio: 3 / 2; }
.dwr-gallery__img { display: block; width: 100%; height: 100%; object-fit: cover; }
html body .dwr-gallery__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: var(--dwr-ocean, #0B3A4A);
	cursor: pointer;
}
html body .dwr-gallery__nav--prev { left: 12px; }
html body .dwr-gallery__nav--next { right: 12px; }
.dwr-gallery__count {
	position: absolute;
	left: 12px;
	bottom: 12px;
	margin: 0;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(7, 40, 51, .8);
	color: #fff;
	font-size: 13px;
}
html body .dwr-gallery__thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
html body .dwr-gallery__thumb {
	flex: 0 0 auto;
	width: 84px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 8px;
	overflow: hidden;
	background: none;
	cursor: pointer;
	opacity: .7;
}
html body .dwr-gallery__thumb img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
html body .dwr-gallery__thumb[aria-current="true"] { border-color: #fff; opacity: 1; }
.dwr-modal__body { padding: 28px 28px 32px; }
.dwr-modal__meta { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 14px; color: var(--dwr-muted, #4F4A45); }
.dwr-modal__meta .dwr-badge { position: static; border: 1px solid var(--dwr-line, #DDD4C7); }
html body .dwr-modal__title {
	margin: 0 0 6px;
	padding-right: 40px;
	font-family: var(--e-global-typography-primary-font-family, "DM Serif Display"), Georgia, serif;
	font-size: clamp(26px, 3vw, 34px);
	font-weight: 400;
	line-height: 1.15;
	color: var(--dwr-ocean, #0B3A4A);
}
@media (min-width: 900px) { .dwr-modal__title { padding-right: 0; } }
.dwr-modal__address { margin: 0 0 12px; color: var(--dwr-muted, #4F4A45); }
.dwr-modal__price {
	margin: 0;
	font-family: var(--e-global-typography-primary-font-family, "DM Serif Display"), Georgia, serif;
	font-size: 30px;
	color: var(--dwr-ink, #1B1B1B);
}
.dwr-modal__desc { margin: 16px 0 0; line-height: 1.65; }
html body .dwr-modal__subtitle {
	margin: 22px 0 10px;
	font-family: var(--e-global-typography-secondary-font-family, "DM Sans"), system-ui, sans-serif;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--dwr-muted, #4F4A45);
}
.dwr-modal__features { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.dwr-modal__features li { position: relative; padding-left: 18px; }
.dwr-modal__features li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .55em;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--dwr-seaglass, #8FB9AA);
}
.dwr-modal__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
@media (max-width: 480px) {
	.dwr-modal__features { grid-template-columns: 1fr; }
	.dwr-modal__actions .dwr-btn { flex: 1 1 100%; }
	.dwr-modal__body { padding: 22px 20px 26px; }
}

/* Keep icon buttons neutral against the kit's global button hover/focus styles. */
html body .dwr-modal__close:hover,
html body .dwr-modal__close:focus,
html body .dwr-gallery__nav:hover,
html body .dwr-gallery__nav:focus {
	background: #fff;
	color: var(--dwr-ocean, #0B3A4A);
}
html body .dwr-gallery__thumb:hover,
html body .dwr-gallery__thumb:focus { background: none; opacity: 1; }
html body .dwr-btn--ghost:focus { background: transparent; color: var(--dwr-ocean, #0B3A4A); }
html body .dwr-btn--ghost:hover { background: var(--dwr-ocean, #0B3A4A); color: #fff; }
