/* ==========================================================================
   Mypoonji 2.0 — Main Stylesheet
   Paste into: /wp-content/themes/astra-child-mypoonji/assets/css/mypoonji-style.css
   Mobile-first. Every rule below is written for small screens first,
   then progressively enhanced with min-width media queries. This is the
   single biggest fix for "elements overlap on phones" — you are never
   fighting a desktop layout down to a small screen.
   ========================================================================== */

/* ---- 1. Reset & box model ------------------------------------------------
   universal box-sizing is what stops padding/border from pushing elements
   wider than their parent and causing horizontal overlap/scroll. */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.mypoonji {
	margin: 0;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	color: #1e293b;
	line-height: 1.65;
	overflow-x: hidden; /* belt-and-braces: stops any stray wide element from creating side-scroll */
}

img, svg, video, iframe {
	max-width: 100%;
	height: auto;
	display: block; /* removes the 4px baseline gap that misaligns image cards */
}

a { color: inherit; }

:root {
	--navy: #0B3D91;
	--navy-dark: #062b6e;
	--emerald: #0F9D58;
	--gold: #D4AF37;
	--light-bg: #f8fafc;
	--border: #e2e8f0;
	--text-muted: #64748b;
	--radius: 14px;
	--container-width: 1200px;
	--space-1: 0.5rem;
	--space-2: 1rem;
	--space-3: 1.5rem;
	--space-4: 2.5rem;
	--z-header: 100;
	--z-dropdown: 200;
	--z-modal: 300;
}

h1, h2, h3, h4 {
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	line-height: 1.25;
	margin: 0 0 var(--space-2);
	word-wrap: break-word; /* long fund names never force a container wider than the grid cell */
}

p { margin: 0 0 var(--space-2); }

.container {
	width: 100%;
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0 var(--space-2);
}

/* ---- 2. Buttons ---------------------------------------------------------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.85rem 1.75rem;
	border-radius: 50px;
	font-weight: 600;
	font-size: 0.95rem;
	text-decoration: none;
	border: 2px solid transparent;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
	white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1e293b; }
.btn-block { width: 100%; }

/* Buttons inside a hero on a dark background need a light outline variant */
.hero .btn-outline { border-color: #fff; color: #fff; }
.hero .btn-outline:hover { background: #fff; color: var(--navy); }

/* ---- 3. Header / navigation ----------------------------------------------
   position: sticky (not fixed) so it never overlaps page content the way
   `position:fixed` does unless every section has matching padding-top. */
.site-header {
	position: sticky;
	top: 0;
	z-index: var(--z-header);
	background: #fff;
	border-bottom: 1px solid var(--border);
}
.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 64px;
	flex-wrap: wrap; /* logo + toggle never collide on very narrow screens */
	gap: var(--space-1);
}
.site-nav { display: none; width: 100%; }
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: var(--space-2) 0 0; display: flex; flex-direction: column; gap: 0.75rem; }
.site-nav a { text-decoration: none; font-weight: 500; }
.nav-toggle { border: none; background: none; font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 0.25rem; }

/* ---- 4. Hero --------------------------------------------------------------
   min-height instead of a fixed height lets long headlines wrap without
   text spilling out of / overlapping the section below it. */
