/*
Theme Name: PracticeTestsHub
Theme URI: https://practicetestshub.com/
Author: PracticeTestsHub
Author URI: https://practicetestshub.com/
Description: Lightweight classic theme for PracticeTestsHub — free bilingual (English + Hindi) mock tests for Indian government exams. Custom sticky header and footer per the Claude UI/UX spec (HOMEPAGE-SPEC.md §2/§11); page content is supplied by the PracticeTestsHub Examination System plugin shortcodes.
Version: 1.1.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pth-theme
Tags: education, one-column, custom-menu, featured-images
*/

/* ============================================================
   Tokens (HOMEPAGE-SPEC §12 — same system as the plugin)
   ============================================================ */
:root {
	--pth-primary: #2563EB;
	--pth-primary-hover: #1D4ED8;
	--pth-navy: #0F172A;
	--pth-bg: #F8FAFC;
	--pth-muted: #64748B;
	--pth-body: #334155;
	--pth-border: #E2E8F0;
	--pth-blue-50: #EFF6FF;
	--pth-blue-100: #DBEAFE;
	--pth-on-dark: #CBD5E1;
	--pth-on-dark-dim: #94A3B8;
	--pth-on-dark-accent: #93C5FD;
	--pth-font: Inter, "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ============================================================
   Base — minimal only. No global margin/padding resets beyond
   box-sizing + body margin, no border-radius resets: the
   plugin player lives inside page content and must not be
   fought by the theme.
   ============================================================ */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	overflow-x: clip;
}

body {
	margin: 0;
	background: #FFFFFF;
	color: var(--pth-navy);
	font-family: var(--pth-font);
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

[lang="hi"] {
	letter-spacing: 0;
	line-height: 1.75;
}

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

a {
	color: var(--pth-primary);
}

::selection {
	background: var(--pth-blue-100);
}

/* Full-width content: plugin/homepage wrappers centre themselves
   at their own max-widths, so the theme imposes NO column cap. */
.pth-site-main {
	display: block;
	width: 100%;
	padding-inline: 0;
}

/* Generic content basics (About-style pages, posts). Plugin
   shortcode output carries its own .pth- classes and is not
   affected by these element-level rules in any structural way. */
.pth-entry {
	width: 100%;
}

/* Page content column (v1.0.2) — page.php wraps the_content() in
   .pth-entry-content so plain page copy (paragraphs, headings, lists)
   and plugin blocks share the SAME centred 1200px column as the page
   title. Before this, raw page content flowed the full viewport width
   and stuck to the screen edges on the catalogue landing pages. */
.pth-entry-content {
	width: 100%;
	max-width: min(1200px, calc(100vw - 32px));
	margin-inline: auto;
}

/* Page title H1 (v1.0.1) — printed by page.php on pages whose
   content carries no H1 of its own (exam landing / category
   pages). Same measure as the plugin wrappers so the title
   lines up with the centred content column below it. */
.pth-page-head {
	width: 100%;
	max-width: min(1200px, calc(100vw - 32px));
	margin-inline: auto;
	padding-top: 40px;
}

.pth-page-title {
	margin: 0 0 8px;
	font-size: 36px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--pth-navy);
}

@media (max-width: 640px) {
	.pth-page-head {
		padding-top: 28px;
	}

	.pth-page-title {
		font-size: 28px;
	}
}

.pth-entry-title {
	max-width: 1200px;
	margin: 40px auto 8px;
	padding-inline: 24px;
	font-size: 32px;
	line-height: 1.25;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.pth-entry-meta {
	max-width: 1200px;
	margin: 0 auto 16px;
	padding-inline: 24px;
	font-size: 13px;
	color: var(--pth-muted);
}

.pth-post-nav {
	max-width: 1200px;
	margin: 32px auto 48px;
	padding-inline: 24px;
	display: flex;
	justify-content: space-between;
	gap: 16px;
	font-size: 14px;
	font-weight: 500;
}

/* ============================================================
   Header (spec §2)
   ============================================================ */
.pth-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(255, 255, 255, 0.92);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--pth-border);
}

