/**
 * Desktop-first magazine home layout.
 * Everything is scoped to the dedicated page template.
 */

.journal-home-template {
	overflow-x: clip;
}

.journal-home-template #page.site {
	overflow: visible !important;
}

.journal-home-template .site-content.fixed {
	max-width: 1280px;
}

.journal-home-template .site-content-inner,
.journal-home-template .journal-home,
.journal-home-template .journal-home__main {
	width: 100%;
	max-width: none;
}

.journal-home-template .journal-home__constructor {
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.journal-home-template .journal-home__row,
.journal-home-template .journal-home__row > .section-block {
	min-width: 0;
}

.journal-home-template .journal-home__row .section-block {
	margin: 0;
}

.journal-home-template .journal-home__row .section-block__header {
	margin-top: 0;
}

.journal-home-template .journal-home__admin-notice {
	padding: 20px 24px;
	border: 1px solid #e5a742;
	background: #fff8e8;
	color: #4a3820;
}

@media (min-width: 992px) {
	/* Match the native article grid: 24px outer guides, 860/340 columns and 32px gap. */
	.journal-home-template .site-content-inner {
		width: auto;
		margin-right: 24px;
		margin-left: 24px;
	}

	.journal-home-template.sidebar-right .site-content-inner,
	.journal-home-template.sidebar-left .site-content-inner {
		display: grid !important;
		grid-template-columns: minmax(0, 43fr) minmax(0, 17fr) !important;
		align-items: start;
		gap: 32px !important;
	}

	.journal-home-template #primary.journal-home {
		grid-column: 1;
		width: 100%;
		padding-right: 0;
	}

	.journal-home-template.sidebar-left #primary.journal-home {
		grid-column: 2;
		grid-row: 1;
	}

	body.journal-home-template .journal-home__row > .section-block.section-posts {
		padding-right: 0 !important;
		padding-left: 0 !important;
	}

	.journal-home-template #secondary {
		grid-column: 2;
		align-self: stretch;
		width: auto;
		max-width: none;
		margin: 0;
		padding: 0;
	}

	.journal-home-template.sidebar-left #secondary {
		grid-column: 1;
		grid-row: 1;
	}

	/* Native Reboot Sticky Kit remains primary; this covers delayed/disabled JS. */
	.journal-home-template #secondary .sticky-sidebar:not(.is_stuck) {
		position: sticky;
		top: 20px;
		max-height: calc(100vh - 40px);
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: none;
	}

	.journal-home-template #secondary .sticky-sidebar:not(.is_stuck)::-webkit-scrollbar {
		display: none;
	}

	body.admin-bar.journal-home-template #secondary .sticky-sidebar:not(.is_stuck) {
		top: 52px;
		max-height: calc(100vh - 72px);
	}

	.journal-home-template #secondary .widget:first-child {
		margin-top: 0;
	}

	.journal-home-template .journal-home__row--horizontal .post-cards--horizontal {
		display: flex;
		flex-direction: column;
		gap: 0;
		width: 100%;
	}

	.journal-home-template .journal-home__row > .section-block {
		margin-bottom: 0 !important;
		padding-right: 0 !important;
		padding-left: 0 !important;
	}

	.journal-home-template .journal-home__row--horizontal .post-cards--horizontal > .post-card--horizontal {
		display: flex !important;
		align-items: center !important;
		gap: 24px !important;
		width: 100% !important;
		max-width: none !important;
		min-height: 0 !important;
		margin: 0 !important;
		padding: 20px 0 !important;
		border-bottom: 1px solid #e5e5e5 !important;
	}

	.journal-home-template .journal-home__row--horizontal .post-card--horizontal .post-card__thumbnail,
	.journal-home-template .journal-home__row--horizontal .post-card--horizontal .post-card__thumbnail a,
	.journal-home-template .journal-home__row--horizontal .post-card--horizontal .post-card__thumbnail img {
		display: block !important;
		flex: 0 0 208px !important;
		width: 208px !important;
		min-width: 208px !important;
		max-width: 208px !important;
		height: 104px !important;
		min-height: 104px !important;
		max-height: 104px !important;
		margin: 0 !important;
		border-radius: 0 !important;
	}

	.journal-home-template .journal-home__row--horizontal .post-card--horizontal .post-card__thumbnail img {
		object-fit: cover !important;
	}

	.journal-home-template .journal-home__row--horizontal .post-card--horizontal .post-card__body {
		min-width: 0 !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.journal-home-template .journal-home__row--horizontal .post-card--horizontal .post-card__title {
		margin: 0 0 8px !important;
		font-size: 20px !important;
		font-weight: 800 !important;
		line-height: 1.22 !important;
		letter-spacing: -.018em !important;
	}

	.journal-home-template .journal-home__row--horizontal .post-card--horizontal .post-card__description {
		display: -webkit-box !important;
		margin: 0 0 9px !important;
		overflow: hidden !important;
		color: #666 !important;
		font-size: 14px !important;
		line-height: 1.4 !important;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}

	.journal-home-template .journal-home__row--horizontal .post-card--horizontal .post-card__meta {
		margin: 0 !important;
		font-size: 12px !important;
	}
}

