/*
Theme Name: Vivek Earthing
Theme URI: https://vivekearthing.com
Author: Vivek Earthing Pvt. Ltd.
Description: Custom block theme for Vivek Earthing Pvt. Ltd. Dark blue, earth green, copper and ice blue. After activating, go to Appearance > Vivek Earthing Setup to install the page designs.
Version: 1.2.0
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: vivek-earthing
*/

/* ---------- Type details theme.json cannot express ---------- */
h1, h2, h3, .wp-block-site-title {
	font-stretch: 116%;
	text-wrap: balance;
}
h1 { letter-spacing: -0.02em; }
h2 { letter-spacing: -0.012em; }
p { text-wrap: pretty; }

:where(.wp-site-blocks) :focus-visible {
	outline: 3px solid var(--wp--preset--color--copper);
	outline-offset: 3px;
}

/* ---------- Header ---------- */
.ve-topbar { font-size: 0.875rem; }
.ve-topbar a { color: #fff; text-decoration: none; }
.ve-topbar a:hover { text-decoration: underline; }
.ve-topbar .ve-topbar__muted { color: var(--wp--preset--color--ice-muted); }

.ve-mainbar {
	position: sticky;
	top: 0;
	z-index: 50;
	border-bottom: 1px solid var(--wp--preset--color--ice-line);
}
.admin-bar .ve-mainbar { top: 32px; }
@media (max-width: 782px) { .admin-bar .ve-mainbar { top: 46px; } }

.ve-mainbar .wp-block-site-title a { text-decoration: none; color: var(--wp--preset--color--primary); }
.ve-mainbar .wp-block-navigation a:hover { color: var(--wp--preset--color--copper-deep); }
.ve-mainbar .wp-block-navigation .current-menu-item > a { box-shadow: inset 0 -2px 0 var(--wp--preset--color--copper); }

/* ---------- Buttons ---------- */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 2px solid currentColor;
	background: transparent;
}
.ve-on-dark .wp-block-button.is-style-outline > .wp-block-button__link { color: #fff; }
.wp-block-button__link { transition: background-color .15s ease, color .15s ease; }

/* ---------- Hero: the drawing is the signature element ---------- */
.ve-hero { position: relative; overflow: hidden; }
.ve-hero::after {
	/* ground line running under the whole hero */
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: 6px;
	background: repeating-linear-gradient(90deg, var(--wp--preset--color--primary) 0 18px, transparent 18px 26px);
	opacity: .18;
}
.ve-hero h1 { max-width: 15ch; }
.ve-hero .ve-lede { max-width: 54ch; }
.ve-cert-line { display: flex; align-items: center; gap: .5rem; }
.ve-cert-line::before {
	content: "";
	width: 1.1rem; height: 1.1rem; flex: none;
	border-radius: 50%;
	background: var(--wp--preset--color--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.4l2.5 2.4L12 5.3' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/80% no-repeat;
}
.ve-drawing img { width: 100%; height: auto; }

/* ---------- Facts strip ---------- */
.ve-facts .wp-block-column { border-left: 3px solid var(--wp--preset--color--copper); padding-left: 1rem; }
.ve-facts h3 { margin: 0 0 .25rem; }
.ve-facts p { margin: 0; }

/* ---------- Product index rows (not cards) ---------- */
.ve-index > .ve-row {
	border-top: 1px solid var(--wp--preset--color--ice-line);
	padding-block: 1.25rem;
}
.ve-index > .ve-row:last-child { border-bottom: 1px solid var(--wp--preset--color--ice-line); }
.ve-row .wp-block-image { flex: 0 0 56px; margin: 0; }
.ve-row .wp-block-image img { width: 56px; height: 56px; }
.ve-row h3 { margin: 0 0 .25rem; }
.ve-row p { margin: 0; }
.ve-sticky { position: sticky; top: 7rem; }

/* ---------- Services grid with rules ---------- */
.ve-rules > .wp-block-column > .wp-block-group {
	border-top: 2px solid var(--wp--preset--color--primary);
	padding-top: 1rem;
}

/* ---------- Numbered process (a real sequence) ---------- */
.ve-steps { counter-reset: step; }
.ve-steps > .wp-block-group { counter-increment: step; position: relative; padding-left: 3.5rem; }
.ve-steps > .wp-block-group::before {
	content: counter(step);
	position: absolute; left: 0; top: .1rem;
	width: 2.4rem; height: 2.4rem;
	display: grid; place-items: center;
	border: 2px solid var(--wp--preset--color--copper);
	border-radius: 50%;
	font-weight: 700; font-stretch: 116%;
	color: var(--wp--preset--color--primary);
}
.ve-steps h3 { margin: 0 0 .25rem; }
.ve-steps p { margin: 0; }

/* ---------- Lists ---------- */
.ve-ticks { list-style: none; padding-left: 0; }
.ve-ticks li { position: relative; padding-left: 1.6rem; margin-bottom: .5rem; }
.ve-ticks li::before {
	content: "";
	position: absolute; left: 0; top: .55em;
	width: .75rem; height: .2rem;
	background: var(--wp--preset--color--copper);
}
.ve-on-dark .ve-ticks li::before { background: var(--wp--preset--color--copper-light); }

.ve-industries p {
	margin: 0;
	padding: .75rem 0;
	border-bottom: 1px solid var(--wp--preset--color--ice-line);
	font-weight: 500;
}

/* ---------- FAQ ---------- */
.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--ice-line);
	padding-block: 1rem;
}
.wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--primary);
	list-style: none;
	position: relative;
	padding-right: 2rem;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after {
	content: "+";
	position: absolute; right: 0; top: -.1rem;
	font-size: 1.5rem; line-height: 1;
	color: var(--wp--preset--color--copper-deep);
}
.wp-block-details[open] summary::after { content: "\2212"; }
.wp-block-details > :not(summary) { margin-top: .75rem; max-width: 70ch; }

