/*
Theme Name: DunedinMLS
Theme URI: https://dunedinmls.com/
Author: Andy Polce
Description: Fast, SEO-focused theme for DunedinMLS.com (Andy Polce, Realtor, Charles Rutenberg Realty). Pair with the "DunedinMLS Core" plugin.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: dunedinmls
*/

:root {
	--navy: #0e3550;
	--sea: #17798a;
	--sea-dark: #0f5f6d;
	--sand: #f7f2e8;
	--coral: #e0663f;
	--coral-dark: #c4532f;
	--ink: #1d2730;
	--muted: #5b6874;
	--line: #e3ddd0;
	--white: #fff;
	--radius: 10px;
	--wrap: 1140px;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--serif: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 18px; line-height: 1.65; color: var(--ink); background: var(--white); }
img { max-width: 100%; height: auto; }
a { color: var(--sea-dark); }
a:hover { color: var(--coral-dark); }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--navy); line-height: 1.2; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-top: 0; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.3rem; }
p, ul, ol { margin: 0 0 1.1em; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; background: #fff; padding: 8px 14px; clip: auto; width: auto; height: auto; }

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

/* Top bar + header */
.topbar { background: var(--navy); color: #dfe8ee; font-size: 14px; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 12px; padding-top: 6px; padding-bottom: 6px; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; font-weight: 600; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; }
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; color: var(--navy); }
.brand-sub { font-size: .8rem; color: var(--muted); letter-spacing: .02em; }
.brand img { max-height: 56px; width: auto; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 16px; cursor: pointer; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.main-nav a { display: block; padding: 8px 12px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; border-radius: 8px; }
.main-nav a:hover, .main-nav .current-menu-item > a { background: var(--sand); color: var(--navy); }
.main-nav .menu-cta > a { background: var(--coral); color: #fff; }
.main-nav .menu-cta > a:hover { background: var(--coral-dark); color: #fff; }

@media (max-width: 900px) {
	.nav-toggle { display: block; }
	.main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 20px 16px; }
	.main-nav.open { display: block; }
	.main-nav ul { flex-direction: column; align-items: stretch; }
}

/* Buttons */
.btn, .wp-block-button__link, .dmls-form button {
	display: inline-block; background: var(--coral); color: #fff !important; border: 0; border-radius: 999px;
	padding: 14px 26px; font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover, .wp-block-button__link:hover, .dmls-form button:hover { background: var(--coral-dark); }
.btn-alt, .is-style-outline .wp-block-button__link { background: transparent; color: var(--navy) !important; border: 2px solid var(--navy); }
.btn-alt:hover, .is-style-outline .wp-block-button__link:hover { background: var(--navy); color: #fff !important; }
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 1.2em; }

/* Content */
.site-main { padding: 48px 0 64px; }
.page-header { background: var(--sand); padding: 44px 0 36px; border-bottom: 1px solid var(--line); }
.page-header h1 { margin: 0; }
.page-header .lead { color: var(--muted); font-size: 1.1rem; margin: .6em 0 0; }
.breadcrumbs { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.breadcrumbs a { color: var(--muted); }
.entry-content > *:first-child { margin-top: 0; }
.entry-content .wp-block-columns { display: flex; gap: 28px; flex-wrap: wrap; margin: 1.5em 0; }
.entry-content .wp-block-column { flex: 1 1 260px; }
.entry-content .wp-block-group.is-card, .card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.entry-content .wp-block-group.is-tint { background: var(--sand); border-radius: var(--radius); padding: 28px; margin: 2em 0; }
.entry-content .wp-block-group.is-tint > :first-child { margin-top: 0; }
@media (max-width: 640px) { .entry-content .wp-block-group.is-tint { padding: 16px; } }
.entry-content details { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 12px; background: #fff; }
.entry-content details summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.entry-content details[open] summary { margin-bottom: 8px; }
.entry-content table { border-collapse: collapse; width: 100%; margin: 1em 0 1.5em; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; }

/* Hero (front page) */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--sea) 100%); color: #fff; padding: 72px 0 64px; position: relative; overflow: hidden; }
.hero.has-image { background-size: cover; background-position: center; }
.hero.has-image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,53,80,.88) 0%, rgba(14,53,80,.55) 100%); }
.hero .wrap { position: relative; }
.hero h1 { color: #fff; max-width: 760px; }
.hero p { font-size: 1.2rem; max-width: 640px; color: #e8f1f5; }
.hero .btn-alt { color: #fff !important; border-color: #fff; }
.hero .btn-alt:hover { background: #fff; color: var(--navy) !important; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 28px; font-size: 15px; color: #d6e6ee; }
.trust-row strong { color: #fff; }

/* Search chips */
.dmls-areas { display: flex; flex-wrap: wrap; gap: 10px; margin: 1em 0 1.6em; padding: 0; list-style: none; }
.dmls-areas a { display: inline-block; padding: 9px 16px; border-radius: 999px; background: var(--sand); border: 1px solid var(--line); color: var(--navy); font-weight: 600; text-decoration: none; font-size: 15px; }
.dmls-areas a:hover { background: var(--navy); color: #fff; }

/* Agent card */
.dmls-agent { display: flex; gap: 22px; align-items: center; background: var(--sand); border-radius: var(--radius); padding: 22px; margin: 2em 0; flex-wrap: wrap; }
.dmls-agent img { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; }
.dmls-agent .initials { width: 112px; height: 112px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 2.2rem; }
.dmls-agent > div:last-child { flex: 1 1 240px; }
.dmls-agent h3 { margin: 0 0 4px; }
.dmls-agent p { margin: 0 0 6px; color: var(--muted); }

/* Forms */
.dmls-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 1.5em 0; box-shadow: 0 6px 20px rgba(14,53,80,.06); }
.dmls-form h3 { margin-top: 0; }
.dmls-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .dmls-form .row { grid-template-columns: 1fr; } }
.dmls-form label { display: block; font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.dmls-form input[type=text], .dmls-form input[type=email], .dmls-form input[type=tel], .dmls-form select, .dmls-form textarea {
	width: 100%; padding: 12px 14px; border: 1px solid #c9c2b4; border-radius: 8px; font: inherit; font-size: 16px; margin-bottom: 12px; background: #fff;
}
.dmls-form .consent { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 14px; font-weight: 400; }
.dmls-form .consent input { margin-top: 4px; }
.dmls-form .hp { position: absolute; left: -9999px; }
.dmls-form .fine { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.dmls-notice { background: #e7f5ee; border: 1px solid #9dd3b6; padding: 16px 18px; border-radius: var(--radius); margin: 0 0 1.5em; }
.dmls-notice.err { background: #fdecea; border-color: #f2a59b; }

/* Stats + reviews */
.dmls-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 1em 0 .6em; }
.dmls-stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.dmls-stat .v { font-family: var(--serif); font-size: 1.8rem; color: var(--navy); font-weight: 700; }
.dmls-stat .l { font-size: 14px; color: var(--muted); }
.dmls-asof { font-size: 14px; color: var(--muted); }
.dmls-reviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 1em 0 1.5em; }
.dmls-review { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0; }
.dmls-review .stars { color: #e3a008; letter-spacing: 2px; }
.dmls-review footer { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* Footer */
.site-footer { background: var(--navy); color: #cfdbe3; font-size: 15px; padding: 48px 0 90px; }
.site-footer a { color: #fff; }
.site-footer h2 { color: #fff; font-size: 1.15rem; margin: 0 0 12px; font-family: var(--font); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.legal { border-top: 1px solid rgba(255,255,255,.15); margin-top: 32px; padding-top: 18px; font-size: 13px; color: #a9bccb; }
.legal p { margin: 0 0 6px; }

/* Mobile sticky contact bar */
.mobile-cta { display: none; }
@media (max-width: 760px) {
	.mobile-cta { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(0,0,0,.08); }
	.mobile-cta a { flex: 1; text-align: center; padding: 13px 6px; font-weight: 700; text-decoration: none; color: var(--navy); font-size: 15px; }
	.mobile-cta a.primary { background: var(--coral); color: #fff; }
	body { font-size: 17px; }
	.topbar .wrap > span:first-child { display: none; }
	.hero { padding: 40px 0 36px; }
	.hero p { font-size: 1.05rem; }
	.mobile-cta a { white-space: nowrap; font-size: 14px; }
	.site-header .wrap { min-height: 62px; }
}

/* Blog list */
.post-list article { border-bottom: 1px solid var(--line); padding: 0 0 24px; margin: 0 0 24px; }
.post-list h2 { margin: 0 0 6px; font-size: 1.5rem; }
.post-list h2 a { text-decoration: none; color: var(--navy); }
.meta { color: var(--muted); font-size: 14px; }
.pagination { display: flex; gap: 10px; }
.dmls-rating { font-weight: 600; margin: .5em 0 0; }
.dmls-rating .stars { color: #e3a008; letter-spacing: 2px; }

/* Hero with headshot */
.hero-grid { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: center; }
.hero-photo { margin: 0; }
.hero-photo img { width: 300px; height: 375px; object-fit: cover; border-radius: 16px; border: 4px solid rgba(255,255,255,.85); box-shadow: 0 16px 40px rgba(0,0,0,.25); display: block; }
@media (max-width: 860px) {
	.hero-grid { grid-template-columns: 1fr; gap: 14px; }
	.hero-photo { order: -1; }
	.hero h1 { font-size: 1.8rem; }
	.hero-photo img { width: 84px; height: 84px; border-radius: 50%; object-position: center 20%; border-width: 3px; }
}
