/**
 * Homepage composition fixes after the first real WordPress previews.
 * Loaded last so the relaunch can reliably escape GeneratePress content columns.
 */

/* Release GeneratePress even if the body helper class is missing. */
body:has(.sc-page.sc-home) .site.grid-container,
body:has(.sc-page.sc-home) .site-content.grid-container,
body:has(.sc-page.sc-home) .site-content,
body:has(.sc-page.sc-home) #primary,
body:has(.sc-page.sc-home) .content-area,
body:has(.sc-page.sc-home) .site-main,
body:has(.sc-page.sc-home) .inside-article,
body:has(.sc-page.sc-home) .entry-content {
	float: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	max-width: none !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	width: 100% !important;
}

body:has(.sc-page.sc-home) .site-content { display: block !important; }
body:has(.sc-page.sc-home) .widget-area,
body:has(.sc-page.sc-home) #right-sidebar,
body:has(.sc-page.sc-home) #left-sidebar { display: none !important; }

/*
 * Gutenberg can still constrain the first block inside entry-content even when
 * all GeneratePress wrappers are released. The relaunch root itself therefore
 * performs the viewport breakout once, and every full-width section can then
 * use normal width:100% instead of fighting nested content widths.
 */
body:has(.sc-page.sc-home) .entry-content > .sc-page.sc-home {
	left: 50% !important;
	margin-left: -50vw !important;
	margin-right: -50vw !important;
	max-width: none !important;
	position: relative !important;
	right: 50% !important;
	width: 100vw !important;
}

.sc-page.sc-home {
	max-width: none !important;
}

.sc-page.sc-home .alignfull,
.sc-page.sc-home > .alignfull,
.sc-page.sc-home .sc-hero-video,
.sc-page.sc-home .sc-newsletter-section,
.sc-page.sc-home .sc-home-finale {
	left: auto !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	max-width: none !important;
	right: auto !important;
	width: 100% !important;
}

/* Hero: actual cinematic opening. */
.sc-page.sc-home .sc-hero-video {
	border-radius: 0 !important;
	min-height: min(880px, 88svh) !important;
}
.sc-page.sc-home .sc-hero-video__inner { max-width: none !important; width: 100% !important; }
.sc-page.sc-home .sc-home-hero__content {
	margin: 0 auto !important;
	max-width: 1320px !important;
	padding: 0 clamp(1.5rem, 5vw, 5rem) !important;
	width: 100% !important;
}

.sc-page.sc-home .sc-home-hero__welcome,
.sc-page.sc-home .sc-home-section-title,
.sc-page.sc-home .sc-newsletter__headline,
.sc-page.sc-home .sc-home-finale__headline,
.sc-page.sc-home .sc-category-card h2,
.sc-page.sc-home .sc-home-stories__heading h2 {
	font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif !important;
}

.sc-page.sc-home .sc-home-hero__welcome {
	font-size: clamp(4rem, 7vw, 7rem) !important;
	font-weight: 400 !important;
	letter-spacing: -0.045em !important;
}

/* Existing test page still contains the old explanatory invitation heading. */
.sc-page.sc-home .sc-home-invitations__heading { display: none !important; }

/* Topic doors: visual Croatia first, labels second. */
.sc-page.sc-home .sc-home-opening {
	padding: clamp(3.25rem, 5vw, 5rem) 0 clamp(5rem, 8vw, 8rem) !important;
}
.sc-page.sc-home .sc-home-invitations > .sc-container,
.sc-page.sc-home .sc-home-stories > .sc-container {
	margin-inline: auto !important;
	max-width: 1320px !important;
	width: min(calc(100% - 3rem), 1320px) !important;
}
.sc-page.sc-home .sc-home-section-title {
	font-size: clamp(2rem, 3.2vw, 3.7rem) !important;
	font-weight: 400 !important;
	margin: 0 0 clamp(2rem, 4vw, 3.5rem) !important;
	max-width: none !important;
}

