/* SiteX Engine: shared stylesheet for every marketplace.
   Brand values (--brand, --brand-tint, --action, --action-dark, --field, --field-hover, --heading, --price, --photo-bg, --placeholder)
   are printed per brand from inc/mod_config.php by inc/inc_head.php. Never put a brand color, name or path in this file. */

/* ---------- Tokens ---------- */
:root { --select-arrow: 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='%235F6B78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }  /* arrow = --ink-soft gray, the same on every site (a data URI can't read variables, so the color is written out) */
/* Neutral tokens: the same on every site */
:root { --ink: #1D2733; --ink-soft: #5F6B78; --line: #CFD6DE; --font: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif; --wrap: 1170px; --gutter: clamp(0.75rem, 3vw, 1.5rem); --control-h: clamp(2.75rem, 2rem + 1.6vw, 3.5rem); --fs-control: clamp(1rem, 0.9rem + 0.35vw, 1.25rem); --logo-h: clamp(33.6px, calc(31.44px + 0.55vw), 42px); --gap-section: 22px; --gap-heading: clamp(28px, 22px + 1vw, 34px); --pad-box: clamp(14px, 2vw, 22px); --gap-item: clamp(10px, 1.6vw, 16px); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: #fff; color: var(--ink); font-family: var(--font); -webkit-text-size-adjust: 100%; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.skip-link { position: absolute; left: 0.5rem; top: -4rem; z-index: 10; padding: 0.5rem 0.75rem; border-radius: 5px; background: #fff; color: var(--brand); font-weight: 600; }
.skip-link:focus { top: 0.5rem; }

/* ---------- Header (55px) ---------- */
.site-header { container-type: inline-size; height: 55px; background: var(--brand); border-bottom: 1px solid #fff; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; height: 100%; }
.site-logo-link { display: block; flex: 0 1 auto; min-width: 0; }
.site-logo { display: block; width: auto; max-width: 100%; height: var(--logo-h); object-fit: contain; object-position: left center; filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.15)); }
.header-actions { display: flex; flex: none; align-items: center; gap: 0.4rem; }
@container (max-width: 430px) { .account-my, .header-button .account-icon { display: none; } }
.header-button { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; position: relative; height: var(--logo-h); padding: 0 clamp(0.5rem, 0.1rem + 1.8vw, 0.9rem); border-radius: 5px; font: 600 0.9375rem/1 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color 0.15s; }
/* keeps a 44px tap area around the smaller buttons */
.header-button::after { content: ""; position: absolute; inset: -5px -2px; }
.header-button-list { background: #fff; color: var(--brand); border: 1px solid #fff; }
.header-button-menu { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.65); }
.header-button-list:hover { background: var(--brand-tint); }
.header-button-menu:hover { background: rgba(255, 255, 255, 0.12); }
.header-button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.account-icon { display: block; width: 16px; height: 16px; }

/* ---------- Hero ---------- */
.hero { position: relative; height: clamp(300px, 17.68vw + 230px, 570px); background: var(--brand); overflow: hidden; }
.hero img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }
/* bottom scrim keeps the headline readable on any part of the photo: delete to remove */
.hero::before { content: ""; position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0)); pointer-events: none; }
/* dot texture from the original design: delete to remove */
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(rgba(255, 255, 255, 0.35) 0.4px, transparent 0.4px) 0 0 / 3px 3px repeat; pointer-events: none; }