.hero {
	background: linear-gradient(135deg, var(--navy) 0%, #1a5bbf 100%);
	color: #fff;
	padding: 3rem 0;
	text-align: center;
}
.hero h1 { font-size: 1.75rem; margin-bottom: var(--space-2); }
.hero-sub { font-size: 1rem; opacity: 0.92; max-width: 560px; margin: 0 auto var(--space-3); }
.hero-cta { display: flex; flex-direction: column; gap: 0.75rem; align-items: center; }
.trust-strip {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	align-items: center;
	margin-top: var(--space-3);
	font-size: 0.85rem;
	opacity: 0.9;
}

/* ---- 5. Generic section spacing ------------------------------------------- */
section { padding: var(--space-4) 0; }
section.alt-bg { background: var(--light-bg); }

/* ---- 6. Grids --------------------------------------------------------------
   auto-fit + minmax is the key mobile-safe grid pattern: on a narrow
   screen every card automatically drops to a single column instead of
   being squeezed and overlapping its neighbour. */
.category-grid,
.fund-grid,
.card-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-3);
	margin: var(--space-3) 0;
}
.cat-card, .fund-card, .info-card {
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: var(--space-3);
	box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.fund-card { border-left: 4px solid var(--navy); }
.fund-card h3 { font-size: 1.05rem; }

/* ---- 7. Calculator / forms -------------------------------------------------
   max-width + margin:auto keeps calculators centred and prevents inputs
   from stretching edge-to-edge and overlapping labels on tablets. */
.mypoonji-card {
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: var(--space-3);
	max-width: 640px;
	margin: var(--space-3) auto;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.input-group { margin-bottom: var(--space-3); }
.input-group label {
	display: block;
	font-weight: 500;
	font-size: 0.9rem;
	margin-bottom: 0.4rem;
}
.input-group input[type="range"] { width: 100%; margin-top: 0.4rem; accent-color: var(--navy); }
.input-group input[type="text"],
.input-group input[type="number"],
.input-group select {
	width: 100%;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	font-size: 0.95rem;
	font-family: inherit;
}
.input-group .val { display: inline-block; margin-top: 0.25rem; font-weight: 600; color: var(--navy); }

.calc-results {
	background: var(--light-bg);
	border-radius: 10px;
	padding: var(--space-3);
	margin: var(--space-3) 0;
}
.calc-results p { display: flex; justify-content: space-between; gap: var(--space-2); margin-bottom: 0.5rem; flex-wrap: wrap; }
.calc-results p:last-child { margin-bottom: 0; }

.disclaimer { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-top: var(--space-2); }

.filter-bar {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-bottom: var(--space-3);
}
.filter-bar input, .filter-bar select { width: 100%; }

/* ---- 8. Compliance / disclaimer strip ------------------------------------- */
.compliance-disclaimer {
	background: #fff7ed;
	border-top: 1px solid #fcd34d;
	padding: var(--space-2) 0;
	font-size: 0.8rem;
	color: #78350f;
}
.compliance-disclaimer .container { max-width: var(--container-width); }

/* ---- 9. Utility ------------------------------------------------------------ */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }

/* ==========================================================================
   Breakpoints — progressive enhancement upward, never downward.
   ========================================================================== */

/* Small tablets and large phones */
@media (min-width: 576px) {
	.hero-cta { flex-direction: row; justify-content: center; flex-wrap: wrap; }
	.trust-strip { flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 1.5rem; }
	.filter-bar { flex-direction: row; flex-wrap: wrap; }
	.filter-bar input { flex: 1 1 220px; }
	.filter-bar select { flex: 0 1 200px; }
	.filter-bar button { flex: 0 0 auto; }
}

/* Tablets */
@media (min-width: 768px) {
	.hero { padding: 5rem 0; }
	.hero h1 { font-size: 2.4rem; }
	.hero-sub { font-size: 1.1rem; }
	.category-grid { grid-template-columns: repeat(2, 1fr); }
	.fund-grid, .card-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
	.site-nav { display: block; width: auto; }
	.site-nav ul { flex-direction: row; gap: 1.75rem; padding-top: 0; }
	.nav-toggle { display: none; }
}

/* Small desktops */
@media (min-width: 992px) {
	.hero h1 { font-size: 2.9rem; }
	.category-grid { grid-template-columns: repeat(4, 1fr); }
	.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); align-items: center; }
}

/* Large desktops */
@media (min-width: 1200px) {
	.fund-grid, .card-grid { grid-template-columns: repeat(3, 1fr); }
}

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