/*
Theme Name:        B Realtors Satellite
Theme URI:         https://brealtors.com/
Description:       Shared GeneratePress child theme for B Realtors satellite building sites. One stylesheet, no front-end JavaScript, system fonts, WCAG 2.1 AA. Per-site colour comes from the br-satellite site file.
Author:            B Realtors, Inc.
Template:          generatepress
Version:           1.0.0
Requires at least: 6.4
Requires PHP:      8.0
Text Domain:       br-satellite-child
License:           Proprietary
*/

/* ---------- 1. Tokens ----------------------------------------------------------------
 * --brs-accent is set per site from the site file's footer.background (inc/accent.php).
 * Every pairing below is checked by tools/contrast.py (AA: 4.5:1 text, 3:1 large text/UI). */
:root {
	--brs-accent: #12355b;          /* replaced per site */
	--brs-ink: #1b1f24;             /* body text on white: 16.6:1 */
	--brs-muted: #4a5561;           /* secondary text on white: 7.6:1 */
	--brs-line: #d5dbe1;
	--brs-tint: #f4f6f8;            /* panels; ink on tint 15.3:1 */
	--brs-link: #0b5394;            /* links on white: 7.8:1 */
	--brs-focus: #ffbf47;           /* focus halo: 7.6:1 against the default accent */
	--brs-mark: #fff3bf;            /* "to confirm" marks (staging drafts only) */
	--brs-radius: 6px;
	--brs-measure: 72ch;
	--brs-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--brs-serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
}

/* ---------- 2. Base ----------------------------------------------------------------- */
body {
	font-family: var(--brs-font);
	font-size: 1.0625rem;
	line-height: 1.65;
	color: var(--brs-ink);
	-webkit-text-size-adjust: 100%;
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4,
.entry-title {
	font-family: var(--brs-serif);
	color: var(--brs-ink);
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-wrap: balance;
}
h1, .entry-title { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem); }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.85rem); margin-top: 2.2em; }
h3 { font-size: 1.25rem; margin-top: 1.8em; }

.entry-content > * { max-width: var(--brs-measure); }
.entry-content > .wp-block-table,
.entry-content > .wp-block-image,
.entry-content > .br-guide,
.entry-content > .wp-block-shortcode,
.entry-content > [class*="br-listings"] { max-width: none; }

p, li { text-wrap: pretty; }

/* Links: always underlined in running text (WCAG 1.4.1: never colour alone). */
.entry-content a,
.br-reviewed a,
.br-source a {
	color: var(--brs-link);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}
.entry-content a:hover { text-decoration-thickness: 2px; }

/* Focus: visible on every interactive element, keyboard only. Two rings so one always contrasts:
 * a dark outline (16.6:1 on white pages) and a yellow halo (7.6:1 on the dark accent buttons). */
:focus-visible {
	outline: 3px solid var(--brs-ink);
	outline-offset: 2px;
	box-shadow: 0 0 0 6px var(--brs-focus);
	border-radius: 2px;
}
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) { outline: none; }

/* GeneratePress skip link: make it obvious when focused. */
.skip-link:focus {
	background: var(--brs-ink);
	color: #fff;
	padding: 0.75rem 1rem;
	z-index: 100000;
}

img { height: auto; }

/* ---------- 3. Header and navigation ------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--brs-line); }
.main-title a,
.main-title a:visited { color: var(--brs-ink); font-family: var(--brs-serif); font-weight: 700; }
.main-navigation .main-nav ul li a { font-weight: 600; }
.main-navigation .main-nav ul li[class*="current-menu-"] > a {
	text-decoration: underline;
	text-underline-offset: 0.35em;
	text-decoration-thickness: 2px;
}
/* Call button: the last menu item carries class "brs-call" (set by the importer). */
.main-navigation .main-nav ul li.brs-call > a {
	background: var(--brs-accent);
	color: #fff;
	border-radius: var(--brs-radius);
	padding-left: 1rem;
	padding-right: 1rem;
	margin: 0.6rem 0 0.6rem 0.5rem;
	line-height: 2.6;
}