/* ---------- Search (overlaps the bottom edge of the hero) ---------- */
.search { position: relative; z-index: 1; container-type: inline-size; margin-top: calc(var(--control-h) / -2 - 5px); }
.search-lead { --t: clamp(34px, 4vw, 56px); --lead-gap: clamp(8px, 0.45vw, 12px); position: absolute; bottom: 100%; left: 0; right: 0; display: grid; grid-template-columns: fit-content(100%); justify-content: center; gap: calc(var(--lead-gap) * 0.2); padding-bottom: calc(var(--lead-gap) - var(--t) * 0.06 - 1px); pointer-events: none; }
.search-title { margin: 0 0 calc(-0.28em + 1px); color: #fff; text-align: center; white-space: nowrap; font: 700 var(--t)/1 var(--font); text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.6); }
.search-tag { contain: inline-size; margin: 0; padding: calc(0.3em + var(--t) * 0.045) 0 calc(0.3em + var(--t) * 0.024); background: none; color: #fff; text-align: center; font: 400 calc(var(--t) * 0.364)/1.2 var(--font); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-form { display: grid; grid-template-columns: calc(15% - 0.4px) repeat(3, minmax(0, 1fr)) calc(15% - 0.4px); align-items: center; gap: 4px; padding: 5px; background: #fff; border-radius: 7px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.1); }
.field, .btn-search { width: 100%; min-width: 0; height: var(--control-h); border-radius: 4px; font: 400 var(--fs-control)/1 var(--font); }
.field { padding: 0 0.75rem; border: 1px solid var(--line); background-color: var(--field); color: var(--ink); transition: background-color 0.15s, border-color 0.15s; } /* resting: same gray as inactive tabs */
.field:hover { background-color: var(--field-hover); }                                   /* hover: a touch darker, invites the click */
.field:focus { background-color: var(--brand-tint); border-color: var(--brand); outline: none; } /* typing: light blue fill + blue 1px border; no ring, size never changes */
.field::placeholder { color: var(--ink-soft); opacity: 1; }
select.field { appearance: none; -webkit-appearance: none; padding-right: 2.25rem; cursor: pointer; background-image: var(--select-arrow); background-repeat: no-repeat; background-position: right 0.8rem center; background-size: 0.8rem; }
select.field:has(option[value=""]:checked) { color: var(--ink-soft); }
select.field option { color: var(--ink); }
.btn-search { border: 0; background: var(--action); color: #fff; font-weight: 600; cursor: pointer; transition: background-color 0.15s; }
.btn-search:hover { background: var(--action-dark); }
.btn-search:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- Below the search: browse + recent listings (one-line rules) ---------- */
/* One visual gap (--gap-section) between every block. Text carries a few px of built-in line spacing above and below,
   so blocks that start or end with text subtract it; the gap you SEE is the same everywhere. */
.block { margin-top: calc(var(--gap-heading) - 3px); }   /* starts with an H2: more air above than below (about 2:1), so the heading belongs to its content */
.block.block-box { margin-top: var(--gap-section); }      /* starts with a box (sell band) */
.block.about { margin-top: calc(var(--gap-section) - 6px); } /* starts with body text */
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: var(--gap-item); } /* heading sits one card-gap from its content */
.block h2 { margin: 0; color: var(--heading); font: 700 clamp(1.375rem, 1rem + 1.1vw, 1.875rem)/1.15 var(--font); } /* ~1.4x the card prices (middle of the old 20-26 and the tested 24-34), paler slate because it is large */
.block-head > * { text-box: trim-end cap alphabetic; } /* drop the empty space under the baseline, so --gap-item is the real distance to the content (Chrome, Edge, Safari; Firefox keeps the old spacing) */
.more-link { color: var(--brand); font: 600 1rem/1.2 var(--font); text-decoration: none; white-space: nowrap; }
.more-link:hover { text-decoration: underline; }
.more-link:focus-visible, .card-link:focus-visible, .linklist a:focus-visible, .btn-sell:focus-visible, .foot-links a:focus-visible, .pop-list a:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
/* recent listings: 2 columns on phones, up to 4 on desktop, always 12 cards = full rows at 2, 3 and 4 columns (12 divides by all three) */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(8.5rem, calc((100% - 3 * var(--gap-item)) / 4)), 1fr)); column-gap: var(--gap-item); row-gap: 0; margin: 0; padding: 0; list-style: none; }
.card { margin-bottom: var(--gap-item); min-width: 0; }
.listing-grid { margin-bottom: calc(-1 * var(--gap-item)); }
.card-link { display: block; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); text-decoration: none; transition: border-color 0.15s; }
.card-link:hover { border-color: var(--brand); }
.card-photo { position: relative; aspect-ratio: 4 / 3; background: var(--photo-bg) var(--placeholder) center / 42% no-repeat; }
.card-photo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 0.6rem 0.75rem 0.75rem; }
/* price left, location top right (away from the title); the price never shrinks or wraps */
.card-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.card-price { flex: none; margin: 0; color: var(--price); font: 700 clamp(1.125rem, 1rem + 0.4vw, 1.3125rem)/1.2 var(--font); }
.card-loc { display: flex; min-width: 0; margin: 0; color: var(--ink-soft); font: 400 0.8125rem/1.2 var(--font); white-space: nowrap; }
/* only the city shortens ("Lake Ha..., AZ"); the state always stays visible */
.loc-city { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.loc-st { flex: none; }
/* title: always one line, long names end in "..."; 15px on phones growing to 16px by about 800px wide */
.card-title { margin: 0.2rem 0 0; overflow: hidden; color: #3A4652; font: 400 clamp(0.9375rem, 0.875rem + 0.25vw, 1rem)/1.3 var(--font); white-space: nowrap; text-overflow: ellipsis; }
.linklist { columns: 9.5rem; column-gap: 1rem; margin: 0; padding: 0; list-style: none; }
.linklist li { break-inside: avoid; }
.linklist a { display: inline-block; padding: 0.3rem 0; color: var(--brand); font: 400 1.0625rem/1.2 var(--font); text-decoration: none; }
.linklist a:hover { text-decoration: underline; }
/* 6/4/3/2 columns: list length must divide by 12 (48 states; 24 or 36 types and brands) so every row is complete. Columns stay at least 145px wide (longest entry: 142px). */
.tab-panel { container-type: inline-size; }
.linklist-grid { columns: 2; }
@container (min-width: 470px) { .linklist-grid { columns: 3; } }
@container (min-width: 630px) { .linklist-grid { columns: 4; } }
@container (min-width: 950px) { .linklist-grid { columns: 6; } }
/* browse hub: tabs without JavaScript (radio inputs + :has). All links stay in the HTML. */
.tabs { position: relative; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.tab-input { position: absolute; opacity: 0; pointer-events: none; }
.tab-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--field); border-bottom: 1px solid var(--line); }
.tab-label { margin-bottom: -1px; padding: 0.8rem 0.4rem; border-bottom: 3px solid transparent; text-align: center; white-space: nowrap; color: var(--ink-soft); font: 600 1.0625rem/1 var(--font); cursor: pointer; transition: color 0.15s; }
.tab-label + .tab-label { border-left: 1px solid var(--line); } /* equal thirds, gray divider between tabs */
.tab-label { transition: color 0.15s, background-color 0.15s; }
.tab-label:hover { color: var(--brand); background: var(--field-hover); } /* hover: same as the search fields */
.tab-panel { display: none; padding: var(--pad-box); }
.tabs:has(#tab-types:checked) [for="tab-types"], .tabs:has(#tab-brands:checked) [for="tab-brands"], .tabs:has(#tab-states:checked) [for="tab-states"] { border-bottom-color: var(--brand); background: var(--brand-tint); color: var(--brand); } /* active tab: same light blue as a focused search field */
.tabs:has(#tab-types:checked) #panel-types, .tabs:has(#tab-brands:checked) #panel-brands, .tabs:has(#tab-states:checked) #panel-states { display: block; }
.tabs:has(#tab-types:focus-visible) [for="tab-types"], .tabs:has(#tab-brands:focus-visible) [for="tab-brands"], .tabs:has(#tab-states:focus-visible) [for="tab-states"] { outline: 3px solid var(--brand); outline-offset: -3px; }
@supports not selector(:has(*)) { .tab-panel { display: block; } .tab-list { display: none; } }
.cnt { margin-left: 0.35em; color: var(--ink-soft); font-size: 0.875rem; }
/* sell band */
.sell { container-type: inline-size; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; padding: var(--pad-box); border-radius: 8px; background: var(--brand); color: #fff; }
.sell-copy { flex: 1 1 18rem; }
.sell h2 { margin: 0; color: #fff; font: 700 clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem)/1.2 var(--font); }
.sell p { margin: 0.35rem 0 0; font: 400 1.0625rem/1.4 var(--font); }
.btn-sell { display: inline-flex; align-items: center; justify-content: center; height: var(--control-h); padding: 0 1.75rem; border-radius: 4px; background: #fff; color: var(--brand); font: 600 var(--fs-control)/1 var(--font); text-decoration: none; transition: background-color 0.15s; }
.btn-sell:hover { background: var(--brand-tint); }
/* narrow: full-width button, same as the full-width Search button */
@container (max-width: 520px) { .btn-sell { width: 100%; } }
.about p { text-wrap: pretty; margin: 0; color: var(--ink-soft); font: 400 1.0625rem/1.55 var(--font); }
/* footer */
.site-footer { margin-top: calc(var(--gap-section) - 3px); padding: 0 0 14px; color: var(--ink-soft); font: 400 0.9375rem/1.4 var(--font); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
/* copyright left, links right on one line; if they ever have to wrap, the links move up and the copyright stays the last line */
.site-footer .foot-bottom { flex-wrap: wrap-reverse; column-gap: 10px; }
.site-footer .foot-pop { display: block; margin-bottom: calc(var(--gap-section) - 6px); padding-top: calc(var(--gap-section) - 4px); border-top: 1px solid var(--line); }
.foot-pop-title { margin: 0 0 4px; color: var(--ink-soft); font: 600 0.9375rem/1.4 var(--font); }
/* 18 links in complete rows only: 6, 3 or 2 columns, chosen by the footer width (never 4 or 5, which would leave a half row) */
.foot-pop { container-type: inline-size; }
.pop-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 0.75rem; margin: 0; padding: 0; list-style: none; }
@container (min-width: 600px) { .pop-list { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 1rem; } }
@container (min-width: 1140px) { .pop-list { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.pop-list a { display: inline-block; padding: 0.2rem 0; color: var(--ink-soft); text-decoration: none; }
.pop-list a:hover { color: var(--brand); text-decoration: underline; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; }
/* small dots between the links; the "/ ''" part keeps screen readers from announcing them */
.foot-links li + li::before { content: "\2022"; content: "\2022" / ""; margin: 0 0.25em; color: #8A96A3; }
/* copyright is always the last line: on narrow footers the links move above it */
.site-footer .foot-bottom { container-type: inline-size; padding-top: calc(var(--gap-section) - 7px); border-top: 1px solid var(--line); }
.foot-copy { color: #6B7682; font-size: 0.875rem; }
/* narrowest phones: one size down so copyright and links still share one line */
@container (max-width: 350px) { .foot-copy, .foot-links { font-size: 0.8125rem; } }
.foot-links a { display: inline-block; padding: 0.25rem 0; color: var(--ink-soft); text-decoration: none; }
.foot-links a:hover { color: var(--brand); text-decoration: underline; }

/* narrow reflow: 2 + 2 + full-width Search */
@container (max-width: 760px) {
  .search-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn-search { grid-column: 1 / -1; }
}

/* phones: the lockup spans exactly the header's content width (logo left edge to Menu right edge). 9.52 = title width in em (measured 9.46 for "Boats for Sale Near You" in Roboto Condensed Bold, plus ~0.6% slack); justify spreads that sliver across the word gaps. Re-tune if you reword the H1. */
@container (max-width: 480px) {
  .search-lead { --t: calc(100cqw / 9.52); grid-template-columns: 100%; }
  .search-title { text-align: justify; text-align-last: justify; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
