/**
 * Krishnendu Ayurveda – supplementary styles.
 * Colours, fonts and spacing come from theme.json presets, so a change in
 * Styles (Site Editor) or Elementor kit flows through these rules too.
 * Loaded on the front end and inside the block editor.
 */

:root {
	--ka-radius-s: var(--wp--custom--radius--small, 6px);
	--ka-radius: var(--wp--custom--radius--medium, 12px);
	--ka-radius-l: var(--wp--custom--radius--large, 22px);
	--ka-ease: var(--wp--custom--transition, 180ms ease);
}

/* ---------- Header ---------- */
.ka-site-header {
	position: sticky;
	top: 0;
	z-index: 50;
}
body.admin-bar .ka-site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .ka-site-header { top: 46px; } }
@media (max-width: 600px) { .ka-site-header { position: relative; top: 0 !important; } }

.ka-mainbar { box-shadow: 0 1px 0 var(--wp--preset--color--border); }
.ka-topbar p { margin: 0; }
.ka-topbar a { text-decoration: none; }
.ka-topbar a:hover { text-decoration: underline; }
@media (max-width: 600px) { .ka-topbar-contact { display: none; } }

.ka-logo-fallback { margin: 0; font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: var(--wp--preset--font-size--large); }
.ka-logo-fallback a { color: var(--wp--preset--color--primary); text-decoration: none; }

.ka-primary-nav a { text-decoration: none; }
.ka-primary-nav .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--secondary); }
.ka-primary-nav .wp-block-navigation__submenu-container {
	border: 1px solid var(--wp--preset--color--border) !important;
	border-radius: var(--ka-radius-s);
	box-shadow: var(--wp--preset--shadow--soft);
	padding: 0.35rem 0;
	background: var(--wp--preset--color--white) !important;
}
/* Long Treatments list: two columns on desktop */
@media (min-width: 1180px) {
	.ka-primary-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation-submenu:has(> .wp-block-navigation__submenu-container > li:nth-child(12)) > .wp-block-navigation__submenu-container {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(220px, 1fr));
	}
}
.ka-primary-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 0.45rem 1rem !important; }

/* ---------- Sections & cards ---------- */
.ka-section > * { position: relative; }
.wp-block-group.is-style-ka-card,
.wp-block-column.is-style-ka-card {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--ka-radius);
	padding: var(--wp--preset--spacing--40);
	gap: 0.75rem;
	height: 100%;
	box-sizing: border-box;
	transition: box-shadow var(--ka-ease), transform var(--ka-ease);
}
.wp-block-group.is-style-ka-card:hover { box-shadow: var(--wp--preset--shadow--lifted); }
.is-style-ka-card > .wp-block-buttons { margin-top: auto; }
.is-style-ka-card .wp-block-image,
.is-style-ka-card .wp-block-post-featured-image { margin: calc(var(--wp--preset--spacing--40) * -1) calc(var(--wp--preset--spacing--40) * -1) 0.5rem; }
.is-style-ka-card .wp-block-image img,
.is-style-ka-card .wp-block-post-featured-image img { border-radius: var(--ka-radius) var(--ka-radius) 0 0; width: 100%; }
.is-style-ka-card h2, .is-style-ka-card h3 { margin: 0; }
.is-style-ka-card h2 a, .is-style-ka-card h3 a { color: inherit; text-decoration: none; }
.ka-featured { border-color: var(--wp--preset--color--accent) !important; box-shadow: var(--wp--preset--shadow--soft); }
.ka-sticky { position: sticky; top: 140px; height: auto !important; }

.ka-card-cover { border-radius: var(--ka-radius); overflow: hidden; }
.ka-card-cover .wp-block-cover__image-background { transition: transform 600ms ease; }
.ka-card-cover:hover .wp-block-cover__image-background { transform: scale(1.04); }