/* Sidebar follows the same flat editorial language as the article feed. */
.journal-home-template #secondary .widget {
	margin: 0 0 32px !important;
	padding: 18px 0 26px !important;
	border: 0 !important;
	border-top: 4px solid var(--js-accent, #ef5b40) !important;
	border-bottom: 1px solid #e2e2e2 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

.journal-home-template #secondary .widget:last-child {
	margin-bottom: 0 !important;
}

.journal-home-template #secondary .widget-header,
.journal-home-template #secondary .widget-title {
	margin: 0 0 18px !important;
	padding: 0 !important;
	color: #171717 !important;
	font-size: 21px !important;
	font-weight: 800 !important;
	line-height: 1.2 !important;
	letter-spacing: -.02em !important;
	text-transform: none !important;
}

.journal-home-template #secondary .widget-articles {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.journal-home-template #secondary .post-card--small {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) !important;
	gap: 0 !important;
	width: 100% !important;
	max-width: none !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 16px 0 !important;
	border: 0 !important;
	border-bottom: 1px solid #e6e6e6 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	transform: none !important;
}

.journal-home-template #secondary .post-card--small:first-child {
	padding-top: 0 !important;
}

.journal-home-template #secondary .post-card--small:last-child {
	padding-bottom: 0 !important;
	border-bottom: 0 !important;
}

.journal-home-template #secondary .post-card--small:has(.post-card__thumbnail) {
	grid-template-columns: 92px minmax(0, 1fr) !important;
	gap: 14px !important;
}

.journal-home-template #secondary .post-card--small .post-card__thumbnail,
.journal-home-template #secondary .post-card--small .post-card__thumbnail a,
.journal-home-template #secondary .post-card--small .post-card__thumbnail img {
	display: block !important;
	width: 92px !important;
	min-width: 92px !important;
	max-width: 92px !important;
	height: 92px !important;
	min-height: 92px !important;
	max-height: 92px !important;
	margin: 0 !important;
	border-radius: 0 !important;
}

.journal-home-template #secondary .post-card--small .post-card__thumbnail img {
	object-fit: cover !important;
}

.journal-home-template #secondary .post-card--small .post-card__body {
	display: block !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
}

.journal-home-template #secondary .post-card__category {
	display: block !important;
	margin: 0 0 6px !important;
	padding: 0 !important;
	color: var(--js-accent, #ef5b40) !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	line-height: 1.25 !important;
	letter-spacing: .035em !important;
	text-transform: uppercase !important;
}

.journal-home-template #secondary .post-card__title {
	margin: 0 0 9px !important;
	padding: 0 !important;
	color: #171717 !important;
	font-size: 15px !important;
	font-weight: 750 !important;
	line-height: 1.32 !important;
	letter-spacing: -.012em !important;
}

.journal-home-template #secondary .post-card__title a {
	color: inherit !important;
	text-decoration: none !important;
}

.journal-home-template #secondary .post-card__title a:hover {
	color: var(--js-accent, #ef5b40) !important;
}

.journal-home-template #secondary .post-card__meta {
	display: flex !important;
	align-items: center !important;
	gap: 14px !important;
	margin: 0 !important;
	padding: 0 !important;
	color: #8a8a8a !important;
	font-size: 12px !important;
	line-height: 1.3 !important;
}

.journal-home-template #secondary .post-card__meta > * {
	margin: 0 !important;
}

/* Vertical Reboot sections stay inside the main feed and become carousels. */
.journal-home-template .journal-home__row--vertical {
	position: relative;
}

.journal-home-template .journal-home__row--vertical .section-block__header {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 20px !important;
	margin-bottom: 20px !important;
}

