/*
Theme Name: BoatTrader
Theme URI: https://example.co.za/
Author: BoatTrader
Description: A fast theme for buying and selling new and pre-owned boats in South Africa. Luminous green and light blue design, boat listings with photo galleries, specs and Rand pricing, search and filters, enquiry and WhatsApp buttons, and a "Sell your boat" form. No extra plugins needed.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dirk-boat-trader
Tags: custom-menu, custom-logo, featured-images, one-column, two-columns
*/

/* ---------- Colours ---------- */
:root {
	--green: #7cff4f;          /* luminous green (logo) */
	--green-bright: #a6ff7f;
	--green-deep: #3fd61a;
	--green-text: #1e7d0a;     /* readable green on white */
	--glow: 0 0 18px rgba(124, 255, 79, .55);
	--blue: #7fd3ff;           /* light blue */
	--blue-soft: #bfe9ff;
	--blue-pale: #eaf8ff;
	--blue-link: #0d78b0;
	--night: #0a0f0b;          /* logo background */
	--night-2: #121a14;
	--night-3: #1a261d;
	--ink: #142019;
	--muted: #56655c;
	--line: #d9ecf5;
	--white: #ffffff;
	--sold: #c0392b;
	--offer: #e09b12;
	--ok: #2e9b3e;
	--whatsapp: #25d366;
	--radius: 12px;
	--shadow: 0 8px 28px rgba(10, 30, 20, .10);
	--wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	color: var(--ink);
	background: var(--white);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue-link); text-decoration: none; }
a:hover { color: #075a86; text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; color: var(--night); margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	position: fixed; top: 10px; left: 10px; z-index: 1000; width: auto; height: auto;
	clip: auto; background: var(--white); padding: 10px 16px; border-radius: 6px;
}

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
	font-weight: 700; font-size: 1rem; cursor: pointer; text-decoration: none;
	transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
	line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--green); color: var(--night); }
.btn-primary:hover { background: var(--green-bright); color: var(--night); box-shadow: var(--glow); }
.btn-outline { background: transparent; border-color: var(--blue); color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: var(--night); }
.btn-ghost { background: var(--white); border-color: var(--line); color: var(--night); }
.btn-ghost:hover { border-color: var(--green-deep); color: var(--green-text); }
.btn-dark { background: var(--night); color: var(--green); }
.btn-dark:hover { background: var(--night-3); color: var(--green-bright); }
.btn-whatsapp { background: var(--whatsapp); color: #06301a; }
.btn-whatsapp:hover { background: #1fbe5a; color: #06301a; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.topbar { background: #050806; color: var(--blue-soft); font-size: .88rem; }
.topbar .wrap { display: flex; gap: 20px; justify-content: flex-end; padding-top: 6px; padding-bottom: 6px; flex-wrap: wrap; }
.topbar a { color: var(--blue); }
@media (max-width: 620px) {
	.topbar .wrap { justify-content: center; gap: 14px; }
	.topbar span { display: none; }
}

.site-header {
	background: var(--night); border-bottom: 1px solid rgba(124, 255, 79, .18);
	position: sticky; top: 0; z-index: 50;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 20px; position: relative; }

.site-branding { display: flex; align-items: center; gap: 12px; }
.site-branding a:hover { text-decoration: none; }
.site-branding .custom-logo, .site-branding .site-logo { max-height: 54px; width: auto; }
.site-title { font-size: 1.4rem; font-weight: 800; color: var(--green); margin: 0; text-shadow: var(--glow); }
.site-title a { color: inherit; }
.site-description { margin: 0; font-size: .85rem; color: var(--blue-soft); }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; align-items: center; }
.main-nav a { display: block; padding: 10px 12px; color: #e6f6ee; font-weight: 600; border-radius: 999px; font-size: .95rem; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .is-current > a { color: var(--green); background: rgba(124, 255, 79, .10); text-decoration: none; }
.main-nav .menu-cta > a { background: var(--green); color: var(--night); }
.main-nav .menu-cta > a:hover { background: var(--green-bright); color: var(--night); box-shadow: var(--glow); }

.menu-toggle {
	display: none; background: none; border: 2px solid var(--green); border-radius: 999px;
	padding: 8px 16px; font-weight: 700; color: var(--green); cursor: pointer;
}

@media (max-width: 1020px) {
	.menu-toggle { display: inline-block; }
	.main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--night); border-bottom: 1px solid rgba(124, 255, 79, .25); box-shadow: var(--shadow); }
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; align-items: stretch; padding: 10px 20px 20px; }
}

