/**
 * Seniorenwohnkompass - Homepage Styles
 * Pixel-perfect match to Pencil mockup (xZmTg)
 * WCAG 2.1 AA | Senior-Friendly
 */

/* ========================================
   1. CSS VARIABLES (DESIGN SYSTEM)
======================================== */

:root {
	/* Colors - Primary (Terracotta) */
	--swk-color-primary: #D8704F;
	--swk-color-primary-dark: #B85A3D;
	--swk-color-primary-light: #E89578;

	/* Colors - Secondary (Olive Green) */
	--swk-color-secondary: #8A9A5B;
	--swk-color-secondary-dark: #6F7D48;

	/* Colors - Accent (Warm Gold) */
	--swk-color-accent: #D4A574;

	/* Colors - Backgrounds */
	--swk-color-bg-sand: #F5EDE3;
	--swk-color-bg-cream: #FAF7F2;

	/* Colors - Text (Warm Tones) */
	--swk-color-text-dark: #2C1A0E;
	--swk-color-text-body: #4A4743;
	--swk-color-text-card: #4E4C4A;
	--swk-color-text-muted: #8A8580;

	/* Colors - Borders */
	--swk-color-border: #D8CFC1;

	/* Typography */
	--font-primary: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;

	/* Border Radius */
	--radius-sm: 4px;
	--radius-md: 12px;

	/* Shadows */
	--shadow-sm: 0 1px 2px rgba(42, 36, 32, 0.05);
	--shadow-md: 0 4px 6px rgba(42, 36, 32, 0.08);
	--shadow-lg: 0 10px 15px rgba(42, 36, 32, 0.1);
	--shadow-focus: 0 0 0 3px #FFFFFF, 0 0 0 6px #2C1A0E;

	/* Touch Targets */
	--touch-min: 48px;

	/* Animation */
	--duration-fast: 200ms;
	--duration-base: 300ms;
	--ease-default: ease-out;
}

html {
	scroll-behavior: smooth;
}

html,
body {
	overscroll-behavior: none;
}

/* ========================================
   2. BASE STYLES
======================================== */

.swk-homepage-wrapper {
	font-family: var(--font-primary);
	color: var(--swk-color-text-body);
	font-size: 20px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
	-moz-osx-font-smoothing: grayscale;
}

.swk-homepage-wrapper *,
.swk-homepage-wrapper *::before,
.swk-homepage-wrapper *::after {
	-webkit-tap-highlight-color: transparent;
}

.swk-container {
	max-width: 1280px;
	margin: 0 auto;
	padding-left: 80px;
	padding-right: 80px;
}

/* Accessibility - Screen Reader Only */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* Override Kadence theme link colors (prevent blue hover) */
.swk-homepage-wrapper a {
	color: inherit;
}
@media (hover: hover) {
	.swk-homepage-wrapper a:hover {
		color: inherit;
	}
}

/* Focus States - WCAG AA (no JS dependency) */
*:focus-visible {
	outline: 3px solid #2C1A0E;
	outline-offset: 3px;
	border-radius: var(--radius-sm);
}

/* Skip Link */
.skip-link {
	position: absolute;
	top: -100%;
	left: 16px;
	background: #7A3020;
	color: #FFFFFF;
	padding: 12px 24px;
	border-radius: 0 0 8px 8px;
	z-index: 1000;
	text-decoration: none;
	font-size: 18px;
	font-weight: 600;
}

.skip-link:focus {
	top: 0;
}

.skip-link:focus-visible {
	outline: 3px solid #FFFFFF;
	outline-offset: 3px;
}

/* Inline SVG icons */
.swk-icon {
	display: inline-block;
	vertical-align: middle;
	flex-shrink: 0;
}

/* ========================================
   3. HERO SECTION
   Mockup: PIPka | Gradient 160deg | Padding 140px 80px
======================================== */