.sc-page.sc-home .sc-home-invitations .sc-category-grid {
	display: grid !important;
	gap: clamp(1rem, 1.5vw, 1.5rem) !important;
	grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
	max-width: none !important;
	width: 100% !important;
}
.sc-page.sc-home .sc-home-invitations .sc-category-grid > .sc-category-item:nth-child(1) { grid-column: span 7 !important; }
.sc-page.sc-home .sc-home-invitations .sc-category-grid > .sc-category-item:nth-child(2) { grid-column: span 5 !important; }
.sc-page.sc-home .sc-home-invitations .sc-category-grid > .sc-category-item:nth-child(3) { grid-column: span 4 !important; }
.sc-page.sc-home .sc-home-invitations .sc-category-grid > .sc-category-item:nth-child(4) { grid-column: span 4 !important; }
.sc-page.sc-home .sc-home-invitations .sc-category-grid > .sc-category-item:nth-child(5) { grid-column: span 4 !important; }

.sc-page.sc-home .sc-home-invitations .sc-category-card {
	background: #36524f !important;
	border-radius: 22px !important;
	box-shadow: 0 18px 45px rgba(24,49,47,.12) !important;
	isolation: isolate;
	min-height: clamp(270px, 28vw, 410px) !important;
	overflow: hidden;
	padding: 0 !important;
	position: relative;
}
.sc-page.sc-home .sc-category-card__image {
	height: 100%;
	inset: 0;
	object-fit: cover;
	position: absolute;
	transition: transform 700ms cubic-bezier(.2,.7,.2,1);
	width: 100%;
	z-index: -3;
}
.sc-page.sc-home .sc-category-card__shade {
	background: linear-gradient(180deg, rgba(12,29,28,.04) 18%, rgba(12,29,28,.8) 100%);
	inset: 0;
	position: absolute;
	z-index: -2;
}
.sc-page.sc-home .sc-category-card__content {
	align-items: flex-end;
	display: flex;
	height: 100%;
	padding: clamp(1.6rem, 2.6vw, 2.5rem);
	width: 100%;
}
.sc-page.sc-home .sc-category-card h2 {
	color: #fffdf8 !important;
	font-size: clamp(2rem, 3vw, 3.5rem) !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	margin: 0 !important;
	max-width: 11ch !important;
}
.sc-page.sc-home .sc-category-card:hover .sc-category-card__image,
.sc-page.sc-home .sc-category-card:focus-within .sc-category-card__image { transform: scale(1.035); }

/* Keep the editorial moment close to the content around it. */
.sc-page.sc-home .sc-home-moment-section {
	padding: clamp(2rem, 4vw, 4rem) 1rem clamp(5rem, 7vw, 7rem) !important;
}

/* Real articles are now visible before manual curation. */
.sc-page.sc-home .sc-home-stories {
	padding: clamp(4.5rem, 6vw, 6rem) 0 clamp(6rem, 8vw, 8rem) !important;
}
.sc-page.sc-home .sc-home-stories__heading {
	margin: 0 0 clamp(2rem, 3vw, 3rem) !important;
	max-width: none !important;
}
.sc-page.sc-home .sc-home-stories__heading h2 {
	font-size: clamp(2rem, 3.2vw, 3.7rem) !important;
	font-weight: 400 !important;
	margin: 0 !important;
	max-width: none !important;
}

/*
 * Dynamic blocks inside a constrained Gutenberg group otherwise inherit the
 * theme content width. That was squeezing the story cards to a few characters
 * per line in the real preview.
 */