.ka-leaf-bg {
	background-image: radial-gradient(circle at 12% 20%, rgba(234, 217, 174, 0.12) 0, transparent 35%), radial-gradient(circle at 88% 80%, rgba(63, 125, 58, 0.35) 0, transparent 40%);
}

/* ---------- Block style variations ---------- */
.is-style-ka-eyebrow {
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: var(--wp--preset--font-size--x-small) !important;
	font-weight: 700 !important;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin-bottom: 0.25rem;
}
.is-style-ka-eyebrow.has-text-color { color: inherit; }

ul.is-style-ka-check { list-style: none; padding-left: 0; }
ul.is-style-ka-check li { position: relative; padding-left: 1.9em; margin-bottom: 0.55em; }
ul.is-style-ka-check li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.35em;
	width: 1.15em;
	height: 1.15em;
	border-radius: 50%;
	background: var(--wp--preset--color--secondary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-width='2.2' d='M4 8.5l2.6 2.6L12 5.6'/%3E%3C/svg%3E") center/80% no-repeat;
}
ul.is-style-ka-plain { list-style: none; padding-left: 0; }
ul.is-style-ka-plain li { margin-bottom: 0.45em; }
ul.is-style-ka-plain a { text-decoration: none; color: inherit; opacity: 0.92; }
ul.is-style-ka-plain a:hover { text-decoration: underline; opacity: 1; }

.wp-block-button.is-style-ka-whatsapp .wp-block-button__link {
	background-color: var(--wp--preset--color--whatsapp);
	color: var(--wp--preset--color--white);
}
.wp-block-button.is-style-ka-whatsapp .wp-block-button__link::before {
	content: "";
	display: inline-block;
	width: 1.1em;
	height: 1.1em;
	margin-right: 0.45em;
	vertical-align: -0.18em;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm0 18.2a8.2 8.2 0 0 1-4.2-1.2l-.3-.2-3 .8.8-2.9-.2-.3A8.2 8.2 0 1 1 12 20.2zm4.5-6.1c-.2-.1-1.5-.7-1.7-.8-.2-.1-.4-.1-.6.1l-.8 1c-.1.2-.3.2-.5.1a6.7 6.7 0 0 1-3.3-2.9c-.2-.4.2-.4.7-1.3.1-.2 0-.3 0-.4l-.8-1.8c-.2-.5-.4-.4-.6-.4h-.5a1 1 0 0 0-.7.3 3 3 0 0 0-.9 2.2 5.2 5.2 0 0 0 1.1 2.7 11.8 11.8 0 0 0 4.5 4c1.7.7 2.3.8 3.2.6.5-.1 1.5-.6 1.7-1.2.2-.6.2-1.1.2-1.2-.1-.1-.3-.2-.5-.3z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.wp-block-button.is-style-ka-whatsapp .wp-block-button__link:hover { filter: brightness(0.92); }
.wp-block-button.is-style-ka-text-link .wp-block-button__link {
	background: transparent;
	padding: 0;
	border-radius: 0;
	color: var(--wp--preset--color--secondary);
	border-bottom: 2px solid currentColor;
}
.wp-block-button.is-style-ka-text-link .wp-block-button__link.has-text-color { color: inherit; }
.wp-block-button.is-style-ka-text-link .wp-block-button__link:hover { background: transparent; color: var(--wp--preset--color--accent); }
.wp-block-button.is-style-outline .wp-block-button__link {
	border: 2px solid currentColor;
	background: transparent;
	color: var(--wp--preset--color--primary);
	padding: calc(0.8em - 2px) calc(1.6em - 2px);
}
.has-white-color .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color) { color: var(--wp--preset--color--white); }
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--wp--preset--color--primary); color: var(--wp--preset--color--white); border-color: var(--wp--preset--color--primary); }

.wp-block-image.is-style-ka-arch img { border-radius: 200px 200px var(--ka-radius) var(--ka-radius); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }

