/*
Theme Name: Kathait Gold Child
Theme URI: https://kathaitgold.com
Description: Child theme customizations for Kathait Gold, built for Flatsome.
Author: Upfront Enterprise
Author URI: https://kathaitgold.com
Template: flatsome
Version: 7.0.1
Text Domain: kathait-gold-child
Requires at least: 6.8
Requires PHP: 8.1
*/

/* =========================================================
   1. DESIGN SYSTEM VARIABLES
   ========================================================= */
:root {
	--kg-text: #3e3b33;
	--kg-dark: #1d231a;
	--kg-white: #ffffff;
	--kg-bg: #f7f4ee;
	--kg-border: rgba(29, 35, 26, 0.12);
	--kg-success: #476d29;
	--kg-accent-gold: #B87900;
	--kg-accent-gold-text: #996500; /* WCAG AA 4.5:1 compliant on light surfaces */
	--kg-link: #166534;           /* High-contrast accessible editorial link */
	--kg-link-hover: #975a16;     /* Accessible rich amber on hover */
	--kg-radius: 10px;
	--kg-radius-lg: 24px;
	--kg-shadow: 0 10px 30px rgba(29, 35, 26, 0.06);
}

/* =========================================================
   2. LOCAL FONT DECLARATIONS
   ========================================================= */
@font-face {
	font-family: "KG Poppins";
	src: url("assets/fonts/poppins-devanagari-400-normal.woff2") format("woff2");
	font-style: normal;
	font-weight: 400;
	font-display: swap;
}

@font-face {
	font-family: "KG Poppins";
	src: url("assets/fonts/poppins-devanagari-500-normal.woff2") format("woff2");
	font-style: normal;
	font-weight: 500;
	font-display: swap;
}

@font-face {
	font-family: "KG Poppins";
	src: url("assets/fonts/poppins-devanagari-600-normal.woff2") format("woff2");
	font-style: normal;
	font-weight: 600;
	font-display: swap;
}

@font-face {
	font-family: "KG Poppins";
	src: url("assets/fonts/poppins-devanagari-700-normal.woff2") format("woff2");
	font-style: normal;
	font-weight: 700;
	font-display: swap;
}

@font-face {
	font-family: "Noto Sans Devanagari";
	src: url("assets/fonts/NotoSansDevanagari-Regular.woff2") format("woff2");
	font-style: normal;
	font-weight: 400;
	font-display: swap;
}

body {
	color: var(--kg-text);
	font-family: "KG Poppins", "Noto Sans Devanagari", sans-serif;
}

/* Clear keyboard focus indicator */
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--kg-accent-gold);
	outline-offset: 3px;
}

/* =========================================================
   3. EDITORIAL & PRODUCT TYPOGRAPHY
   ========================================================= */
:is(.entry-content, .product-short-description, .woocommerce-Tabs-panel) {
	line-height: 1.7;
}

:is(.entry-content, .product-short-description, .woocommerce-Tabs-panel) p {
	font-size: 1rem;
}

.single-post .entry-content {
	max-width: 850px;
	margin-inline: auto;
	overflow-wrap: break-word;
}

.single-post .entry-content > :is(h2, h3, h4) {
	color: var(--kg-dark);
	margin-top: 2em;
}

.entry-content :is(figure, .wp-block-image) figcaption {
	color: var(--kg-text);
	font-size: 0.875rem;
}

.entry-content .wp-block-table {
	overflow-x: auto;
}

.entry-content :is(table, .wp-block-table table) {
	width: 100%;
	border-collapse: collapse;
}

.entry-content :is(th, td) {
	border: 1px solid var(--kg-border);
	padding: 0.75rem;
	text-align: start;
}

.entry-content th {
	background: var(--kg-bg);
	font-weight: 700;
}

/* =========================================================
   4. PRODUCT CARDS & GALLERY
   ========================================================= */
.product-small.box {
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
	transition: transform 180ms ease, box-shadow 180ms ease;
}

.product-small.box:hover {
	box-shadow: var(--kg-shadow);
	transform: translateY(-3px);
}

.product-small .box-image {
	overflow: hidden;
}

.product-small .box-image img {
	transition: transform 180ms ease;
	backface-visibility: hidden;
}

.product-small:hover .box-image img {
	transform: scale(1.025);
}

.single-product .product_meta {
	font-size: 0.875rem;
}

.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image img,
.product-gallery-slider img {
	border: 1px solid var(--kg-border);
	border-radius: 6px;
}

.product-thumbnails .is-nav-selected img,
.product-thumbnails .col:hover img {
	border-color: var(--kg-accent-gold);
}

/* =========================================================
   5. REUSABLE KATHAIT GOLD COMPONENTS
   ========================================================= */