.pth-header-in {
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: 24px;
	height: 68px;
	display: flex;
	align-items: center;
	gap: 28px;
}

/* Logo */
.pth-logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	flex-shrink: 0;
}

.pth-logo-mark {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: var(--pth-primary);
	display: grid;
	place-items: center;
	flex-shrink: 0;
}

.pth-logo-mark svg {
	display: block;
}

.pth-logo-text {
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--pth-navy);
	white-space: nowrap;
}

.pth-logo-hub {
	color: var(--pth-primary);
}

/* Nav */
.pth-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 28px;
}

.pth-menu > li {
	position: relative;
}

.pth-menu a {
	display: inline-block;
	padding: 8px 0;
	font-size: 15px;
	font-weight: 500;
	color: var(--pth-navy);
	text-decoration: none;
}

.pth-menu a:hover,
.pth-menu a:focus-visible {
	color: var(--pth-primary);
}

.pth-menu .current-menu-item > a,
.pth-menu .current_page_item > a {
	color: var(--pth-primary);
	box-shadow: inset 0 -2px 0 var(--pth-primary);
}

/* Exams dropdown (CSS-only) */
.pth-dropdown {
	list-style: none;
	margin: 0;
	padding: 8px;
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translate(-50%, 6px);
	min-width: 480px;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2px;
	background: #FFFFFF;
	border: 1px solid var(--pth-border);
	border-radius: 14px;
	box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
	z-index: 110;
}

.pth-menu li:hover > .pth-dropdown,
.pth-menu li:focus-within > .pth-dropdown {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

.pth-dropdown a {
	display: block;
	padding: 9px 12px;
	border-radius: 8px;
	font-size: 14px;
	white-space: nowrap;
}

.pth-dropdown a:hover,
.pth-dropdown a:focus-visible {
	background: var(--pth-blue-50);
	color: var(--pth-primary);
}

.pth-dropdown .pth-dropdown-all {
	grid-column: 1 / -1;
	border-top: 1px solid var(--pth-border);
	margin-top: 4px;
	padding-top: 6px;
}

.pth-dropdown .pth-dropdown-all a {
	font-weight: 600;
	color: var(--pth-primary);
}

/* Header actions: language pill + CTA + burger */
.pth-header-actions {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-shrink: 0;
	margin-inline-start: auto;
}

/* Language pill — visual placeholder only (real switching later) */
.pth-lang-pill {
	display: inline-flex;
	align-items: center;
	height: 36px;
	padding: 3px;
	background: #F1F5F9;
	border: 1px solid var(--pth-border);
	border-radius: 999px;
}

.pth-lang-opt {
	display: inline-flex;
	align-items: center;
	height: 28px;
	padding: 0 12px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 500;
	color: var(--pth-muted);
	white-space: nowrap;
}

.pth-lang-opt.is-active {
	background: #FFFFFF;
	color: var(--pth-primary);
	font-weight: 600;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

/* CTA */
.pth-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 40px;
	padding: 0 20px;
	border-radius: 12px;
	background: var(--pth-primary);
	color: #FFFFFF;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
	transition: background 0.15s ease, transform 0.15s ease;
	white-space: nowrap;
}

.pth-cta:hover,
.pth-cta:focus-visible {
	background: var(--pth-primary-hover);
	color: #FFFFFF;
	transform: translateY(-1px);
}

/* Burger */
.pth-burger {
	display: none;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--pth-border);
	border-radius: 10px;
	background: #FFFFFF;
	cursor: pointer;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
}

.pth-burger span {
	display: block;
	width: 18px;
	height: 2px;
	border-radius: 2px;
	background: var(--pth-navy);
	transition: transform 0.15s ease, opacity 0.15s ease;
}

