/* =========================================================================
 * TripuraPulse — Base
 * -------------------------------------------------------------------------
 * Neutral reset + shared chrome. Everything here uses design tokens, so it
 * adapts automatically to whichever design system is active. System-specific
 * visual language lives in /assets/css/{ds}.css.
 * ========================================================================= */

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

* {
	margin: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	background: var(--tp-bg, #f4efe6);
	/* Kill horizontal overflow from 100vw full-bleed heroes and scaled
	   overlays without creating a scroll container (sticky stays intact). */
	overflow-x: clip;
}

body {
	font-family: var(--tp-font-body, system-ui, sans-serif);
	font-size: var(--tp-body, 1.0625rem);
	line-height: var(--tp-lh-body, 1.7);
	color: var(--tp-text, #1d2b26);
	background: var(--tp-bg, #f4efe6);
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

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

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

button {
	cursor: pointer;
	background: none;
	border: 0;
}

a {
	color: var(--tp-accent, #0e3b2e);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: color var(--tp-dur, 240ms) var(--tp-ease, ease);
}

a:hover {
	color: var(--tp-highlight, #c46a4a);
}

ul,
ol {
	padding-left: 1.25em;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--tp-font-display, Georgia, serif);
	line-height: var(--tp-lh-tight, 1.15);
	color: var(--tp-text, #1d2b26);
	font-weight: 700;
	text-wrap: balance;
	overflow-wrap: break-word;
}

h1 { font-size: var(--tp-h1, clamp(2rem, 5.5vw, 4.5rem)); }
h2 { font-size: var(--tp-h2, clamp(1.5rem, 3.5vw, 2.75rem)); }
h3 { font-size: var(--tp-h3, clamp(1.15rem, 2vw, 1.6rem)); }
h4 { font-size: var(--tp-h4, 1.1rem); }

p {
	overflow-wrap: break-word;
}

blockquote {
	border-left: 4px solid var(--tp-highlight, #c46a4a);
	padding: var(--tp-space-2, 0.5rem) 0 var(--tp-space-2, 0.5rem) var(--tp-space-5, 1.5rem);
	margin: var(--tp-space-6, 2rem) 0;
	font-style: italic;
	font-family: var(--tp-font-display, Georgia, serif);
	font-size: var(--tp-lead, 1.3rem);
	color: var(--tp-text-soft, #4d5c56);
}

hr {
	border: 0;
	border-top: 1px solid var(--tp-line, #d9cfbc);
	margin: var(--tp-space-7, 3rem) 0;
}

table {
	width: 100%;
	border-collapse: collapse;
	margin: var(--tp-space-5, 1.5rem) 0;
	font-size: var(--tp-small, 0.875rem);
}

th, td {
	border: 1px solid var(--tp-line, #d9cfbc);
	padding: var(--tp-space-3, 0.75rem) var(--tp-space-4, 1rem);
	text-align: left;
}

th {
	background: var(--tp-surface-alt, #f1eadb);
	font-family: var(--tp-font-display, Georgia, serif);
}

/* --- Accessibility ------------------------------------------------------- */
.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	background: var(--tp-accent, #0e3b2e);
	color: var(--tp-on-accent, #fff);
	padding: 0.75em 1.25em;
	border-radius: 0 0 8px 0;
}

.skip-link:focus {
	left: 0;
	color: var(--tp-on-accent, #fff);
}

:focus-visible {
	outline: 3px solid var(--tp-highlight, #c46a4a);
	outline-offset: 2px;
	border-radius: var(--tp-radius-s, 4px);
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--tp-surface, #fff);
	clip: auto !important;
	clip-path: none;
	color: var(--tp-text, #1d2b26);
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* --- Layout shell -------------------------------------------------------- */
.tp-container {
	width: 100%;
	max-width: var(--tp-container, 1280px);
	margin-inline: auto;
	padding-inline: var(--tp-gutter, 1rem);
}

.tp-container--narrow {
	max-width: var(--tp-container-narrow, 760px);
	margin-inline: auto;
}

.tp-main {
	display: block;
	min-height: 60vh;
}

/* --- Cards / entries (structural base; systems restyle) ------------------ */
.tp-card {
	background: var(--tp-surface, #fff);
	border-radius: var(--tp-radius-m, 10px);
	box-shadow: var(--tp-shadow-1, none);
	overflow: hidden;
	transition:
		transform var(--tp-dur, 240ms) var(--tp-ease, ease),
		box-shadow var(--tp-dur, 240ms) var(--tp-ease, ease);
}

.tp-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--tp-shadow-2, none);
}

.tp-card__media {
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--tp-surface-alt, #f1eadb);
}

.tp-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 600ms var(--tp-ease, ease);
}

.tp-card:hover .tp-card__media img {
	transform: scale(1.045);
}

.tp-card__body {
	padding: var(--tp-space-5, 1.5rem);
}

.tp-card__title {
	font-size: var(--tp-h3, 1.3rem);
	margin-bottom: var(--tp-space-2, 0.5rem);
}

.tp-card__title a {
	color: inherit;
	text-decoration: none;
}

.tp-card__title a:hover {
	color: var(--tp-accent, #0e3b2e);
}

.tp-card__excerpt {
	color: var(--tp-text-soft, #4d5c56);
	font-size: var(--tp-small, 0.875rem);
}

/* --- Meta rows ----------------------------------------------------------- */
.tp-meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--tp-space-3, 0.75rem);
	align-items: center;
	font-size: var(--tp-micro, 0.75rem);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--tp-text-faint, #8a9791);
}

.tp-meta a {
	color: inherit;
	text-decoration: none;
}

.tp-meta__cat {
	color: var(--tp-highlight, #c46a4a);
	font-weight: 700;
}

.tp-meta__sep::before {
	content: "·";
	margin-inline: 0.35em;
	color: var(--tp-text-faint, #8a9791);
}

/* --- Buttons ------------------------------------------------------------- */
.tp-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.65em 1.3em;
	border-radius: var(--tp-radius-m, 10px);
	background: var(--tp-accent, #0e3b2e);
	color: var(--tp-on-accent, #fff);
	font-weight: 600;
	font-size: var(--tp-small, 0.875rem);
	text-decoration: none;
	transition:
		background var(--tp-dur, 240ms) var(--tp-ease, ease),
		transform var(--tp-dur, 240ms) var(--tp-ease, ease);
}

.tp-btn:hover {
	background: var(--tp-accent-strong, #08241c);
	color: var(--tp-on-accent, #fff);
	transform: translateY(-1px);
}

.tp-btn--ghost {
	background: transparent;
	color: var(--tp-accent, #0e3b2e);
	box-shadow: inset 0 0 0 1px var(--tp-accent, #0e3b2e);
}

.tp-btn--ghost:hover {
	background: var(--tp-accent, #0e3b2e);
	color: var(--tp-on-accent, #fff);
}

/* --- Pagination ---------------------------------------------------------- */
.navigation.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--tp-space-2, 0.5rem);
	justify-content: center;
	padding: var(--tp-space-7, 3rem) 0;
}

.navigation.pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 2.75em;
	height: 2.75em;
	padding: 0 0.4em;
	border-radius: var(--tp-radius-s, 4px);
	border: 1px solid var(--tp-line, #d9cfbc);
	text-decoration: none;
	color: var(--tp-text-soft, #4d5c56);
	font-size: var(--tp-small, 0.875rem);
}

.navigation.pagination .page-numbers.current {
	background: var(--tp-accent, #0e3b2e);
	border-color: var(--tp-accent, #0e3b2e);
	color: var(--tp-on-accent, #fff);
}

.navigation.pagination .page-numbers:hover:not(.current) {
	border-color: var(--tp-highlight, #c46a4a);
	color: var(--tp-highlight, #c46a4a);
}

/* --- Gutenberg ----------------------------------------------------------- */
.alignwide {
	margin-inline: calc((var(--tp-container, 1280px) - min(100%, var(--tp-container, 1280px))) / 2 * -0.25);
	max-width: none;
}

.alignfull {
	margin-inline: calc(50% - 50vw);
	max-width: 100vw;
	width: 100vw;
}

.wp-block-embed iframe {
	max-width: 100%;
}

/* --- Widgets ------------------------------------------------------------- */
.tp-widget {
	margin-bottom: var(--tp-space-6, 2rem);
	padding: var(--tp-space-5, 1.5rem);
	background: var(--tp-surface, #fff);
	border-radius: var(--tp-radius-m, 10px);
	box-shadow: var(--tp-shadow-1, none);
}

.tp-widget__title {
	font-size: var(--tp-h4, 1.1rem);
	margin-bottom: var(--tp-space-4, 1rem);
	padding-bottom: var(--tp-space-2, 0.5rem);
	border-bottom: 2px solid var(--tp-highlight, #c46a4a);
}

.tp-widget ul {
	list-style: none;
	padding-left: 0;
}

.tp-widget ul li {
	padding: var(--tp-space-2, 0.5rem) 0;
	border-bottom: 1px solid var(--tp-line, #d9cfbc);
}

.tp-widget ul li:last-child {
	border-bottom: 0;
}

/* --- Forms --------------------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="password"],
textarea,
select {
	width: 100%;
	padding: 0.7em 1em;
	border: 1px solid var(--tp-line, #d9cfbc);
	border-radius: var(--tp-radius-s, 4px);
	background: var(--tp-surface, #fff);
	color: var(--tp-text, #1d2b26);
}

input:focus,
textarea:focus,
select:focus {
	outline: 3px solid var(--tp-highlight, #c46a4a);
	outline-offset: 0;
	border-color: transparent;
}

/* --- Ads -------------------------------------------------------------------- */
.tp-ad {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4em;
	margin: var(--tp-space-5, 1.5rem) auto;
	padding: var(--tp-space-2, 0.5rem);
	max-width: 100%;
	overflow: hidden;
}

.tp-ad--leaderboard {
	width: 100%;
	margin: 0;
	padding: var(--tp-space-3, 0.75rem) var(--tp-gutter, 1rem);
	background: color-mix(in srgb, var(--tp-surface-alt, #f1eadb) 55%, transparent);
	border-bottom: 1px solid var(--tp-line, #d9cfbc);
}

.tp-ad--leaderboard img {
	width: 100%;
	max-width: 970px;
	height: auto;
}

.tp-ad__tag {
	font-size: 0.65rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--tp-text-faint, #8a9791);
}

.tp-ad img {
	max-width: 100%;
	height: auto;
}

/* --- Comments (shared structural styles) --------------------------------- */
.comment-list {
	list-style: none;
	padding-left: 0;
}

.comment-list .children {
	list-style: none;
	padding-left: var(--tp-space-6, 2rem);
}

.comment-body {
	padding: var(--tp-space-5, 1.5rem) 0;
	border-bottom: 1px solid var(--tp-line, #d9cfbc);
}

.comment-meta {
	font-size: var(--tp-small, 0.875rem);
	color: var(--tp-text-soft, #4d5c56);
	margin-bottom: var(--tp-space-3, 0.75rem);
}