.swk-hero-section {
	background: linear-gradient(160deg, var(--swk-color-bg-sand) 0%, var(--swk-color-bg-cream) 100%);
	background-size: 300% 300%;
	animation: swk-hero-gradient 12s ease infinite;
	padding: 140px 80px;
	min-height: 85vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

@keyframes swk-hero-gradient {
	0% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
	100% { background-position: 0% 50%; }
}

.swk-hero-content {
	max-width: 960px;
	text-align: center;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 40px;
}

.swk-hero-headline {
	font-family: var(--font-display);
	font-size: 54px;
	font-weight: 700;
	color: var(--swk-color-text-dark);
	line-height: 1.2;
	margin: 0;
	max-width: 960px;
}

.swk-hero-subheadline {
	font-family: var(--font-primary);
	font-size: 22px;
	color: var(--swk-color-text-body);
	line-height: 1.6;
	margin: 0;
	max-width: 720px;
}

/* CTA Button - Mockup: MQbtT | #B85A3D | padding 16 40 | radius 8 */
.swk-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	cursor: pointer;
	border: none;
	min-height: var(--touch-min);
	transition: all var(--duration-base) var(--ease-default);
}

.swk-btn-primary {
	background: var(--swk-color-primary-dark);
	color: #FFFFFF !important;
	padding: 18px 48px;
	border-radius: 8px;
	font-family: var(--font-primary);
	font-size: 18px;
	font-weight: 600;
	will-change: transform;
	transition: all var(--duration-base) var(--ease-default);
	outline: 2px solid transparent;
	outline-offset: 0px;
}

@media (hover: hover) {
	.swk-btn-primary:hover {
		background: #9A4830 !important;
		color: #FFFFFF !important;
		transform: translateY(-2px);
		outline: 2px solid #9A4830;
		outline-offset: 3px;
	}
}

/* Trust Signals - Mockup: I45Af | gap 40 | icons olive #8A9A5B */
.swk-hero-trust {
	display: flex;
	flex-wrap: nowrap;
	justify-content: center;
	gap: 32px;
}

.swk-trust-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--font-primary);
	font-size: 18px;
	font-weight: 400;
	color: #3A3533;
	white-space: nowrap;
}

/* ========================================
   4. CATEGORIES
   Mockup: 2KuMT | bg #F5EDE3 | padding 64 80 | gap 40
======================================== */

.swk-categories {
	padding: 64px 80px;
	background: var(--swk-color-bg-sand);
}

.swk-section-headline {
	font-family: var(--font-display);
	font-size: 36px;
	font-weight: 700;
	color: var(--swk-color-text-dark);
	text-align: center;
	margin: 0 0 40px 0;
}

/* Mobile-first grid: 1 column, expands to 5 on desktop */
.swk-categories-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

@media (min-width: 768px) and (max-width: 1023px) {
	.swk-categories-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 16px;
	}
}

@media (min-width: 1024px) {
	.swk-categories-grid {
		grid-template-columns: repeat(5, 1fr);
		gap: 20px;
	}
}

.swk-category-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: #FFFFFF;
	border: 1px solid var(--swk-color-border);
	border-radius: var(--radius-md);
	padding: 24px;
	transition: all var(--duration-base) var(--ease-default);
	will-change: transform;
	text-decoration: none;
	color: inherit;
}

@media (hover: hover) {
	.swk-category-card:hover {
		background: #FFFFFF !important;
		color: inherit !important;
		box-shadow: var(--shadow-md);
		transform: translateY(-2px);
		outline: 2px solid #9A4830;
		outline-offset: 3px;
	}
}

/* Mockup: 18px Source Serif 4 600 #2C1A0E */
.swk-category-title {
	font-family: var(--font-display);
	font-size: 18px;
	font-weight: 600;
	color: var(--swk-color-text-dark);
	margin: 0;
}