/* ---------- Hero ---------- */
.hero {
	position: relative; color: var(--white);
	background: var(--night) center / cover no-repeat;
	padding: 96px 0 130px;
	overflow: hidden;
}
.hero::before {
	content: ""; position: absolute; inset: 0;
	background:
		radial-gradient(ellipse at 20% 30%, rgba(124, 255, 79, .22), transparent 55%),
		linear-gradient(180deg, rgba(10, 15, 11, .55) 0%, rgba(10, 15, 11, .9) 100%);
}
.hero.no-image {
	background:
		radial-gradient(ellipse at 15% 20%, rgba(124, 255, 79, .30), transparent 50%),
		radial-gradient(ellipse at 85% 80%, rgba(127, 211, 255, .25), transparent 55%),
		var(--night);
}
.hero.no-image::before { display: none; }
.hero .wrap { position: relative; }
.hero h1 { color: var(--green); max-width: 780px; text-shadow: 0 0 22px rgba(124, 255, 79, .55); }
.hero p.lead { font-size: 1.2rem; max-width: 640px; color: var(--blue-soft); margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Search box ---------- */
.search-panel {
	background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
	border-top: 4px solid var(--green);
	padding: 22px; position: relative; margin-top: -72px; z-index: 5;
}
.search-panel h2 { font-size: 1.15rem; margin-bottom: 14px; }
.filter-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; align-items: end; }
.filter-grid .field-wide { grid-column: span 2; }
@media (max-width: 980px) { .filter-grid { grid-template-columns: repeat(2, 1fr); } .filter-grid .field-wide { grid-column: span 2; } }

label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="search"], select, textarea {
	width: 100%; padding: 11px 12px; border: 1px solid #bcd7e4; border-radius: 8px;
	font: inherit; color: var(--ink); background: var(--white);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue-link); }
textarea { min-height: 120px; resize: vertical; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-alt { background: var(--blue-pale); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head p { color: var(--muted); margin: 0; }
.section-head h2::after { content: ""; display: block; width: 56px; height: 4px; border-radius: 4px; background: var(--green); margin-top: 10px; box-shadow: var(--glow); }

/* ---------- Boat cards ---------- */
.boat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 980px) { .boat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .boat-grid { grid-template-columns: 1fr; } }

.boat-card {
	background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
	overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s, border-color .15s;
}
.boat-card:hover { box-shadow: 0 10px 30px rgba(63, 214, 26, .18); transform: translateY(-2px); border-color: var(--green); }
.boat-card-media { position: relative; aspect-ratio: 4 / 3; background: var(--blue-pale); }
.boat-card-media img { width: 100%; height: 100%; object-fit: cover; }
.boat-card-media .no-photo { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-weight: 600; }
.boat-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.boat-card h3 { margin: 0; font-size: 1.1rem; }
.boat-card h3 a { color: var(--night); }
.boat-card .price { font-size: 1.3rem; font-weight: 800; color: var(--green-text); }
.boat-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .9rem; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }

.badge {
	position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: 999px;
	font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--white);
}
.badge-sold { background: var(--sold); }
.badge-offer { background: var(--offer); color: var(--night); }
.badge-new { background: var(--blue); color: var(--night); top: auto; bottom: 12px; }
.badge-featured { background: var(--green); color: var(--night); left: auto; right: 12px; box-shadow: var(--glow); }

/* ---------- Type tiles ---------- */
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 860px) { .type-grid { grid-template-columns: repeat(2, 1fr); } }
.type-tile {
	display: flex; justify-content: space-between; align-items: center; padding: 18px 20px;
	background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); color: var(--night); font-weight: 700;
}
.type-tile:hover { border-color: var(--green-deep); text-decoration: none; box-shadow: 0 0 0 3px rgba(124, 255, 79, .25); color: var(--night); }
.type-tile span { color: var(--night); background: var(--blue-soft); border-radius: 999px; padding: 1px 10px; font-weight: 700; font-size: .85rem; }

/* ---------- Features strip ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }
.feature { padding: 24px; background: var(--white); border-radius: var(--radius); border: 1px solid var(--line); }
.feature .num { display: inline-flex; width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: var(--night); font-weight: 800; align-items: center; justify-content: center; margin-bottom: 10px; box-shadow: var(--glow); }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(120deg, var(--green) 0%, #5cf03a 55%, var(--blue) 140%); color: var(--night); padding: 56px 0; }
.cta-band .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { color: var(--night); margin: 0 0 6px; }
.cta-band p { color: #173a10; margin: 0; }

/* ---------- Archive layout ---------- */
.page-banner {
	background:
		radial-gradient(ellipse at 10% 0%, rgba(124, 255, 79, .22), transparent 55%),
		radial-gradient(ellipse at 90% 100%, rgba(127, 211, 255, .20), transparent 55%),
		var(--night);
	padding: 44px 0 34px;
}
.page-banner h1 { color: var(--green); text-shadow: var(--glow); margin-bottom: 6px; }
.page-banner p, .page-banner div { color: var(--blue-soft); margin: 0; }
.archive-layout { display: grid; grid-template-columns: 280px 1fr; gap: 30px; padding: 36px 0 64px; }
@media (max-width: 920px) { .archive-layout { grid-template-columns: 1fr; } }
.filter-sidebar { background: var(--blue-pale); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; align-self: start; position: sticky; top: 96px; }
@media (max-width: 920px) { .filter-sidebar { position: static; } }
.filter-sidebar .field { margin-bottom: 14px; }
.filter-sidebar .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.results-bar .count { color: var(--muted); }
.results-bar select { width: auto; }