.sc-page.sc-home .sc-home-stories > .sc-container > .sc-featured-stories,
.sc-page.sc-home .sc-home-stories .sc-featured-stories {
	max-width: none !important;
	width: 100% !important;
}
.sc-page.sc-home .sc-featured-stories {
	align-items: stretch !important;
	display: grid !important;
	gap: clamp(1.25rem, 2vw, 2rem) !important;
	grid-template-columns: minmax(0, 1.55fr) minmax(360px, .85fr) !important;
}
.sc-page.sc-home .sc-featured-stories__lead,
.sc-page.sc-home .sc-featured-stories__side,
.sc-page.sc-home .sc-featured-story,
.sc-page.sc-home .sc-featured-story__body {
	max-width: none !important;
	min-width: 0 !important;
	width: 100% !important;
}
.sc-page.sc-home .sc-featured-stories__side {
	display: grid !important;
	gap: clamp(1.25rem, 2vw, 2rem) !important;
	grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
}
.sc-page.sc-home .sc-featured-story--small {
	grid-template-columns: minmax(190px, .9fr) minmax(260px, 1.1fr) !important;
}
.sc-page.sc-home .sc-featured-story h3,
.sc-page.sc-home .sc-featured-story p {
	overflow-wrap: normal !important;
	word-break: normal !important;
}

/* Newsletter: atmospheric but not a giant poster. */
.sc-page.sc-home .sc-newsletter-section { padding: clamp(4.5rem, 7vw, 7rem) 0 !important; }
.sc-page.sc-home .sc-newsletter-section .sc-newsletter {
	grid-template-columns: minmax(0, 1.05fr) minmax(360px, .75fr) !important;
	gap: clamp(3rem, 5vw, 5rem) !important;
	margin-inline: auto !important;
	max-width: 1180px !important;
	padding-inline: 1.5rem !important;
	width: 100% !important;
}
.sc-page.sc-home .sc-newsletter__headline {
	font-size: clamp(2.8rem, 4.3vw, 4.8rem) !important;
	font-weight: 400 !important;
	line-height: 1.02 !important;
	max-width: 13ch !important;
}
.sc-page.sc-home .sc-newsletter__paper-title {
	font-size: clamp(2rem, 2.6vw, 2.7rem) !important;
	max-width: none !important;
	white-space: nowrap;
}

/* Closing line: present, but no campaign-poster scale. */
.sc-page.sc-home .sc-home-finale { padding: clamp(5.5rem, 8vw, 8rem) 1.5rem !important; }
.sc-page.sc-home .sc-home-finale__inner {
	margin-inline: auto !important;
	max-width: 900px !important;
	width: 100% !important;
}
.sc-page.sc-home .sc-home-finale .sc-home-finale__headline {
	font-size: clamp(3.4rem, 6vw, 6.4rem) !important;
	font-weight: 400 !important;
	line-height: .96 !important;
	max-width: 11ch !important;
}

@media (max-width: 1024px) {
	.sc-page.sc-home .sc-featured-stories { grid-template-columns: 1fr !important; }
	.sc-page.sc-home .sc-featured-stories__side {
		grid-template-columns: repeat(2, minmax(0,1fr)) !important;
		grid-template-rows: none !important;
	}
	.sc-page.sc-home .sc-featured-story--small {
		grid-template-columns: 1fr !important;
		grid-template-rows: 240px auto !important;
	}
}

@media (max-width: 900px) {
	.sc-page.sc-home .sc-home-invitations .sc-category-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
	.sc-page.sc-home .sc-home-invitations .sc-category-grid > .sc-category-item { grid-column: auto !important; }
	.sc-page.sc-home .sc-home-invitations .sc-category-grid > .sc-category-item:last-child { grid-column: 1 / -1 !important; }
	.sc-page.sc-home .sc-newsletter-section .sc-newsletter { grid-template-columns: 1fr !important; max-width: 760px !important; }
}
@media (max-width: 620px) {
	.sc-page.sc-home .sc-home-invitations > .sc-container,
	.sc-page.sc-home .sc-home-stories > .sc-container { width: min(calc(100% - 1.5rem),1320px) !important; }
	.sc-page.sc-home .sc-home-invitations .sc-category-grid { grid-template-columns: 1fr !important; }
	.sc-page.sc-home .sc-home-invitations .sc-category-grid > .sc-category-item:last-child { grid-column: auto !important; }
	.sc-page.sc-home .sc-featured-stories__side { grid-template-columns: 1fr !important; }
	.sc-page.sc-home .sc-newsletter__paper-title { white-space: normal; }
}