/* ---------- Page heads ---------- */
.ve-pagehead { border-bottom: 1px solid var(--wp--preset--color--ice-line); }
.ve-pagehead p { max-width: 62ch; }

/* ---------- Enquiry form ---------- */
.ve-form { display: grid; gap: 1rem; }
.ve-form .ve-form__two { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .ve-form .ve-form__two { grid-template-columns: 1fr; } }
.ve-form label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: .35rem; color: var(--wp--preset--color--primary); }
.ve-form input, .ve-form select, .ve-form textarea {
	width: 100%;
	box-sizing: border-box;
	font: inherit;
	padding: .7rem .85rem;
	border: 1px solid #9FB8CC;
	border-radius: 4px;
	background: #fff;
	color: var(--wp--preset--color--ink);
}
.ve-form textarea { min-height: 8rem; resize: vertical; }
.ve-form input:focus, .ve-form select:focus, .ve-form textarea:focus {
	outline: 3px solid var(--wp--preset--color--copper);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--primary);
}
.ve-form button {
	justify-self: start;
	font: inherit; font-weight: 600;
	padding: .85rem 1.6rem;
	border: 0; border-radius: 4px;
	background: var(--wp--preset--color--copper-deep);
	color: #fff; cursor: pointer;
}
.ve-form button:hover { background: var(--wp--preset--color--copper-dark); }
.ve-form .ve-hp { position: absolute; left: -9999px; }
.ve-notice { padding: 1rem 1.25rem; border-radius: 4px; margin-bottom: 1rem; }
.ve-notice--ok { background: #E3F1E4; border-left: 4px solid var(--wp--preset--color--green); }
.ve-notice--err { background: #FBEAEA; border-left: 4px solid #B3261E; }

/* ---------- Contact details ---------- */
.ve-contact-list p { margin: 0 0 .35rem; }
.ve-contact-list a { color: var(--wp--preset--color--primary); }

/* ---------- Footer ---------- */
.ve-footer a { color: #fff; text-decoration: none; }
.ve-footer a:hover { text-decoration: underline; }
.ve-footer .ve-footer__muted, .ve-footer .ve-footer__muted a { color: var(--wp--preset--color--ice-muted); }
.ve-footer h2 { font-size: 1rem; font-stretch: 116%; margin-bottom: .75rem; color: #fff; }
.ve-footer p { margin: 0 0 .4rem; }
.ve-footer .wp-block-separator { border-color: rgba(234,244,251,.18); opacity: 1; }

/* ---------- WhatsApp button ---------- */
.ve-wa {
	position: fixed;
	right: 1.25rem; bottom: 1.25rem;
	z-index: 90;
	display: flex; align-items: center; gap: .5rem;
	padding: .7rem 1rem .7rem .8rem;
	border-radius: 999px;
	background: #1E7F45;
	color: #fff !important;
	font-weight: 600; font-size: .9375rem;
	text-decoration: none;
	box-shadow: 0 6px 18px rgba(11,37,69,.28);
}
.ve-wa svg { width: 22px; height: 22px; }
.ve-wa:hover { background: #17693A; }
@media (max-width: 600px) { .ve-wa span { display: none; } .ve-wa { padding: .8rem; } }

/* ---------- Blog ---------- */
.ve-postlist .wp-block-post { border-top: 1px solid var(--wp--preset--color--ice-line); padding-top: 1.5rem; }
.ve-postlist .wp-block-post-title a { text-decoration: none; color: var(--wp--preset--color--primary); }
.ve-postlist .wp-block-post-title a:hover { color: var(--wp--preset--color--copper-deep); }

/* ---------- Mobile ---------- */
@media (max-width: 781px) {
	.ve-sticky { position: static; }
	.ve-hero h1 { max-width: none; }
	.ve-topbar .ve-topbar__hide-sm { display: none; }
}

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

/* ---------- Section and colour helpers (kept as classes so blocks stay simple) ---------- */
.ve-section { padding-block: var(--wp--preset--spacing--60); }
.ve-section--tight { padding-block: var(--wp--preset--spacing--50); }
.ve-bg-ice { background: var(--wp--preset--color--ice); }
.ve-bg-primary { background: var(--wp--preset--color--primary); color: #E4EEF7; }
.ve-bg-deep { background: var(--wp--preset--color--primary-deep); color: #E4EEF7; }
.ve-bg-primary h1, .ve-bg-primary h2, .ve-bg-primary h3,
.ve-bg-deep h1, .ve-bg-deep h2, .ve-bg-deep h3 { color: #fff; }
.ve-bg-primary a:not(.wp-block-button__link), .ve-bg-deep a:not(.wp-block-button__link) { color: #fff; }
.ve-bg-white { background: #fff; }
.ve-copper-rule { border-top: 4px solid var(--wp--preset--color--copper); }

.ve-btn-copper > .wp-block-button__link { background: var(--wp--preset--color--copper-deep); color: #fff; }
.ve-btn-copper > .wp-block-button__link:hover { background: var(--wp--preset--color--copper-dark); color: #fff; }
.ve-btn-whatsapp > .wp-block-button__link { background: #1E7F45; color: #fff; }
.ve-btn-whatsapp > .wp-block-button__link:hover { background: #17693A; color: #fff; }

.ve-small { font-size: var(--wp--preset--font-size--small); }
.ve-lede { font-size: var(--wp--preset--font-size--medium); line-height: 1.55; }
.ve-muted { color: #52657A; }
.ve-bg-primary .ve-muted, .ve-bg-deep .ve-muted { color: var(--wp--preset--color--ice-muted); }
.ve-placeholder-note {
	font-size: var(--wp--preset--font-size--small);
	background: #FFF6E8;
	border-left: 4px solid var(--wp--preset--color--copper);
	padding: .75rem 1rem;
}



.ve-footer .wp-block-social-links .wp-social-link { color: #fff; }
.ve-footer .wp-block-social-links .wp-social-link svg { fill: #fff; }

/* ---------- Products page ---------- */
.ve-cat-head .wp-block-image { flex: 0 0 56px; margin: 0; }
.ve-cat-head .wp-block-image img { width: 56px; height: 56px; }
.ve-cat-head h2 { margin: 0; scroll-margin-top: 7rem; }
.ve-cat-note { font-weight: 600; color: var(--wp--preset--color--green); }
.ve-2col { columns: 2; column-gap: 2rem; }
.ve-2col li { break-inside: avoid; }
@media (max-width: 600px) { .ve-2col { columns: 1; } }

.ve-map { width: 100%; height: 380px; border: 0; border-radius: 6px; display: block; }

@media (max-width: 1080px) { .ve-header-cta { display: none; } }

/* Designed pages: full-width sections sit flush against each other */
.wp-site-blocks > * + * { margin-block-start: 0; }
.ve-designed .wp-block-post-content > .alignfull { margin-block: 0; }
.ve-designed .wp-block-post-content > .alignfull + .alignfull { margin-block-start: 0; }

.ve-topbar { padding-block: .45rem; }
.ve-topbar p { margin: 0; }
.ve-mainbar { padding-block: .8rem; }

.ve-readable > * { max-width: 72ch; }
.ve-readable > .wp-block-details { max-width: 860px; }

/* Core forces align-items:normal on columns; centre the children directly. */
.wp-block-columns.are-vertically-aligned-center > .wp-block-column { align-self: center; }

@media (max-width: 1080px) { .ve-mainbar .wp-block-buttons.ve-header-cta { display: none; } }

/* ---------- Real product photos ---------- */
.ve-row .wp-block-image.ve-thumb { flex: 0 0 76px; }
.ve-row .wp-block-image.ve-thumb img {
	width: 76px; height: 76px; object-fit: contain;
	background: #fff; border: 1px solid var(--wp--preset--color--ice-line); border-radius: 4px; padding: 4px; box-sizing: border-box;
}
.ve-prodgrid { gap: 1rem; }
.ve-prodimg { margin: 0; }
.ve-prodimg img {
	width: 100%; aspect-ratio: 1 / 1; object-fit: contain;
	background: #fff; border: 1px solid var(--wp--preset--color--ice-line); border-radius: 4px;
	padding: .75rem; box-sizing: border-box;
}
.ve-prodimg figcaption {
	margin-top: .5rem; text-align: left;
	font-size: .9375rem; font-weight: 600; color: var(--wp--preset--color--primary);
}
.ve-jump { gap: .5rem 1.25rem; margin-top: 1.25rem; }
.ve-jump p { margin: 0; }
.ve-jump a { text-decoration: none; font-weight: 600; border-bottom: 2px solid var(--wp--preset--color--copper); }
.ve-jump a:hover { color: var(--wp--preset--color--copper-deep); }
section [id], .wp-block-heading[id] { scroll-margin-top: 7rem; }
.ve-stats h3 { font-size: var(--wp--preset--font-size--x-large); font-stretch: 116%; }
.wp-block-site-logo img { border-radius: 50%; }
.ve-mainbar .wp-block-site-title { font-size: 1.125rem; }
@media (max-width: 600px) { .ve-mainbar .wp-block-site-title { font-size: 1rem; } }