/* ---------- 4. Breadcrumbs (inc/breadcrumbs.php) ------------------------------------- */
.brs-breadcrumbs {
	font-size: 0.875rem;
	color: var(--brs-muted);
	margin: 0 0 1rem;
}
.brs-breadcrumbs a { color: var(--brs-muted); text-decoration: underline; text-underline-offset: 0.15em; }
.brs-breadcrumbs .breadcrumb_last { color: var(--brs-ink); }

/* ---------- 5. Content notes (classes used by the satellite content) ----------------- */
.br-reviewed {
	font-size: 0.9rem;
	color: var(--brs-muted);
	border-left: 3px solid var(--brs-accent);
	padding: 0.15rem 0 0.15rem 0.75rem;
	margin: 0.5rem 0 1.75rem;
}
.br-source,
.br-disclaimer {
	font-size: 0.875rem;
	color: var(--brs-muted);
}
.br-disclaimer {
	border-top: 1px solid var(--brs-line);
	padding-top: 1rem;
	margin-top: 2.5rem;
}
.br-note {
	background: var(--brs-tint);
	border-radius: var(--brs-radius);
	padding: 0.9rem 1.1rem;
	font-size: 0.95rem;
}
mark.br-verify {
	background: var(--brs-mark);
	color: var(--brs-ink);
	padding: 0 0.25em;
	border-radius: 3px;
	font-size: 0.9em;
}

/* ---------- 6. Tables (facts, floor plans, market) ----------------------------------- */
.wp-block-table { overflow-x: auto; margin: 1.5rem 0; }
.wp-block-table table,
.br-guide table {
	border-collapse: collapse;
	width: 100%;
	font-size: 0.975rem;
}
.wp-block-table th,
.wp-block-table td,
.br-guide th,
.br-guide td {
	border: 0;
	border-bottom: 1px solid var(--brs-line);
	padding: 0.65rem 0.75rem;
	text-align: left;
	vertical-align: top;
}
.wp-block-table thead th {
	background: var(--brs-tint);
	font-weight: 700;
}
.wp-block-table tbody th,
.wp-block-table td:first-child { font-weight: 600; }
.wp-block-table thead:empty,
.wp-block-table thead tr:has(th:empty:only-child),
.wp-block-table thead tr:not(:has(th:not(:empty))) { display: none; }

/* ---------- 7. Images and media ------------------------------------------------------ */
.wp-block-image img { border-radius: var(--brs-radius); }
.wp-block-image figcaption { font-size: 0.85rem; color: var(--brs-muted); }
.br-video a {
	display: block;
	background: var(--brs-tint);
	border-radius: var(--brs-radius);
	padding: 1rem;
}

/* ---------- 8. Posts ----------------------------------------------------------------- */
.entry-meta { color: var(--brs-muted); font-size: 0.9rem; }
.entry-meta a { color: var(--brs-muted); }
.brs-updated { font-weight: 600; }

/* ---------- 9. Buttons and forms (lead form inherits) -------------------------------- */
.button,
.wp-block-button__link,
button[type="submit"],
input[type="submit"] {
	background: var(--brs-accent);
	color: #fff;
	border-radius: var(--brs-radius);
	font-weight: 600;
	min-height: 44px;                 /* WCAG 2.5.8 target size */
	padding: 0.7rem 1.3rem;
}
input, select, textarea {
	min-height: 44px;
	border: 1px solid #8a96a3;        /* 3.1:1 against white: non-text contrast */
	border-radius: 4px;
}

/* ---------- 10. Motion and print ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
@media print {
	.site-header, .main-navigation, .site-footer, .br-footer, .brs-breadcrumbs { display: none; }
	.entry-content a::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