/* Mockup: 15px DM Sans 400 #4E4C4A | line-height 1.5 | width 192 */
.swk-category-description {
	font-family: var(--font-primary);
	font-size: 17px;
	color: var(--swk-color-text-card);
	margin: 0;
	line-height: 1.5;
	flex-grow: 1;
}

/* Mockup: 16px DM Sans 600 #B85A3D | flex for multiline touch target */
.swk-category-cta {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	font-family: var(--font-primary);
	font-size: 18px;
	font-weight: 600;
	color: var(--swk-color-primary-dark);
	text-decoration: none;
	margin-top: auto;
	min-height: var(--touch-min);
	transition: color var(--duration-fast) var(--ease-default);
	position: relative;
}

.swk-category-cta::after {
	content: '';
	position: absolute;
	bottom: 12px;
	left: 0;
	width: 0;
	height: 2px;
	background: #D8704F;
	transition: width var(--duration-base) var(--ease-default);
}

@media (hover: hover) {
	.swk-category-card:hover .swk-category-cta {
		color: var(--swk-color-primary);
	}

	.swk-category-card:hover .swk-category-cta::after {
		width: 100%;
	}
}

/* ========================================
   4b. CATEGORY FINDER (ACCORDION)
======================================== */

/* Button reset for category tiles (preserve card visuals) */
.swk-category-tile {
	font: inherit;
	cursor: pointer;
	text-align: left;
	width: 100%;
	min-height: 120px;
}

/* Active state: highlighted tile */
.swk-category-tile.is-active {
	border: 2px solid #8A9A5B;
	background-color: #F5F8F0;
	box-shadow: 0 4px 16px rgba(138, 154, 91, 0.25);
}

/* Focus state override for tiles */
.swk-category-tile:focus-visible {
	outline: 3px solid #005FCC;
	outline-offset: 3px;
	border-radius: 4px;
}

/* Subcategory panel (accordion body) */
.swk-subcategory-panel {
	max-height: 0;
	overflow: hidden;
	transition: max-height 350ms ease-in-out, padding 350ms ease-in-out;
	padding: 0;
}

.swk-subcategory-panel.is-open {
	max-height: 600px;
	padding: 24px 0;
}

@media (prefers-reduced-motion: reduce) {
	.swk-subcategory-panel {
		transition: none;
	}
}

/* Sub-tile grid */
.swk-subcategory-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (min-width: 768px) and (max-width: 1023px) {
	.swk-subcategory-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 12px;
	}
}

@media (min-width: 1024px) {
	.swk-subcategory-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 16px;
		max-width: 700px;
		margin: 0 auto;
	}
}

/* Individual sub-tile */
.swk-sub-tile {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 80px;
	padding: 16px;
	background: #FFFFFF;
	border: 1px solid var(--swk-color-border);
	border-radius: var(--radius-md);
	text-decoration: none;
	color: var(--swk-color-text-dark);
	font-family: var(--font-primary);
	font-size: 17px;
	font-weight: 600;
	text-align: center;
	transition: all var(--duration-base) var(--ease-default);
}

@media (hover: hover) {
	.swk-sub-tile:hover {
		border-color: var(--swk-color-secondary);
		background-color: #F5F8F0;
		box-shadow: var(--shadow-md);
		color: var(--swk-color-text-dark);
	}
}

.swk-sub-tile-label {
	line-height: 1.3;
}

/* "Alle X Ratgeber anzeigen" link in subcategory panel */
.swk-subcategory-more {
	text-align: center;
	margin-top: 16px;
}

/* ========================================
   5. LATEST POSTS
   Mockup: 6DtJm | bg #FAF7F2 | padding 64 80 | gap 40
======================================== */

.swk-latest-posts {
	padding: 64px 80px;
	background: var(--swk-color-bg-cream);
}

/* Mockup: 3 columns, gap 24px, 2 rows */
.swk-posts-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