.pth-burger[aria-expanded="true"] span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.pth-burger[aria-expanded="true"] span:nth-child(2) {
	opacity: 0;
}

.pth-burger[aria-expanded="true"] span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* Mobile panel */
.pth-mobile-panel {
	border-top: 1px solid var(--pth-border);
	background: #FFFFFF;
	padding: 12px 24px 20px;
}

.pth-mobile-panel[hidden] {
	display: none;
}

.pth-mobile-links,
.pth-mobile-cats {
	list-style: none;
	margin: 0;
	padding: 0;
}

.pth-mobile-links a {
	display: block;
	padding: 11px 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--pth-navy);
	text-decoration: none;
	border-bottom: 1px solid var(--pth-border);
}

.pth-mobile-cats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 20px;
	margin-top: 6px;
}

.pth-mobile-cats a {
	display: block;
	padding: 9px 0;
	font-size: 14px;
	font-weight: 500;
	color: var(--pth-body);
	text-decoration: none;
}

.pth-mobile-cats a:hover,
.pth-mobile-links a:hover {
	color: var(--pth-primary);
}

.pth-mobile-cta {
	margin-top: 16px;
	width: 100%;
	height: 48px;
	font-size: 16px;
}

/* Header responsive */
@media (max-width: 1023px) {
	.pth-nav {
		display: none;
	}

	.pth-burger {
		display: inline-flex;
	}
}

@media (max-width: 640px) {
	.pth-header-in {
		height: 56px;
		padding-inline: 16px;
		gap: 12px;
	}

	.pth-logo-mark {
		width: 32px;
		height: 32px;
		border-radius: 9px;
	}

	.pth-logo-text {
		font-size: 18px;
	}

	.pth-header .pth-cta {
		display: none;
	}

	.pth-lang-pill {
		height: 28px;
		padding: 2px;
	}

	.pth-lang-opt {
		height: 22px;
		padding: 0 8px;
		font-size: 12px;
	}

	.pth-mobile-panel {
		padding-inline: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pth-dropdown,
	.pth-cta,
	.pth-burger span {
		transition: none;
	}
}

/* ============================================================
   Footer (spec §11)
   ============================================================ */
.pth-footer {
	background: var(--pth-navy);
	color: var(--pth-on-dark);
	margin-top: 0;
}

.pth-footer-in {
	max-width: 1200px;
	margin-inline: auto;
	padding: 64px 24px 0;
}

.pth-footer-grid {
	display: grid;
	grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
	gap: 32px;
	padding-bottom: 48px;
}

/* Brand column */
.pth-footer-logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
}

.pth-footer-logo .pth-logo-text {
	color: #FFFFFF;
}

.pth-footer-logo .pth-logo-hub {
	color: var(--pth-on-dark-accent);
}

.pth-footer-blurb {
	margin: 16px 0 0;
	font-size: 14px;
	line-height: 1.65;
	color: var(--pth-on-dark-dim);
	max-width: 260px;
}

.pth-footer-lang {
	margin-top: 20px;
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.14);
}

.pth-footer-lang .pth-lang-opt {
	color: var(--pth-on-dark-dim);
}

.pth-footer-lang .pth-lang-opt.is-active {
	background: rgba(255, 255, 255, 0.12);
	color: #FFFFFF;
	box-shadow: none;
}

/* Link columns */
.pth-footer-h {
	margin: 4px 0 14px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #FFFFFF;
}

.pth-footer-links {
	list-style: none;
	margin: 0;
	padding: 0;
}

.pth-footer-links li {
	margin-bottom: 10px;
	font-size: 14px;
	color: var(--pth-on-dark-dim);
}

.pth-footer-links a {
	color: var(--pth-on-dark-dim);
	text-decoration: none;
}

.pth-footer-links a:hover,
.pth-footer-links a:focus-visible {
	color: #FFFFFF;
}

