/**
 * Psykpatient V2 – startsida.
 *
 * Laddas endast på is_front_page(). Alla selektorer är avgränsade till
 * .home-v2 eller startsidans header för att övriga vyer ska lämnas orörda.
 */

/* ─────── STARTSIDANS HEADER ─────── */
.home .site-header {
	position: sticky;
	top: 0;
	background: color-mix(in srgb, var(--bg) 94%, transparent);
	backdrop-filter: blur(14px) saturate(130%);
	-webkit-backdrop-filter: blur(14px) saturate(130%);
}

.home .site-header-inner {
	min-height: 78px;
}

.home .site-header-left {
	min-width: 240px;
}

.home .site-header-brand {
	display: inline-flex;
	align-items: center;
	gap: 11px;
	color: inherit;
}

.home .site-header-brand:hover {
	color: inherit;
}

.home .site-header-brand-icon {
	display: block;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
}

.home .site-header-brand-icon-placeholder {
	display: inline-grid;
	width: 44px;
	height: 44px;
	place-items: center;
	border-radius: 50%;
	background: var(--accent);
	color: #fff;
}

.home .site-header-brand-name {
	font-family: var(--serif);
	font-size: 28px;
	font-weight: 650;
	letter-spacing: -0.03em;
	white-space: nowrap;
}

/* ─────── RAM ─────── */
.home-v2 {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 44px var(--gutter) 72px;
}

.home-v2 a:focus-visible,
.home .site-header a:focus-visible,
.home .site-header button:focus-visible,
.home .site-header input:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 4px;
}

.home-v2-kicker,
.home-v2-eyebrow,
.home-v2-card-kicker {
	margin: 0;
	font-family: var(--sans);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.16em;
	line-height: 1.35;
	text-transform: uppercase;
	color: var(--accent);
}

.home-v2-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	min-height: 48px;
	padding: 11px 20px;
	border: 1px solid var(--accent);
	border-radius: 3px;
	background: var(--accent);
	color: #fff;
	font-family: var(--sans);
	font-size: 14px;
	font-weight: 650;
	line-height: 1.2;
	transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.home-v2-button:hover {
	background: var(--accent-hover);
	border-color: var(--accent-hover);
	color: #fff;
	transform: translateY(-1px);
}

/* ─────── HUVUDARTIKEL ─────── */
.home-v2-hero {
	display: grid;
	grid-template-columns: minmax(0, 0.88fr) minmax(440px, 1.12fr);
	min-height: 470px;
	border-bottom: 1px solid var(--rule);
}

.home-v2-hero-copy {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	padding: 36px 50px 40px 0;
}

.home-v2-kicker {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 18px;
}

.home-v2-kicker::after {
	content: "";
	display: block;
	width: 48px;
	height: 1px;
	background: var(--ink-faint);
}

.home-v2-hero h1 {
	max-width: 690px;
	margin: 0 0 20px;
	font-family: var(--serif);
	font-size: clamp(42px, 4.4vw, 68px);
	font-weight: 650;
	letter-spacing: -0.035em;
	line-height: 0.98;
}

.home-v2-hero h1 a {
	color: var(--ink);
}

.home-v2-hero h1 a:hover {
	color: var(--accent);
}

.home-v2-hero-excerpt {
	max-width: 620px;
	margin: 0 0 28px;
	color: var(--ink-soft);
	font-size: 16px;
	line-height: 1.65;
}

.home-v2-hero-media {
	position: relative;
	display: block;
	min-height: 420px;
	overflow: hidden;
	background: var(--bg-elev);
}

.home-v2-hero-media::after {
	content: "";
	position: absolute;
	inset: 0;
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rule) 65%, transparent);
	pointer-events: none;
}

.home-v2-hero-image {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 470px;
	object-fit: cover;
	filter: saturate(0.72) contrast(1.03);
	transition: transform 500ms ease, filter 300ms ease;
}

.home-v2-hero-media:hover .home-v2-hero-image {
	transform: scale(1.015);
	filter: saturate(0.9) contrast(1.03);
}

/* ─────── REDAKTIONENS LÄGE ─────── */
.home-v2-status {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(330px, 0.65fr);
	align-items: center;
	gap: 10px 28px;
	margin: 24px 0 48px;
	padding: 18px 22px;
	border: 1px solid var(--rule);
	background: var(--bg-raise);
}

.home-v2-status-intro {
	display: block;
}

.home-v2-status h2,
.home-v2-section-head h2,
.home-v2-submit h2 {
	margin: 5px 0 0;
	font-family: var(--serif);
	font-weight: 620;
	letter-spacing: -0.025em;
	line-height: 1.1;
}

.home-v2-status h2 {
	font-size: clamp(24px, 2.2vw, 30px);
}

.home-v2-status-intro > p {
	max-width: 620px;
	margin: 7px 0 0;
	color: var(--ink-soft);
	font-size: 13px;
	line-height: 1.5;
}