/* Mockup: White, border 1px #D8CFC1, radius 12, clip */
.swk-post-card {
	position: relative;
	background: #FFFFFF;
	border-radius: var(--radius-md);
	overflow: hidden;
	border: 1px solid var(--swk-color-border);
	transition: all var(--duration-base) var(--ease-default);
	display: flex;
	flex-direction: column;
	will-change: transform;
}

@media (hover: hover) {
	.swk-post-card:hover {
		box-shadow: var(--shadow-lg);
		transform: translateY(-2px);
	}

	.swk-post-card:hover .swk-post-title a {
		background-size: 100% 2px;
	}
}

/* Post title link covers entire card */
.swk-post-title a {
	text-decoration: none;
	color: inherit;
	background-image: linear-gradient(currentColor, currentColor);
	background-position: 0% 100%;
	background-repeat: no-repeat;
	background-size: 0% 2px;
	transition: background-size 300ms ease-out;
}

.swk-post-title a::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* Placeholder for posts without thumbnail */
.swk-post-image-placeholder {
	background: var(--swk-color-bg-sand);
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Mockup: Thumbnail 180px height, radius top already from card clip */
.swk-post-image {
	height: 180px;
	overflow: hidden;
	background: var(--swk-color-bg-sand);
}

.swk-post-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Mockup: padding 20px, gap 8 */
.swk-post-content {
	padding: 20px;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Mockup: 15px DM Sans 600 #2C1A0E, letter-spacing 0.5 */
.swk-post-category {
	display: inline-block;
	font-family: var(--font-primary);
	font-size: 17px;
	font-weight: 600;
	color: var(--swk-color-text-dark);
	letter-spacing: 0.5px;
}

/* Mockup: 20px Source Serif 4 600 #2C1A0E, line-height 1.3 */
.swk-post-title {
	font-family: var(--font-display);
	font-size: 20px;
	font-weight: 600;
	color: var(--swk-color-text-dark);
	margin: 0;
	line-height: 1.3;
}

/* Mockup: 15px DM Sans 400 #4E4C4A, line-height 1.5 */
.swk-post-excerpt {
	font-family: var(--font-primary);
	font-size: 17px;
	color: var(--swk-color-text-card);
	margin: 0;
	line-height: 1.5;
	flex-grow: 1;
}

/* Mockup: 15px DM Sans 400 #4E4C4A */
.swk-post-date {
	font-family: var(--font-primary);
	font-size: 17px;
	color: var(--swk-color-text-card);
	margin-top: auto;
}

.swk-no-posts {
	grid-column: 1 / -1;
	text-align: center;
	color: var(--swk-color-text-muted);
	font-size: 22px;
	padding: 64px 0;
}

/* Mockup: RrHAx | 18px DM Sans 600 #B85A3D, center */
.swk-all-posts-link {
	text-align: center;
	margin-top: 40px;
}

.swk-link-arrow {
	display: inline-flex;
	align-items: center;
	font-family: var(--font-primary);
	font-size: 18px;
	font-weight: 600;
	color: #B85A3D !important;
	text-decoration: none !important;
	min-height: var(--touch-min);
	transition: color var(--duration-fast) var(--ease-default);
	position: relative;
}

.swk-link-arrow::after {
	content: '';
	position: absolute;
	bottom: 12px;
	left: 0;
	width: 0;
	height: 2px;
	background: #D8704F;
	transition: width var(--duration-base) var(--ease-default);
}

@media (hover: hover) {
	.swk-link-arrow:hover::after {
		width: 100%;
	}

	.swk-link-arrow:hover {
		color: #D8704F !important;
	}
}

/* ========================================
   6. FOOTER
   Mockup: KTsqL | bg #2C1A0E
======================================== */

.swk-footer {
	background: var(--swk-color-text-dark);
}

/* Terracotta accent line - 3px */
.swk-footer-accent {
	height: 3px;
	background: var(--swk-color-primary);
}

/* Main footer area - 3 columns */
.swk-footer-main {
	display: flex;
	justify-content: space-between;
	gap: 48px;
	padding: 56px 80px 40px 80px;
	max-width: 1280px;
	margin: 0 auto;
}

/* Brand column */
.swk-footer-brand {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 300px;
	flex-shrink: 0;
}

.swk-footer-logo {
	font-family: var(--font-display);
	font-size: 22px;
	font-weight: 700;
	color: #FFFFFF;
}

.swk-footer-desc {
	font-family: var(--font-primary);
	font-size: 16px;
	font-weight: 400;
	color: #B8A898;
	line-height: 1.6;
	margin: 0;
}

/* Nav columns */
.swk-footer-nav,
.swk-footer-legal {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.swk-footer-heading {
	font-family: var(--font-display);
	font-size: 17px;
	font-weight: 700;
	color: var(--swk-color-accent);
	margin: 0 0 4px 0;
}

.swk-footer-heading--kontakt {
	margin-top: 8px;
}

.swk-footer-link {
	font-family: var(--font-primary);
	font-size: 16px;
	font-weight: 400;
	color: var(--swk-color-border);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	padding: 4px 0;
	transition: color var(--duration-fast) var(--ease-default);
}

@media (hover: hover) {
	.swk-footer-link:hover {
		color: #FFFFFF;
	}
}

/* Copyright bar */
.swk-footer-bottom {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 0 80px 32px 80px;
	max-width: 1280px;
	margin: 0 auto;
}

.swk-footer-divider {
	height: 1px;
	background: #3D2A1A;
}

.swk-footer-copyright {
	font-family: var(--font-primary);
	font-size: 15px;
	font-weight: 400;
	color: #C8BAB0;
	text-align: center;
	margin: 0;
}

/* ========================================
   7. RESPONSIVE
======================================== */

/* Tablet */
@media (max-width: 1024px) {
	.swk-hero-section {
		padding: 64px 32px;
	}

	.swk-hero-headline {
		font-size: 40px;
	}

	.swk-categories {
		padding: 64px 32px;
	}

	.swk-latest-posts {
		padding: 64px 32px;
	}

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

	.swk-container {
		padding-left: 32px;
		padding-right: 32px;
	}

	.swk-footer-main {
		padding: 40px 32px 32px 32px;
		flex-wrap: wrap;
	}

	.swk-footer-brand {
		width: 100%;
	}

	.swk-footer-bottom {
		padding: 0 32px 24px 32px;
	}
}

/* Mobile */
@media (max-width: 640px) {
	.swk-hero-section {
		padding: 48px 16px;
	}

	.swk-hero-headline {
		font-size: 32px;
	}

	.swk-hero-subheadline {
		font-size: 18px;
	}

	.swk-hero-trust {
		flex-direction: column;
		gap: 12px;
		align-items: center;
	}

	.swk-section-headline {
		font-size: 28px;
	}

	.swk-categories {
		padding: 48px 16px;
	}

	.swk-latest-posts {
		padding: 48px 16px;
	}

	.swk-posts-grid {
		grid-template-columns: 1fr;
	}

	.swk-container {
		padding-left: 16px;
		padding-right: 16px;
	}

	.swk-btn-primary {
		width: 100%;
		justify-content: center;
		text-align: center;
	}

	.swk-link-arrow {
		display: block;
		text-align: center;
	}

	.swk-footer-main {
		flex-direction: column;
		padding: 32px 16px 24px 16px;
		gap: 32px;
	}

	.swk-footer-brand {
		width: 100%;
	}

	.swk-footer-bottom {
		padding: 0 16px 24px 16px;
	}
}

/* ========================================
   8. ACCESSIBILITY
======================================== */

/* Footer focus ring - white outline on dark background */
.swk-footer *:focus-visible {
	outline: 3px solid #FFFFFF;
	outline-offset: 3px;
	box-shadow: 0 0 0 6px #D8704F;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

