/**
 * responsive.css
 * Breakpoints for laptop, tablet and mobile. The 320px sidebar collapses
 * above the content column on narrower viewports, and the top navigation
 * turns into an off-canvas mobile menu.
 */

/* Laptop and below: slightly narrower sidebar */
@media (max-width: 1200px) {
	:root {
		--jpm-sidebar-width: 300px;
	}

	.jpm-layout {
		padding-left: 1rem;
		padding-right: 1rem;
	}
}

/* Tablet: stack sidebar above content */
@media (max-width: 980px) {
	.jpm-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.jpm-sidebar {
		position: static;
		grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	}

	.jpm-sidebar__logo {
		grid-column: 1 / -1;
	}

	.jpm-content__inner {
		margin-top: 0;
	}

	.jpm-footer__inner {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Mobile navigation */
@media (max-width: 860px) {
	.jpm-nav-toggle {
		display: inline-flex;
		margin-left: auto;
	}

	.jpm-topbar__nav {
		flex: 0 0 auto;
	}

	.jpm-topbar__menu-wrap {
		position: fixed;
		top: var(--jpm-topbar-height);
		left: 0;
		right: 0;
		bottom: 0;
		background: var(--jpm-color-primary-dark);
		padding: 1rem;
		overflow-y: auto;
		transform: translateX(-100%);
		transition: transform 250ms ease;
		z-index: 999;
		display: block;
	}

	.jpm-topbar__menu-wrap.is-open {
		transform: translateX(0);
	}

	.jpm-menu {
		flex-direction: column;
		align-items: stretch;
		gap: 0.15rem;
	}

	.jpm-menu li {
		width: 100%;
	}

	.jpm-menu > li > a {
		font-size: 1.05rem;
		padding: 0.85rem 1rem;
	}

	.jpm-menu .menu-item-has-children {
		display: grid;
		grid-template-columns: 1fr auto;
		align-items: center;
	}

	.jpm-submenu-toggle {
		display: inline-flex;
		color: #fff;
	}

	.jpm-menu .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		background: rgba(255, 255, 255, 0.06);
		grid-column: 1 / -1;
		display: none;
		padding: 0.25rem 0 0.25rem 1rem;
	}

	.jpm-menu .sub-menu.is-open {
		display: grid;
	}

	.jpm-menu .sub-menu a {
		color: rgba(255, 255, 255, 0.9);
	}

	.jpm-menu .sub-menu a:hover,
	.jpm-menu .sub-menu a:focus {
		background: rgba(255, 255, 255, 0.1);
		color: #fff;
	}
}

/* Small tablets and large phones */
@media (max-width: 680px) {
	.jpm-entry {
		grid-template-columns: minmax(0, 1fr);
	}

	.jpm-entry__thumb {
		max-width: 320px;
	}

	.jpm-footer__inner {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--jpm-gap);
	}

	.jpm-footer__bottom-inner {
		flex-direction: column;
		align-items: flex-start;
	}

	.jpm-news-grid__list {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	}

	.jpm-hero {
		aspect-ratio: 3 / 2;
		min-height: 260px;
	}
}

/* Phones */
@media (max-width: 480px) {
	.jpm-topbar__utils .jpm-social-menu {
		display: none;
	}

	.jpm-news-grid__list {
		grid-template-columns: minmax(0, 1fr);
	}

	.jpm-hero__nav {
		width: 2.5rem;
		height: 2.5rem;
	}

	.jpm-content__inner {
		padding: 1.1rem;
	}
}
