/**
 * Base: reset, document defaults, typography, utilities.
 * Uses tokens from tokens.css only. No hard-coded colours or sizes.
 */

/* ---------------------------------------------------------------------
 * Reset
 * ------------------------------------------------------------------ */
*,
*::before,
*::after {
	box-sizing: border-box;
}

* {
	margin: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--bhg-header-height) + var(--bhg-space-4));
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

body {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	background: var(--bhg-color-bg);
	color: var(--bhg-color-text);
	font-family: var(--bhg-font-body);
	font-size: var(--bhg-text-base);
	font-weight: var(--bhg-weight-regular);
	line-height: var(--bhg-leading-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
}

img,
video {
	height: auto;
}

input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
}

/* Theme UI lists only. Lists inside post content keep their bullets. */
.bhg-nav__list,
.bhg-legal__list,
.bhg-lang__list,
.bhg-social,
.bhg-post-list {
	list-style: none;
	padding: 0;
}

/* ---------------------------------------------------------------------
 * Typography
 * ------------------------------------------------------------------ */
h1,
h2,
h3,
h4,
h5,
h6 {
	color: var(--bhg-color-heading);
	font-family: var(--bhg-font-heading);
	font-weight: var(--bhg-weight-extrabold);
	line-height: var(--bhg-leading-tight);
	letter-spacing: var(--bhg-tracking-tight);
	text-wrap: balance;
}

h1 { font-size: var(--bhg-text-4xl); }
h2 { font-size: var(--bhg-text-3xl); }
h3 { font-size: var(--bhg-text-2xl); }
h4 { font-size: var(--bhg-text-xl); }
h5 { font-size: var(--bhg-text-lg); }
h6 { font-size: var(--bhg-text-base); }

p {
	text-wrap: pretty;
}

/*
 * Small meta text (dates, read time, "By Bhahuk"): monospace, uppercase,
 * letter-spaced. Hindi pages switch to Mukta, no caps, no tracking (tokens).
 */
.bhg-meta {
	font-family: var(--bhg-font-meta);
	font-size: var(--bhg-text-xs);
	font-weight: var(--bhg-weight-semibold);
	letter-spacing: var(--bhg-tracking-meta);
	text-transform: var(--bhg-meta-case);
}

a {
	color: var(--bhg-color-link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--bhg-duration-fast) var(--bhg-ease-out);
}

a:hover {
	color: var(--bhg-color-link-hover);
}

strong,
b {
	font-weight: var(--bhg-weight-bold);
}

::selection {
	background: var(--bhg-color-accent);
	color: var(--bhg-color-on-accent);
}

/* ---------------------------------------------------------------------
 * Focus
 * ------------------------------------------------------------------ */
:focus {
	outline: none;
}

:focus-visible {
	outline: 2px solid var(--bhg-color-focus);
	outline-offset: 2px;
	border-radius: var(--bhg-radius-xs);
}

/* ---------------------------------------------------------------------
 * Layout
 * ------------------------------------------------------------------ */
.bhg-container {
	width: 100%;
	max-width: calc(var(--bhg-container) + var(--bhg-gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--bhg-gutter);
}

.bhg-main {
	flex: 1 0 auto;
	padding-block: var(--bhg-space-section);
}

.bhg-main:focus {
	outline: none;
}

.bhg-page-title {
	margin-block-end: var(--bhg-space-6);
}

/* Temporary list on index.php until real templates exist. */
.bhg-post-list {
	display: grid;
	gap: var(--bhg-space-3);
}

/* ---------------------------------------------------------------------
 * Icons and icon buttons
 * ------------------------------------------------------------------ */
.bhg-icon {
	width: 1.5rem;
	height: 1.5rem;
	flex-shrink: 0;
}

.bhg-icon-button {
	display: inline-grid;
	place-items: center;
	width: var(--bhg-tap-target);
	height: var(--bhg-tap-target);
	padding: 0;
	border: var(--bhg-border-width) solid transparent;
	border-radius: var(--bhg-radius-md);
	background: transparent;
	color: var(--bhg-color-text);
	transition:
		background-color var(--bhg-duration-fast) var(--bhg-ease-out),
		border-color var(--bhg-duration-fast) var(--bhg-ease-out);
}

.bhg-icon-button:hover {
	background: var(--bhg-color-surface-raised);
}

.bhg-icon-button[aria-expanded="true"] {
	background: var(--bhg-color-surface-raised);
	border-color: var(--bhg-color-border);
}

.bhg-icon-button__close,
.bhg-icon-button[aria-expanded="true"] .bhg-icon-button__open {
	display: none;
}

.bhg-icon-button[aria-expanded="true"] .bhg-icon-button__close {
	display: contents;
}

/* ---------------------------------------------------------------------
 * Accessibility utilities (WordPress core class names)
 * ------------------------------------------------------------------ */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
	word-wrap: normal !important;
}

.bhg-skip-link:focus {
	position: fixed !important;
	top: var(--bhg-space-2);
	left: var(--bhg-space-2);
	z-index: var(--bhg-z-toast);
	width: auto;
	height: auto;
	padding: var(--bhg-space-3) var(--bhg-space-5);
	margin: 0;
	clip: auto;
	overflow: visible;
	background: var(--bhg-color-accent);
	color: var(--bhg-color-on-accent);
	font-weight: var(--bhg-weight-bold);
	text-decoration: none;
	border-radius: var(--bhg-radius-md);
	box-shadow: var(--bhg-shadow-lg);
}

/* ---------------------------------------------------------------------
 * Reduced motion
 * ------------------------------------------------------------------ */
@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;
	}
}
.bhg-badge-notice { position:fixed; z-index:50; inset:auto 1rem 1rem auto; max-width:min(25rem,calc(100% - 2rem)); background:var(--bhg-color-surface); color:var(--bhg-color-text); border:1px solid var(--bhg-color-accent); padding:.65rem 1rem; border-radius:6px; }
.bhg-badge-notice button { padding:.3rem .6rem; color:inherit; border:1px solid var(--bhg-color-border-strong); background:transparent; cursor:pointer; }
.bhg-member-rank { display:inline-block; padding:.15rem .45rem; border:1px solid currentColor; border-radius:4px; color:var(--bhg-color-accent); font:600 .75rem/1.4 var(--bhg-font-meta); }
 .bhg-sponsored-chip{display:inline-block;color:#00f0f0;font-size:.75rem;font-weight:700;margin:.3rem .5rem .3rem 0}.bhg-sponsored-disclosure{padding:1rem;border:1px solid #00b4b4;border-radius:8px;margin:1rem 0}.bhg-sponsored-disclosure p{margin:.4rem 0 0}