.wp-block-table.is-style-ka-clean td, .wp-block-table.is-style-ka-clean th { border: 0; border-bottom: 1px solid var(--wp--preset--color--border); }
.ka-table thead th, .wp-block-table thead th { background: var(--wp--preset--color--primary); color: var(--wp--preset--color--white); text-align: left; }
.wp-block-table td, .wp-block-table th { padding: 0.75em 1em; }
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background-color: var(--wp--preset--color--surface); }
@media (max-width: 600px) { .wp-block-table { overflow-x: auto; } .wp-block-table table { min-width: 520px; } }

/* ---------- Hero ---------- */
.ka-hero h1, .ka-hero h2 { max-width: 16ch; }
.wp-block-cover .wp-block-buttons { margin-top: 1.5rem; }

/* ---------- FAQ (Details block) ---------- */
.ka-faq .wp-block-details summary,
.ka-entry .wp-block-details summary {
	cursor: pointer;
	list-style: none;
	font-weight: 700;
	color: var(--wp--preset--color--primary);
	padding-right: 2rem;
	position: relative;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.ka-faq .wp-block-details summary::after,
.ka-entry .wp-block-details summary::after {
	content: "+";
	position: absolute;
	right: 0.25rem;
	top: -0.1em;
	font-size: 1.5em;
	font-weight: 400;
	color: var(--wp--preset--color--accent);
	transition: transform var(--ka-ease);
}
.wp-block-details[open] summary::after { transform: rotate(45deg); }
.wp-block-details > p { margin-top: 0.75rem; color: var(--wp--preset--color--muted); }

/* ---------- Timeline / misc ---------- */
.ka-timeline-row { border-bottom: 1px dashed var(--wp--preset--color--border); padding: 0.4rem 0; margin-bottom: 0 !important; }
.ka-timeline-row p { margin: 0; }
.ka-stars { letter-spacing: 0.15em; margin: 0; }
.ka-price { margin: 0; line-height: 1.1; }
.ka-icon { margin: 0; line-height: 1; }
.ka-media-text { margin-bottom: var(--wp--preset--spacing--50) !important; }
.ka-media-text .wp-block-media-text__media img { border-radius: var(--ka-radius); }
.ka-gallery.wp-block-gallery img { border-radius: var(--ka-radius-s); }
.ka-form-card .wpcf7, .ka-form-card form { width: 100%; }

/* ---------- Forms (Contact Form 7, WPForms Lite, Fluent Forms, search) ---------- */
.ka-entry input[type="text"], .ka-entry input[type="email"], .ka-entry input[type="tel"], .ka-entry input[type="number"],
.ka-entry input[type="date"], .ka-entry select, .ka-entry textarea, .wp-block-search__input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.75em 1em;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--ka-radius-s);
	background: var(--wp--preset--color--white);
	font: inherit;
	color: var(--wp--preset--color--contrast);
}
.ka-entry input:focus, .ka-entry select:focus, .ka-entry textarea:focus, .wp-block-search__input:focus {
	outline: 2px solid var(--wp--preset--color--secondary);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--secondary);
}
.ka-entry input[type="submit"], .ka-entry button[type="submit"], .wp-block-search__button {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	border: 0;
	border-radius: 999px;
	padding: 0.85em 1.8em;
	font-weight: 700;
	cursor: pointer;
}

/* ---------- Breadcrumbs ---------- */
.ka-breadcrumbs { font-size: var(--wp--preset--font-size--x-small); color: var(--wp--preset--color--muted); margin-bottom: 0.5rem; }
.ka-breadcrumbs a { color: inherit; text-decoration: none; }
.ka-breadcrumbs a:hover { text-decoration: underline; }
.ka-breadcrumbs__sep { margin: 0 0.35em; opacity: 0.6; }
.ka-breadcrumbs--light, .ka-breadcrumbs--light a { color: rgba(255, 255, 255, 0.9); text-align: center; }
.wp-block-cover .ka-breadcrumbs { text-align: center; }