.kg-premium {
	background: linear-gradient(to bottom, #fcfbf8, var(--kg-bg));
	color: var(--kg-text);
}

.kg-container {
	width: min(100% - 2rem, 1280px);
	margin-inline: auto;
}

.kg-section {
	padding-block: clamp(3.5rem, 8vw, 5.625rem);
}

.kg-card,
.kg-faq,
.kg-highlight,
.kg-recipe-card {
	border: 1px solid var(--kg-border);
	border-radius: var(--kg-radius);
	padding: clamp(1.25rem, 3vw, 2rem);
}

.kg-card,
.kg-faq,
.kg-recipe-card {
	background: var(--kg-white);
	box-shadow: var(--kg-shadow);
}

.kg-highlight {
	background: var(--kg-bg);
}

.kg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.75rem 1.25rem;
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.kg-btn:hover {
	transform: translateY(-2px);
}

.kg-btn-primary {
	background: var(--kg-dark);
	color: var(--kg-white);
}

.kg-btn-primary:hover {
	background: #0f120d;
	color: var(--kg-white);
}

.kg-btn-secondary {
	border: 1px solid var(--kg-border);
	background: var(--kg-white);
	color: var(--kg-dark);
}

/* =========================================================
   6. WOOCOMMERCE SHOP & SIDEBAR LINK STYLING
   ========================================================= */
.widget_product_categories ul.product-categories li > a {
	color: var(--kg-text) !important;
	text-decoration: none !important;
	transition: color 0.2s ease;
}

.widget_product_categories ul.product-categories li > a:hover {
	color: var(--kg-accent-gold-text) !important;
}

.widget_product_categories ul.product-categories li.current-cat > a {
	color: var(--kg-dark) !important;
	font-weight: 600 !important;
}

.widget_product_categories ul.product-categories li .count {
	color: var(--kg-text) !important;
	opacity: 0.75;
}

.product-small .title-wrapper .product-title a {
	color: var(--kg-dark) !important;
	transition: color 0.2s ease;
}

.product-small .title-wrapper .product-title a:hover {
	color: var(--kg-accent-gold-text) !important;
}

:is(.widget_recently_viewed_products, .widget_products, .widget_top_rated_products) ul.product_list_widget li a {
	color: var(--kg-text) !important;
	text-decoration: none !important;
	transition: color 0.2s ease;
}

:is(.widget_recently_viewed_products, .widget_products, .widget_top_rated_products) ul.product_list_widget li a:hover {
	color: var(--kg-accent-gold-text) !important;
}

.woocommerce ul.products li.product .product-title a:focus-visible,
.widget_product_categories ul.product-categories li > a:focus-visible,
.product_list_widget li a:focus-visible {
	outline: 2px solid var(--kg-accent-gold);
	outline-offset: 2px;
}

/* =========================================================
   7. HIGH-CONTRAST IN-TEXT EDITORIAL LINKS
   Safeguarded against buttons, images, and non-content elements
   ========================================================= */
:is(
	.entry-content,
	.page-content,
	.article-inner,
	.woocommerce-product-details__content,
	.woocommerce-Tabs-panel,
	.wc-product-section,
	.kg-article-content,
	.kg-local-landing,
	[class*="hilvera-"]
) :is(p, li, td, address) a:not(.button, .btn, .kg-btn, .wp-block-button__link, :has(img)) {
	color: var(--kg-link) !important;
	font-weight: 600 !important;
	text-decoration: underline !important;
	text-underline-offset: 3px !important;
	text-decoration-thickness: 1.5px !important;
	transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

:is(
	.entry-content,
	.page-content,
	.article-inner,
	.woocommerce-product-details__content,
	.woocommerce-Tabs-panel,
	.wc-product-section,
	.kg-article-content,
	.kg-local-landing,
	[class*="hilvera-"]
) :is(p, li, td, address) a:not(.button, .btn, .kg-btn, .wp-block-button__link, :has(img)):hover {
	color: var(--kg-link-hover) !important;
	text-decoration-color: var(--kg-link-hover) !important;
}

/* =========================================================
   8. MOBILE RESPONSIVENESS & TOUCH TARGETS
   ========================================================= */
@media screen and (max-width: 768px) {
	:is(.entry-content, .product-short-description, .woocommerce-Tabs-panel) p {
		font-size: 1.0625rem !important; /* ~17px scalable */
		line-height: 1.65;
	}

	.widget_product_categories ul.product-categories li > a,
	:is(.widget_recently_viewed_products, .widget_products) ul.product_list_widget li a {
		display: block; /* Enables true tap target sizing */
		font-size: 1.0625rem !important;
		line-height: 1.5;
		padding-block: 8px;
	}

	.single-product .product_meta,
	.entry-content :is(figure, .wp-block-image) figcaption {
		font-size: 0.9375rem !important; /* ~15px scalable */
		line-height: 1.5;
	}
}

/* =========================================================
   9. ACCESSIBILITY: REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}