.home-v2-status-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	padding-top: 0;
}

.home-v2-status-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 70px;
	padding: 4px 18px;
	text-align: center;
	border-left: 1px solid var(--rule);
}

.home-v2-status-item:first-child {
	border-left: 0;
}

.home-v2-status-item strong {
	font-family: var(--serif);
	font-size: 38px;
	font-weight: 580;
	letter-spacing: -0.04em;
	line-height: 1;
	color: var(--ink);
}

.home-v2-status-item .home-v2-status-value-text {
	font-size: 29px;
	letter-spacing: -0.025em;
}

.home-v2-status-item span {
	margin-top: 6px;
	color: var(--ink-soft);
	font-family: var(--serif);
	font-size: 13px;
	line-height: 1.25;
}

.home-v2-status-note {
	grid-column: 1 / -1;
	margin: 0;
	color: var(--ink-faint);
	font-size: 11px;
	text-align: right;
}

/* ─────── SEKTIONSRUBRIKER ─────── */
.home-v2-section {
	margin-top: 0;
}

.home-v2-section-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 24px;
	padding-bottom: 15px;
	border-bottom: 1px solid var(--rule);
}

.home-v2-section-head h2 {
	font-size: clamp(30px, 3vw, 42px);
}

.home-v2-section-actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 18px;
	padding-bottom: 4px;
}

.home-v2-article-count {
	color: var(--ink-soft);
	font-family: var(--sans);
	font-size: 12px;
	font-weight: 650;
	white-space: nowrap;
}

.home-v2-section-link {
	flex: 0 0 auto;
	color: var(--ink-soft);
	font-family: var(--sans);
	font-size: 12px;
	font-weight: 650;
	white-space: nowrap;
}

.home-v2-section-link:hover {
	color: var(--accent);
}

/* ─────── ARTIKELKORT ─────── */
.home-v2-card-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

.home-v2-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	border: 1px solid var(--rule);
	background: var(--bg-raise);
	transition: border-color 180ms ease, transform 180ms ease;
}

.home-v2-card:hover {
	border-color: color-mix(in srgb, var(--accent) 65%, var(--rule));
	transform: translateY(-2px);
}

.home-v2-card-media {
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--bg-elev);
}

.home-v2-card-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: saturate(0.78);
	transition: transform 400ms ease, filter 250ms ease;
}

.home-v2-card:hover .home-v2-card-media img {
	transform: scale(1.02);
	filter: saturate(0.95);
}

.home-v2-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 21px 22px 20px;
}

.home-v2-card-kicker {
	margin-bottom: 9px;
	font-size: 10px;
}

.home-v2-card h3 {
	margin: 0 0 9px;
	font-family: var(--serif);
	font-size: 23px;
	font-weight: 610;
	letter-spacing: -0.02em;
	line-height: 1.12;
}

.home-v2-card h3 a,
.home-v2-story-item h3 a {
	color: var(--ink);
}

.home-v2-card h3 a:hover,
.home-v2-story-item h3 a:hover {
	color: var(--accent);
}

.home-v2-card-body > p:not(.home-v2-card-kicker) {
	margin: 0 0 18px;
	color: var(--ink-soft);
	font-size: 13px;
	line-height: 1.55;
}

.home-v2-card-meta {
	margin-top: auto;
	color: var(--ink-faint);
	font-family: var(--sans);
	font-size: 11px;
	line-height: 1.4;
}

/* ─────── PATIENTBERÄTTELSER + CTA ─────── */
.home-v2-stories {
	display: grid;
	grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.7fr);
	gap: 0;
	margin-top: 48px;
	border: 1px solid var(--rule);
	background: var(--bg-raise);
}

.home-v2-stories-list {
	padding: 28px 30px 30px;
}

.home-v2-section-head-compact {
	margin-bottom: 4px;
}

.home-v2-section-head-compact h2 {
	font-size: clamp(27px, 2.8vw, 36px);
}

.home-v2-story-items {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
}

.home-v2-story-item {
	padding: 24px 28px 8px 0;
}

.home-v2-story-item + .home-v2-story-item {
	padding-right: 0;
	padding-left: 28px;
	border-left: 1px solid var(--rule-soft);
}

.home-v2-story-item h3 {
	margin: 0 0 10px;
	font-family: var(--serif);
	font-size: 24px;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.15;
}

.home-v2-story-item > p {
	margin: 0 0 18px;
	color: var(--ink-soft);
	font-size: 14px;
	line-height: 1.6;
}

.home-v2-submit {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	padding: 34px 36px;
	border-left: 1px solid var(--rule);
	background: var(--bg-elev);
}

.home-v2-submit h2 {
	margin-top: 7px;
	font-size: 31px;
}

