/* ═══════════════════════════════════════════════════
   NONGOR Theme — Responsive Breakpoints
   ═══════════════════════════════════════════════════ */

/* ── Tablet (max-width: 991px) ── */
@media (max-width: 991px) {
	:root {
		--space-xl: 3rem;
		--space-2xl: 4rem;
		--space-3xl: 5rem;
	}

	/* Logo - smaller on tablet */
	.site-logo img,
	.site-logo .custom-logo,
	.custom-logo-link img {
		max-height: 40px !important;
	}

	/* Header / Nav */
	.menu-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		z-index: 1002;
	}
	
	.menu-toggle svg {
		width: 28px;
		height: 28px;
	}

	/* Hide donate button on tablet/mobile */
	.header-donate-btn {
		display: none;
	}

	/* Add gap between header and hero content */
	.hero__content {
		padding-top: calc(var(--header-height) + 2rem);
	}

	.main-navigation ul {
		display: none;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: var(--color-navy);
		flex-direction: column;
		justify-content: center;
		align-items: center;
		gap: 8px;
		z-index: 999;
		padding: var(--space-xl);
	}

	.main-navigation ul.is-open {
		display: flex;
	}

	.main-navigation li a {
		font-size: 1.3rem;
		padding: 12px 24px;
	}

	.menu-toggle {
		z-index: 1001;
	}

	/* Stats */
	.stats-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.stat-item:nth-child(2) .stat-item__line {
		display: none;
	}

	/* About */
	.about-grid {
		grid-template-columns: 1fr;
		gap: var(--space-xl);
	}

	.about-text-wrap {
		padding-right: 0;
	}

	.about-image img,
	.about-image--placeholder {
		height: 350px;
	}

	/* Programs */
	.programs-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	/* Stories / Blog */
	.stories-grid,
	.posts-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	/* Footer */
	.footer-grid {
		grid-template-columns: 1fr 1fr;
		gap: var(--space-lg);
	}

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

	/* Post nav */
	.post-navigation {
		grid-template-columns: 1fr;
	}
}

/* ── Mobile (max-width: 640px) ── */
@media (max-width: 640px) {
	:root {
		--space-xl: 2.5rem;
		--space-2xl: 3rem;
		--space-3xl: 4rem;
		--header-height: 60px;
	}

	body {
		font-size: 15px;
	}

	/* Logo - smaller on mobile */
	.site-logo img,
	.site-logo .custom-logo,
	.custom-logo-link img {
		max-height: 32px !important;    /* Slightly larger for visibility */
		width: auto !important;        /* THIS IS THE FIX: Overrides inline width from Customizer */
		height: auto !important;       /* Overrides inline height */
	}

	/* Smaller headings on mobile */
	h1, .wp-block-heading:where(h1) {
		font-size: 1.75rem !important;
	}

	h2, .wp-block-heading:where(h2) {
		font-size: 1.5rem !important;
	}

	h3, .wp-block-heading:where(h3) {
		font-size: 1.25rem !important;
	}

	/* Smaller cover block text */
	.wp-block-cover h1,
	.wp-block-cover .wp-block-heading {
		font-size: 1.75rem !important;
		line-height: 1.2 !important;
		word-wrap: break-word !important;
		overflow-wrap: break-word !important;
		padding: 0 10px !important;
	}

	.wp-block-cover p {
		font-size: 0.9rem !important;
		padding: 0 15px !important;
		word-wrap: break-word !important;
	}
	
	.wp-block-cover__inner-container {
		padding: 0 10px !important;
	}

	/* Smaller buttons */
	.wp-block-button__link {
		padding: 12px 20px !important;
		font-size: 14px !important;
	}

	/* Add more space between header and hero content */
	.hero__content {
		padding-top: calc(var(--header-height) + 3rem);
	}

	/* Fix cover block padding for fixed header on mobile */
	body.home .wp-block-cover:first-child,
	body.page .wp-block-cover:first-child {
		padding-top: calc(var(--header-height, 70px) + 3rem);
	}

	/* Hero */
	.hero__title {
		font-size: clamp(2rem, 8vw, 3rem);
	}

	.hero__subtitle {
		font-size: 1rem;
	}

	.hero__actions {
		flex-direction: column;
		align-items: center;
	}

	.hero__actions .btn {
		width: 100%;
		max-width: 300px;
		justify-content: center;
	}

	.hero__badge {
		font-size: 0.7rem;
		padding: 6px 16px;
	}

	.hero__scroll {
		display: none;
	}

	/* Stats */
	.stats-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: var(--space-sm);
	}

	.stat-item__number {
		font-size: 2.2rem;
	}

	.stat-item__label {
		font-size: 0.75rem;
	}

	.stat-item__line {
		display: none;
	}

	/* Programs */
	.programs-grid {
		grid-template-columns: 1fr;
	}

	.program-card {
		padding: var(--space-lg);
	}

	/* Stories / Blog */
	.stories-grid,
	.posts-grid {
		grid-template-columns: 1fr;
	}

	/* Footer */
	.footer-grid {
		grid-template-columns: 1fr;
		gap: var(--space-lg);
	}

	.footer-wave svg {
		height: 40px;
	}

	/* CTA Section */
	.cta-section__actions {
		flex-direction: column;
		align-items: center;
	}

	.cta-section__actions .btn {
		width: 100%;
		max-width: 300px;
		justify-content: center;
	}

	/* Page Hero */
	.page-hero {
		padding: calc(var(--header-height) + var(--space-lg)) 0 var(--space-lg);
	}

	/* Content */
	.entry-content-wrap {
		padding: var(--space-md);
		border-radius: var(--radius-sm);
	}

	/* 404 */
	.error-404__number {
		font-size: 5rem;
	}

	/* Buttons - full width on mobile */
	.btn--lg {
		padding: 16px 32px;
	}
}

/* ── Small phones (max-width: 380px) ── */
@media (max-width: 380px) {
	.stats-grid {
		grid-template-columns: 1fr 1fr;
	}

	.stat-item__number {
		font-size: 1.8rem;
	}

	.container {
		padding-left: var(--space-sm);
		padding-right: var(--space-sm);
	}
}