.journal-home-template .journal-home__row--vertical .post-cards--vertical {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 16px;
	width: 100%;
	margin: 0;
	padding: 0 0 4px !important;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.journal-home-template .journal-home__row--vertical .post-cards--vertical::-webkit-scrollbar {
	display: none;
}

html body.journal-home-template #page.site .journal-home__row--vertical .post-cards.post-cards--vertical {
	gap: 16px !important;
	padding: 0 0 4px !important;
}

.journal-home-template .journal-home__row--vertical .post-cards--vertical > .post-card--vertical {
	position: relative !important;
	display: block !important;
	flex: 0 0 calc((100% - 48px) / 4) !important;
	width: auto !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: #292929 !important;
	box-shadow: none !important;
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
	aspect-ratio: 3 / 4;
	scroll-snap-align: start;
	opacity: 1 !important;
	visibility: visible !important;
	transform: none !important;
}

/* Reboot sets desktop flex-basis/min-width with high specificity. */
html body.journal-home-template #page.site .journal-home__row--vertical .post-cards--vertical > .post-card.post-card--vertical {
	flex-grow: 0 !important;
	flex-shrink: 0 !important;
	flex-basis: calc((100% - 48px) / 4) !important;
	width: calc((100% - 48px) / 4) !important;
	min-width: calc((100% - 48px) / 4) !important;
	max-width: calc((100% - 48px) / 4) !important;
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
}

.journal-home-template .journal-home__row--vertical .post-cards--vertical > .post-card--vertical::after {
	content: "";
	position: absolute;
	z-index: 1;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(0, 0, 0, .02) 26%, rgba(0, 0, 0, .84) 100%);
}

.journal-home-template .journal-home__row--vertical .post-card--vertical .post-card__thumbnail,
.journal-home-template .journal-home__row--vertical .post-card--vertical .post-card__thumbnail a,
.journal-home-template .journal-home__row--vertical .post-card--vertical .post-card__thumbnail img {
	position: absolute !important;
	inset: 0 !important;
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	min-height: 100% !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
}

.journal-home-template .journal-home__row--vertical .post-card--vertical .post-card__thumbnail img {
	object-fit: cover !important;
	transition: transform .3s ease !important;
}

.journal-home-template .journal-home__row--vertical .post-card--vertical .post-card__title {
	position: absolute !important;
	z-index: 2 !important;
	right: 16px !important;
	bottom: 16px !important;
	left: 16px !important;
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	color: #fff !important;
	opacity: 1 !important;
	visibility: visible !important;
	-webkit-text-fill-color: #fff !important;
	font-size: 16px !important;
	font-weight: 800 !important;
	line-height: 1.32 !important;
	letter-spacing: -.018em !important;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .35) !important;
}

html body.journal-home-template #page.site .journal-home__row--vertical .post-card--vertical .post-card__title {
	font-size: 16px !important;
	line-height: 1.32 !important;
}

.journal-home-template .journal-home__row--vertical .post-card--vertical .post-card__title a {
	color: #fff !important;
	opacity: 1 !important;
	visibility: visible !important;
	-webkit-text-fill-color: #fff !important;
	font-size: 16px !important;
	font-weight: 800 !important;
	line-height: 1.32 !important;
	letter-spacing: -.018em !important;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .35) !important;
	text-decoration: none !important;
}

.journal-home-template .journal-home__row--vertical .post-card--vertical .post-card__title a:visited,
.journal-home-template .journal-home__row--vertical .post-card--vertical .post-card__title a:hover,
.journal-home-template .journal-home__row--vertical .post-card--vertical .post-card__title a:focus {
	color: #fff !important;
	-webkit-text-fill-color: #fff !important;
}

/*
 * Final home-template overrides for the shared child-theme shelf rules.
 * style.css uses body.home selectors with !important on desktop; without an
 * equally explicit template selector it restores 42px shelf padding and puts
 * the title on the same stacking layer as the dark card overlay.
 */
html body.home.journal-home-template #page.site .journal-home__row > .section-block.section-posts {
	margin: 0 !important;
	padding: 0 !important;
}

html body.home.journal-home-template #page.site .journal-home__row--vertical .section-block__header {
	margin: 0 0 20px !important;
}

html body.home.journal-home-template #page.site .journal-home__row--vertical .post-card.post-card--vertical > .post-card__title {
	z-index: 3 !important;
	color: #fff !important;
	opacity: 1 !important;
	-webkit-text-fill-color: #fff !important;
}