/* Disclaimer + legal rows */
.pth-footer-disclaimer {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding: 24px 0;
	font-size: 13px;
	line-height: 1.7;
	color: var(--pth-on-dark-dim);
}

.pth-footer-disclaimer p {
	margin: 0;
}

.pth-footer-legal {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding: 20px 0 28px;
	font-size: 13px;
	color: var(--pth-on-dark-dim);
	display: flex;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.pth-footer-legal p {
	margin: 0;
}

/* Footer responsive */
@media (max-width: 1023px) {
	.pth-footer-grid {
		grid-template-columns: 1fr 1fr;
		gap: 36px 24px;
	}

	.pth-footer-brand {
		grid-column: 1 / -1;
	}

	.pth-footer-blurb {
		max-width: 420px;
	}
}

@media (max-width: 640px) {
	.pth-footer-in {
		padding: 48px 16px 0;
	}
}

@media (max-width: 480px) {
	.pth-footer-grid {
		grid-template-columns: 1fr;
	}

	.pth-footer-legal {
		flex-direction: column;
		gap: 6px;
	}
}

/* ============================================================
   404
   ============================================================ */
.pth-404 {
	max-width: 720px;
	margin: 0 auto;
	padding: 96px 24px;
	text-align: center;
}

.pth-404 h1 {
	margin: 0 0 12px;
	font-size: 36px;
	font-weight: 700;
}

.pth-404 p {
	margin: 0 0 28px;
	color: var(--pth-muted);
	font-size: 16px;
}

.pth-404 .pth-cta {
	height: 48px;
	padding: 0 28px;
}

/* WordPress core helpers */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

/* ============================================================
   v1.1.0 — Mobile Phase 1 (MOBILE-UX-SPEC): bottom tab bar +
   hide-on-scroll header. Everything in this section is scoped
   to <=767px; the desktop layout is untouched.
   ============================================================ */

/* Tab bar markup is always in the DOM (footer.php) but only
   ever displayed on mobile. */
.pth-tabbar {
	display: none;
}

@media (max-width: 767px) {
	/* Room for the fixed tab bar, so footer content is never
	   hidden behind it. The fullscreen player is position:fixed
	   (plugin, z-index 200000) and does not see this padding. */
	body {
		padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
	}

	.pth-tabbar {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 90;
		height: calc(56px + env(safe-area-inset-bottom, 0px));
		padding-bottom: env(safe-area-inset-bottom, 0px);
		background: #FFFFFF;
		border-top: 1px solid var(--pth-border);
		box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.05);
	}

	/* Never over the fullscreen test player: the player overlay
	   (z-index 200000) already covers z-90, and the player adds
	   pth-player-open to <body> while a test is live. */
	body.pth-player-open .pth-tabbar {
		display: none;
	}

	.pth-tab {
		flex: 1 1 0;
		min-width: 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 2px;
		color: var(--pth-muted);
		text-decoration: none;
		-webkit-tap-highlight-color: transparent;
		touch-action: manipulation;
	}

	.pth-tab-ic {
		display: grid;
		place-items: center;
		width: 48px;
		height: 28px;
		border-radius: 999px;
	}

	.pth-tab-ic svg {
		display: block;
	}

	.pth-tab-label {
		font-size: 11px;
		font-weight: 600;
		line-height: 1.2;
	}

	.pth-tab.is-active {
		color: var(--pth-primary);
	}

	.pth-tab.is-active .pth-tab-ic {
		background: var(--pth-blue-50);
	}

	/* Header hide-on-scroll-down / show-on-scroll-up (mobile
	   only; the class is toggled by assets/menu.js and it never
	   hides while the mobile panel is open). */
	.pth-header {
		transition: transform 0.25s ease;
		will-change: transform;
	}

	.pth-header.pth-header-hidden {
		transform: translateY(-100%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.pth-header {
		transition: none;
	}
}
