/*
Theme Name: RAS NZ
Theme URI: https://ras.co.nz/
Description: Clean, light block theme for RAS NZ - remote sensing, IoT sensors and AI for New Zealand real estate and agriculture.
Version: 1.6.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: ras-nz
License: GNU General Public License v2 or later
*/

/* ---------- Header ---------- */
/* Sticky header: stick the template-part wrapper (a direct child of .wp-site-blocks),
   not the inner group, so it stays pinned for the whole page. */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
}
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) { .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 46px; } }
@media (max-width: 600px) { .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 0; } }
.ras-header {
	background: #fff;
	border-bottom: 1px solid #dadce0;
	transition: box-shadow .2s ease;
}
.ras-header.is-scrolled { box-shadow: 0 1px 2px rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15); }
/* No backdrop-filter/transform/filter on the header: any of those makes it the containing
   block for the position:fixed mobile menu overlay, squashing the menu into the header. */
.ras-logo { display: flex; align-items: center; gap: .75rem; text-decoration: none !important; }
.ras-logo img { height: 38px; width: auto; display: block; }
.ras-logo span {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.15rem;
	white-space: nowrap;
	color: #5f6368;
	font-weight: 400;
	border-left: 1px solid #dadce0;
	padding-left: .75rem;
}
.ras-header .wp-block-navigation a:hover { color: #202124; text-decoration: none; }
.ras-header .wp-block-navigation .ras-nav-cta a {
	background: #1a73e8;
	color: #fff !important;
	border-radius: 999px;
	padding: .5rem 1.15rem;
}
.ras-header .wp-block-navigation .ras-nav-cta a:hover { background: #1557b0; }

/* ---------- Typography helpers ---------- */
.ras-kicker {
	font-family: var(--wp--preset--font-family--display);
	font-size: .875rem !important;
	font-weight: 500;
	letter-spacing: .02em;
	color: #1a73e8;
}
.ras-lead { color: #5f6368; }

/* Google-style four-colour accent bar */
.ras-dots { display: inline-flex; gap: 6px; margin-bottom: .25rem; }
.ras-dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.ras-dots i:nth-child(1) { background: #4285f4; }
.ras-dots i:nth-child(2) { background: #ea4335; }
.ras-dots i:nth-child(3) { background: #fbbc04; }
.ras-dots i:nth-child(4) { background: #34a853; }

/* ---------- Cards ---------- */
.ras-card {
	background: #fff;
	border: 1px solid #dadce0;
	border-radius: 24px;
	height: 100%;
	transition: box-shadow .2s ease, border-color .2s ease;
}
.ras-card:hover {
	border-color: transparent;
	box-shadow: 0 1px 3px rgba(60, 64, 67, .3), 0 4px 8px 3px rgba(60, 64, 67, .15);
}
.ras-surface { border-radius: 28px; }
.ras-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #e8f0fe;
	color: #1a73e8;
}
.ras-icon.green { background: #e6f4ea; color: #188038; }
.ras-icon.yellow { background: #fef7e0; color: #b06000; }
.ras-icon svg { width: 24px; height: 24px; }
.ras-step-num {
	font-family: var(--wp--preset--font-family--display);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #e8f0fe;
	color: #1a73e8 !important;
	font-weight: 500;
	font-size: 1rem !important;
}
.ras-list li { margin-bottom: .55em; }
.ras-list li::marker { color: #1a73e8; }
.ras-plain { list-style: none; padding-left: 0; }
.ras-plain li { margin-bottom: .45em; }

/* Outline button, Google style */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: #fff;
	color: #1a73e8;
	border: 1px solid #dadce0;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: #f6fafe;
	border-color: #d2e3fc;
	color: #1557b0;
}

/* Hero illustration */
.ras-hero-art { width: 100%; max-width: 440px; display: block; margin: auto; }
.ras-map-preview {
	display: block;
	border-radius: 24px;
	overflow: hidden;
	border: 1px solid #dadce0;
	box-shadow: 0 1px 3px rgba(60, 64, 67, .15);
}

/* ---------- Footer ---------- */
.ras-footer a { color: #5f6368; }
.ras-footer a:hover { color: #202124; }

/* ---------- Contact form ---------- */
.ras-form { display: grid; gap: 1.1rem; max-width: 640px; }
.ras-form label { display: block; font-weight: 500; margin-bottom: .35rem; font-size: .9rem; color: #3c4043; }
.ras-form input[type=text],
.ras-form input[type=email],
.ras-form select,
.ras-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: .8rem 1rem;
	border: 1px solid #dadce0;
	border-radius: 8px;
	font: inherit;
	background: #fff;
	color: #202124;
}
.ras-form textarea { min-height: 150px; }
.ras-form input:focus, .ras-form select:focus, .ras-form textarea:focus {
	outline: none;
	border-color: #1a73e8;
	box-shadow: 0 0 0 1px #1a73e8;
}
.ras-form button {
	justify-self: start;
	background: #1a73e8;
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: .75rem 1.6rem;
	font-family: var(--wp--preset--font-family--display);
	font-size: .95rem;
	font-weight: 500;
	cursor: pointer;
}
.ras-form button:hover { background: #1557b0; box-shadow: 0 1px 3px rgba(60, 64, 67, .3); }
.ras-form .ras-hp { position: absolute; left: -9999px; }
.ras-notice { padding: 1rem 1.2rem; border-radius: 12px; margin-bottom: 1.5rem; }
.ras-notice.ok { background: #e6f4ea; color: #137333; }
.ras-notice.err { background: #fce8e6; color: #c5221f; }

/* ---------- Layout fixes ---------- */
/* No gap between header, page content and footer (full-bleed sections butt together) */
.wp-site-blocks > main,
.wp-site-blocks > footer,
.wp-site-blocks > .wp-block-template-part { margin-block-start: 0; }
.wp-block-post-content > :first-child { margin-block-start: 0; }
.wp-block-post-content > .alignfull + .alignfull { margin-block-start: 0; }
.wp-block-post-content > :last-child { margin-block-end: 0; }
.wp-block-post-content > .alignwide.ras-surface { margin-block: 1rem 1rem; }

/* Full-width hairline divider */
.ras-footer .wp-block-separator {
	width: 100% !important;
	max-width: none !important;
	border: 0;
	height: 1px;
	margin-block: 2rem 1rem;
}

/* Hero intro text: comfortable, not shouty */
.ras-lead.has-large-font-size { font-size: clamp(1.1rem, 1.6vw, 1.3rem) !important; line-height: 1.55; }

/* Form controls use body size */
.ras-form input, .ras-form select, .ras-form textarea { font-size: 1rem; }

/* ---------- Responsive navigation ---------- */
/* Use the hamburger up to 1079px: WordPress only switches below 600px, and the
   logo wordmark plus seven menu items need ~1060px on one line. */
@media (min-width: 600px) and (max-width: 1079px) {
	.ras-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.ras-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}

/* Open (overlay) menu: padded, left-aligned, full-width tap rows */
.ras-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: 1rem 1.5rem 2rem !important;
	background: #fff !important;
	color: #202124 !important;
}
.ras-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 3.25rem !important;
	align-items: stretch !important;
}
.ras-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: stretch !important;
	gap: 0 !important;
	width: 100%;
}
.ras-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	width: 100%;
	justify-content: flex-start;
	align-items: stretch !important;
	border-bottom: 1px solid #dadce0;
}
.ras-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 1rem .25rem !important;
	font-size: 1.15rem;
	color: #202124 !important;
}
.ras-header .wp-block-navigation__responsive-container.is-menu-open .ras-nav-cta {
	border-bottom: 0;
	margin-top: 1.5rem;
}
.ras-header .wp-block-navigation__responsive-container.is-menu-open .ras-nav-cta a {
	display: block;
	text-align: center;
	padding: .9rem 1.5rem !important;
	color: #fff !important;
}
.ras-header .wp-block-navigation__responsive-container-close {
	top: 1rem !important;
	right: 1.25rem !important;
}
.ras-header .wp-block-navigation__responsive-container-open {
	padding: .4rem;
	margin-right: -.4rem;
}

/* ---------- Partners ---------- */
.ras-partner-logo {
	display: block;
	border-radius: 20px;
	overflow: hidden;
	border: 1px solid #dadce0;
	background: #f5f4ef;
}
.ras-partner-logo img { display: block; width: 100%; height: auto; }

/* Long wordmark: tighten on small screens so logo, name and menu button fit */
@media (max-width: 420px) { .ras-logo img { height: 32px; } .ras-logo { gap: .55rem; } .ras-logo span { font-size: .98rem; padding-left: .55rem; } }

/* ---------- Mānuka heat map (e-hive use case) ---------- */
.ras-map-card {
	position: relative;
	margin: 2rem 0 0;
	border: 1px solid #dadce0;
	border-radius: 24px;
	overflow: hidden;
	background: #fff;
}
/* Badge and hint are positioned over the map only, not the legend */
.ras-map-wrap { position: relative; }
/* isolate: keep Leaflet's high z-index panes below the sticky header and mobile menu */
.ras-manuka-map { height: 520px; isolation: isolate; z-index: 0; background: #eef2f6; }
@media (max-width: 700px) { .ras-manuka-map { height: 440px; } }
.ras-map-badge {
	position: absolute;
	bottom: 12px;
	left: 12px;
	z-index: 1;
	background: #fef7e0;
	color: #b06000;
	border: 1px solid #fbe3a1;
	font-family: var(--wp--preset--font-family--display);
	font-size: .8rem;
	font-weight: 500;
	padding: .3rem .75rem;
	border-radius: 999px;
	pointer-events: none;
}
.ras-map-hint {
	display: none;
	position: absolute;
	bottom: 48px;
	left: 12px;
	z-index: 1;
	background: rgba(32, 33, 36, .75);
	color: #fff;
	font-size: .78rem;
	padding: .25rem .6rem;
	border-radius: 6px;
	pointer-events: none;
}
@media (hover: none) and (pointer: coarse) { .ras-map-hint { display: block; } .ras-manuka-map.is-active + .ras-map-hint { display: none; } }
.ras-map-legend {
	display: grid;
	gap: .45rem;
	padding: 1rem 1.25rem 1.1rem;
	border-top: 1px solid #dadce0;
	font-size: .85rem;
	color: #5f6368;
}
.ras-map-legend-title { color: #202124; font-weight: 500; font-family: var(--wp--preset--font-family--display); }
.ras-map-scale { height: 10px; border-radius: 999px; background: linear-gradient(90deg, #34a853 0%, #fbbc04 45%, #fb7819 75%, #d93025 100%); max-width: 520px; }
.ras-map-ticks { display: flex; justify-content: space-between; max-width: 520px; font-size: .78rem; }
.ras-map-note { font-size: .78rem; color: #80868b; }
.ras-map-card .leaflet-control-layers { border-radius: 12px; border: 1px solid #dadce0; box-shadow: none; font-family: var(--wp--preset--font-family--text); font-size: .82rem; }
.ras-map-card .leaflet-popup-content-wrapper { border-radius: 12px; }
/* Light, Google-style basemap from standard OSM tiles */
.ras-manuka-map .leaflet-tile-pane { filter: grayscale(.85) brightness(1.06) contrast(.92); }
.ras-map-card .leaflet-popup-content { font-family: var(--wp--preset--font-family--text); font-size: .9rem; line-height: 1.45; }

/* ---------- Live heatmap embed (Real estate) ---------- */
.ras-livemap { margin-top: 0; }
.ras-livemap-frame { display: block; width: 100%; height: 640px; border: 0; background: #f0f4f9; }
.ras-livemap-caption {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem;
	padding: 1rem 1.25rem; border-top: 1px solid #dadce0;
	font-size: .95rem; color: #3c4043;
}
.ras-livemap-open { color: #1a73e8; font-weight: 500; text-decoration: none; white-space: nowrap; }
.ras-livemap-open:hover { text-decoration: underline; }
@media (max-width: 781px) { .ras-livemap-frame { height: 520px; } }