html body.home.journal-home-template #page.site .journal-home__row--vertical .post-card.post-card--vertical > .post-card__title > a {
	color: #fff !important;
	opacity: 1 !important;
	-webkit-text-fill-color: #fff !important;
}

.journal-home-template .journal-home__row--vertical .post-card--vertical .post-card__meta,
.journal-home-template .journal-home__row--vertical .post-card--vertical .post-card__description,
.journal-home-template .journal-home__row--vertical .post-card--vertical .post-card__category {
	display: none !important;
}

.journal-home-template .journal-home__row--vertical .post-card--vertical:hover .post-card__thumbnail img {
	transform: scale(1.04) !important;
}

.journal-home-template .journal-home-carousel__navigation {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

.journal-home-template .journal-home-carousel__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	border: 1px solid #d8d8d8;
	border-radius: 50%;
	background: #fff;
	color: #171717;
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
	box-shadow: none;
	cursor: pointer;
	transition: color .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
}

.journal-home-template .journal-home-carousel__button:hover {
	border-color: var(--js-accent, #ef5b40);
	background: var(--js-accent, #ef5b40);
	color: #fff;
}

.journal-home-template .journal-home-carousel__button[disabled] {
	opacity: .3;
	cursor: default;
}

/* Safe fallback below the requested desktop breakpoint. */
@media (max-width: 991px) {
	.journal-home-template .journal-home__constructor {
		gap: 28px;
	}

	.journal-home-template #secondary {
		margin-top: 28px;
	}

	.journal-home-template .journal-home-carousel__button {
		display: none;
	}

	.journal-home-template .journal-home__row--vertical .post-cards--vertical > .post-card--vertical {
		flex-basis: 76% !important;
	}

	html body.journal-home-template #page.site .journal-home__row--vertical .post-cards--vertical > .post-card.post-card--vertical {
		flex-basis: 76% !important;
		width: 76% !important;
		min-width: 76% !important;
		max-width: 76% !important;
	}
}

/* Keep the dedicated homepage cards inside the mobile content rail. */
@media (max-width: 767px) {
	html body.home.journal-home-template #page.site #main .section-posts {
		width: 100% !important;
		max-width: 100% !important;
		margin-right: 0 !important;
		margin-left: 0 !important;
		padding-right: 0 !important;
		padding-left: 0 !important;
		box-sizing: border-box !important;
	}

	html body.home.journal-home-template #page.site .journal-home__row--horizontal .post-cards.post-cards--horizontal {
		display: flex !important;
		flex-direction: column !important;
		gap: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	html body.home.journal-home-template #page.site .journal-home__row--horizontal .post-cards--horizontal > .post-card.post-card--horizontal {
		display: grid !important;
		grid-template-columns: 124px minmax(0, 1fr) !important;
		column-gap: 14px !important;
		align-items: start !important;
		width: 100% !important;
		min-width: 0 !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 18px 0 !important;
		box-sizing: border-box !important;
	}

	html body.home.journal-home-template #page.site .journal-home__row--horizontal .post-card--horizontal .post-card__thumbnail,
	html body.home.journal-home-template #page.site .journal-home__row--horizontal .post-card--horizontal .post-card__thumbnail a,
	html body.home.journal-home-template #page.site .journal-home__row--horizontal .post-card--horizontal .post-card__thumbnail img {
		display: block !important;
		width: 124px !important;
		min-width: 124px !important;
		max-width: 124px !important;
		height: 82px !important;
		min-height: 82px !important;
		max-height: 82px !important;
		margin: 0 !important;
		padding: 0 !important;
		border-radius: 0 !important;
		object-fit: cover !important;
	}

	html body.home.journal-home-template #page.site .journal-home__row--horizontal .post-card--horizontal .post-card__body {
		display: block !important;
		width: auto !important;
		min-width: 0 !important;
		margin: 0 0 15px !important;
		padding: 0 !important;
	}

	html body.home.journal-home-template #page.site .journal-home__row--horizontal .post-card--horizontal .post-card__title {
		display: block !important;
		grid-column: auto !important;
		margin: 0 0 8px !important;
		font-size: 17px !important;
		line-height: 1.25 !important;
	}

	html body.home.journal-home-template #page.site .journal-home__row--horizontal .post-card--horizontal .post-card__meta {
		display: block !important;
		grid-column: auto !important;
		width: auto !important;
		margin: 0 0 10px !important;
		padding: 0 !important;
		font-size: 13px !important;
		line-height: 1.5 !important;
	}
}
