/* Pet Nest — mobile layout fixes (≤921px = Astra mobile header breakpoint) */

/* Custom mobile nav (fallback when Astra toggle missing) */
.pf-mobile-nav {
	display: none;
}

@media (max-width: 921px) {
	.pf-mobile-nav {
		display: block;
	}

	.pf-mobile-nav__toggle {
		position: fixed;
		top: max(8px, env(safe-area-inset-top, 0px));
		left: max(12px, env(safe-area-inset-left, 0px));
		z-index: 100002;
		display: inline-flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		gap: 4px;
		width: 40px;
		height: 40px;
		padding: 0;
		border: 1px solid var(--pf-border, #c8e6c9);
		border-radius: 10px;
		background: #fff;
		box-shadow: 0 1px 4px rgba(27, 67, 50, 0.08);
		cursor: pointer;
	}

	.pf-mobile-nav__bar {
		display: block;
		width: 18px;
		height: 2px;
		border-radius: 2px;
		background: var(--pf-text, #1b4332);
	}

	.pf-mobile-nav__backdrop {
		position: fixed;
		inset: 0;
		z-index: 100003;
		background: rgba(27, 67, 50, 0.45);
	}

	.pf-mobile-nav__panel {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		z-index: 100004;
		width: min(300px, 86vw);
		padding: max(56px, calc(12px + env(safe-area-inset-top, 0px))) 16px 24px;
		background: #fff;
		box-shadow: 4px 0 24px rgba(27, 67, 50, 0.15);
		overflow-y: auto;
	}

	.pf-mobile-nav__list {
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.pf-mobile-nav__list > li {
		border-bottom: 1px solid var(--pf-green-100, #e8f5e9);
	}

	.pf-mobile-nav__list a {
		display: block;
		padding: 14px 4px;
		color: var(--pf-text, #1b4332);
		text-decoration: none;
		font-size: 0.95rem;
		font-weight: 600;
	}

	.pf-mobile-nav__list a:hover,
	.pf-mobile-nav__list .current-menu-item > a {
		color: var(--pf-primary, #40916c);
	}

	body.pf-mobile-nav-open {
		overflow: hidden;
	}

	#ast-mobile-header .ast-primary-header-bar,
	#ast-mobile-header .site-primary-header-wrap {
		padding-left: max(52px, calc(12px + env(safe-area-inset-left, 0px))) !important;
		padding-right: max(72px, calc(12px + env(safe-area-inset-right, 0px))) !important;
	}

	/* Auth pill — fixed top-right */
	.pf-header-top-bar {
		position: fixed;
		top: max(8px, env(safe-area-inset-top, 0px));
		right: max(12px, env(safe-area-inset-right, 0px));
		left: auto;
		width: auto;
		z-index: 100001;
		pointer-events: none;
	}

		min-height: 36px;
		padding: 6px 10px !important;
		font-size: 0.72rem !important;
	}

	.pf-auth-label {
		max-width: 64px;
	}

	.pf-auth-menu {
		position: fixed;
		top: auto;
		right: max(12px, env(safe-area-inset-right, 0px));
		left: auto;
		min-width: min(240px, calc(100vw - 24px));
		max-height: calc(100vh - 80px);
		overflow-y: auto;
		z-index: 100010;
	}

	/* Footer copyright wraps on narrow screens */
	.site-below-footer-wrap .ast-footer-copyright {
		font-size: 0.78rem;
		line-height: 1.55;
		padding: 0 12px;
	}

	/* wpForo — prevent horizontal page scroll */
	#wpforo-wrap {
		max-width: 100%;
		overflow-x: clip;
	}

	#wpforo-wrap .wpf-head-bar {
		flex-wrap: wrap;
		gap: 8px;
		padding: 10px 12px;
	}

	#wpforo-wrap .wpf-head-bar .wpf-head-bar-right {
		width: 100%;
		justify-content: flex-start;
	}

	#wpforo-wrap .wpf-button,
	#wpforo-wrap .wpf-button span {
		font-size: 0.82rem;
	}

	#wpforo-wrap .wpforo-forum-title,
	#wpforo-wrap .wpf-forum-title {
		font-size: 0.95rem;
		line-height: 1.35;
		word-break: break-word;
	}

	#wpforo-wrap .wpfl-1 {
		display: block;
		width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	#wpforo-wrap .wpforo-topic-badges,
	#wpforo-wrap .wpf-breadcrumb {
		font-size: 0.8rem;
		flex-wrap: wrap;
	}

	/* Register — type picker */
	.pf-split-register {
		margin: 20px auto;
		padding: 0 12px;
	}

	.pf-register-headline {
		font-size: 1.35rem;
	}

	.pf-register-sub {
		font-size: 0.9rem;
		margin-bottom: 24px;
	}

	.pf-type-card {
		padding: 24px 18px;
	}

	.pf-select-type-btn {
		min-height: 44px;
		padding-top: 14px;
		padding-bottom: 14px;
	}
}

@media (max-width: 640px) {
	.pf-home-wrapper {
		padding: 0 14px 32px;
	}

	.pf-hero {
		margin: 16px 0 24px;
	}

	.pf-hero-main {
		min-height: 260px;
		border-radius: 12px;
	}

	.pf-hero-img {
		height: 260px;
	}

	.pf-hero-content {
		padding: 16px;
	}

	.pf-hero-content h1 {
		font-size: 1.1rem;
		line-height: 1.35;
	}

	.pf-hero-sub {
		flex-direction: column;
	}

	.pf-hero-sub-item img {
		width: 72px;
		height: 56px;
	}

	.pf-section-title {
		font-size: 1rem;
		margin-bottom: 14px;
	}

	.pf-main-layout {
		margin: 24px 0;
		gap: 20px;
	}

	.pf-card-img {
		height: 160px;
	}

	.pf-card-body h3 {
		font-size: 0.88rem;
	}

	.pf-btn-load {
		width: 100%;
		max-width: 320px;
		min-height: 44px;
	}

	.pf-trending-scroll {
		margin: 0 -4px;
		padding-left: 4px;
		padding-right: 4px;
		-webkit-overflow-scrolling: touch;
	}

	.pf-trending-card {
		flex: 0 0 min(78vw, 220px);
	}

	.page-template-page-home .ast-container {
		padding-left: 0;
		padding-right: 0;
	}
}

@media (max-width: 480px) {
	.pf-auth-label {
		display: none;
	}

	.pf-auth-btn {
		min-width: 36px;
		min-height: 36px;
		padding: 8px !important;
		justify-content: center;
	}

	.pf-auth-caret {
		display: none;
	}

	#ast-mobile-header .ast-primary-header-bar,
	#ast-mobile-header .site-primary-header-wrap {
		padding-right: max(52px, calc(8px + env(safe-area-inset-right, 0px))) !important;
	}

	.pf-register-form {
		padding: 18px 14px;
	}

	.pf-form-header h2 {
		font-size: 1.1rem;
	}
}
