/* BestHouseSwap.com, 2026. One stylesheet for the whole site, mobile first.
 * Look: the old site's warm off-white, red links and gold accents, kept light and flat. */

:root {
	--band: #F7F7F3;        /* header band and banner: the off-white of the logo and the banner art */
	--bg: #ffffff;
	--text: #222222;
	--muted: #777570;
	--line: #E4E2DA;
	--dash: #D5D4D0;        /* the banner's dashed frame */
	--red: #B30000;         /* the old link red */
	--red-dark: #8A0000;
	--green: #3F7D20;
	--green-dark: #2F6117;
	--gold: #E1A541;        /* the old section colour */
	--gold-dark: #C98A26;
	--tint: #FFF8E1;        /* the old yellow form colour, softened */
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	/* sticky footer: short pages (howitworks.php) push the footer to the bottom of the window */
	display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

img { max-width: 100%; height: auto; border: 0; }

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; color: var(--text); margin: 0 0 .5em; }
p { margin: 0 0 1em; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

/* ---------- header (unchanged) ---------- */

.site-header { background: var(--band); border-bottom: 1px solid var(--line); }

.header-row {
	display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
	gap: 12px; min-height: 74px; padding-top: 10px; padding-bottom: 10px;
}

.logo { display: block; line-height: 0; }
.logo img { width: 215px; height: auto; }

.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-nav a { color: var(--text); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.site-nav a:hover { background: #ECEBE4; text-decoration: none; }
.site-nav a.active { color: var(--red); }
.site-nav a.btn { color: #fff; margin-left: 8px; }

.menu-toggle {
	display: none; font: inherit; font-weight: 600; color: var(--text);
	background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer;
}

@media (max-width: 900px) {
	.menu-toggle { display: block; }
	.site-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 6px; }
	.site-nav.open { display: flex; }
	.site-nav a { padding: 12px; border-top: 1px solid var(--line); border-radius: 0; }
	.site-nav a.btn { margin: 10px 0 0; border-radius: 8px; text-align: center; }
	.logo img { width: 180px; }
}

/* ---------- page layout: content + ad column ---------- */

.site-main { flex: 1 0 auto; width: 100%; padding-top: 24px; padding-bottom: 40px; font-size: 15px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.content { container-type: inline-size; min-width: 0; }
.sidebar { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 24px; }
@media (max-width: 999px) {
	.layout { grid-template-columns: minmax(0, 1fr); }
	.sidebar { position: static; }
	.sidebar:not(:has(> :not(.ad-desktop))) { display: none; }
}

h1 { font-size: 1.6rem; }
.content h1 { margin-top: 2px; }

/* Section heading: the old gold bar, as a gold underline */
.section {
	font-size: 1.1rem; margin: 28px 0 10px; padding-bottom: 6px;
	border-bottom: 2px solid var(--gold);
	display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.section a { font-size: .9rem; font-weight: 500; }

.prose { max-width: 720px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose h1 + p { margin-top: 6px; }

.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* ---------- buttons and form fields ---------- */

.btn, button, input[type=button], input[type=submit] {
	display: inline-block; font: inherit; font-weight: 600; line-height: 1.2;
	padding: 10px 18px; border-radius: 6px; border: 1px solid #CFCCC2;
	background: #fff; color: var(--text); cursor: pointer; text-align: center;
}
.btn:hover, button:hover, input[type=button]:hover, input[type=submit]:hover { background: #F4F3EE; text-decoration: none; color: var(--text); }
button:disabled, input:disabled { opacity: .45; cursor: default; }

.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: #fff; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-sm { padding: 6px 12px; font-size: .9rem; font-weight: 500; }

label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 4px; }

input[type=text], input[type=email], input:not([type]), select, textarea {
	width: 100%; font: inherit; color: var(--text);
	padding: 9px 11px; border: 1px solid #CFCCC2; border-radius: 6px; background: #fff;
}
select[multiple] { padding: 4px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(225,165,65,.45); border-color: var(--gold-dark); }
textarea { resize: vertical; }

.field { margin-bottom: 14px; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.req { color: var(--red); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.captcha { display: flex; align-items: center; gap: 10px; }
.captcha img { border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.captcha input { max-width: 100px; }

/* Light-yellow panel: the old form colour, used for search and contact */
.panel { background: var(--tint); border: 1px solid #F0E3B8; border-radius: 8px; padding: 16px; }
.panel h3 { font-size: 1.05rem; margin-bottom: 10px; }

/* ---------- home banner: the old illustration ---------- */

.banner {
	position: relative; height: 160px; margin-bottom: 18px; overflow: hidden;
	background: var(--band); border: 1px dashed var(--dash); border-radius: 8px;
}
.banner-art {     /* the illustration, its own frame trimmed off: the .banner border is the frame */
	position: absolute; left: 0; top: 0; width: 727px; height: 158px;
	background: url("images/main-picture.jpg") no-repeat -1px -1px;
}
.banner-text {
	position: absolute; left: 378px; right: 26px; top: 0; bottom: 0;
	display: flex; flex-direction: column; justify-content: center;
	font-size: 15px; line-height: 1.4; color: #111; max-width: 420px;
}
.banner-text p { margin: 0 0 10px; }
.banner-text a { font-weight: 700; font-size: 16px; text-decoration: underline; }

@container (max-width: 729px) {
	.banner { height: auto; }
	.banner-art { position: static; width: auto; height: 150px; background-size: auto 152px; }
	.banner-text { position: static; padding: 14px 16px 16px; max-width: none; }
}

.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.home-actions .act { display: flex; flex-direction: column; justify-content: space-between; }
.home-actions .act p { margin: 0 0 8px; color: #444; }
.home-actions .btn { width: 100%; }
@container (max-width: 560px) { .home-actions { grid-template-columns: 1fr; } }

/* ---------- search bar ---------- */

.search { margin-bottom: 8px; }
.search-row { display: grid; grid-template-columns: 1fr 1fr 1.3fr auto; gap: 10px; align-items: end; }
.search-row .field { margin: 0; }
@container (max-width: 640px) { .search-row { grid-template-columns: 1fr; } }

/* ---------- listing rows ---------- */

.results-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; margin: 16px 0 4px; color: var(--muted); font-size: .9rem; }
.results-head .popular a { white-space: nowrap; }

.rows { border-top: 1px solid var(--line); }
.row {
	display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 14px;
	padding: 12px 0; border-bottom: 1px solid var(--line);
}
.row .thumb { width: 96px; height: 72px; border-radius: 4px; overflow: hidden; background: var(--band); display: block; }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row .thumb.none {
	background: var(--band) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M10 30 32 12l22 18v24H10z' fill='none' stroke='%23C9C6BC' stroke-width='3' stroke-linejoin='round'/%3E%3Crect x='27' y='38' width='10' height='16' fill='none' stroke='%23C9C6BC' stroke-width='3'/%3E%3C/svg%3E") no-repeat center / 40px;
}
.row .title { font-weight: 600; line-height: 1.35; display: block; margin-bottom: 2px; }
.row .title:visited { color: #8a5a5a; }
.row .descr { color: #444; margin: 0; overflow-wrap: anywhere; line-height: 1.45; }
.row .side { text-align: right; white-space: nowrap; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.row .side b { color: var(--text); font-weight: 600; display: block; }
.row .meta-inline { display: none; }

@container (max-width: 600px) {
	.row { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; }
	.row .thumb { width: 76px; height: 58px; }
	.row .side { display: none; }
	.row .meta-inline { display: block; color: var(--muted); font-size: .85rem; margin-top: 3px; }
	.row .meta-inline b { color: var(--text); font-weight: 600; }
}

.row-ad { padding: 14px 0; border-bottom: 1px solid var(--line); }

.pager { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: 20px 0; }
.pager a, .pager b { min-width: 36px; padding: 6px 10px; border-radius: 4px; text-align: center; }
.pager a:hover { background: var(--band); text-decoration: none; }
.pager b { background: var(--gold); color: #fff; }

/* states */
.states { list-style: none; padding: 0; margin: 0; columns: 4 160px; column-gap: 16px; }
.states li { break-inside: avoid; padding: 2px 0; }

/* ---------- listing page ---------- */

.view-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

.facts { margin: -2px 0 14px; color: #444; }
.facts span { display: inline-block; margin-right: 20px; }
.facts b { color: var(--text); }

.gallery { margin: 0 0 18px; max-width: 640px; }
.gallery .main { display: block; line-height: 0; background: var(--band); border-radius: 6px; overflow: hidden; }
.gallery .main img { width: 100%; max-height: 480px; object-fit: contain; }
.gallery .thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.gallery .thumbs a { width: 84px; height: 63px; border-radius: 4px; overflow: hidden; line-height: 0; outline: 2px solid transparent; }
.gallery .thumbs a:hover { outline-color: var(--gold); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }

.descr-full { overflow-wrap: anywhere; margin-bottom: 18px; max-width: 720px; }

#map_canvas { width: 100% !important; max-width: 640px; height: 260px !important; border-radius: 6px; margin: 0 0 20px; }

.wanted h2 { font-size: 1.1rem; }

.status { display: inline-block; font-weight: 700; font-size: .8rem; letter-spacing: .04em; padding: 3px 10px; border-radius: 4px; margin-bottom: 12px; }
.status.on { background: #E5F2DC; color: var(--green-dark); }
.status.off { background: #FBE3E3; color: var(--red-dark); }

.owner-actions .act { padding: 10px 0; border-bottom: 1px solid #F0E3B8; }
.owner-actions .act:last-child { border-bottom: 0; padding-bottom: 0; }
.owner-actions .act a { font-weight: 600; }
.owner-actions .act p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }

/* ---------- add / edit form ---------- */

.form-wrap { max-width: 820px; }
.form-section { margin-bottom: 8px; }
.existing-images { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.img-item { text-align: center; font-size: .88rem; }
.img-item img { width: 104px; height: 78px; object-fit: cover; border-radius: 4px; display: block; margin-bottom: 2px; }
.file-row { flex-basis: 100%; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-row input[type=file] { font: inherit; max-width: 100%; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- confirmation ---------- */

.notice { max-width: 620px; margin: 24px auto; text-align: center; }
.notice h1 { font-size: 1.35rem; }
.notice.error h1 { color: var(--red-dark); }

/* ---------- ads ---------- */

.ad { width: 100%; }
.ad:has(ins[data-ad-status^="unfill"]) { display: none; }     /* Google had no ad for this slot */
.row-ad:has(ins[data-ad-status^="unfill"]) { display: none; }
.ad-label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #9a978f; margin-bottom: 3px; }
.ad-box { max-width: 300px; }
.ad-tall { max-width: 300px; }
.ad-feed { margin: 4px 0; }
@media (max-width: 999px) { .ad-desktop { display: none; } }
@media (min-width: 1000px) { .ad-mobile, .row-ad:has(> .ad-mobile) { display: none; } }

/* sample creatives (local preview only, ADS_DUMMY) */
.dummy { position: relative; background: var(--t); border: 1px solid rgba(0,0,0,.08); color: #222; overflow: hidden; font-size: 14px; }
.dummy .d-img { background: #fff; display: flex; align-items: center; justify-content: center; }
.dummy .d-img svg { width: 56%; height: 56%; }
.dummy .d-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.dummy .d-head { font-weight: 700; font-size: 18px; color: var(--c); line-height: 1.2; }
.dummy .d-text { color: #333; line-height: 1.35; }
.dummy .d-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.dummy .d-adv { color: #777; font-size: 12px; }
.dummy .d-cta { background: var(--c); color: #fff; font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 16px; white-space: nowrap; }
.dummy .d-mark { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 3px; }

.dummy-box { width: 300px; max-width: 100%; height: 250px; display: flex; flex-direction: column; }
.dummy-box .d-img { height: 120px; }
.dummy-box .d-body { flex: 1; }

.dummy-tall { width: 300px; max-width: 100%; height: 600px; display: flex; flex-direction: column; }
.dummy-tall .d-img { height: 330px; }
.dummy-tall .d-head { font-size: 24px; }
.dummy-tall .d-body { flex: 1; padding: 18px; }

.dummy-feed { display: grid; grid-template-columns: 110px minmax(0, 1fr); min-height: 100px; }
.dummy-feed .d-img { height: 100%; min-height: 100px; }
.dummy-feed .d-head { font-size: 16px; }

/* ---------- footer ---------- */

.site-footer { background: var(--band); border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer-row { padding-top: 20px; padding-bottom: 20px; text-align: center; }
.footer-partner a { color: var(--muted); }
.footer-copy { margin: 0; }
.footer-copy a { color: var(--text); }

/* ---------- older pages that still use the 2006 class names (premium purchase) ---------- */

.bhsForm2Caption, .bhsFormCaption, .bhsFormMainCaption, .adCaption {
	background: var(--gold); color: #fff; font-weight: 700; padding: 6px 10px;
}
.bhsForm, .bhsForm2, .bhsFormHelp, .bhsFormHint, .bhsFormLabel, .bhsFormLabelRequired, .bhsForm2LabelRequired { background: var(--tint); padding: 6px; }
.bhsFormLabelRequired, .bhsForm2LabelRequired { font-weight: 600; }
.bhsFormHint, .bhsForm2Hint, .bhsLightFont, .totals { color: var(--muted); font-size: .9rem; }