.cond-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cond-tabs a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--night); font-weight: 600; font-size: .9rem; }
.cond-tabs a:hover { text-decoration: none; border-color: var(--green-deep); }
.cond-tabs a.is-active { background: var(--night); color: var(--green); border-color: var(--night); }

.pagination { margin-top: 30px; display: flex; gap: 6px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--night); }
.pagination .current { background: var(--green); color: var(--night); border-color: var(--green); font-weight: 800; }

.empty-state { padding: 40px; text-align: center; border: 2px dashed var(--blue-soft); border-radius: var(--radius); color: var(--muted); background: var(--blue-pale); }

/* ---------- Single boat ---------- */
.boat-single { padding: 30px 0 64px; }
.breadcrumbs { font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.boat-single-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.boat-single-head h1 { margin-bottom: 4px; }
.boat-single-head .location { color: var(--muted); }
.boat-single-head .price { font-size: 2rem; font-weight: 800; color: var(--green-text); white-space: nowrap; }
.status-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 800; text-transform: uppercase; color: var(--white); margin-left: 8px; vertical-align: middle; }
.status-available { background: var(--green); color: var(--night); }
.status-sold { background: var(--sold); }
.status-under-offer { background: var(--offer); color: var(--night); }

.boat-single-layout { display: grid; grid-template-columns: 1fr 360px; gap: 32px; }
@media (max-width: 980px) { .boat-single-layout { grid-template-columns: 1fr; } }

.gallery-main { border-radius: var(--radius); overflow: hidden; background: var(--blue-pale); aspect-ratio: 16 / 10; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 8px; }
@media (max-width: 620px) { .gallery-thumbs { grid-template-columns: repeat(4, 1fr); } }
.gallery-thumbs button { padding: 0; border: 3px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; aspect-ratio: 4 / 3; }
.gallery-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs button.is-active { border-color: var(--green); box-shadow: var(--glow); }

.spec-table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.spec-table th, .spec-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.spec-table th { width: 40%; color: var(--muted); font-weight: 600; background: var(--blue-pale); }

.boat-description { margin-top: 10px; }

.enquiry-box { background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); position: sticky; top: 96px; }
.enquiry-box h2 { font-size: 1.2rem; }
.enquiry-box .field { margin-bottom: 12px; }
.enquiry-box .quick { display: grid; gap: 8px; margin-bottom: 18px; }
.enquiry-box .divider { text-align: center; color: var(--muted); font-size: .85rem; margin: 6px 0 14px; }

.hp-field { position: absolute !important; left: -9999px !important; }

.notice { padding: 14px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 600; }
.notice-success { background: #eaffe0; color: #1e6b0b; border: 1px solid #b9f39d; }
.notice-error { background: #fdeceb; color: #8a2a2a; border: 1px solid #f0c4c4; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(5, 10, 7, .94); display: none; align-items: center; justify-content: center; z-index: 200; padding: 30px; }
.lightbox.is-open { display: flex; }
.lightbox img { max-height: 90vh; max-width: 95vw; width: auto; border-radius: 6px; }
.lightbox button { position: absolute; background: rgba(124, 255, 79, .18); color: var(--green); border: 0; font-size: 1.6rem; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; }
.lightbox .lb-close { top: 20px; right: 20px; }
.lightbox .lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ---------- Pages & forms ---------- */
.page-content { padding: 40px 0 64px; }
.content-narrow { max-width: 780px; }
.form-card { background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 860px) { .contact-layout { grid-template-columns: 1fr; } }
.contact-list { list-style: none; padding: 0; margin: 0 0 20px; }
.contact-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact-list strong { display: block; color: var(--muted); font-size: .85rem; }

.entry-content > * + * { margin-top: 1em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }

/* ---------- Footer ---------- */
.site-footer { background: #050806; color: #a9c3b4; padding: 50px 0 24px; font-size: .95rem; border-top: 3px solid var(--green); }
.site-footer h3 { color: var(--green); font-size: 1rem; }
.site-footer a { color: var(--blue); }
.footer-logo { max-width: 240px; margin-bottom: 12px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; margin-bottom: 30px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { padding: 3px 0; }
.footer-bottom { border-top: 1px solid rgba(127, 211, 255, .15); padding-top: 18px; font-size: .85rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.photo-credit { font-size: .8rem; color: var(--muted); }

/* Floating WhatsApp */
.wa-float {
	position: fixed; right: 18px; bottom: 18px; z-index: 60; width: 56px; height: 56px; border-radius: 50%;
	background: var(--whatsapp); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.wa-float svg { width: 30px; height: 30px; fill: #fff; }

/* WordPress core classes */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text { font-size: .85rem; color: var(--muted); }