.home-v2-submit > p:not(.home-v2-eyebrow) {
	margin: 15px 0 24px;
	color: var(--ink-soft);
	font-size: 14px;
	line-height: 1.6;
}

/* ─────── RESPONSIVT ─────── */
@media (max-width: 1120px) {
	.home .site-header-left {
		min-width: 180px;
	}

	.home .site-header-brand-name {
		font-size: 24px;
	}

	.home-v2-hero {
		grid-template-columns: minmax(0, 0.92fr) minmax(390px, 1.08fr);
	}

	.home-v2-hero-copy {
		padding-right: 36px;
	}
}

@media (max-width: 900px) {
	.home .site-header-inner {
		min-height: 66px;
	}

	.home .site-header-left {
		min-width: 0;
	}

	.home .site-header-brand-name {
		font-size: 23px;
	}

	.home-v2 {
		padding-top: 24px;
	}

	.home-v2-hero {
		grid-template-columns: 1fr;
		min-height: 0;
	}

	.home-v2-hero-copy {
		padding: 32px 0 30px;
	}

	.home-v2-hero-media,
	.home-v2-hero-image {
		min-height: 390px;
	}

	.home-v2-status-intro {
		display: block;
	}

	.home-v2-status {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.home-v2-status-grid {
		margin-top: 14px;
		padding-top: 14px;
		border-top: 1px solid var(--rule-soft);
	}

	.home-v2-status-note {
		margin-top: 10px;
	}

	.home-v2-card-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.home-v2-card:last-child {
		grid-column: 1 / -1;
	}

	.home-v2-stories {
		grid-template-columns: 1fr;
	}

	.home-v2-submit {
		border-top: 1px solid var(--rule);
		border-left: 0;
	}
}

@media (max-width: 640px) {
	.home .site-header-brand-icon {
		width: 38px;
		height: 38px;
	}

	.home .site-header-brand-name {
		display: none;
	}

	.home .site-header-search {
		display: none;
	}

	.home .site-header .theme-toggle {
		padding: 7px 9px;
	}

	.home-v2 {
		padding: 12px var(--gutter) 48px;
	}

	.home-v2-hero h1 {
		font-size: clamp(38px, 12vw, 52px);
	}

	.home-v2-hero-media,
	.home-v2-hero-image {
		min-height: 250px;
	}

	.home-v2-status {
		margin: 20px 0 38px;
		padding: 18px 16px;
	}

	.home-v2-status-grid {
		grid-template-columns: 1fr 1fr;
	}

	.home-v2-status-item {
		min-height: 76px;
		border-top: 1px solid var(--rule-soft);
	}

	.home-v2-status-item:nth-child(odd) {
		border-left: 0;
	}

	.home-v2-status-item:nth-child(-n + 2) {
		border-top: 0;
	}

	.home-v2-section-head {
		align-items: flex-start;
		flex-direction: column;
		gap: 12px;
	}

	.home-v2-section-actions {
		justify-content: space-between;
		width: 100%;
		padding-bottom: 0;
	}

	.home-v2-card-grid,
	.home-v2-story-items {
		grid-template-columns: 1fr;
	}

	.home-v2-card:last-child {
		grid-column: auto;
	}

	.home-v2-story-item,
	.home-v2-story-item + .home-v2-story-item {
		padding: 22px 0;
		border-left: 0;
	}

	.home-v2-story-item + .home-v2-story-item {
		border-top: 1px solid var(--rule-soft);
	}

	.home-v2-stories-list,
	.home-v2-submit {
		padding: 24px 20px;
	}
}

/* På riktigt smala skärmar blir uppgifterna tydligare som kompakta rader. */
@media (max-width: 420px) {
	.home-v2-status {
		padding: 22px 16px 18px;
	}

	.home-v2-status-grid {
		grid-template-columns: 1fr;
		padding-top: 14px;
	}

	.home-v2-status-item:nth-child(n) {
		min-height: 0;
		padding: 14px 2px;
		flex-direction: row;
		justify-content: flex-start;
		gap: 14px;
		border-top: 1px solid var(--rule-soft);
		border-left: 0;
		text-align: left;
	}

	.home-v2-status-item:first-child {
		border-top: 0;
	}

	.home-v2-status-item strong {
		flex: 0 0 38px;
		font-size: 34px;
		text-align: center;
	}

	.home-v2-status-item .home-v2-status-value-text {
		flex-basis: 94px;
		font-size: 24px;
	}

	.home-v2-status-item span {
		margin-top: 0;
		font-size: 14px;
	}

	.home-v2-status-note {
		margin-top: 12px;
		text-align: left;
	}
}

@media (prefers-reduced-motion: reduce) {
	.home-v2 *,
	.home-v2 *::before,
	.home-v2 *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.001ms !important;
	}
}

@media print {
	.home-v2-status,
	.home-v2-submit {
		break-inside: avoid;
	}
}