/* ---------- Footer ---------- */
.ka-footer a { color: inherit; }
.ka-footer .wp-block-site-logo img { filter: brightness(0) invert(1); }
.ka-footer .ka-logo-fallback a { color: var(--wp--preset--color--white); }
.ka-float-whatsapp {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 60;
	margin: 0 !important;
}
.ka-float-whatsapp .wp-block-button__link { box-shadow: var(--wp--preset--shadow--lifted); }

/* ---------- Entry content ---------- */
.ka-entry > .alignfull:first-child { margin-top: 0; }
.ka-entry > .alignfull:last-child { margin-bottom: 0; }
.ka-entry > .ka-section + .ka-section { margin-top: 0; }
.wp-site-blocks > main + footer, main.wp-block-group { margin-block-start: 0; }
.wp-site-blocks > footer { margin-block-start: 0; }
.ka-entry--full > * { margin-top: 0; margin-bottom: 0; }

/* Elementor Free: let sections span the page, keep theme fonts by default */
.ka-entry > .elementor, .ka-entry--full > .elementor { max-width: none !important; width: 100%; margin: 0 !important; }
.ka-elementor-page .ka-page-title .wp-block-post-title { margin-bottom: 0; }

/* ---------- Responsive visibility (Visibility panel) ---------- */
@media (min-width: 1024px) { .ka-hide-desktop { display: none !important; } }
@media (min-width: 600px) and (max-width: 1023.98px) { .ka-hide-tablet { display: none !important; } }
@media (max-width: 599.98px) { .ka-hide-mobile { display: none !important; } }
/* Inside the editor everything stays visible, hidden blocks are dimmed */
.editor-styles-wrapper .ka-hide-desktop, .editor-styles-wrapper .ka-hide-tablet, .editor-styles-wrapper .ka-hide-mobile { display: revert !important; }
.editor-styles-wrapper .ka-editor-visibility { outline: 1px dashed rgba(184, 134, 47, 0.7); outline-offset: 2px; }
.editor-styles-wrapper .ka-editor-hidden { opacity: 0.4; }

/* ---------- Small screens ---------- */
@media (max-width: 781px) {
	.ka-sticky { position: static; }
	.ka-hero { min-height: 70vh !important; }
	.wp-block-columns.ka-timeline-row { flex-wrap: nowrap !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; }
}

/* Image-hero template without a featured image: solid brand background */
.ka-image-hero:not(:has(.wp-block-cover__image-background)) .wp-block-cover__background { opacity: 1 !important; }
.ka-image-hero:not(:has(.wp-block-cover__image-background)) { background: var(--wp--preset--gradient--forest-diagonal); }
@media (max-width: 600px) { .ka-float-whatsapp { right: 12px; bottom: 12px; } .ka-float-whatsapp .wp-block-button__link { padding: 0.7em 1.1em; } }

/* Header: keep one line; switch the long menu to the hamburger overlay below 1180px */
.ka-header-cta .wp-block-button__link, .ka-header-cta.wp-block-button .wp-block-button__link { white-space: nowrap; }
.ka-mainbar .wp-block-site-logo, .ka-mainbar .ka-logo-fallback { flex-shrink: 0; }
@media (min-width: 600px) and (max-width: 1179.98px) {
	.ka-primary-nav .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.ka-primary-nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
	.ka-primary-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { flex-direction: column; align-items: flex-start; }
	.ka-primary-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container { display: block !important; position: static !important; border: 0 !important; box-shadow: none; padding-left: 1rem; opacity: 1 !important; visibility: visible !important; width: auto !important; height: auto !important; }
	.ka-primary-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
	.ka-primary-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-submenu__toggle { display: none; }
	.ka-primary-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { align-items: flex-start; text-align: left; }
	.ka-primary-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 0.3rem 0 !important; }
}
